const CFG = {
  company: "Larspeenghar Livestock and Agriculture Company",
  tagline: "DAIRY GENETICS · HERD MANAGEMENT · PEDIGREE RECORDS",
  pedTitle: "LARSPEENGHAR PEDIGREE",
  certSub: "OFFICIAL THREE-GENERATION PEDIGREE CERTIFICATE",
  signers: [
    { role: "Herd Manager", org: "Larspeenghar Livestock & Agriculture" },
    { role: "Veterinarian / Inspector", org: "Official Certifying Authority" },
    { role: "Director / Owner", org: "Larspeenghar Livestock & Agriculture" },
  ],
  storageKey: "larspeenghar_v7",
};

/* ══════════════════════════════════════════════════════
   10 EXAMPLE ANIMALS — Tests every feature:
   • 3 Sires (2 Holstein, 1 Montbéliarde)
   • 7 Cows (5 Holstein, 2 Montbéliarde)
   • All cows are linked to a registered sire
   • Two cows also linked to a registered dam (c05→c01)
   • Full production data on all females
   • Grandparent DOB + production on every record
   • Demonstrates: kinship clusters, offspring lists,
     auto-filled pedigree boxes, 305d calculations
   ══════════════════════════════════════════════════════ */
const DEMO = [
  /* ── SIRE 1: Holstein AI bull ── */
  {
    id: "b01",
    breed: "Holstein",
    name: "PEAK ALTASPRING",
    regId: "HOL-US-70350363",
    dob: "2018-04-12",
    sex: "Male",
    color: "Black & White",
    lact: "",
    photo: "",
    sireLinkedId: "",
    sireName: "SANDY-VALLEY CHROME",
    sireId: "HOL-US-65963857",
    sireDob: "2015-02-08",
    sireBreed: "Holstein",
    ssName: "MR SPRING OUTSIDE",
    ssId: "HOL-US-60200892",
    ssDob: "2012-05-14",
    ssBreed: "Holstein",
    sdName: "SANDY VALLEY ALICIA",
    sdId: "HOL-US-60441220",
    sdDob: "2013-08-22",
    sdBreed: "Holstein",
    sdMilk: "9800",
    sdFat: "3.75",
    sdProt: "3.20",
    sdPhoto: "",
    damLinkedId: "",
    damName: "ALTASPRING LEAH ET",
    damId: "HOL-US-68790022",
    damDob: "2016-07-01",
    damBreed: "Holstein",
    damMilk: "10100",
    damFat: "3.80",
    damProt: "3.30",
    damPhoto: "",
    dsName: "MR SAM",
    dsId: "HOL-US-58990011",
    dsDob: "2011-03-15",
    dsBreed: "Holstein",
    ddName: "LEAH SUPREME",
    ddId: "HOL-US-61230045",
    ddDob: "2014-09-30",
    ddBreed: "Holstein",
    ddMilk: "9600",
    ddFat: "3.78",
    ddProt: "3.28",
    ddPhoto: "",
    milk: "",
    fat: "",
    prot: "",
    peak: "",
    dim: "",
    scs: "",
    calving: "",
    notes:
      "Elite AI sire. High milk EBV +1420 kg. Widely used in Europe and the Americas. Sons show strong feet & legs.",
    role: "Sire",
    ownerId: "ow1",
    earTag: "LK-B-001",
    province: "Kabul",
    district: "Paghman",
  },

  /* ── SIRE 2: Second Holstein bull (shares grandsire with b01 → kinship) ── */
  {
    id: "b03",
    breed: "Holstein",
    name: "WESTCOAST LIGHTHOUSE",
    regId: "HOL-CA-109244",
    dob: "2019-07-20",
    sex: "Male",
    color: "Black & White",
    lact: "",
    photo: "",
    sireLinkedId: "",
    sireName: "SANDY-VALLEY CHROME",
    sireId: "HOL-US-65963857",
    sireDob: "2015-02-08",
    sireBreed: "Holstein",
    ssName: "MR SPRING OUTSIDE",
    ssId: "HOL-US-60200892",
    ssDob: "2012-05-14",
    ssBreed: "Holstein",
    sdName: "WESTCOAST BEACON",
    sdId: "HOL-CA-105119",
    sdDob: "2014-03-11",
    sdBreed: "Holstein",
    sdMilk: "10400",
    sdFat: "3.68",
    sdProt: "3.18",
    sdPhoto: "",
    damLinkedId: "",
    damName: "LIGHTHOUSE PEARL ET",
    damId: "HOL-CA-107788",
    damDob: "2017-09-05",
    damBreed: "Holstein",
    damMilk: "11200",
    damFat: "3.72",
    damProt: "3.22",
    damPhoto: "",
    dsName: "SEAGULL-BAY SUPERSIRE",
    dsId: "HOL-US-62297099",
    dsDob: "2012-11-30",
    dsBreed: "Holstein",
    ddName: "LIGHTHOUSE RUBY",
    ddId: "HOL-CA-104551",
    ddDob: "2014-06-18",
    ddBreed: "Holstein",
    ddMilk: "10800",
    ddFat: "3.69",
    ddProt: "3.19",
    ddPhoto: "",
    milk: "",
    fat: "",
    prot: "",
    peak: "",
    dim: "",
    scs: "",
    calving: "",
    notes:
      "Canadian AI bull. Very high milk volume. Daughters show excellent udder conformation and longevity.",
    role: "Sire",
    ownerId: "ow3",
    earTag: "LK-B-003",
    province: "Balkh",
    district: "Dehdadi",
  },

  /* ── SIRE 3: Montbéliarde AI bull ── */
  {
    id: "b02",
    breed: "Montbeliard",
    name: "UBAYE",
    regId: "MO-FR-7041902",
    dob: "2017-09-03",
    sex: "Male",
    color: "Pied Red & White",
    lact: "",
    photo: "",
    sireLinkedId: "",
    sireName: "OLERON",
    sireId: "MO-FR-6098801",
    sireDob: "2012-04-18",
    sireBreed: "Montbéliarde",
    ssName: "NORTON",
    ssId: "MO-FR-5500112",
    ssDob: "2009-01-11",
    ssBreed: "Montbéliarde",
    sdName: "VENUS DES VOSGES",
    sdId: "MO-FR-5877231",
    sdDob: "2011-07-22",
    sdBreed: "Montbéliarde",
    sdMilk: "8400",
    sdFat: "3.90",
    sdProt: "3.55",
    sdPhoto: "",
    damLinkedId: "",
    damName: "UBAYE MÈRE 31",
    damId: "MO-FR-6340088",
    damDob: "2014-05-30",
    damBreed: "Montbéliarde",
    damMilk: "8600",
    damFat: "3.95",
    damProt: "3.60",
    damPhoto: "",
    dsName: "NABAB",
    dsId: "MO-FR-6245312",
    dsDob: "2013-02-14",
    dsBreed: "Montbéliarde",
    ddName: "BONNE ÉTOILE 22",
    ddId: "MO-FR-5900441",
    ddDob: "2010-11-08",
    ddBreed: "Montbéliarde",
    ddMilk: "8100",
    ddFat: "3.88",
    ddProt: "3.52",
    ddPhoto: "",
    milk: "",
    fat: "",
    prot: "",
    peak: "",
    dim: "",
    scs: "",
    calving: "",
    notes:
      "Top Montbéliarde dual-purpose AI sire. Excellent cheese yield index. 312 daughters in official recording.",
    role: "Sire",
    ownerId: "ow2",
    earTag: "LK-B-002",
    province: "Herat",
    district: "Guzara",
  },

  /* ── COW 1: Holstein, sire=b01, 2nd lactation, high producer ── */
  {
    id: "c01",
    breed: "Holstein",
    name: "BELLE MEADOW ROSE",
    regId: "HO-2022-00415",
    dob: "2022-03-14",
    sex: "Female",
    color: "Black & White",
    lact: "2",
    photo: "",
    sireLinkedId: "b01",
    sireName: "PEAK ALTASPRING",
    sireId: "HOL-US-70350363",
    sireDob: "2018-04-12",
    sireBreed: "Holstein",
    ssName: "SANDY-VALLEY CHROME",
    ssId: "HOL-US-65963857",
    ssDob: "2015-02-08",
    ssBreed: "Holstein",
    sdName: "SANDY VALLEY ALICIA",
    sdId: "HOL-US-60441220",
    sdDob: "2013-08-22",
    sdBreed: "Holstein",
    sdMilk: "9800",
    sdFat: "3.75",
    sdProt: "3.20",
    sdPhoto: "",
    damLinkedId: "",
    damName: "MEADOW ROSE 712 ET",
    damId: "FR-2019-004821",
    damDob: "2019-06-10",
    damBreed: "Local",
    damMilk: "10300",
    damFat: "3.88",
    damProt: "3.38",
    damPhoto: "",
    dsName: "NO-FI UNIVERSAL",
    dsId: "HOL-FI-109931",
    dsDob: "2014-11-05",
    dsBreed: "Holstein",
    ddName: "MEADOW ROSE 518",
    ddId: "FR-2016-003312",
    ddDob: "2016-04-20",
    ddBreed: "Holstein",
    ddMilk: "9700",
    ddFat: "3.82",
    ddProt: "3.32",
    ddPhoto: "",
    milk: "10200",
    fat: "3.85",
    prot: "3.35",
    peak: "44.5",
    dim: "298",
    scs: "2.6",
    calving: "2024-01-10",
    notes:
      "Excellent conformation score 88. Daughter of PEAK ALTASPRING (b01). Will be used as dam for next generation.",
    role: "Cow",
    ownerId: "ow1",
    earTag: "LK-C-001",
    province: "Kabul",
    district: "Paghman",
  },

  /* ── COW 2: Holstein, sire=b01, 1st lactation ── */
  {
    id: "c03",
    breed: "Holstein",
    name: "MEADOW SUNRISE",
    regId: "HO-2023-00881",
    dob: "2023-05-08",
    sex: "Female",
    color: "Black & White",
    lact: "1",
    photo: "",
    sireLinkedId: "b01",
    sireName: "PEAK ALTASPRING",
    sireId: "HOL-US-70350363",
    sireDob: "2018-04-12",
    sireBreed: "Holstein",
    ssName: "SANDY-VALLEY CHROME",
    ssId: "HOL-US-65963857",
    ssDob: "2015-02-08",
    ssBreed: "Holstein",
    sdName: "SANDY VALLEY ALICIA",
    sdId: "HOL-US-60441220",
    sdDob: "2013-08-22",
    sdBreed: "Holstein",
    sdMilk: "9800",
    sdFat: "3.75",
    sdProt: "3.20",
    sdPhoto: "",
    damLinkedId: "",
    damName: "SUNRISE TOPAZ ET",
    damId: "FR-2020-005501",
    damDob: "2020-02-14",
    damBreed: "Local",
    damMilk: "9900",
    damFat: "3.82",
    damProt: "3.30",
    damPhoto: "",
    dsName: "NO-FI UNIVERSAL",
    dsId: "HOL-FI-109931",
    dsDob: "2014-11-05",
    dsBreed: "Holstein",
    ddName: "TOPAZ QUEEN",
    ddId: "FR-2017-002210",
    ddDob: "2017-07-20",
    ddBreed: "Holstein",
    ddMilk: "9400",
    ddFat: "3.78",
    ddProt: "3.26",
    ddPhoto: "",
    milk: "9800",
    fat: "3.80",
    prot: "3.30",
    peak: "41.0",
    dim: "271",
    scs: "2.8",
    calving: "2024-06-01",
    notes:
      "First lactation — very promising start. Half-sister to BELLE MEADOW ROSE through shared sire (PEAK ALTASPRING).",
    role: "Cow",
    ownerId: "ow1",
    earTag: "LK-C-003",
    province: "Kabul",
    district: "Paghman",
  },

  /* ── COW 3: Holstein, sire=b03 (LIGHTHOUSE), different family line ── */
  {
    id: "c04",
    breed: "Holstein",
    name: "ALPINE CRYSTAL",
    regId: "HO-2021-00773",
    dob: "2021-11-17",
    sex: "Female",
    color: "Black & White",
    lact: "3",
    photo: "",
    sireLinkedId: "b03",
    sireName: "WESTCOAST LIGHTHOUSE",
    sireId: "HOL-CA-109244",
    sireDob: "2019-07-20",
    sireBreed: "Holstein",
    ssName: "SANDY-VALLEY CHROME",
    ssId: "HOL-US-65963857",
    ssDob: "2015-02-08",
    ssBreed: "Holstein",
    sdName: "WESTCOAST BEACON",
    sdId: "HOL-CA-105119",
    sdDob: "2014-03-11",
    sdBreed: "Holstein",
    sdMilk: "10400",
    sdFat: "3.68",
    sdProt: "3.18",
    sdPhoto: "",
    damLinkedId: "",
    damName: "ALPINE CRYSTAL MÈRE",
    damId: "FR-2018-007741",
    damDob: "2018-08-05",
    damBreed: "Holstein",
    damMilk: "10800",
    damFat: "3.71",
    damProt: "3.21",
    damPhoto: "",
    dsName: "DELTA-LLOYD GOLD CHIP",
    dsId: "HOL-US-62715009",
    dsDob: "2013-07-22",
    dsBreed: "Holstein",
    ddName: "ALPINE TOPAZ",
    ddId: "FR-2015-005512",
    ddDob: "2015-12-10",
    ddBreed: "Holstein",
    ddMilk: "10200",
    ddFat: "3.74",
    ddProt: "3.24",
    ddPhoto: "",
    milk: "11400",
    fat: "3.72",
    prot: "3.22",
    peak: "48.2",
    dim: "305",
    scs: "2.3",
    calving: "2023-09-14",
    notes:
      "Herd's highest producer. Daughter of WESTCOAST LIGHTHOUSE (b03). Shares grandsire SANDY-VALLEY CHROME with b01 family.",
    role: "Cow",
    ownerId: "ow3",
    earTag: "LK-C-004",
    province: "Balkh",
    district: "Dehdadi",
  },

  /* ── COW 4: Holstein, sire=b03, dam=c01 (BELLE MEADOW ROSE — linked!) ── */
  {
    id: "c05",
    breed: "Holstein",
    name: "MEADOW LIGHTHOUSE STAR",
    regId: "HO-2024-01122",
    dob: "2024-04-03",
    sex: "Female",
    color: "Black & White",
    lact: "1",
    photo: "",
    sireLinkedId: "b03",
    sireName: "WESTCOAST LIGHTHOUSE",
    sireId: "HOL-CA-109244",
    sireDob: "2019-07-20",
    sireBreed: "Holstein",
    ssName: "SANDY-VALLEY CHROME",
    ssId: "HOL-US-65963857",
    ssDob: "2015-02-08",
    ssBreed: "Holstein",
    sdName: "WESTCOAST BEACON",
    sdId: "HOL-CA-105119",
    sdDob: "2014-03-11",
    sdBreed: "Holstein",
    sdMilk: "10400",
    sdFat: "3.68",
    sdProt: "3.18",
    sdPhoto: "",
    damLinkedId: "c01",
    damName: "BELLE MEADOW ROSE",
    damId: "HO-2022-00415",
    damDob: "2022-03-14",
    damBreed: "Holstein",
    damMilk: "10200",
    damFat: "3.85",
    damProt: "3.35",
    damPhoto: "",
    dsName: "PEAK ALTASPRING",
    dsId: "HOL-US-70350363",
    dsDob: "2018-04-12",
    dsBreed: "Holstein",
    ddName: "MEADOW ROSE 712 ET",
    ddId: "FR-2019-004821",
    ddDob: "2019-06-10",
    ddBreed: "Holstein",
    ddMilk: "10300",
    ddFat: "3.88",
    ddProt: "3.38",
    ddPhoto: "",
    milk: "9600",
    fat: "3.83",
    prot: "3.33",
    peak: "40.8",
    dim: "188",
    scs: "2.5",
    calving: "2025-05-01",
    notes:
      "Currently in 1st lactation. Sire=WESTCOAST LIGHTHOUSE, Dam=BELLE MEADOW ROSE (c01). Demonstrates 3-way linked pedigree. High inbreeding check on Kinship page.",
    role: "Cow",
    ownerId: "ow1",
    earTag: "LK-C-005",
    province: "Kabul",
    district: "Paghman",
  },

  /* ── COW 5: Holstein, sire=b01, 4th lactation, veteran cow ── */
  {
    id: "c06",
    breed: "Holstein",
    name: "GREENFIELD DUCHESS",
    regId: "HO-2019-00202",
    dob: "2019-08-22",
    sex: "Female",
    color: "Black & White",
    lact: "4",
    photo: "",
    sireLinkedId: "b01",
    sireName: "PEAK ALTASPRING",
    sireId: "HOL-US-70350363",
    sireDob: "2018-04-12",
    sireBreed: "Holstein",
    ssName: "SANDY-VALLEY CHROME",
    ssId: "HOL-US-65963857",
    ssDob: "2015-02-08",
    ssBreed: "Holstein",
    sdName: "SANDY VALLEY ALICIA",
    sdId: "HOL-US-60441220",
    sdDob: "2013-08-22",
    sdBreed: "Holstein",
    sdMilk: "9800",
    sdFat: "3.75",
    sdProt: "3.20",
    sdPhoto: "",
    damLinkedId: "",
    damName: "GREENFIELD PRIDE ET",
    damId: "FR-2016-00881",
    damDob: "2016-12-01",
    damBreed: "Local",
    damMilk: "10600",
    damFat: "3.80",
    damProt: "3.28",
    damPhoto: "",
    dsName: "GENERVATIONS HARVEY",
    dsId: "HOL-US-60596506",
    dsDob: "2012-04-18",
    dsBreed: "Holstein",
    ddName: "GREENFIELD BELLA",
    ddId: "FR-2013-00443",
    ddDob: "2013-10-25",
    ddBreed: "Holstein",
    ddMilk: "9900",
    ddFat: "3.76",
    ddProt: "3.25",
    ddPhoto: "",
    milk: "10850",
    fat: "3.91",
    prot: "3.38",
    peak: "46.0",
    dim: "305",
    scs: "2.4",
    calving: "2023-05-18",
    notes:
      "Veteran 4th-lactation cow. Consistent producer across all lactations. One of the herd's most valuable brood cows.",
    role: "Cow",
    ownerId: "ow3",
    earTag: "LK-C-006",
    province: "Balkh",
    district: "Dehdadi",
  },

  /* ── COW 6: Montbéliarde, sire=b02, 3rd lactation ── */
  {
    id: "c02",
    breed: "Montbeliard",
    name: "DORÉE DES VOSGES",
    regId: "MO-2021-00231",
    dob: "2021-06-22",
    sex: "Female",
    color: "Pied Red & White",
    lact: "3",
    photo: "",
    sireLinkedId: "b02",
    sireName: "UBAYE",
    sireId: "MO-FR-7041902",
    sireDob: "2017-09-03",
    sireBreed: "Montbéliarde",
    ssName: "OLERON",
    ssId: "MO-FR-6098801",
    ssDob: "2012-04-18",
    ssBreed: "Montbéliarde",
    sdName: "VENUS DES VOSGES",
    sdId: "MO-FR-5877231",
    sdDob: "2011-07-22",
    sdBreed: "Montbéliarde",
    sdMilk: "8400",
    sdFat: "3.90",
    sdProt: "3.55",
    sdPhoto: "",
    damLinkedId: "",
    damName: "FLEURIE 44",
    damId: "FR-2018-00114",
    damDob: "2018-03-17",
    damBreed: "Local",
    damMilk: "8900",
    damFat: "3.95",
    damProt: "3.62",
    damPhoto: "",
    dsName: "NABAB",
    dsId: "MO-FR-6245312",
    dsDob: "2013-02-14",
    dsBreed: "Montbéliarde",
    ddName: "FLEURIE 28",
    ddId: "FR-2015-00088",
    ddDob: "2015-09-01",
    ddBreed: "Montbéliarde",
    ddMilk: "8500",
    ddFat: "3.88",
    ddProt: "3.55",
    ddPhoto: "",
    milk: "8700",
    fat: "3.92",
    prot: "3.62",
    peak: "38.0",
    dim: "305",
    scs: "3.1",
    calving: "2023-11-05",
    notes:
      "Good dual-purpose traits. Cheese-suitable milk with high protein. Strong feet & legs score 9/9.",
    role: "Cow",
    ownerId: "ow2",
    earTag: "LK-C-002",
    province: "Herat",
    district: "Guzara",
  },

  /* ── COW 7: Montbéliarde, sire=b02, 2nd lactation ── */
  {
    id: "c07",
    breed: "Montbeliard",
    name: "AURORE DE FRANCHE-COMTÉ",
    regId: "MO-2022-00589",
    dob: "2022-09-11",
    sex: "Female",
    color: "Pied Red & White",
    lact: "2",
    photo: "",
    sireLinkedId: "b02",
    sireName: "UBAYE",
    sireId: "MO-FR-7041902",
    sireDob: "2017-09-03",
    sireBreed: "Montbéliarde",
    ssName: "OLERON",
    ssId: "MO-FR-6098801",
    ssDob: "2012-04-18",
    ssBreed: "Montbéliarde",
    sdName: "VENUS DES VOSGES",
    sdId: "MO-FR-5877231",
    sdDob: "2011-07-22",
    sdBreed: "Montbéliarde",
    sdMilk: "8400",
    sdFat: "3.90",
    sdProt: "3.55",
    sdPhoto: "",
    damLinkedId: "",
    damName: "COMTÉ MARGUERITE 18",
    damId: "MO-FR-6812044",
    damDob: "2019-04-28",
    damBreed: "Local",
    damMilk: "8300",
    damFat: "3.96",
    damProt: "3.64",
    damPhoto: "",
    dsName: "VERCORS",
    dsId: "MO-FR-6100882",
    dsDob: "2014-08-09",
    dsBreed: "Montbéliarde",
    ddName: "COMTÉ MARGUERITE 7",
    ddId: "MO-FR-5990017",
    ddDob: "2016-02-14",
    ddBreed: "Montbéliarde",
    ddMilk: "8000",
    ddFat: "3.94",
    ddProt: "3.60",
    ddPhoto: "",
    milk: "8450",
    fat: "3.96",
    prot: "3.65",
    peak: "36.5",
    dim: "288",
    scs: "2.9",
    calving: "2024-03-22",
    notes:
      "Half-sister to DORÉE DES VOSGES through shared sire UBAYE. Highest protein % in the Montbéliarde group. Ideal for cheese production.",
    role: "Cow",
    ownerId: "ow2",
    earTag: "LK-C-007",
    province: "Herat",
    district: "Guzara",
  },
];

/* Google Drive — replace YOUR_GOOGLE_CLIENT_ID with your actual Client ID from console.cloud.google.com */
const GDRIVE = {
  CLIENT_ID: "YOUR_GOOGLE_CLIENT_ID",
  SCOPE: "https://www.googleapis.com/auth/drive.file",
  FILE: "larspeenghar_backup.json",
  token: null,
};
