'use client';

import { useState, useEffect, useRef } from 'react';
import Link from 'next/link';

type Accent = 'green' | 'blue' | 'teal' | 'gold';
type Row = { sl: number | string; sample: React.ReactNode; parameter: React.ReactNode; process: string; qty: string; num: string; charges: string };

const TH       = ['Sl', 'Sample', 'Parameter', 'Process', 'Minimum Qty of sample', 'Minimum No of sample', 'Charges (INR)'];
const SEQ_TH   = ['Sl', 'Sample', 'Parameter', 'Method', 'Minimum Qty of sample', 'Process', 'Charges (INR)'];
const ST2_TH   = ['Sl', 'Sample', 'Parameter', 'Minimum Qty of sample', 'Process', 'Charges (INR)'];
const HYG_TH   = ['Sl', 'Sample', 'Parameter', 'Process', 'Charges (INR)'];
const MGEN_TH  = ['Sl', 'Services', 'Sample requirements', 'Descriptions', 'Deliverables', 'Price'];

// ─── NUTRITION ───────────────────────────────────────────────────────────────
const NUTRITION: Row[] = [
  { sl:1,  sample:'Raw Material',                parameter:'Proximate Analysis¹',                          process:'NIRS',                     qty:'250 gm', num:'01 Sample', charges:'1,500.00' },
  { sl:2,  sample:'Raw Material & Feed',         parameter:'Proximate Analysis²',                          process:'Wet Chemistry',            qty:'250 gm', num:'01 Sample', charges:'1,800.00' },
  { sl:3,  sample:'Raw Material & Feed',         parameter:'Moisture',                                     process:'Oven drying',              qty:'250 gm', num:'01 Sample', charges:'150.00' },
  { sl:4,  sample:'Raw Material & Feed',         parameter:'Total Ash',                                    process:'Dry Ash MF',               qty:'250 gm', num:'01 Sample', charges:'200.00' },
  { sl:5,  sample:'Raw Material & Feed',         parameter:'SS/AIA',                                       process:'Dry Ash Filtration',       qty:'250 gm', num:'01 Sample', charges:'200.00' },
  { sl:6,  sample:'Raw Material & Feed',         parameter:'Crude Protein',                                process:'Kjeldahl',                 qty:'250 gm', num:'01 Sample', charges:'500.00' },
  { sl:7,  sample:'Raw Material & Feed',         parameter:'Crude Fat/EE',                                 process:'Soxtherm',                 qty:'250 gm', num:'01 Sample', charges:'300.00' },
  { sl:8,  sample:'Raw Material & Feed',         parameter:'Crude Fibre',                                  process:'Acid alkali extraction',   qty:'250 gm', num:'01 Sample', charges:'400.00' },
  { sl:9,  sample:'Raw Material & Feed',         parameter:'Calcium',                                      process:'Titration',                qty:'250 gm', num:'01 Sample', charges:'400.00' },
  { sl:10, sample:'Raw Material & Feed',         parameter:'Total Phosphorous',                            process:'Photocolorimetric',        qty:'250 gm', num:'01 Sample', charges:'400.00' },
  { sl:11, sample:'Raw Material & Feed',         parameter:'Salt',                                         process:"Mohr's titration method",  qty:'250 gm', num:'01 Sample', charges:'400.00' },
  { sl:12, sample:'Oil',                         parameter:'Peroxide Value',                               process:'Titration',                qty:'250 ml', num:'01 Sample', charges:'350.00' },
  { sl:13, sample:'Oil',                         parameter:'Rancidity',                                    process:'Qualitative',              qty:'250 ml', num:'01 Sample', charges:'350.00' },
  { sl:14, sample:'Oil',                         parameter:'Free Fatty Acid',                              process:'Titrimetric (Oleic Acid)', qty:'250 ml', num:'01 Sample', charges:'300.00' },
  { sl:15, sample:'Rice polish / Raw Rice Bran', parameter:'Free Fatty Acid',                              process:'Titrimetric (Oleic Acid)', qty:'250 ml', num:'01 Sample', charges:'300.00' },
  { sl:16, sample:'Raw Material',                parameter:'PSI/KOH Solubility',                           process:'Kjeldahl',                 qty:'250 gm', num:'01 Sample', charges:'500.00' },
  { sl:17, sample:'Raw Material',                parameter:'Urease Activity',                              process:'pH method',                qty:'250 gm', num:'01 Sample', charges:'250.00' },
  { sl:18, sample:'Raw Material',                parameter:'Non-Protein Nitrogen',                         process:'Kjeldahl',                 qty:'250 gm', num:'01 Sample', charges:'500.00' },
  { sl:19, sample:'Raw Material',                parameter:'Pepsin Digestibility',                         process:'Kjeldahl',                 qty:'250 gm', num:'01 Sample', charges:'500.00' },
  { sl:20, sample:'Fish Meal, MBM',              parameter:'Total Volatile Base Nitrogen (TVBN)',           process:'Kjeldahl',                 qty:'250 gm', num:'01 Sample', charges:'500.00' },
  { sl:21, sample:'Raw Material',                parameter:'Presence of Thirum',                           process:'Qualitative',              qty:'250 gm', num:'01 Sample', charges:'200.00' },
  { sl:22, sample:'Raw Material',                parameter:'Non-Protein Nitrogen',                         process:'Qualitative',              qty:'250 gm', num:'01 Sample', charges:'200.00' },
  { sl:23, sample:'Raw Material',                parameter:'Presence of Leather Meal',                     process:'Qualitative',              qty:'250 gm', num:'01 Sample', charges:'200.00' },
  { sl:24, sample:'Raw Material',                parameter:'Presence of Plant CP',                         process:'Qualitative',              qty:'250 gm', num:'01 Sample', charges:'200.00' },
  { sl:25, sample:'Raw Material',                parameter:'Urea Adulteration',                            process:'Qualitative',              qty:'250 gm', num:'01 Sample', charges:'200.00' },
  { sl:26, sample:'Raw Material',                parameter:'Presence of Hulls / Husks',                    process:'Qualitative',              qty:'250 gm', num:'01 Sample', charges:'200.00' },
  { sl:27, sample:'Raw Material',                parameter:'Presence of Hair & Wool',                      process:'Qualitative',              qty:'250 gm', num:'01 Sample', charges:'200.00' },
  { sl:28, sample:'Raw Material',                parameter:'Presence of Hoof & Horn',                      process:'Qualitative',              qty:'250 gm', num:'01 Sample', charges:'200.00' },
  { sl:29, sample:'Raw Material',                parameter:'Presence of Mahua',                            process:'Qualitative',              qty:'250 gm', num:'01 Sample', charges:'200.00' },
  { sl:30, sample:'Raw Material',                parameter:'Presence of Tannin',                           process:'Qualitative',              qty:'250 gm', num:'01 Sample', charges:'200.00' },
  { sl:31, sample:'Raw Material',                parameter:'Presence of Calcite',                          process:'Qualitative',              qty:'250 gm', num:'01 Sample', charges:'250.00' },
  { sl:32, sample:'Raw Material',                parameter:'Decomposition',                                process:'Qualitative',              qty:'250 gm', num:'01 Sample', charges:'200.00' },
  { sl:33, sample:'Raw Material & Feed',         parameter:'pH',                                           process:'Quantitative',             qty:'250 gm', num:'01 Sample', charges:'150.00' },
  { sl:34, sample:'Water',                       parameter:'pH, TDS, Total hardness as Calcium carbonate', process:'Quantitative',             qty:'500 ml', num:'01 Sample', charges:'1050.00' },
];

