-- =============================================================
-- plants_database_day_night.sql
-- Creates a NEW `plants_v2` table with day/night setpoints.
-- This is SEPARATE from the existing `plants` table — the old
-- table is NOT touched.  Each lifecycle stage carries:
--
--   General setpoints  (encompass full day+night range, incl. temp_optimal_c)
--   day   { temp_min_c, temp_max_c, temp_optimal_c,
--            humidity_min_pct, humidity_max_pct,
--            light_lux_min, light_lux_max }
--   night { ... same keys ... }
--   day   { temp_min_c, temp_max_c, temp_optimal_c,
--            humidity_min_pct, humidity_max_pct,
--            light_lux_min, light_lux_max }
--   night { … same keys … }
--
-- HOW TO USE:
--   1. Paste the entire file into the Supabase SQL editor.
--   2. Run it. A new `plants_v2` table is created alongside
--      the existing `plants` table (both coexist safely).
--   3. Update supabase_client.py to fetch from /plants_v2
--      and save to plants_database_day_night.json so the AI
--      can use the new day/night setpoints.
-- =============================================================

-- 1. DROP OLD plants_v2 IF IT EXISTS (idempotent re-run)
DROP TABLE IF EXISTS public.plants_v2 CASCADE;

-- 2. CREATE NEW TABLE
CREATE TABLE public.plants_v2 (
    id              TEXT PRIMARY KEY,
    common_names    TEXT[],
    scientific_name TEXT NOT NULL,
    family          TEXT NOT NULL,
    description     TEXT,
    sources         TEXT[],
    lifecycle       JSONB NOT NULL
);

-- 3. INSERT ALL 21 PLANTS WITH DAY / NIGHT SETPOINTS
INSERT INTO public.plants_v2 (id, common_names, scientific_name, family, description, sources, lifecycle) VALUES