// ─── BIOCHEMISTRY ─────────────────────────────────────────────────────────────
const BIOCHEMISTRY: Row[] = [
  { sl:1,  sample:'Blood Serum',  parameter:'Liver Function Test¹',       process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'1000.00' },
  { sl:2,  sample:'Blood Serum',  parameter:'Kidney Function Test²',      process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'650.00' },
  { sl:3,  sample:'Blood Serum',  parameter:'Lipid Profile³',             process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'1250.00' },
  { sl:4,  sample:'Blood Serum',  parameter:'Tri Glyceride',              process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'350.00' },
  { sl:5,  sample:'Blood Serum',  parameter:'Total Cholesterol',          process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'300.00' },
  { sl:6,  sample:'Blood Serum',  parameter:'HDL/LDL',                    process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'350.00' },
  { sl:7,  sample:'Blood Plasma', parameter:'Glucose (Random)',            process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'150.00' },
  { sl:8,  sample:'Blood Serum',  parameter:'Alkaline Phosphatase',       process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'250.00' },
  { sl:9,  sample:'Blood Serum',  parameter:'Bilirubin',                  process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'200.00' },
  { sl:10, sample:'Blood Serum',  parameter:'Albumin',                    process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'200.00' },
  { sl:11, sample:'Blood Serum',  parameter:'Total Protein',              process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'200.00' },
  { sl:12, sample:'Blood Serum',  parameter:'SGOT (AST)',                 process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'250.00' },
  { sl:13, sample:'Blood Serum',  parameter:'SGPT (ALT)',                 process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'250.00' },
  { sl:14, sample:'Blood Serum',  parameter:'Carbon Di-oxide',            process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'200.00' },
  { sl:15, sample:'Blood Serum',  parameter:'Calcium (Arsenazo)',         process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'300.00' },
  { sl:16, sample:'Blood Serum',  parameter:'Phosphorous',                process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'300.00' },
  { sl:17, sample:'Blood Serum',  parameter:'Gamma Glutamyl Transferase', process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'500.00' },
  { sl:18, sample:'Blood Serum',  parameter:'Urea/Bun',                  process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'200.00' },
  { sl:19, sample:'Blood Serum',  parameter:'Creatinine',                 process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'200.00' },
  { sl:20, sample:'Blood Serum',  parameter:'Uric acid',                  process:'Photometry', qty:'0.5 ml', num:'01 Sample', charges:'300.00' },
];

// ─── MICROBIOLOGY & SEROLOGY ──────────────────────────────────────────────────
const MICROBIOLOGY: Row[] = [
  { sl:1,  sample:'Blood Serum',                parameter:'Avian Encephalomyelitis (AE)',                        process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'NA' },
  { sl:2,  sample:'Blood Serum',                parameter:'Avian Leucosis Complex (ALC)',                        process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'NA' },
  { sl:3,  sample:'Blood Serum',                parameter:'Avian Pneumo Virus (APV)',                            process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'5,000.00' },
  { sl:4,  sample:'Blood Serum',                parameter:'Chicken Infectious Anemia Virus (CIA)',               process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'4,500.00' },
  { sl:5,  sample:'Blood Serum',                parameter:'Egg Drop Syndrome/ Adeno Virus (EDS)',                process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'NA' },
  { sl:6,  sample:'Blood Serum',                parameter:'Infectious Bursal Disease (IBD)',                     process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'3,500.00' },
  { sl:7,  sample:'Blood Serum',                parameter:'Infectious Bursal Disease-VP2 (IBD-VP2)',             process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'4,200.00' },
  { sl:8,  sample:'Blood Serum',                parameter:'Infectious Bursal Disease-XR (IBD-XR)',               process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'3,500.00' },
  { sl:9,  sample:'Blood Serum',                parameter:'Newcastle Disease (ND)/Rankhet Disease (RD)',         process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'3,500.00' },
  { sl:10, sample:'Blood Serum',                parameter:'Newcastle Disease - Fusion protein (ND-F)',           process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'4,200.00' },
  { sl:11, sample:'Blood Serum',                parameter:'Salmonella',                                          process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'NA' },
  { sl:12, sample:'Blood Serum',                parameter:'Infectious Bronchitis (IB/IBV)',                      process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'3,500.00' },
  { sl:13, sample:'Blood Serum',                parameter:'Mycoplasma gallisepticum (MG)',                       process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'4,500.00' },
  { sl:14, sample:'Blood Serum',                parameter:'Mycoplasma synoviae (MS)',                            process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'4,500.00' },
  { sl:15, sample:'Blood Serum',                parameter:'Infectious Laryngotracheitis (ILT)',                  process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'NA' },
  { sl:16, sample:'Blood Serum',                parameter:'REO Virus',                                           process:'Titre assay - ELISA',      qty:'0.5 ml',     num:'20 Samples', charges:'4,500.00' },
  { sl:17, sample:'Blood Serum',                parameter:'Mycoplasma gallisepticum (MG)',                       process:'Rapid plate test',         qty:'0.5 ml',     num:'20 Samples', charges:'NA' },
  { sl:18, sample:'Blood Serum',                parameter:'Mycoplasma synoviae (MS)',                            process:'Rapid Plate test',         qty:'0.5 ml',     num:'20 Samples', charges:'NA' },
  { sl:19, sample:'Blood Serum',                parameter:'Salmonella pullorum',                                 process:'Rapid Plate test',         qty:'0.5 ml',     num:'50 Samples', charges:'NA' },
  { sl:20, sample:'Biological sample',          parameter:'Antibiotic Sensitivity Test (6 antibiotics)',         process:'Plate test',               qty:'Contact us', num:'Contact us', charges:'1,500.00' },
  { sl:21, sample:'RM, Feed, Water, Meat, Egg', parameter: <>Organism culture: <em>Salmonella</em> sp</>,        process:'Qualitative/Quantitative', qty:'Contact us', num:'Contact us', charges:'700.00' },
  { sl:22, sample:'RM, Feed, Water, Meat, Egg', parameter: <>Organism culture: <em>Escherichia coli</em></>,    process:'Quantitative',             qty:'Contact us', num:'Contact us', charges:'600.00' },
  { sl:23, sample:'RM, Feed, Water, Meat, Egg', parameter:'Organism culture: Total Coliform',                   process:'Quantitative',             qty:'Contact us', num:'Contact us', charges:'400.00' },
  { sl:24, sample:'RM, Feed, Water, Meat, Egg', parameter:'Organism culture: Total bacterial count',            process:'Quantitative',             qty:'Contact us', num:'Contact us', charges:'400.00' },
  { sl:25, sample:'RM, Feed, Water, Meat, Egg', parameter: <>Organism culture: Total <em>Clostridium</em> sp</>,process:'Quantitative',             qty:'Contact us', num:'Contact us', charges:'800.00' },
  { sl:26, sample:'RM, Feed, Water, Meat, Egg', parameter:'Organism culture: Total Mold count',                 process:'Quantitative',             qty:'Contact us', num:'Contact us', charges:'400.00' },
  { sl:27, sample:'RM, Feed, Water, Meat, Egg', parameter:'Total Enterobacteriaceae',                           process:'Quantitative',             qty:'Contact us', num:'Contact us', charges:'700.00' },
  { sl:28, sample:'Poultry egg, Marine sample',  parameter: <>Organism culture: <em>Pseudomonas</em> sp</>,     process:'Qualitative',              qty:'Contact us', num:'Contact us', charges:'700.00' },
  { sl:29, sample:'Marine sample',               parameter: <>Organism culture: <em>Aeromonas</em> sp</>,       process:'Qualitative',              qty:'Contact us', num:'Contact us', charges:'700.00' },
  { sl:30, sample:'Feed',                        parameter:'Complete Feed Microbiology & Hygiene¹',             process:'Quantitative',             qty:'Contact us', num:'Contact us', charges:'2,500.00' },
  { sl:31, sample:'Water',                       parameter:'Complete Water Microbiology & Hygiene²',            process:'Quantitative',             qty:'Contact us', num:'Contact us', charges:'1,500.00' },
  { sl:32, sample:'Day old Chicks',              parameter:'Chick Culture Test',                                process:'Quantitative',             qty:'4 Chicks',   num:'4 Chicks',   charges:'2,000.00' },
];

// ─── BIOTECHNOLOGY ────────────────────────────────────────────────────────────
const BIOTECHNOLOGY: Row[] = [
  { sl:1, sample:'Raw Material & Feed', parameter:'Basic Toxin Profile¹',    process:'Quantitative LFIA Technique', qty:'250 gm', num:'01 Sample', charges:'5,500.00' },
  { sl:2, sample:'Raw Material & Feed', parameter:'Advanced Toxin Profile²', process:'Quantitative LFIA Technique', qty:'250 gm', num:'01 Sample', charges:'8,500.00' },
  { sl:3, sample:'Raw Material & Feed', parameter:'Aflatoxin',               process:'Quantitative LFIA Technique', qty:'250 gm', num:'01 Sample', charges:'1,500.00' },
  { sl:4, sample:'Raw Material & Feed', parameter:'Ochra toxin',             process:'Quantitative LFIA Technique', qty:'250 gm', num:'01 Sample', charges:'1,500.00' },
  { sl:5, sample:'Raw Material & Feed', parameter:'T2 Toxin',                process:'Quantitative LFIA Technique', qty:'250 gm', num:'01 Sample', charges:'1,500.00' },
  { sl:6, sample:'Raw Material & Feed', parameter:'Zearalenone',             process:'Quantitative LFIA Technique', qty:'250 gm', num:'01 Sample', charges:'1,500.00' },
  { sl:7, sample:'Raw Material & Feed', parameter:'Deoxynivalenol',          process:'Quantitative LFIA Technique', qty:'250 gm', num:'01 Sample', charges:'1,500.00' },
  { sl:8, sample:'Raw Material & Feed', parameter:'Fumonisins',              process:'Quantitative LFIA Technique', qty:'250 gm', num:'01 Sample', charges:'1,500.00' },
];

// ─── FEED TECHNOLOGY ─────────────────────────────────────────────────────────
const FEEDTECH: Row[] = [
  { sl:1, sample:'Pelleted Feed', parameter:'Pellet Durability Index',            process:'Holmen PDI Testers',          qty:'1000 gm', num:'01 Sample',          charges:'500.00' },
  { sl:2, sample:'Pelleted Feed', parameter:'Pellet Hardness',                    process:'KAHL Pellet Hardness Tester', qty:'1000 gm', num:'01 Sample',          charges:'500.00' },
  { sl:3, sample:'Pelleted Feed', parameter:'Residual Fine & Texture Profiling',  process:'Automatic Sieving',           qty:'1000 gm', num:'01 Sample',          charges:'500.00' },
  { sl:4, sample:'Pelleted Feed', parameter:'Pellet Dissociation',                process:'Mechanical',                  qty:'1000 gm', num:'01 Sample',          charges:'750.00' },
  { sl:5, sample:'Feed / Premix', parameter:'Mixing Uniformity',                  process:'Salt test method',            qty:'1000 gm', num:'10 x 100 gm Sample', charges:'1,250.00' },
  { sl:6, sample:'Feed / Premix', parameter:'Mixing Uniformity for 1-ton batch',  process:'Micro Tracer F testing',      qty:'1000 gm', num:'10 x 100 gm Sample', charges:'1500.00' },
  { sl:7, sample:'Feed / Premix', parameter:'Mixing Uniformity for 2-ton batch',  process:'Micro Tracer F testing',      qty:'1000 gm', num:'10 x 100 gm Sample', charges:'2500.00' },
];

// ─── PATHOLOGY & PARASITOLOGY ─────────────────────────────────────────────────
const PATHOLOGY: Row[] = [
  { sl:1, sample:'Faecal sample',                       parameter: <>Faeces examination<sup>1</sup></>,               process:'Microscopic', qty:'50 gm',      num:'01 Sample',  charges:'300.00' },
  { sl:2, sample:'Dead Birds',                          parameter:'Post-mortem examination - Poultry',                process:'Macroscopic', qty:'Contact us', num:'Contact us', charges:'250.00' },
  { sl:3, sample:'Mounted slide',                       parameter: <>Microscopic analysis<sup>2</sup> – each slide</>, process:'Microscopic', qty:'Contact us', num:'Contact us', charges:'500.00' },
  { sl:4, sample:'Intestinal tissue / Internal organs', parameter:'Histomorphometry study – each slide',              process:'Microscopic', qty:'Contact us', num:'Contact us', charges:'1,800.00' },
  { sl:5, sample:'Intestinal tissue / Internal organs', parameter:'Histopathology Study + interpretation',            process:'Microscopic', qty:'Contact us', num:'Contact us', charges:'1,800.00' },
];