-- =======================================================
-- GROUP 1: LEAFY GREENS (Full Cycle Compatible)
-- =======================================================
(
    'lettuce',
    ARRAY['Lettuce', 'Selada', 'Selada Keriting', 'Grand Rapids'],
    'Lactuca sativa',
    'Asteraceae',
    'Standard loose-leaf lettuce. High value, fast harvest.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 2,
            "temp_min_c": 18, "temp_max_c": 22, "temp_optimal_c": 20,
            "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 20, "temp_max_c": 22, "temp_optimal_c": 21, "humidity_min_pct": 90, "humidity_max_pct": 95, "humidity_optimal_pct": 93, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 18, "temp_max_c": 20, "temp_optimal_c": 19, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 3, "day_end": 14,
            "temp_min_c": 16, "temp_max_c": 24, "temp_optimal_c": 20,
            "humidity_min_pct": 65, "humidity_max_pct": 80, "humidity_optimal_pct": 73,
            "light_lux_min": 8000, "light_lux_max": 12000, "light_lux_optimal": 10000,
            "day":   { "temp_min_c": 22, "temp_max_c": 24, "temp_optimal_c": 23, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 8000, "light_lux_max": 14000, "light_lux_optimal": 11000 },
            "night": { "temp_min_c": 16, "temp_max_c": 19, "temp_optimal_c": 18, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 15, "day_end": 35,
            "temp_min_c": 16, "temp_max_c": 24, "temp_optimal_c": 20,
            "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68,
            "light_lux_min": 14000, "light_lux_max": 22000, "light_lux_optimal": 18000,
            "notes": "Harvest phase.",
            "day":   { "temp_min_c": 21, "temp_max_c": 24, "temp_optimal_c": 23, "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68, "light_lux_min": 14000, "light_lux_max": 25000, "light_lux_optimal": 19500 },
            "night": { "temp_min_c": 16, "temp_max_c": 19, "temp_optimal_c": 18, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'pak_choy',
    ARRAY['Pak Choy', 'Pakcoy', 'Bok Choy', 'Nauli F1', 'Naura F1'],
    'Brassica rapa chinensis',
    'Brassicaceae',
    'Robust leafy green, very fast turnover.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 2,
            "temp_min_c": 24, "temp_max_c": 28, "temp_optimal_c": 26,
            "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 25, "temp_max_c": 28, "temp_optimal_c": 27, "humidity_min_pct": 90, "humidity_max_pct": 95, "humidity_optimal_pct": 93, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 24, "temp_max_c": 26, "temp_optimal_c": 25, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 3, "day_end": 12,
            "temp_min_c": 20, "temp_max_c": 28, "temp_optimal_c": 24,
            "humidity_min_pct": 65, "humidity_max_pct": 85, "humidity_optimal_pct": 75,
            "light_lux_min": 10000, "light_lux_max": 13000, "light_lux_optimal": 11500,
            "day":   { "temp_min_c": 24, "temp_max_c": 28, "temp_optimal_c": 26, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 10000, "light_lux_max": 15000, "light_lux_optimal": 12500 },
            "night": { "temp_min_c": 20, "temp_max_c": 24, "temp_optimal_c": 22, "humidity_min_pct": 75, "humidity_max_pct": 85, "humidity_optimal_pct": 80, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 13, "day_end": 30,
            "temp_min_c": 18, "temp_max_c": 30, "temp_optimal_c": 24,
            "humidity_min_pct": 60, "humidity_max_pct": 85, "humidity_optimal_pct": 73,
            "light_lux_min": 15000, "light_lux_max": 22000, "light_lux_optimal": 18500,
            "day":   { "temp_min_c": 24, "temp_max_c": 30, "temp_optimal_c": 27, "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68, "light_lux_min": 15000, "light_lux_max": 25000, "light_lux_optimal": 20000 },
            "night": { "temp_min_c": 18, "temp_max_c": 22, "temp_optimal_c": 20, "humidity_min_pct": 75, "humidity_max_pct": 85, "humidity_optimal_pct": 80, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'spinach_amaranth',
    ARRAY['Spinach', 'Bayam', 'Bayam Hijau', 'Maestro', 'Mira'],
    'Amaranthus tricolor',
    'Amaranthaceae',
    'Tropical spinach (Amaranth). Loves heat and light.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 3,
            "temp_min_c": 24, "temp_max_c": 30, "temp_optimal_c": 27,
            "humidity_min_pct": 85, "humidity_max_pct": 95, "humidity_optimal_pct": 90,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 26, "temp_max_c": 30, "temp_optimal_c": 28, "humidity_min_pct": 85, "humidity_max_pct": 90, "humidity_optimal_pct": 88, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 24, "temp_max_c": 28, "temp_optimal_c": 26, "humidity_min_pct": 90, "humidity_max_pct": 95, "humidity_optimal_pct": 93, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 4, "day_end": 10,
            "temp_min_c": 22, "temp_max_c": 30, "temp_optimal_c": 26,
            "humidity_min_pct": 70, "humidity_max_pct": 85, "humidity_optimal_pct": 78,
            "light_lux_min": 12000, "light_lux_max": 17500, "light_lux_optimal": 14750,
            "day":   { "temp_min_c": 26, "temp_max_c": 30, "temp_optimal_c": 28, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 12000, "light_lux_max": 20000, "light_lux_optimal": 16000 },
            "night": { "temp_min_c": 22, "temp_max_c": 26, "temp_optimal_c": 24, "humidity_min_pct": 75, "humidity_max_pct": 85, "humidity_optimal_pct": 80, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 11, "day_end": 25,
            "temp_min_c": 22, "temp_max_c": 32, "temp_optimal_c": 27,
            "humidity_min_pct": 65, "humidity_max_pct": 85, "humidity_optimal_pct": 75,
            "light_lux_min": 20000, "light_lux_max": 30500, "light_lux_optimal": 25250,
            "day":   { "temp_min_c": 26, "temp_max_c": 32, "temp_optimal_c": 29, "humidity_min_pct": 65, "humidity_max_pct": 80, "humidity_optimal_pct": 73, "light_lux_min": 20000, "light_lux_max": 35000, "light_lux_optimal": 27500 },
            "night": { "temp_min_c": 22, "temp_max_c": 26, "temp_optimal_c": 24, "humidity_min_pct": 75, "humidity_max_pct": 85, "humidity_optimal_pct": 80, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'mustard_greens',
    ARRAY['Mustard Greens', 'Caisim', 'Sawi Hijau', 'Sawi Pahit', 'Shinta', 'Tosakan', 'Morakot'],
    'Brassica juncea',
    'Brassicaceae',
    'Standard market mustard green.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 2,
            "temp_min_c": 20, "temp_max_c": 26, "temp_optimal_c": 23,
            "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 22, "temp_max_c": 26, "temp_optimal_c": 24, "humidity_min_pct": 90, "humidity_max_pct": 95, "humidity_optimal_pct": 93, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 20, "temp_max_c": 24, "temp_optimal_c": 22, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 3, "day_end": 12,
            "temp_min_c": 18, "temp_max_c": 26, "temp_optimal_c": 22,
            "humidity_min_pct": 65, "humidity_max_pct": 85, "humidity_optimal_pct": 75,
            "light_lux_min": 10000, "light_lux_max": 13000, "light_lux_optimal": 11500,
            "day":   { "temp_min_c": 22, "temp_max_c": 26, "temp_optimal_c": 24, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 10000, "light_lux_max": 15000, "light_lux_optimal": 12500 },
            "night": { "temp_min_c": 18, "temp_max_c": 20, "temp_optimal_c": 19, "humidity_min_pct": 75, "humidity_max_pct": 85, "humidity_optimal_pct": 80, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 13, "day_end": 35,
            "temp_min_c": 15, "temp_max_c": 25, "temp_optimal_c": 20,
            "humidity_min_pct": 60, "humidity_max_pct": 80, "humidity_optimal_pct": 70,
            "light_lux_min": 15000, "light_lux_max": 22000, "light_lux_optimal": 18500,
            "day":   { "temp_min_c": 20, "temp_max_c": 25, "temp_optimal_c": 23, "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68, "light_lux_min": 15000, "light_lux_max": 25000, "light_lux_optimal": 20000 },
            "night": { "temp_min_c": 15, "temp_max_c": 18, "temp_optimal_c": 17, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'kailan',
    ARRAY['Kailan', 'Chinese Kale', 'Nita'],
    'Brassica oleracea alboglabra',
    'Brassicaceae',
    'Thick stemmed brassica.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 3,
            "temp_min_c": 20, "temp_max_c": 26, "temp_optimal_c": 23,
            "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 22, "temp_max_c": 26, "temp_optimal_c": 24, "humidity_min_pct": 90, "humidity_max_pct": 95, "humidity_optimal_pct": 93, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 20, "temp_max_c": 24, "temp_optimal_c": 22, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 4, "day_end": 14,
            "temp_min_c": 16, "temp_max_c": 24, "temp_optimal_c": 20,
            "humidity_min_pct": 65, "humidity_max_pct": 85, "humidity_optimal_pct": 75,
            "light_lux_min": 12000, "light_lux_max": 15500, "light_lux_optimal": 13750,
            "day":   { "temp_min_c": 20, "temp_max_c": 24, "temp_optimal_c": 22, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 12000, "light_lux_max": 18000, "light_lux_optimal": 15000 },
            "night": { "temp_min_c": 16, "temp_max_c": 18, "temp_optimal_c": 17, "humidity_min_pct": 75, "humidity_max_pct": 85, "humidity_optimal_pct": 80, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 15, "day_end": 45,
            "temp_min_c": 12, "temp_max_c": 24, "temp_optimal_c": 18,
            "humidity_min_pct": 60, "humidity_max_pct": 80, "humidity_optimal_pct": 70,
            "light_lux_min": 15000, "light_lux_max": 22000, "light_lux_optimal": 18500,
            "day":   { "temp_min_c": 18, "temp_max_c": 24, "temp_optimal_c": 21, "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68, "light_lux_min": 15000, "light_lux_max": 25000, "light_lux_optimal": 20000 },
            "night": { "temp_min_c": 12, "temp_max_c": 16, "temp_optimal_c": 14, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'chinese_cabbage',
    ARRAY['Chinese Cabbage', 'Sawi Putih', 'Petsai', 'Leony'],
    'Brassica rapa pekinensis',
    'Brassicaceae',
    'Harvest as Baby Cabbage.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 3,
            "temp_min_c": 18, "temp_max_c": 24, "temp_optimal_c": 21,
            "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 20, "temp_max_c": 24, "temp_optimal_c": 22, "humidity_min_pct": 90, "humidity_max_pct": 95, "humidity_optimal_pct": 93, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 18, "temp_max_c": 22, "temp_optimal_c": 20, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 4, "day_end": 14,
            "temp_min_c": 14, "temp_max_c": 22, "temp_optimal_c": 18,
            "humidity_min_pct": 70, "humidity_max_pct": 85, "humidity_optimal_pct": 78,
            "light_lux_min": 10000, "light_lux_max": 13000, "light_lux_optimal": 11500,
            "day":   { "temp_min_c": 18, "temp_max_c": 22, "temp_optimal_c": 20, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 10000, "light_lux_max": 15000, "light_lux_optimal": 12500 },
            "night": { "temp_min_c": 14, "temp_max_c": 18, "temp_optimal_c": 16, "humidity_min_pct": 75, "humidity_max_pct": 85, "humidity_optimal_pct": 80, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 15, "day_end": 40,
            "temp_min_c": 10, "temp_max_c": 21, "temp_optimal_c": 16,
            "humidity_min_pct": 65, "humidity_max_pct": 85, "humidity_optimal_pct": 75,
            "light_lux_min": 15000, "light_lux_max": 22000, "light_lux_optimal": 18500,
            "day":   { "temp_min_c": 15, "temp_max_c": 21, "temp_optimal_c": 18, "humidity_min_pct": 65, "humidity_max_pct": 80, "humidity_optimal_pct": 73, "light_lux_min": 15000, "light_lux_max": 25000, "light_lux_optimal": 20000 },
            "night": { "temp_min_c": 10, "temp_max_c": 15, "temp_optimal_c": 13, "humidity_min_pct": 70, "humidity_max_pct": 85, "humidity_optimal_pct": 78, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'water_spinach',
    ARRAY['Water Spinach', 'Kangkung', 'Serimpi', 'Bangkok LP-1'],
    'Ipomoea aquatica',
    'Convolvulaceae',
    'Extremely fast growing.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 2,
            "temp_min_c": 26, "temp_max_c": 32, "temp_optimal_c": 29,
            "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 28, "temp_max_c": 32, "temp_optimal_c": 30, "humidity_min_pct": 90, "humidity_max_pct": 95, "humidity_optimal_pct": 93, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 26, "temp_max_c": 30, "temp_optimal_c": 28, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 3, "day_end": 7,
            "temp_min_c": 24, "temp_max_c": 32, "temp_optimal_c": 28,
            "humidity_min_pct": 75, "humidity_max_pct": 90, "humidity_optimal_pct": 83,
            "light_lux_min": 12000, "light_lux_max": 15500, "light_lux_optimal": 13750,
            "day":   { "temp_min_c": 28, "temp_max_c": 32, "temp_optimal_c": 30, "humidity_min_pct": 75, "humidity_max_pct": 85, "humidity_optimal_pct": 80, "light_lux_min": 12000, "light_lux_max": 18000, "light_lux_optimal": 15000 },
            "night": { "temp_min_c": 24, "temp_max_c": 28, "temp_optimal_c": 26, "humidity_min_pct": 80, "humidity_max_pct": 90, "humidity_optimal_pct": 85, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 8, "day_end": 21,
            "temp_min_c": 22, "temp_max_c": 35, "temp_optimal_c": 29,
            "humidity_min_pct": 70, "humidity_max_pct": 95, "humidity_optimal_pct": 83,
            "light_lux_min": 20000, "light_lux_max": 30500, "light_lux_optimal": 25250,
            "day":   { "temp_min_c": 26, "temp_max_c": 35, "temp_optimal_c": 31, "humidity_min_pct": 70, "humidity_max_pct": 85, "humidity_optimal_pct": 78, "light_lux_min": 20000, "light_lux_max": 35000, "light_lux_optimal": 27500 },
            "night": { "temp_min_c": 22, "temp_max_c": 26, "temp_optimal_c": 24, "humidity_min_pct": 80, "humidity_max_pct": 95, "humidity_optimal_pct": 88, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'celery',
    ARRAY['Celery', 'Seledri', 'Daun Sop', 'Amigo', 'Bamby'],
    'Apium graveolens',
    'Apiaceae',
    'Thrives in cooler temps.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 10,
            "temp_min_c": 15, "temp_max_c": 22, "temp_optimal_c": 19,
            "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95,
            "light_lux_min": 1000, "light_lux_max": 4500, "light_lux_optimal": 2750,
            "day":   { "temp_min_c": 20, "temp_max_c": 22, "temp_optimal_c": 21, "humidity_min_pct": 90, "humidity_max_pct": 95, "humidity_optimal_pct": 93, "light_lux_min": 1000, "light_lux_max": 5000, "light_lux_optimal": 3000 },
            "night": { "temp_min_c": 15, "temp_max_c": 18, "temp_optimal_c": 17, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 11, "day_end": 30,
            "temp_min_c": 14, "temp_max_c": 22, "temp_optimal_c": 18,
            "humidity_min_pct": 70, "humidity_max_pct": 85, "humidity_optimal_pct": 78,
            "light_lux_min": 10000, "light_lux_max": 13000, "light_lux_optimal": 11500,
            "day":   { "temp_min_c": 18, "temp_max_c": 22, "temp_optimal_c": 20, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 10000, "light_lux_max": 15000, "light_lux_optimal": 12500 },
            "night": { "temp_min_c": 14, "temp_max_c": 18, "temp_optimal_c": 16, "humidity_min_pct": 75, "humidity_max_pct": 85, "humidity_optimal_pct": 80, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 31, "day_end": 60,
            "temp_min_c": 12, "temp_max_c": 21, "temp_optimal_c": 17,
            "humidity_min_pct": 65, "humidity_max_pct": 80, "humidity_optimal_pct": 73,
            "light_lux_min": 15000, "light_lux_max": 22000, "light_lux_optimal": 18500,
            "day":   { "temp_min_c": 16, "temp_max_c": 21, "temp_optimal_c": 19, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 15000, "light_lux_max": 25000, "light_lux_optimal": 20000 },
            "night": { "temp_min_c": 12, "temp_max_c": 16, "temp_optimal_c": 14, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'green_onion',
    ARRAY['Green Onion', 'Bawang Daun', 'Blaze'],
    'Allium fistulosum',
    'Amaryllidaceae',
    'Grown for leaves.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 6,
            "temp_min_c": 18, "temp_max_c": 24, "temp_optimal_c": 21,
            "humidity_min_pct": 85, "humidity_max_pct": 95, "humidity_optimal_pct": 90,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 20, "temp_max_c": 24, "temp_optimal_c": 22, "humidity_min_pct": 85, "humidity_max_pct": 90, "humidity_optimal_pct": 88, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 18, "temp_max_c": 22, "temp_optimal_c": 20, "humidity_min_pct": 90, "humidity_max_pct": 95, "humidity_optimal_pct": 93, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 7, "day_end": 28,
            "temp_min_c": 14, "temp_max_c": 24, "temp_optimal_c": 19,
            "humidity_min_pct": 65, "humidity_max_pct": 80, "humidity_optimal_pct": 73,
            "light_lux_min": 12000, "light_lux_max": 15500, "light_lux_optimal": 13750,
            "day":   { "temp_min_c": 18, "temp_max_c": 24, "temp_optimal_c": 21, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 12000, "light_lux_max": 18000, "light_lux_optimal": 15000 },
            "night": { "temp_min_c": 14, "temp_max_c": 18, "temp_optimal_c": 16, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 29, "day_end": 70,
            "temp_min_c": 10, "temp_max_c": 24, "temp_optimal_c": 17,
            "humidity_min_pct": 50, "humidity_max_pct": 70, "humidity_optimal_pct": 60,
            "light_lux_min": 20000, "light_lux_max": 30500, "light_lux_optimal": 25250,
            "day":   { "temp_min_c": 15, "temp_max_c": 24, "temp_optimal_c": 20, "humidity_min_pct": 50, "humidity_max_pct": 65, "humidity_optimal_pct": 58, "light_lux_min": 20000, "light_lux_max": 35000, "light_lux_optimal": 27500 },
            "night": { "temp_min_c": 10, "temp_max_c": 15, "temp_optimal_c": 13, "humidity_min_pct": 60, "humidity_max_pct": 70, "humidity_optimal_pct": 65, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),

-- =======================================================
-- GROUP 2: NURSERY ONLY (Fruiting Crops)
-- =======================================================
(
    'chili_pepper',
    ARRAY['Chili', 'Cabai', 'Cabe', 'Bara F1', 'Pilar F1', 'Lado F1', 'Pelita', 'Baja', 'Gada Evo', 'Rawita F1', 'Rajo'],
    'Capsicum annuum',
    'Solanaceae',
    'Nursery Phase Only in PGC.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 7,
            "temp_min_c": 24, "temp_max_c": 29, "temp_optimal_c": 27,
            "humidity_min_pct": 85, "humidity_max_pct": 99, "humidity_optimal_pct": 92,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 26, "temp_max_c": 29, "temp_optimal_c": 28, "humidity_min_pct": 85, "humidity_max_pct": 95, "humidity_optimal_pct": 90, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 24, "temp_max_c": 27, "temp_optimal_c": 26, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 8, "day_end": 30,
            "temp_min_c": 18, "temp_max_c": 26, "temp_optimal_c": 22,
            "humidity_min_pct": 65, "humidity_max_pct": 80, "humidity_optimal_pct": 73,
            "light_lux_min": 14000, "light_lux_max": 22000, "light_lux_optimal": 18000,
            "day":   { "temp_min_c": 22, "temp_max_c": 26, "temp_optimal_c": 24, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 14000, "light_lux_max": 25000, "light_lux_optimal": 19500 },
            "night": { "temp_min_c": 18, "temp_max_c": 21, "temp_optimal_c": 20, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 31, "day_end": 60,
            "temp_min_c": 16, "temp_max_c": 26, "temp_optimal_c": 21,
            "humidity_min_pct": 60, "humidity_max_pct": 80, "humidity_optimal_pct": 70,
            "light_lux_min": 25000, "light_lux_max": 35000, "light_lux_optimal": 30000,
            "notes": "Requires full sun.",
            "day":   { "temp_min_c": 21, "temp_max_c": 26, "temp_optimal_c": 24, "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68, "light_lux_min": 25000, "light_lux_max": 40000, "light_lux_optimal": 32500 },
            "night": { "temp_min_c": 16, "temp_max_c": 21, "temp_optimal_c": 19, "humidity_min_pct": 65, "humidity_max_pct": 80, "humidity_optimal_pct": 73, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'tomato',
    ARRAY['Tomato', 'Tomat', 'Servo F1', 'Agatha', 'Gustavi', 'Gammara'],
    'Solanum lycopersicum',
    'Solanaceae',
    'Nursery Phase Only in PGC.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 5,
            "temp_min_c": 22, "temp_max_c": 28, "temp_optimal_c": 25,
            "humidity_min_pct": 85, "humidity_max_pct": 99, "humidity_optimal_pct": 92,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 24, "temp_max_c": 28, "temp_optimal_c": 26, "humidity_min_pct": 85, "humidity_max_pct": 95, "humidity_optimal_pct": 90, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 22, "temp_max_c": 26, "temp_optimal_c": 24, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 6, "day_end": 25,
            "temp_min_c": 18, "temp_max_c": 26, "temp_optimal_c": 22,
            "humidity_min_pct": 65, "humidity_max_pct": 80, "humidity_optimal_pct": 73,
            "light_lux_min": 15000, "light_lux_max": 22000, "light_lux_optimal": 18500,
            "day":   { "temp_min_c": 22, "temp_max_c": 26, "temp_optimal_c": 24, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 15000, "light_lux_max": 25000, "light_lux_optimal": 20000 },
            "night": { "temp_min_c": 18, "temp_max_c": 20, "temp_optimal_c": 19, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 26, "day_end": 50,
            "temp_min_c": 16, "temp_max_c": 27, "temp_optimal_c": 22,
            "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68,
            "light_lux_min": 30000, "light_lux_max": 43500, "light_lux_optimal": 36750,
            "notes": "Requires full sun.",
            "day":   { "temp_min_c": 21, "temp_max_c": 27, "temp_optimal_c": 24, "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68, "light_lux_min": 30000, "light_lux_max": 50000, "light_lux_optimal": 40000 },
            "night": { "temp_min_c": 16, "temp_max_c": 18, "temp_optimal_c": 17, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'melon',
    ARRAY['Melon', 'Melon', 'Alina', 'Gracia', 'Alisha', 'New Madesta'],
    'Cucumis melo',
    'Cucurbitaceae',
    'High value F1 seeds.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 3,
            "temp_min_c": 26, "temp_max_c": 32, "temp_optimal_c": 29,
            "humidity_min_pct": 85, "humidity_max_pct": 99, "humidity_optimal_pct": 92,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 28, "temp_max_c": 32, "temp_optimal_c": 30, "humidity_min_pct": 85, "humidity_max_pct": 95, "humidity_optimal_pct": 90, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 26, "temp_max_c": 30, "temp_optimal_c": 28, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 4, "day_end": 14,
            "temp_min_c": 20, "temp_max_c": 30, "temp_optimal_c": 25,
            "humidity_min_pct": 65, "humidity_max_pct": 85, "humidity_optimal_pct": 75,
            "light_lux_min": 15000, "light_lux_max": 22000, "light_lux_optimal": 18500,
            "day":   { "temp_min_c": 26, "temp_max_c": 30, "temp_optimal_c": 28, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 15000, "light_lux_max": 25000, "light_lux_optimal": 20000 },
            "night": { "temp_min_c": 20, "temp_max_c": 24, "temp_optimal_c": 22, "humidity_min_pct": 75, "humidity_max_pct": 85, "humidity_optimal_pct": 80, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 15, "day_end": 35,
            "temp_min_c": 18, "temp_max_c": 29, "temp_optimal_c": 24,
            "humidity_min_pct": 60, "humidity_max_pct": 80, "humidity_optimal_pct": 70,
            "light_lux_min": 30000, "light_lux_max": 43500, "light_lux_optimal": 36750,
            "notes": "Requires strong sunlight.",
            "day":   { "temp_min_c": 24, "temp_max_c": 29, "temp_optimal_c": 27, "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68, "light_lux_min": 30000, "light_lux_max": 50000, "light_lux_optimal": 40000 },
            "night": { "temp_min_c": 18, "temp_max_c": 21, "temp_optimal_c": 20, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'watermelon',
    ARRAY['Watermelon', 'Semangka', 'Amara', 'Baginda F1', 'Palguna', 'Dewangga'],
    'Citrullus lanatus',
    'Cucurbitaceae',
    'Move out quickly.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 4,
            "temp_min_c": 26, "temp_max_c": 32, "temp_optimal_c": 29,
            "humidity_min_pct": 85, "humidity_max_pct": 99, "humidity_optimal_pct": 92,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 28, "temp_max_c": 32, "temp_optimal_c": 30, "humidity_min_pct": 85, "humidity_max_pct": 95, "humidity_optimal_pct": 90, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 26, "temp_max_c": 30, "temp_optimal_c": 28, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 5, "day_end": 15,
            "temp_min_c": 20, "temp_max_c": 30, "temp_optimal_c": 25,
            "humidity_min_pct": 65, "humidity_max_pct": 85, "humidity_optimal_pct": 75,
            "light_lux_min": 15000, "light_lux_max": 22000, "light_lux_optimal": 18500,
            "day":   { "temp_min_c": 26, "temp_max_c": 30, "temp_optimal_c": 28, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 15000, "light_lux_max": 25000, "light_lux_optimal": 20000 },
            "night": { "temp_min_c": 20, "temp_max_c": 24, "temp_optimal_c": 22, "humidity_min_pct": 75, "humidity_max_pct": 85, "humidity_optimal_pct": 80, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 16, "day_end": 40,
            "temp_min_c": 18, "temp_max_c": 29, "temp_optimal_c": 24,
            "humidity_min_pct": 60, "humidity_max_pct": 80, "humidity_optimal_pct": 70,
            "light_lux_min": 30000, "light_lux_max": 43500, "light_lux_optimal": 36750,
            "day":   { "temp_min_c": 24, "temp_max_c": 29, "temp_optimal_c": 27, "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68, "light_lux_min": 30000, "light_lux_max": 50000, "light_lux_optimal": 40000 },
            "night": { "temp_min_c": 18, "temp_max_c": 21, "temp_optimal_c": 20, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'cucumber',
    ARRAY['Cucumber', 'Mentimun', 'Timun', 'Bandana', 'Batara', 'Erina'],
    'Cucumis sativus',
    'Cucurbitaceae',
    'Very fast growth.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 2,
            "temp_min_c": 24, "temp_max_c": 30, "temp_optimal_c": 27,
            "humidity_min_pct": 85, "humidity_max_pct": 99, "humidity_optimal_pct": 92,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 26, "temp_max_c": 30, "temp_optimal_c": 28, "humidity_min_pct": 85, "humidity_max_pct": 95, "humidity_optimal_pct": 90, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 24, "temp_max_c": 28, "temp_optimal_c": 26, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 3, "day_end": 12,
            "temp_min_c": 20, "temp_max_c": 28, "temp_optimal_c": 24,
            "humidity_min_pct": 70, "humidity_max_pct": 85, "humidity_optimal_pct": 78,
            "light_lux_min": 15000, "light_lux_max": 22000, "light_lux_optimal": 18500,
            "day":   { "temp_min_c": 24, "temp_max_c": 28, "temp_optimal_c": 26, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 15000, "light_lux_max": 25000, "light_lux_optimal": 20000 },
            "night": { "temp_min_c": 20, "temp_max_c": 22, "temp_optimal_c": 21, "humidity_min_pct": 75, "humidity_max_pct": 85, "humidity_optimal_pct": 80, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 13, "day_end": 30,
            "temp_min_c": 17, "temp_max_c": 26, "temp_optimal_c": 22,
            "humidity_min_pct": 65, "humidity_max_pct": 85, "humidity_optimal_pct": 75,
            "light_lux_min": 25000, "light_lux_max": 39000, "light_lux_optimal": 32000,
            "day":   { "temp_min_c": 24, "temp_max_c": 26, "temp_optimal_c": 25, "humidity_min_pct": 65, "humidity_max_pct": 80, "humidity_optimal_pct": 73, "light_lux_min": 25000, "light_lux_max": 45000, "light_lux_optimal": 35000 },
            "night": { "temp_min_c": 17, "temp_max_c": 21, "temp_optimal_c": 19, "humidity_min_pct": 70, "humidity_max_pct": 85, "humidity_optimal_pct": 78, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'eggplant',
    ARRAY['Eggplant', 'Terong', 'Lezata', 'Hitavi', 'Yuvita'],
    'Solanum melongena',
    'Solanaceae',
    'Heat lover.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 7,
            "temp_min_c": 24, "temp_max_c": 30, "temp_optimal_c": 27,
            "humidity_min_pct": 85, "humidity_max_pct": 99, "humidity_optimal_pct": 92,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 26, "temp_max_c": 30, "temp_optimal_c": 28, "humidity_min_pct": 85, "humidity_max_pct": 95, "humidity_optimal_pct": 90, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 24, "temp_max_c": 28, "temp_optimal_c": 26, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 8, "day_end": 35,
            "temp_min_c": 20, "temp_max_c": 28, "temp_optimal_c": 24,
            "humidity_min_pct": 65, "humidity_max_pct": 80, "humidity_optimal_pct": 73,
            "light_lux_min": 15000, "light_lux_max": 22000, "light_lux_optimal": 18500,
            "day":   { "temp_min_c": 24, "temp_max_c": 28, "temp_optimal_c": 26, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 15000, "light_lux_max": 25000, "light_lux_optimal": 20000 },
            "night": { "temp_min_c": 20, "temp_max_c": 24, "temp_optimal_c": 22, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 36, "day_end": 60,
            "temp_min_c": 18, "temp_max_c": 29, "temp_optimal_c": 24,
            "humidity_min_pct": 65, "humidity_max_pct": 80, "humidity_optimal_pct": 73,
            "light_lux_min": 25000, "light_lux_max": 39000, "light_lux_optimal": 32000,
            "day":   { "temp_min_c": 25, "temp_max_c": 29, "temp_optimal_c": 27, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 25000, "light_lux_max": 45000, "light_lux_optimal": 35000 },
            "night": { "temp_min_c": 18, "temp_max_c": 22, "temp_optimal_c": 20, "humidity_min_pct": 65, "humidity_max_pct": 80, "humidity_optimal_pct": 73, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'pumpkin',
    ARRAY['Pumpkin', 'Labu Kuning', 'Labu', 'Labumadu', 'Suprema'],
    'Cucurbita moschata',
    'Cucurbitaceae',
    'Vigorous seedling.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 4,
            "temp_min_c": 24, "temp_max_c": 30, "temp_optimal_c": 27,
            "humidity_min_pct": 85, "humidity_max_pct": 99, "humidity_optimal_pct": 92,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 26, "temp_max_c": 30, "temp_optimal_c": 28, "humidity_min_pct": 85, "humidity_max_pct": 95, "humidity_optimal_pct": 90, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 24, "temp_max_c": 28, "temp_optimal_c": 26, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 5, "day_end": 14,
            "temp_min_c": 16, "temp_max_c": 28, "temp_optimal_c": 22,
            "humidity_min_pct": 60, "humidity_max_pct": 80, "humidity_optimal_pct": 70,
            "light_lux_min": 15000, "light_lux_max": 22000, "light_lux_optimal": 18500,
            "day":   { "temp_min_c": 24, "temp_max_c": 28, "temp_optimal_c": 26, "humidity_min_pct": 60, "humidity_max_pct": 70, "humidity_optimal_pct": 65, "light_lux_min": 15000, "light_lux_max": 25000, "light_lux_optimal": 20000 },
            "night": { "temp_min_c": 16, "temp_max_c": 20, "temp_optimal_c": 18, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 15, "day_end": 40,
            "temp_min_c": 14, "temp_max_c": 29, "temp_optimal_c": 22,
            "humidity_min_pct": 50, "humidity_max_pct": 75, "humidity_optimal_pct": 63,
            "light_lux_min": 30000, "light_lux_max": 43500, "light_lux_optimal": 36750,
            "day":   { "temp_min_c": 21, "temp_max_c": 29, "temp_optimal_c": 25, "humidity_min_pct": 50, "humidity_max_pct": 70, "humidity_optimal_pct": 60, "light_lux_min": 30000, "light_lux_max": 50000, "light_lux_optimal": 40000 },
            "night": { "temp_min_c": 14, "temp_max_c": 18, "temp_optimal_c": 16, "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),

-- =======================================================
-- GROUP 3: NURSERY ONLY (Brassica / Allium / Tree)
-- =======================================================
(
    'cauliflower',
    ARRAY['Cauliflower', 'Kembang Kol', 'Aquina', 'PM 126'],
    'Brassica oleracea botrytis',
    'Brassicaceae',
    'Nursery only.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 4,
            "temp_min_c": 18, "temp_max_c": 25, "temp_optimal_c": 22,
            "humidity_min_pct": 85, "humidity_max_pct": 99, "humidity_optimal_pct": 92,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 20, "temp_max_c": 25, "temp_optimal_c": 23, "humidity_min_pct": 85, "humidity_max_pct": 95, "humidity_optimal_pct": 90, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 18, "temp_max_c": 22, "temp_optimal_c": 20, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 5, "day_end": 21,
            "temp_min_c": 14, "temp_max_c": 22, "temp_optimal_c": 18,
            "humidity_min_pct": 65, "humidity_max_pct": 85, "humidity_optimal_pct": 75,
            "light_lux_min": 12000, "light_lux_max": 17500, "light_lux_optimal": 14750,
            "day":   { "temp_min_c": 18, "temp_max_c": 22, "temp_optimal_c": 20, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 12000, "light_lux_max": 20000, "light_lux_optimal": 16000 },
            "night": { "temp_min_c": 14, "temp_max_c": 18, "temp_optimal_c": 16, "humidity_min_pct": 70, "humidity_max_pct": 85, "humidity_optimal_pct": 78, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 22, "day_end": 50,
            "temp_min_c": 10, "temp_max_c": 24, "temp_optimal_c": 17,
            "humidity_min_pct": 60, "humidity_max_pct": 80, "humidity_optimal_pct": 70,
            "light_lux_min": 25000, "light_lux_max": 35000, "light_lux_optimal": 30000,
            "day":   { "temp_min_c": 15, "temp_max_c": 24, "temp_optimal_c": 20, "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68, "light_lux_min": 25000, "light_lux_max": 40000, "light_lux_optimal": 32500 },
            "night": { "temp_min_c": 10, "temp_max_c": 16, "temp_optimal_c": 13, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'cabbage',
    ARRAY['Cabbage', 'Kubis', 'Kol', 'Talenta'],
    'Brassica oleracea capitata',
    'Brassicaceae',
    'Nursery only.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 3,
            "temp_min_c": 18, "temp_max_c": 25, "temp_optimal_c": 22,
            "humidity_min_pct": 85, "humidity_max_pct": 99, "humidity_optimal_pct": 92,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 20, "temp_max_c": 25, "temp_optimal_c": 23, "humidity_min_pct": 85, "humidity_max_pct": 95, "humidity_optimal_pct": 90, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 18, "temp_max_c": 22, "temp_optimal_c": 20, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 4, "day_end": 21,
            "temp_min_c": 14, "temp_max_c": 22, "temp_optimal_c": 18,
            "humidity_min_pct": 65, "humidity_max_pct": 85, "humidity_optimal_pct": 75,
            "light_lux_min": 12000, "light_lux_max": 17500, "light_lux_optimal": 14750,
            "day":   { "temp_min_c": 18, "temp_max_c": 22, "temp_optimal_c": 20, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 12000, "light_lux_max": 20000, "light_lux_optimal": 16000 },
            "night": { "temp_min_c": 14, "temp_max_c": 18, "temp_optimal_c": 16, "humidity_min_pct": 70, "humidity_max_pct": 85, "humidity_optimal_pct": 78, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 22, "day_end": 60,
            "temp_min_c": 10, "temp_max_c": 24, "temp_optimal_c": 17,
            "humidity_min_pct": 60, "humidity_max_pct": 80, "humidity_optimal_pct": 70,
            "light_lux_min": 25000, "light_lux_max": 35000, "light_lux_optimal": 30000,
            "day":   { "temp_min_c": 15, "temp_max_c": 24, "temp_optimal_c": 20, "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68, "light_lux_min": 25000, "light_lux_max": 40000, "light_lux_optimal": 32500 },
            "night": { "temp_min_c": 10, "temp_max_c": 16, "temp_optimal_c": 13, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'shallot',
    ARRAY['Shallot', 'Bawang Merah', 'Sanren', 'Lokananta'],
    'Allium cepa var. aggregatum',
    'Amaryllidaceae',
    'Long nursery phase.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 10,
            "temp_min_c": 16, "temp_max_c": 24, "temp_optimal_c": 20,
            "humidity_min_pct": 80, "humidity_max_pct": 95, "humidity_optimal_pct": 88,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 18, "temp_max_c": 24, "temp_optimal_c": 21, "humidity_min_pct": 80, "humidity_max_pct": 90, "humidity_optimal_pct": 85, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 16, "temp_max_c": 20, "temp_optimal_c": 18, "humidity_min_pct": 85, "humidity_max_pct": 95, "humidity_optimal_pct": 90, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 11, "day_end": 42,
            "temp_min_c": 14, "temp_max_c": 22, "temp_optimal_c": 18,
            "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68,
            "light_lux_min": 15000, "light_lux_max": 17500, "light_lux_optimal": 16250,
            "day":   { "temp_min_c": 18, "temp_max_c": 22, "temp_optimal_c": 20, "humidity_min_pct": 60, "humidity_max_pct": 70, "humidity_optimal_pct": 65, "light_lux_min": 15000, "light_lux_max": 20000, "light_lux_optimal": 17500 },
            "night": { "temp_min_c": 14, "temp_max_c": 18, "temp_optimal_c": 16, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 43, "day_end": 70,
            "temp_min_c": 10, "temp_max_c": 24, "temp_optimal_c": 17,
            "humidity_min_pct": 50, "humidity_max_pct": 70, "humidity_optimal_pct": 60,
            "light_lux_min": 25000, "light_lux_max": 35000, "light_lux_optimal": 30000,
            "day":   { "temp_min_c": 15, "temp_max_c": 24, "temp_optimal_c": 20, "humidity_min_pct": 50, "humidity_max_pct": 65, "humidity_optimal_pct": 58, "light_lux_min": 25000, "light_lux_max": 40000, "light_lux_optimal": 32500 },
            "night": { "temp_min_c": 10, "temp_max_c": 15, "temp_optimal_c": 13, "humidity_min_pct": 60, "humidity_max_pct": 70, "humidity_optimal_pct": 65, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),
(
    'papaya',
    ARRAY['Papaya', 'Pepaya', 'Lovena'],
    'Carica papaya',
    'Caricaceae',
    'Nursery only.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 14,
            "temp_min_c": 26, "temp_max_c": 32, "temp_optimal_c": 29,
            "humidity_min_pct": 85, "humidity_max_pct": 99, "humidity_optimal_pct": 92,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 28, "temp_max_c": 32, "temp_optimal_c": 30, "humidity_min_pct": 85, "humidity_max_pct": 95, "humidity_optimal_pct": 90, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 26, "temp_max_c": 28, "temp_optimal_c": 27, "humidity_min_pct": 90, "humidity_max_pct": 99, "humidity_optimal_pct": 95, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 15, "day_end": 45,
            "temp_min_c": 20, "temp_max_c": 29, "temp_optimal_c": 25,
            "humidity_min_pct": 65, "humidity_max_pct": 80, "humidity_optimal_pct": 73,
            "light_lux_min": 15000, "light_lux_max": 22000, "light_lux_optimal": 18500,
            "day":   { "temp_min_c": 26, "temp_max_c": 29, "temp_optimal_c": 28, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 15000, "light_lux_max": 25000, "light_lux_optimal": 20000 },
            "night": { "temp_min_c": 20, "temp_max_c": 24, "temp_optimal_c": 22, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 46, "day_end": 100,
            "temp_min_c": 18, "temp_max_c": 29, "temp_optimal_c": 24,
            "humidity_min_pct": 60, "humidity_max_pct": 80, "humidity_optimal_pct": 70,
            "light_lux_min": 30000, "light_lux_max": 43500, "light_lux_optimal": 36750,
            "day":   { "temp_min_c": 24, "temp_max_c": 29, "temp_optimal_c": 27, "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68, "light_lux_min": 30000, "light_lux_max": 50000, "light_lux_optimal": 40000 },
            "night": { "temp_min_c": 18, "temp_max_c": 22, "temp_optimal_c": 20, "humidity_min_pct": 70, "humidity_max_pct": 80, "humidity_optimal_pct": 75, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
),

-- =======================================================
-- GROUP 4: REFUGIA
-- =======================================================
(
    'marigold',
    ARRAY['Marigold', 'Marigold', 'Golden Bloom', 'Maharani'],
    'Tagetes erecta',
    'Asteraceae',
    'Refugia.',
    ARRAY['EWINDO Catalog'],
    '{
        "germination": {
            "day_start": 0, "day_end": 4,
            "temp_min_c": 20, "temp_max_c": 25, "temp_optimal_c": 23,
            "humidity_min_pct": 85, "humidity_max_pct": 95, "humidity_optimal_pct": 90,
            "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0,
            "day":   { "temp_min_c": 22, "temp_max_c": 25, "temp_optimal_c": 24, "humidity_min_pct": 85, "humidity_max_pct": 90, "humidity_optimal_pct": 88, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 },
            "night": { "temp_min_c": 20, "temp_max_c": 22, "temp_optimal_c": 21, "humidity_min_pct": 90, "humidity_max_pct": 95, "humidity_optimal_pct": 93, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "seedling": {
            "day_start": 5, "day_end": 20,
            "temp_min_c": 16, "temp_max_c": 24, "temp_optimal_c": 20,
            "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68,
            "light_lux_min": 15000, "light_lux_max": 22000, "light_lux_optimal": 18500,
            "day":   { "temp_min_c": 20, "temp_max_c": 24, "temp_optimal_c": 22, "humidity_min_pct": 60, "humidity_max_pct": 70, "humidity_optimal_pct": 65, "light_lux_min": 15000, "light_lux_max": 25000, "light_lux_optimal": 20000 },
            "night": { "temp_min_c": 16, "temp_max_c": 18, "temp_optimal_c": 17, "humidity_min_pct": 65, "humidity_max_pct": 75, "humidity_optimal_pct": 70, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        },
        "vegetative": {
            "day_start": 21, "day_end": 60,
            "temp_min_c": 16, "temp_max_c": 24, "temp_optimal_c": 20,
            "humidity_min_pct": 50, "humidity_max_pct": 75, "humidity_optimal_pct": 63,
            "light_lux_min": 20000, "light_lux_max": 35000, "light_lux_optimal": 27500,
            "day":   { "temp_min_c": 20, "temp_max_c": 24, "temp_optimal_c": 22, "humidity_min_pct": 50, "humidity_max_pct": 70, "humidity_optimal_pct": 60, "light_lux_min": 20000, "light_lux_max": 40000, "light_lux_optimal": 30000 },
            "night": { "temp_min_c": 16, "temp_max_c": 18, "temp_optimal_c": 17, "humidity_min_pct": 60, "humidity_max_pct": 75, "humidity_optimal_pct": 68, "light_lux_min": 0, "light_lux_max": 0, "light_lux_optimal": 0 }
        }
    }'::jsonb
)
;