// ─── MOLECULAR BIOLOGY (52 rows) ─────────────────────────────────────────────
const MB = <>Tissue / Swab / FTA Card<sup>1</sup></>;
const MOLBIO: Row[] = [
  { sl:1,  sample:MB, parameter:'ND/RD (Newcastle Disease Virus/Ranikhet Disease)',    process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'3,500.00' },
  { sl:2,  sample:MB, parameter:'IB (Infectious Bronchitis Virus)',                     process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'3,500.00' },
  { sl:3,  sample:MB, parameter:'AmPV/APV (Avian Pneumo Virus)',                        process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'3,500.00' },
  { sl:4,  sample:MB, parameter:'ILT/AIL (Avian Infectious Laryngotracheitis)',         process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'2,500.00' },
  { sl:5,  sample:MB, parameter:'HPAI/LPAI (New Castle Disease Variant)',               process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'3,500.00' },
  { sl:6,  sample:MB, parameter:'ANV (Avian Nephritis Virus)',                          process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'3,500.00' },
  { sl:7,  sample:MB, parameter:'IBD/Gamboro (Infectious Bursal Disease Virus)',        process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'3,500.00' },
  { sl:8,  sample:MB, parameter: <>MG (<em>Mycoplasma gallisepticum</em>)</>,          process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'2,500.00' },
  { sl:9,  sample:MB, parameter: <>MS (<em>Mycoplasma synoviae</em>)</>,               process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'2,500.00' },
  { sl:10, sample:MB, parameter:'IBH (Inclusion Body Hepatitis)',                       process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'2,500.00' },
  { sl:11, sample:MB, parameter:'MD (Marek’s Disease)',                           process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'2,500.00' },
  { sl:12, sample:MB, parameter:'CAV/CIA (Chicken Anemia Virus)',                       process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'2,500.00' },
  { sl:13, sample:MB, parameter:'REV (Reticuloendotheliosis Virus)',                    process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'3,500.00' },
  { sl:14, sample:MB, parameter:'FC (Fowl Cholera)',                                    process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'2,500.00' },
  { sl:15, sample:MB, parameter:'Staphylococcus',                                       process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'2,500.00' },
  { sl:16, sample:MB, parameter:'IC (Infectious Coryza)',                               process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'2,500.00' },
  { sl:17, sample:MB, parameter:'ORT (Ornitho Bacterium Rhinotracheale)',               process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'2,500.00' },
  { sl:18, sample:MB, parameter:'EDS (Egg Drop Syndrome)',                              process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'2,500.00' },
  { sl:19, sample:MB, parameter:'ALV (Avian Leucosis Virus – A to E)',             process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'3,500.00' },
  { sl:20, sample:MB, parameter:'FP (Fowl Pox)',                                        process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'2,500.00' },
  { sl:21, sample:MB, parameter:'rHVT-IBD (rHVT Infectious Bursal Disease)',            process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'3,500.00' },
  { sl:22, sample:MB, parameter:'rHVT-ND (rHVT New castle disease)',                    process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'3,500.00' },
  { sl:23, sample:MB, parameter:'Avian Reovirus',                                       process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'3,500.00' },
  { sl:24, sample:MB, parameter:'AE (Avian Encephalomyelitis Virus)',                   process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'3,500.00' },
  { sl:25, sample:MB, parameter:'Astrovirus',                                           process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'3,500.00' },
  { sl:26, sample:MB, parameter: <><em>Salmonella</em> (InvA)</>,                      process:'Real Time-PCR test', qty:'500 mg', num:'01 Sample', charges:'2,500.00' },
  { sl:27, sample:MB, parameter:'ND/RD (Newcastle Disease Virus/Ranikhet Disease)',    process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:28, sample:MB, parameter:'IB (Infectious Bronchitis Virus)',                     process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:29, sample:MB, parameter:'AmPV/APV (Avian Pneumo Virus)',                        process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:30, sample:MB, parameter:'ILT/AIL (Avian Infectious Laryngotracheitis)',         process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:31, sample:MB, parameter:'HPAI/LPAI (New Castle Disease Variant)',               process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:32, sample:MB, parameter:'ANV (Avian Nephritis Virus)',                          process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:33, sample:MB, parameter:'IBD (Infectious Bursal Disease Virus)',                process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:34, sample:MB, parameter: <>MG (<em>Mycoplasma gallisepticum</em>)</>,          process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:35, sample:MB, parameter: <>MS (<em>Mycoplasma synoviae</em>)</>,               process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:36, sample:MB, parameter:'IBH (Inclusion Body Hepatitis)',                       process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:37, sample:MB, parameter:'MD (Marek’s Disease)',                           process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:38, sample:MB, parameter:'CAV (Chicken Anemia Virus)',                           process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:39, sample:MB, parameter:'REV (Reticuloendotheliosis Virus)',                    process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:40, sample:MB, parameter:'FC (Fowl Cholera)',                                    process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:41, sample:MB, parameter:'Staphylococcus',                                       process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:42, sample:MB, parameter:'IC (Infectious Coryza)',                               process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:43, sample:MB, parameter:'ORT (Ornitho Bacterium Rhinotracheale)',               process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:44, sample:MB, parameter:'EDS (Egg Drop Syndrome)',                              process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:45, sample:MB, parameter:'ALV -A (Avian Leucosis Virus – A to E)',          process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:46, sample:MB, parameter:'FP (Fowl Pox)',                                        process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:47, sample:MB, parameter:'rHVT-IBD (rHVT Infectious Bursal Disease)',            process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:48, sample:MB, parameter:'rHVT-ND (rHVT New castle disease)',                    process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:49, sample:MB, parameter:'Avian Reovirus',                                       process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:50, sample:MB, parameter:'AE (Avian Encephalomyelitis Virus)',                   process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:51, sample:MB, parameter:'Astrovirus',                                           process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
  { sl:52, sample:MB, parameter: <><em>Salmonella</em> (InvA)</>,                      process:'Regular PCR test',   qty:'500 mg', num:'01 Sample', charges:'1,500.00' },
];

// ─── SEQUENCING ──────────────────────────────────────────────────────────────
const SEQ_ROWS: React.ReactNode[][] = [
  [1, 'PCR product from biological samples', 'Nucleotide sequencing', 'Sanger sequencing', '50 ul', '01 Sample', '3,000.00'],
];

// ─── SPECIAL TESTS ────────────────────────────────────────────────────────────
const ST1_ROWS: React.ReactNode[][] = [
  [1, 'Egg quality test', 'Egg albumin height, Haugh unit, Egg shell strength, Egg shell thickness, Yolk colour, Yolk diameter, yolk index', 'Quantitative', '30 fresh eggs/2-3 days old eggs', '30 eggs', '3,000.00'],
  [2, 'Viscosity test', 'Intestinal content from chicken/liquid substance', 'Quantitative', '10 gm/50 ml', '1 sample', '700.00'],
];
const ST2_ROWS: React.ReactNode[][] = [
  [1, 'Raw Material/Feed/Other', 'Residual Fine & Texture Profiling-Sieve Analysis', '250 gm', 'Automatic Sieving', '500.00'],
  [2, 'Raw Material/Feed/Other', 'Bulk Density (Tapped)',                             '1000 gm', 'USP',              '600.00'],
  [3, 'Raw Material/Feed/Other', 'Water Soluble Extractive',                          '250 gm', 'API, Part I, Vol. II', '600.00'],
];

// ─── HYGIENE MANAGEMENT ───────────────────────────────────────────────────────
const HYG_ROWS: React.ReactNode[][] = [
  [1, 'Hatchery Hygiene Management Package',  'Including all consumables, onsite manpower and laboratory analysis (approximate number of tests 100)', 'Microbial plate count', '35,000.00'],
  [2, 'Farm/Shed Hygiene Management Package', 'Including all consumables, onsite manpower and laboratory analysis (approximate number of tests 50)',  'Microbial plate count', '25,000.00'],
  [3, 'Feed Mill Hygiene Management Package', 'Including all consumables, onsite manpower and laboratory analysis (approximate number of tests 50)',  'Microbial plate count', '25,000.00'],
];

// ─── MOLECULAR BIOLOGY GENERAL (36 rows) ─────────────────────────────────────
const MGEN_ROWS: React.ReactNode[][] = [
  [1,  'DNA isolation of plant, animal, microbes, soil and blood',                                      '5ml EDTA blood, 500mg of tissue, pure culture on slant/ plate/ broth',  'gDNA isolation and agarose gel QC report',                                                                                                                                                                              '2-5 µg of high mol. wt. gDNA in TE buffer/ nuclease free water',                                                          'Enquire'],
  [2,  'gDNA to amplicon up to 2 kb (Price will be based on number of amplicon)',                       'gDNA – vol. 20µl @ 50ng/µl',                              'PCR product generation up to 2 kb from gDNA/ mtDNA',                                                                                                                                                                            'Amplicon sizing report',                                                                                                        'Enquire'],
  [3,  'Tissue to amplicon up to 2 kb',                                                                 '500-1000mg of tissue',                                                   'gDNA isolation, Amplification and agarose gel QC report',                                                                                                                                                                       'Amplicon sizing report',                                                                                                        'Enquire'],
  [4,  'Culture to amplicon up to 2 kb',                                                                'Stab/ Glycerol stock',                                                   'Culture enrichment/ gDNA isolation, PCR product generation upto 2 Kb',                                                                                                                                                         'Amplicon sizing report',                                                                                                        'Enquire'],
  [5,  'Microsatellite Genotyping (1 marker & 24 samples)',                                             'Tissue 500mg, blood 5 ml',                                               'gDNA isolation, Amplicon generation, profiling of the amplicon on Agarose gel',                                                                                                                                          'compiled report',                                                                                                               'Enquire'],
  [6,  'Microsatellite Genotyping (1 marker & 48 samples)',                                             'Tissue 500mg, blood 5 ml',                                               'gDNA isolation, Amplicon generation, profiling of the amplicon on Agarose gel',                                                                                                                                          'compiled report',                                                                                                               'Enquire'],
  [7,  'Microsatellite Genotyping (1 marker & 96 samples)',                                             'Tissue 500mg, blood 5 ml',                                               'gDNA isolation, Amplicon generation, profiling of the amplicon on Agarose gel',                                                                                                                                          'compiled report',                                                                                                               'Enquire'],
  [8,  'Microsatellite Genotyping (2 marker & 24 samples)',                                             'Tissue 500mg, blood 5 ml',                                               'gDNA isolation, Amplicon generation, profiling of the amplicon on Agarose gel',                                                                                                                                          'compiled report',                                                                                                               'Enquire'],
  [9,  'Microsatellite Genotyping (2 marker & 48 samples)',                                             'Tissue 500mg, blood 5 ml',                                               'gDNA isolation, Amplicon generation, profiling of the amplicon on Agarose gel',                                                                                                                                          'compiled report',                                                                                                               'Enquire'],
  [10, 'SYBR™Green qRT-PCR (2 genes, 4 samples)',                                                 'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel, QC, cDNA prep, gene expression analysis',                                                                                                                                'Gene expression compiled report',                                                                                               'Enquire'],
  [11, 'SYBR™Green qRT-PCR (2 genes, 8 samples)',                                                 'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel, QC, cDNA prep, gene expression analysis',                                                                                                                                'Gene expression compiled report',                                                                                               'Enquire'],
  [12, 'SYBR™Green qRT-PCR (3 genes, 4 samples)',                                                 'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel, QC, cDNA prep, gene expression analysis',                                                                                                                                'Gene expression compiled report',                                                                                               'Enquire'],
  [13, 'SYBR™Green qRT-PCR (3 genes, 8 samples)',                                                 'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel, QC, cDNA prep, gene expression analysis',                                                                                                                                'Gene expression compiled report',                                                                                               'Enquire'],
  [14, 'SYBR™Green qRT-PCR (4 genes, 4 samples)',                                                 'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel, QC, cDNA prep, gene expression analysis',                                                                                                                                'Gene expression compiled report',                                                                                               'Enquire'],
  [15, 'SYBR™Green qRT-PCR (4 genes, 8 samples)',                                                 'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel, QC, cDNA prep, gene expression analysis',                                                                                                                                'Gene expression compiled report',                                                                                               'Enquire'],
  [16, 'SYBR™Green qRT-PCR (5 genes, 4 samples)',                                                 'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel, QC, cDNA prep, gene expression analysis',                                                                                                                                'Gene expression compiled report',                                                                                               'Enquire'],
  [17, 'SYBR™Green qRT-PCR (5 genes, 8 samples)',                                                 'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel, QC, cDNA prep, gene expression analysis',                                                                                                                                'Gene expression compiled report',                                                                                               'Enquire'],
  [18, 'TaqMan™qRT-PCR (2 genes, 4 samples)',                                                     'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel QC, cDNA prep, gene expression analysis.',                                                                                                                               'Gene expression compiled report',                                                                                               'Enquire'],
  [19, 'TaqMan™qRT-PCR (2 genes, 8 samples)',                                                     'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel QC, cDNA prep, gene expression analysis.',                                                                                                                               'Gene expression compiled report',                                                                                               'Enquire'],
  [20, 'TaqMan™qRT-PCR (3 genes, 4 samples)',                                                     'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel QC, cDNA prep, gene expression analysis.',                                                                                                                               'Gene expression compiled report',                                                                                               'Enquire'],
  [21, 'TaqMan™qRT-PCR (3 genes, 8 samples)',                                                     'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel QC, cDNA prep, gene expression analysis.',                                                                                                                               'Gene expression compiled report',                                                                                               'Enquire'],
  [22, 'TaqMan™qRT-PCR (4 genes, 4 samples)',                                                     'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel QC, cDNA prep, gene expression analysis.',                                                                                                                               'Gene expression compiled report',                                                                                               'Enquire'],
  [23, 'TaqMan™qRT-PCR (4 genes, 8 samples)',                                                     'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel QC, cDNA prep, gene expression analysis.',                                                                                                                               'Gene expression compiled report',                                                                                               'Enquire'],
  [24, 'TaqMan™qRT-PCR (5 genes, 4 samples)',                                                     'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel QC, cDNA prep, gene expression analysis.',                                                                                                                               'Gene expression compiled report',                                                                                               'Enquire'],
  [25, 'TaqMan™qRT-PCR (5 genes, 8 samples)',                                                     'Pure Culture on slants/ plate/broth, Tissues',                           'Primer Design (optional), RNA isolation, RNA gel QC, cDNA prep, gene expression analysis.',                                                                                                                               'Gene expression compiled report',                                                                                               'Enquire'],
  [26, 'GMO testing by CMV 35S',                                                                        'Pure Culture on slants/ plate/broth, Tissues',                           'GMO testing by using CMV 35S sequence on RT PCR',                                                                                                                                                                               'Compiled report',                                                                                                               'Enquire'],
  [27, 'GMO testing by CRY',                                                                            'Pure Culture on slants/ plate/broth, Tissues',                           'GMO testing by using CRY sequence on RT PCR',                                                                                                                                                                                   'Compiled report',                                                                                                               'Enquire'],
  [28, 'GMO testing by NOS',                                                                            'Pure Culture on slants/ plate/broth, Tissues',                           'GMO testing by using NOS sequence on RT PCR',                                                                                                                                                                                   'Compiled report',                                                                                                               'Enquire'],
  [29, 'Cloning of PCR product up to 2Kb & sequencing',                                                '50ng/µl column purified PCR product @ 30µl',                   'Cloning, screening of 10 clone & sequencing for 10 clones up to 2kb',                                                                                                                                                  'Cloning and sequencing 10 clone data in FASTA format',                                                                          'Enquire'],
  [30, 'Bacteria- Molecular Identification with 16S',                                                   'Pure Culture on slants/ plate/ broth',                                   'Culture propagation, bacterial DNA isolation, PCR product generation with 16S primer, bi-directional sanger sequencing with BigDye® Terminator v3.1 cycle sequence chemistry',                                      'Consensus sequence 1.5 kb, FASTA, .abi file data, Compiled report (Optional)',                                                  'Enquire'],
  [31, 'Fungi- Molecular Identification with ITS',                                                      'Pure Culture on slants/ plate/ broth',                                   'Culture propagation, fungal DNA isolation, PCR product generation with ITS primer, bi-directional sanger sequencing with BigDye® Terminator v3.1 cycle sequence chemistry',                                          'Consensus sequence 1.5 kb, FASTA, .abi file data. Compiled report (Optional)',                                                  'Enquire'],
  [32, 'Fungi- Molecular Identification with 28S',                                                      'Pure Culture on slants/ plate/ broth',                                   'Culture propagation, fungal DNA isolation, PCR product generation with 28S primer, bi-directional sanger sequencing with BigDye® Terminator v3.1 cycle sequence chemistry',                                          'Consensus sequence, FASTA, .abi file data. Compiled report (Optional)',                                                         'Enquire'],
  [33, 'Fungi- Molecular Identification with 18S',                                                      'Pure Culture on slants/ plate/ broth',                                   'Culture propagation, fungal DNA isolation, PCR product generation with 18S primer, bi-directional sanger sequencing with BigDye® Terminator v3.1 cycle sequence chemistry',                                          'Consensus sequence, FASTA, .abi file data. Compiled report (Optional)',                                                         'Enquire'],
  [34, 'Plant RAPD barcoding (Price will vary according to number of markers & sample)',                '500mg to 1g Tissue / gDNA, Vol. 50µl, conc. 30ng/µl, RAPD primers(optional)', 'gDNA isolation, RAPD primer synthesis (optional), PCR amplification by RAPD primers and gel profiling of RAPD amplicons',                                                                                       'Compiled report',                                                                                                               'Enquire'],
  [35, 'Poultry gut / faeces microbiome metagenomics study- 16s rRNA gene sequencing- V3-V4',          '500mg Tissue/faeces',                                                    'Library preparation, Sequencing, Quality filtration of data, phylogenetic analysis of microbial distribution, Heat Map, abundance and identification of microbialcommunity, taxa identification, Refraction curve and alpha diversity, and beta diversity (PCoA Plot) (if more than 3 samples).', 'Compiled report', 'Enquire'],
  [36, 'Poultry gut / faeces microbiome metagenomics study- Whole genome shotgun metagenomics study',  '500mg Tissue/faeces',                                                    'Library preparation, Sequencing, Quality filtration of data, phylogenetic analysis of microbial distribution, Heat Map, abundance and identification of microbialcommunity, taxa identification, Refraction curve and alpha diversity, and beta diversity (PCoA Plot) (if more than 3 samples).', 'Compiled report', 'Enquire'],
];

// ─── Facility section data ───────────────────────────────────────────────────
const INFRA_ITEMS = [
  'Highly bio-secured environment',
  'High end machineries',
  'Uninterrupted power supply to ensure flawless report generation',
  'Dedicated human resource',
  'In-house experts to validate the findings',
  'Sample preparation and logistics guidance for third party analysis is facilitated on request',
  'On demand sample collection facility',
];

type LabFacItem = { id: string; icon: string; title: string; items: string[] };
const LAB_FACILITY: LabFacItem[] = [
  { id:'micro',   icon:'fa-bacteria',     title:'Microbiology & Parasitology',  items:['Isolation & identification of bacteria','Antibiotic sensitivity test','Agglutination test','Feed & water hygiene test','Hatchery hygiene monitoring','Stool examination for microbial & protozoa study'] },
  { id:'biotech', icon:'fa-dna',          title:'Biotechnology & Biochemistry', items:['Serology for viral & bacterial disease','Mycotoxin analysis','Hormone assay','Biomarker assay','Haematology and blood biochemistry'] },
  { id:'histo',   icon:'fa-microscope',   title:'Histology & Histopathology',   items:['Gross pathology study','Histopathology study','Histomorphometry study','Diagnosis of Coccidiosis'] },
  { id:'nirs',    icon:'fa-flask',        title:'NIRS & Wet Chemistry',         items:['Proximate analysis of raw materials and feed','Rancidity study','Adulteration study','Decomposition study','Chemical analysis of water (pH, TDS, Hardness)'] },
  { id:'feedtec', icon:'fa-gears',        title:'Feed Technology',              items:['Pellet durability and hardness study','Pellet Dissociation Test','Residual Fine & Texture Profiling'] },
  { id:'mol',     icon:'fa-circle-nodes', title:'Molecular Biology',            items:['Metagenomics of gut microbiome','Detection and Quantification of Poultry Pathogenic Bacteria and Viruses Using Molecular Techniques','Transcriptomic study','Proteomics study'] },
];

const KEY_PROPS = [
  'The service is conceptualised and executed by experienced veterinarians',
  'Tests are conducted by technically qualified professionals',
  'Reporting time – 24 hrs (for Proximate Analysis through NIR, after receiving the physical sample)',
  'Minimum "Turn Around Time" for better responsiveness',
  'Every report comes after critical evaluation by subject matter specialists',
  "Reports come with expert's observation and advice",
  'Every report includes comments and observations post screening by subject matter specialists',
  'Convenient online "Test Request Form"',
  'Digital Report delivery through email/WhatsApp',
  'Online payment option using Debit/Credit card',
];

type EquipItem = { name: string; brand: string; model: string };
const EQUIPMENT: EquipItem[] = [
  { name:'Anaerobic Chamber',                        brand:'Himedia',                                     model:'Mark V1' },
  { name:'Analytical Precision Balance',             brand:'Wenser',                                      model:'HPB 201' },
  { name:'Analytical Precision Balance',             brand:'Wensar',                                      model:'PGB 200' },
  { name:'Analytical Precision Balance',             brand:'Radwag',                                      model:'PS 6100.R2.M' },
  { name:'Analytical Precision Balance',             brand:'Radwag',                                      model:'PS 6100.R2.M' },
  { name:'Analytical Precision Balance',             brand:'Mettler Toledo',                              model:'NG 8423' },
  { name:'Aseptic Chamber',                          brand:'Instrumentation India',                       model:'-' },
  { name:'Autoclave',                                brand:'Labquip',                                     model:'-' },
  { name:'Autoclave',                                brand:'Allied',                                      model:'-' },
  { name:'Automatic Bottle Top Burette',             brand:'Titrette',                                    model:'DE-M' },
  { name:'Automatic Sieve Shaker & Sieves',          brand:'Electrolab',                                  model:'EMS-8' },
  { name:'BOD Incubator',                            brand:'Labquip',                                     model:'9801' },
  { name:'Centrifuge – Large',                       brand:'Remi',                                        model:'R 8C' },
  { name:'Centrifuge – Refrigerated',                brand:'Eppendorf',                                   model:'5430R' },
  { name:'Centrifuge - Small',                       brand:'Remi',                                        model:'RM 12C' },
  { name:'Digital Colony Counter',                   brand:'Labtronic',                                   model:'LT-36' },
  { name:'Digital Conductivity Meter',               brand:'Labtronic',                                   model:'LT-26' },
  { name:'Digital Egg Tester',                       brand:'NABEL',                                       model:'DET 6500' },
  { name:'Digital pH Meter',                         brand:'Global',                                      model:'DPH 507' },
  { name:'Digital pH Meter',                         brand:'Labman',                                      model:'-' },
  { name:'Digital pH Meter',                         brand:'Labtronic',                                   model:'LT-50' },
  { name:'Digital pH Meter',                         brand:'Eutech',                                      model:'PH Tutor' },
  { name:'Digital Trinocular Microscope & Camera',   brand:'Dewinter',                                    model:'DIGI1000 (USB 3.0)' },
  { name:'Digital Trinocular Microscope & Camera',   brand:'Coslab',                                      model:'HL-32 LED' },
  { name:'Digital Water Bath',                       brand:'Benchmark Scientific',                        model:'B2000-4' },
  { name:'Distillation Unit',                        brand:'Som Scientific',                              model:'-' },
  { name:'Double Beam UV-VIS Spectrophotometer',     brand:'Systonic',                                    model:'S-919' },
  { name:'Double Distillation Unit',                 brand:'Borosil',                                     model:'3362' },
  { name:'ELISA Reader',                             brand:'Bio Tek, USA',                                model:'800 TS' },
  { name:'Ether Extract System',                     brand:'Som Scientific',                              model:'-' },
  { name:'Fibertherm (Automated Fibre Analysis)',    brand:'Gerhardt',                                    model:'EV 1' },
  { name:'Gradient PCR (Thermal Cycler)',            brand:'Bio-Rad',                                     model:'T100' },
  { name:'Horizontal Gel Electrophoresis Unit',      brand:'Bio-Rad',                                     model:'Mini-Sub Cell GT' },
  { name:'Hot Air Oven',                             brand:'Som Scientific',                              model:'-' },
  { name:'Hot Air Oven',                             brand:'Labquip',                                     model:'-' },
  { name:'Hot Air Oven',                             brand:'Cintex',                                      model:'CIC-15' },
  { name:'Hot Plate',                                brand:'Som Scientific',                              model:'-' },
  { name:'Hot Plate',                                brand:'Labquip',                                     model:'-' },
  { name:'Incubator - Large',                        brand:'Labpro',                                      model:'-' },
  { name:'Incubator - Small',                        brand:'Romer Labs',                                  model:'EQASR - 1500' },
  { name:'IR Moisture Analyzer',                     brand:'Radwag',                                      model:'MA 50.R.WH' },
  { name:'Laminar Air Flow',                         brand:'Labquip',                                     model:'Type I' },
  { name:'Magnetic Stirrer',                         brand:'Remi',                                        model:'2-MLH' },
  { name:'Magnetic Stirrer',                         brand:'Remi',                                        model:'2-MLH' },
  { name:'Micro Pipettes',                           brand:'Eppendorf, Thermo, Tarson, Clindiag, Vertex', model:'-' },
  { name:'Muffle Furnace',                           brand:'Som Scientific',                              model:'-' },
  { name:'Muffle Furnace',                           brand:'Cintex',                                      model:'CIC-106' },
  { name:'NIRS Analyzer',                            brand:'Foss',                                        model:'DS 2500' },
  { name:'NIRS Analyzer',                            brand:'Foss',                                        model:'DS 2500' },
  { name:'NIRS Sample Grinder',                      brand:'Foss',                                        model:'CT 293 Cyclotec' },
  { name:'Pellet Durability Tester',                 brand:'Tekpro - Holmen',                             model:'NHP 200' },
  { name:'Pellet Hardness Tester',                   brand:'Kahl',                                        model:'K6432-0054' },
  { name:'Photo-Colorimeter',                        brand:'Som Scientific',                              model:'Model-312' },
  { name:'Semi Auto Biochemical Analyzer',           brand:'Rayto',                                       model:'RT - 9200' },
  { name:'Soxtherm (Automatic Fat Analysis Unit)',   brand:'Gerhardt',                                    model:'SOX 414' },
  { name:'Tissue Homogenizer',                       brand:'Cole-Parmer Scientific Experts',              model:'Labgen 125:TH2' },
  { name:'Toxin Analyzer',                           brand:'Romer Lab',                                   model:'Agra Vision' },
  { name:'Toxin Analyzer',                           brand:'Trouw Nutrition',                             model:'Myco Master' },
  { name:'Turbotherm (Protein Digestion Unit)',      brand:'Gerhardt, Germany',                           model:'TT M' },
  { name:'UV Transilluminator',                      brand:'Accuris, Benchmark Scientific, USA',          model:'E3000' },
  { name:'Vapodest (Protein Kjeldhal Distillation)', brand:'Gerhardt',                                    model:'VAP 200' },
  { name:'Vertical Freezer -20°C, 600 Litre',       brand:'Celfrost, India',                             model:'GN 600 BTM' },
  { name:'Vertical Freezer -86°C, 410 Litre',       brand:'Eppendorf, Germany',                          model:'U410' },
  { name:'Vertical Refrigerator – Large',            brand:'BPL, India',                                  model:'BRS 564H' },
  { name:'Vertical Refrigerator – Small',            brand:'Haier, India',                                model:'HRD 1954C' },
  { name:'Vertical Refrigerator – Large',            brand:'BPL, India',                                  model:'BRS 564H' },
  { name:'Vertical Refrigerator – Small',            brand:'Haier, India',                                model:'HRD 1954C' },
  { name:'Viscometer',                               brand:'Ametek Brookfield, USA',                      model:'Rheocalc - T-LVDVNX' },
  { name:'Vortex',                                   brand:'Benchmark Scientific, USA',                   model:'BV 1003' },
  { name:'Vortex',                                   brand:'Remi, India',                                 model:'CM101' },
  { name:'Vortex',                                   brand:'Remi, India',                                 model:'CM101' },
];

// ─── Components ──────────────────────────────────────────────────────────────
function TestTable({ rows, accent }: { rows: Row[]; accent: Accent }) {
  return (
    <div className="lacc-table-wrap">
      <table className={`lacc-table lacc-table--${accent}`}>
        <thead><tr>{TH.map(h => <th key={h}>{h}</th>)}</tr></thead>
        <tbody>
          {rows.map(r => (
            <tr key={r.sl}>
              <td>{r.sl}</td><td>{r.sample}</td><td>{r.parameter}</td>
              <td>{r.process}</td><td>{r.qty}</td><td>{r.num}</td><td>{r.charges}</td>
            </tr>
          ))}
        </tbody>
      </table>
    </div>
  );
}

function GenericTable({ headers, rows, accent }: { headers: string[]; rows: React.ReactNode[][]; accent: Accent }) {
  return (
    <div className="lacc-table-wrap">
      <table className={`lacc-table lacc-table--${accent}`}>
        <thead><tr>{headers.map((h, i) => <th key={i}>{h}</th>)}</tr></thead>
        <tbody>
          {rows.map((row, i) => (
            <tr key={i}>{row.map((cell, j) => <td key={j}>{cell}</td>)}</tr>
          ))}
        </tbody>
      </table>
    </div>
  );
}

// ─── Accordion sections ───────────────────────────────────────────────────────
type AccSection = { id: string; label: string; icon: string; accent: Accent; content: React.ReactNode };

const ACC_SECTIONS: AccSection[] = [
  { id:'nutrition',  label:'NUTRITION',                                                     icon:'fa-seedling',       accent:'green', content:<TestTable rows={NUTRITION}    accent="green" /> },
  { id:'biochem',    label:'BIOCHEMISTRY',                                                  icon:'fa-vial',           accent:'blue',  content:<TestTable rows={BIOCHEMISTRY} accent="blue"  /> },
  { id:'micro',      label:'MICROBIOLOGY & SEROLOGY',                                       icon:'fa-bacteria',       accent:'teal',  content:<TestTable rows={MICROBIOLOGY} accent="teal"  /> },
  { id:'biotech',    label:'BIOTECHNOLOGY',                                                 icon:'fa-dna',            accent:'gold',  content:<TestTable rows={BIOTECHNOLOGY} accent="gold" /> },
  { id:'feedtech',   label:'FEED TECHNOLOGY',                                               icon:'fa-gears',          accent:'green', content:<TestTable rows={FEEDTECH}     accent="green" /> },
  { id:'pathology',  label:'PATHOLOGY & PARASITOLOGY',                                      icon:'fa-microscope',     accent:'blue',  content:<TestTable rows={PATHOLOGY}    accent="blue"  /> },
  { id:'molbio',     label:'MOLECULAR BIOLOGY - MOLECULAR DIAGNOSIS OF POULTRY DISEASES',  icon:'fa-circle-nodes',   accent:'teal',  content:<TestTable rows={MOLBIO}       accent="teal"  /> },
  { id:'sequencing', label:'SEQUENCING',                                                    icon:'fa-diagram-project',accent:'gold',  content:<GenericTable headers={SEQ_TH}  rows={SEQ_ROWS}  accent="gold"  /> },
  { id:'special',    label:'SPECIAL TESTS',                                                 icon:'fa-vials',          accent:'green', content:<><GenericTable headers={SEQ_TH} rows={ST1_ROWS} accent="green" /><GenericTable headers={ST2_TH} rows={ST2_ROWS} accent="green" /></> },
  { id:'hygiene',    label:'HYGIENE MANAGEMENT PACKAGES',                                   icon:'fa-hand-sparkles',  accent:'blue',  content:<GenericTable headers={HYG_TH}  rows={HYG_ROWS}  accent="blue"  /> },
  { id:'molgen',     label:'MOLECULAR BIOLOGY - GENERAL MOLECULAR BIOLOGY ANALYTICAL SERVICES', icon:'fa-network-wired', accent:'teal', content:<GenericTable headers={MGEN_TH} rows={MGEN_ROWS} accent="teal" /> },
];

const MAIN_TABS = [
  { id: 'keyprops',  icon: 'fa-star',               label: 'Key Propositions' },
  { id: 'tests',     icon: 'fa-flask-vial',          label: 'Comprehensive Test List' },
  { id: 'infra',     icon: 'fa-building-columns',    label: 'Infrastructure and Facilities' },
  { id: 'facility',  icon: 'fa-microscope',           label: 'Laboratory Facility' },
  { id: 'equipment', icon: 'fa-list-ul',              label: 'List of Equipment' },
] as const;

type MainTab = typeof MAIN_TABS[number]['id'];

export default function LaboratoryPage() {
  const [mainTab, setMainTab]       = useState<MainTab>('keyprops');
  const [open, setOpen]             = useState<string | null>(null);
  const itemRefs                    = useRef<Record<string, HTMLDivElement | null>>({});
  const [labAccOpen, setLabAccOpen] = useState<string | null>(null);
  const [equipSearch, setEquipSearch] = useState('');

  const toggle = (id: string) => setOpen(p => p === id ? null : id);

  useEffect(() => {
    if (!open) return;
    const el = itemRefs.current[open];
    if (!el) return;
    const timer = setTimeout(() => {
      const navbar = document.getElementById('navbar');
      const offset = (navbar?.offsetHeight ?? 70) + 12;
      const top = el.getBoundingClientRect().top + window.scrollY - offset;
      window.scrollTo({ top, behavior: 'smooth' });
    }, 60);
    return () => clearTimeout(timer);
  }, [open]);

  const filteredEquip = equipSearch.trim()
    ? EQUIPMENT.filter(eq => [eq.name, eq.brand, eq.model].some(f => f.toLowerCase().includes(equipSearch.toLowerCase())))
    : EQUIPMENT;

  return (
    <>
      {/* ── Hero ── */}
      <div className="op-hero">
        <div className="op-hero-deco" aria-hidden="true">
          <svg className="deco-leaf-1" viewBox="0 0 200 300" fill="none">
            <path d="M100 10 C160 40 190 120 160 200 C130 280 40 290 20 220 C0 150 40 80 100 10Z" fill="#7abf9e"/>
            <path d="M100 50 C140 70 160 130 140 190 C120 250 60 260 40 200" stroke="#a9d4bc" strokeWidth="1.5" fill="none"/>
          </svg>
          <svg className="deco-leaf-2" viewBox="0 0 200 300" fill="none">
            <path d="M100 10 C160 40 190 120 160 200 C130 280 40 290 20 220 C0 150 40 80 100 10Z" fill="#7abf9e"/>
          </svg>
        </div>
        <div className="container op-hero-inner">
          <nav className="op-breadcrumb" aria-label="Breadcrumb">
            <Link href="/" className="op-bc-item">Home</Link>
            <span className="op-bc-sep" aria-hidden="true">/</span>
            <span className="op-bc-item active">Laboratory</span>
          </nav>
          <h1>Agrivet <em>Laboratory</em></h1>
        </div>
        <div className="op-hero-wave" aria-hidden="true">
          <svg viewBox="0 0 1440 60" preserveAspectRatio="none" fill="#f7f9f8">
            <path d="M0,40 C360,70 1080,10 1440,40 L1440,60 L0,60Z"/>
          </svg>
        </div>
      </div>

      {/* ── 5-Tab Section ── */}
      <section className="lmain-section">
        <div className="container">

          {/* Tab bar */}
          <div className="lmain-tab-bar" role="tablist">
            {MAIN_TABS.map(t => (
              <button
                key={t.id}
                role="tab"
                aria-selected={mainTab === t.id}
                className={`lmain-tab-btn${mainTab === t.id ? ' lmain-tab-btn--active' : ''}`}
                onClick={() => setMainTab(t.id)}
              >
                <i className={`fas ${t.icon} lmain-tab-icon`} />
                <span>{t.label}</span>
              </button>
            ))}
          </div>

          {/* Tab 1 — Key Propositions */}
          {mainTab === 'keyprops' && (
            <div className="lmain-tab-panel">
              <div className="lab-kp-inner">
                <div className="lab-kp-content">
                  <div className="section-eyebrow">Why Choose Us</div>
                  <h2 className="lab-kp-title">Agrivet Laboratories:<br /><em>The Key Propositions</em></h2>
                  <ul className="lab-kp-list">
                    {KEY_PROPS.map((item, i) => (
                      <li key={i}>
                        <i className="fas fa-circle-check lab-kp-check-icon" />
                        <span>{item}</span>
                      </li>
                    ))}
                  </ul>
                </div>
                <figure className="lab-kp-figure">
                  <img src="/images/lab-1.webp" alt="Agrivet Laboratory Facility" />
                </figure>
              </div>
            </div>
          )}

          {/* Tab 2 — Comprehensive Test List */}
          {mainTab === 'tests' && (
            <div className="lmain-tab-panel">
              {ACC_SECTIONS.map(sec => (
                <div key={sec.id} className="lacc-item" ref={el => { itemRefs.current[sec.id] = el; }}>
                  <button
                    className={`lacc-btn lacc-btn--${sec.accent}${open === sec.id ? ' open' : ''}`}
                    onClick={() => toggle(sec.id)}
                  >
                    <i className={`fas ${sec.icon} lacc-btn-icon`} />
                    <span className="lacc-btn-text">{sec.label}</span>
                    <i className="fas fa-chevron-down lacc-btn-arrow" />
                  </button>
                  {open === sec.id && (
                    <div className="lacc-body">{sec.content}</div>
                  )}
                </div>
              ))}
            </div>
          )}

          {/* Tab 2 — Infrastructure and Facilities */}
          {mainTab === 'infra' && (
            <div className="lmain-tab-panel">
              <div className="lsf-infra-card">
                <div className="lsf-infra-badge">
                  <i className="fas fa-shield-halved" />
                  <span>Agrivet Laboratories: Infrastructure and Facilities</span>
                </div>
                <ul className="lsf-checklist">
                  {INFRA_ITEMS.map((item, i) => (
                    <li key={i}>
                      <span className="lsf-check-icon"><i className="fas fa-check" /></span>
                      <span>{item}</span>
                    </li>
                  ))}
                </ul>
              </div>
            </div>
          )}

          {/* Tab 3 — Laboratory Facility */}
          {mainTab === 'facility' && (
            <div className="lmain-tab-panel">
              <div className="lsf-lab-acc">
                {LAB_FACILITY.map(sec => (
                  <div key={sec.id} className={`lsf-lab-item${labAccOpen === sec.id ? ' lsf-lab-item--open' : ''}`}>
                    <button
                      className="lsf-lab-btn"
                      onClick={() => setLabAccOpen(p => p === sec.id ? null : sec.id)}
                    >
                      <span className="lsf-lab-btn-left">
                        <i className={`fas ${sec.icon} lsf-lab-btn-icon`} />
                        <span>{sec.title}</span>
                      </span>
                      <span className="lsf-lab-chevron">
                        <i className={`fas ${labAccOpen === sec.id ? 'fa-minus' : 'fa-plus'}`} />
                      </span>
                    </button>
                    {labAccOpen === sec.id && (
                      <div className="lsf-lab-panel">
                        <ul className="lsf-checklist">
                          {sec.items.map((item, i) => (
                            <li key={i}>
                              <span className="lsf-check-icon"><i className="fas fa-check" /></span>
                              <span>{item}</span>
                            </li>
                          ))}
                        </ul>
                      </div>
                    )}
                  </div>
                ))}
              </div>
            </div>
          )}

          {/* Tab 4 — List of Equipment */}
          {mainTab === 'equipment' && (
            <div className="lmain-tab-panel">
              <div className="lsf-equip-controls">
                <div className="lsf-equip-search-wrap">
                  <i className="fas fa-magnifying-glass lsf-equip-search-icon" />
                  <input
                    type="text"
                    className="lsf-equip-search"
                    placeholder="Search by name, brand or model…"
                    value={equipSearch}
                    onChange={e => setEquipSearch(e.target.value)}
                  />
                </div>
                <div className="lsf-equip-count">
                  Showing <strong>{filteredEquip.length}</strong>
                  {filteredEquip.length !== EQUIPMENT.length ? ` of ${EQUIPMENT.length}` : ''} equipment
                </div>
              </div>
              <div className="lsf-equip-grid">
                {filteredEquip.map((eq, i) => (
                  <div key={i} className="lsf-equip-card">
                    <h4 className="lsf-equip-name">{eq.name}</h4>
                    <div className="lsf-equip-row">
                      <span className="lsf-equip-label">Brand</span>
                      <span className="lsf-equip-value">{eq.brand}</span>
                    </div>
                    <div className="lsf-equip-row">
                      <span className="lsf-equip-label">Model</span>
                      <span className="lsf-equip-value">{eq.model}</span>
                    </div>
                  </div>
                ))}
                {filteredEquip.length === 0 && (
                  <div className="lsf-equip-empty">No equipment matches your search.</div>
                )}
              </div>
            </div>
          )}

        </div>
      </section>
    </>
  );
}
