// ============================================================
// Maquinário — dados de demonstração (espelham o produto real)
// Nomes, códigos e valores vêm das telas de referência do módulo.
// ============================================================
const FARMS = [{ id: 1, name: 'Guanabara' }, { id: 2, name: 'Mateira' }, { id: 3, name: 'Paranapanema' }]

const MACHINERY = [
  { id: 29, name: 'Subaru Forester XT 2017 - FG029', type: 'Veículo de Apoio', model: 'Toyota Hilux', mileage: 0, fleet: 'FG029', farm: 'Guanabara', unit: 'Km' },
  { id: 56, name: 'Fiat Toro - FG056', type: 'Transporte de Administração', model: 'Fiat Toro', mileage: 163128, fleet: 'FG056', farm: 'Guanabara', unit: 'Km', observation: null },
  { id: 63, name: 'Honda HRV - FG063', type: 'Transporte de Administração', model: 'Honda HRV', mileage: 0, fleet: 'FG063', farm: 'Guanabara', unit: 'Km' },
  { id: 64, name: 'Volvo XC60 - FG064', type: 'Transporte de Administração', model: 'Volvo XC 60', mileage: 0, fleet: 'FG064', farm: 'Guanabara', unit: 'Km' },
  { id: 84, name: 'Corolla Cross - FG084', type: 'Transporte de Administração', model: 'Toyota Corola Cross', mileage: 1462, fleet: 'FG084', farm: 'Guanabara', unit: 'Km' },
  { id: 6, name: 'Moto HD Bross 150 - FG006', type: 'Motocicleta', model: 'Honda Bross 150', mileage: 92018, fleet: 'FG006', farm: 'Guanabara', unit: 'Km' },
  { id: 7, name: 'Moto HD Bross 150 - FG007', type: 'Motocicleta', model: 'Honda Bross 150', mileage: 32508, fleet: 'FG007', farm: 'Guanabara', unit: 'Km' },
  { id: 17, name: 'Toyota Hilux Simples - FG017', type: 'Veículo de Apoio', model: 'Toyota Hilux', mileage: 340045, fleet: 'FG017', farm: 'Guanabara', unit: 'Km' },
  { id: 62, name: 'Quadriciclo Sportsman 570 Desert - FM062', type: 'Quadriciclo e UTV', model: 'Polaris Sportsman 570', mileage: 919, fleet: 'FM062', farm: 'Mateira', unit: 'Horas' },
  { id: 67, name: 'Quadriciclo Sportsman 570 - FP067', type: 'Quadriciclo e UTV', model: 'Polaris Sportsman 570', mileage: 2972, fleet: 'FP067', farm: 'Paranapanema', unit: 'Horas' },
  { id: 74, name: 'UTV Polaris - FG074', type: 'Quadriciclo e UTV', model: 'Polaris Ranger', mileage: 1551, fleet: 'FG074', farm: 'Guanabara', unit: 'Horas' },
  { id: 76, name: 'Toyota Hilux - FM076', type: 'Veículo de Apoio', model: 'Toyota Hilux', mileage: 140020, fleet: 'FM076', farm: 'Mateira', unit: 'Km' },
  { id: 91, name: 'Trator John Deere 5055E - FG091', type: 'Trator', model: 'John Deere 5055E', mileage: 1284, fleet: 'FG091', farm: 'Guanabara', unit: 'Horas' },
  { id: 92, name: 'Trator John Deere 5055E - FM092', type: 'Trator', model: 'John Deere 5055E', mileage: 3106, fleet: 'FM092', farm: 'Mateira', unit: 'Horas' },
  // Maquinários de manutenção periódica (base em dias) — sem odômetro/horímetro e sem frota
  { id: 101, name: 'Gerador Stemac 180kVA - FG101', type: 'Gerador', model: 'Stemac ST180', mileage: null, fleet: null, farm: 'Guanabara', unit: null, periodic: true },
  { id: 102, name: 'Motobomba Diesel 4" - FM102', type: 'Motor estacionário', model: 'Buffalo BFDE 4', mileage: null, fleet: null, farm: 'Mateira', unit: null, periodic: true },
]

// Tipos de manutenção — Preventiva/Periódica renovam, Garantia é única
const MAINTENANCE_TYPES = ['Preventiva', 'Periódica', 'Garantia', 'Corretiva']
const SCHEDULED_TYPES = ['Preventiva', 'Periódica', 'Garantia']

// Próximas manutenções programadas (dashboard)
const NEXT_MAINTENANCES = [
  { id: 1, type: 'Preventiva', status: 'Atrasada', machinery: 'Quadriciclo Sportsman 570 Desert - FM062', model: 'Polaris Sportsman 570', farm: 'Mateira', maintenance: 'QUAD POLARIS - Padrão 100Hrs Garantia' },
  { id: 2, type: 'Preventiva', status: 'Atrasada', machinery: 'Quadriciclo Sportsman 570 - FP067', model: 'Polaris Sportsman 570', farm: 'Paranapanema', maintenance: 'QUAD POLARIS - Padrão 80Hrs' },
  { id: 3, type: 'Preventiva', status: 'Atrasada', machinery: 'Trator John Deere 5055E - FM092', model: 'John Deere 5055E', farm: 'Mateira', maintenance: '5055E Padrão - 300Hrs' },
  { id: 4, type: 'Preventiva', status: 'Atrasada', machinery: 'Moto HD Bross 150 - FG006', model: 'Honda Bross 150', farm: 'Guanabara', maintenance: 'Bross Padrão - 5.000km' },
  { id: 5, type: 'Preventiva', status: 'A vencer', machinery: 'UTV Polaris - FG074', model: 'Polaris Ranger', farm: 'Guanabara', maintenance: 'UTV RANGER - Padrão - 80Hrs' },
  { id: 6, type: 'Preventiva', status: 'Atenção', machinery: 'Toyota Hilux - FM076', model: 'Toyota Hilux', farm: 'Mateira', maintenance: 'Hilux Padrão - 10.000km' },
  { id: 7, type: 'Preventiva', status: 'Segura', machinery: 'Fiat Toro - FG056', model: 'Fiat Toro', farm: 'Guanabara', maintenance: 'Fiat Padrão - 10.000Km' },
  { id: 8, type: 'Preventiva', status: 'Segura', machinery: 'Corolla Cross - FG084', model: 'Toyota Corola Cross', farm: 'Guanabara', maintenance: 'Corolla Padrão - 10.000km' },
  { id: 9, type: 'Preventiva', status: 'Segura', machinery: 'Trator John Deere 5055E - FG091', model: 'John Deere 5055E', farm: 'Guanabara', maintenance: '5055E Padrão - 500Hrs' },
  // Garantia — única, exibida automaticamente nos maquinários do modelo que chegam perto do limite
  { id: 10, type: 'Garantia', status: 'Atenção', machinery: 'Quadriciclo Sportsman 570 - FP067', model: 'Polaris Sportsman 570', farm: 'Paranapanema', maintenance: 'QUAD POLARIS - Garantia 100Hrs', auto: true },
  { id: 11, type: 'Garantia', status: 'A vencer', machinery: 'Fiat Toro - FG056', model: 'Fiat Toro', farm: 'Guanabara', maintenance: 'Fiat Toro - Garantia 20.000Km', auto: true },
  // Periódica — renova, base em dias
  { id: 12, type: 'Periódica', status: 'A vencer', machinery: 'Gerador Stemac 180kVA - FG101', model: 'Stemac ST180', farm: 'Guanabara', maintenance: 'Gerador - Troca de óleo 60 dias' },
  { id: 13, type: 'Periódica', status: 'Atrasada', machinery: 'Gerador Stemac 180kVA - FG101', model: 'Stemac ST180', farm: 'Guanabara', maintenance: 'Gerador - Troca de filtros 120 dias' },
  { id: 14, type: 'Periódica', status: 'Segura', machinery: 'Motobomba Diesel 4" - FM102', model: 'Buffalo BFDE 4', farm: 'Mateira', maintenance: 'Motobomba - Inspeção 90 dias' },
]

const TOTALIZERS = { overdue: 9, dueSoon: 1, attention: 1, safe: 43 }

// Histórico de manutenções
const HISTORY = [
  { id: 1, date: '2026-08-27', type: 'Preventiva', maintenance: 'QUAD POLARIS - Padrão 100Hrs Garantia', machinery: 'Quadriciclo Sportsman 570 Desert - FM062', model: 'Polaris Sportsman 570', machineryType: 'Quadriciclo e UTV', mileage: 919, executor: 'RONALDO', farm: 'Mateira' },
  { id: 2, date: '2026-07-25', type: 'Preventiva', maintenance: 'QUAD POLARIS - Padrão 80Hrs', machinery: 'Quadriciclo Sportsman 570 - FP067', model: 'Polaris Sportsman 570', machineryType: 'Quadriciclo e UTV', mileage: 2972, executor: 'EVERTON', farm: 'Paranapanema' },
  { id: 3, date: '2026-07-09', type: 'Preventiva', maintenance: 'UTV RANGER - Padrão - 80Hrs', machinery: 'UTV Polaris - FG074', model: 'Polaris Ranger', machineryType: 'Quadriciclo e UTV', mileage: 1551, executor: 'EVERTON', farm: 'Guanabara' },
  { id: 4, date: '2026-06-18', type: 'Preventiva', maintenance: 'Hilux Padrão - 10.000km', machinery: 'Toyota Hilux - FM076', model: 'Toyota Hilux', machineryType: 'Veículo de Apoio', mileage: 140020, executor: 'THIAGO', farm: 'Mateira' },
  { id: 5, date: '2026-06-18', type: 'Preventiva', maintenance: 'QUAD POLARIS - Padrão 100Hrs Garantia', machinery: 'Quadriciclo Sportsman 570 Desert - FM062', model: 'Polaris Sportsman 570', machineryType: 'Quadriciclo e UTV', mileage: 520, executor: 'THIAGO', farm: 'Mateira' },
  { id: 6, date: '2026-05-30', type: 'Corretiva', maintenance: 'Troca de embreagem', machinery: 'Trator John Deere 5055E - FM092', model: 'John Deere 5055E', machineryType: 'Trator', mileage: 2984, executor: 'RONALDO', farm: 'Mateira' },
  { id: 7, date: '2026-05-12', type: 'Preventiva', maintenance: '5055E Padrão - 300Hrs', machinery: 'Trator John Deere 5055E - FG091', model: 'John Deere 5055E', machineryType: 'Trator', mileage: 1188, executor: 'EVERTON', farm: 'Guanabara' },
  { id: 8, date: '2026-04-21', type: 'Preventiva', maintenance: 'Fiat Padrão - 10.000Km', machinery: 'Fiat Toro - FG056', model: 'Fiat Toro', machineryType: 'Transporte de Administração', mileage: 156597, executor: 'ANA PRADO', farm: 'Guanabara' },
  { id: 9, date: '2026-08-27', type: 'Garantia', maintenance: 'QUAD POLARIS - Garantia 100Hrs', machinery: 'Quadriciclo Sportsman 570 Desert - FM062', model: 'Polaris Sportsman 570', machineryType: 'Quadriciclo e UTV', mileage: 919, executor: 'RONALDO', farm: 'Mateira' },
  { id: 10, date: '2026-07-12', type: 'Periódica', maintenance: 'Gerador - Troca de óleo 60 dias', machinery: 'Gerador Stemac 180kVA - FG101', model: 'Stemac ST180', machineryType: 'Gerador', mileage: null, executor: 'THIAGO', farm: 'Guanabara' },
  { id: 11, date: '2026-05-05', type: 'Periódica', maintenance: 'Gerador - Inspeção geral 180 dias', machinery: 'Gerador Stemac 180kVA - FG101', model: 'Stemac ST180', machineryType: 'Gerador', mileage: null, executor: 'EVERTON', farm: 'Guanabara' },
  { id: 12, date: '2026-03-02', type: 'Periódica', maintenance: 'Gerador - Troca de filtros 120 dias', machinery: 'Gerador Stemac 180kVA - FG101', model: 'Stemac ST180', machineryType: 'Gerador', mileage: null, executor: 'THIAGO', farm: 'Guanabara' },
]

// Detalhe de registro de manutenção (cards da ficha)
const HISTORY_DETAIL = {
  8: { registeredAt: '21/04/2026', resolution: 'Atrasada', registeredWith: '500Hrs de atraso', materials: ['Óleo de motor 15w40', 'Filtro de ar'], notDone: 'Pneu, Não possuía o modelo', extraMaterials: 'Filtro de ar-condicionado', comments: null },
  10: { registeredAt: '12/07/2026', resolution: 'Segura', registeredWith: '3 dias de antecedência', materials: ['Óleo lubrificante 15W40'], notDone: null, extraMaterials: null, comments: 'Gerador em operação normal.' },
  11: { registeredAt: '05/05/2026', resolution: 'Segura', registeredWith: 'Em dia', materials: [], notDone: null, extraMaterials: null, comments: null },
  12: { registeredAt: '02/03/2026', resolution: 'Atrasada', registeredWith: '12 dias de atraso', materials: ['Filtro de combustível'], notDone: null, extraMaterials: null, comments: null },
  9: { registeredAt: '27/08/2026', resolution: 'Atenção', registeredWith: '4 horas de atraso', materials: ['Filtro de óleo (quadriciclo)'], notDone: null, extraMaterials: null, comments: null },
}

const MATERIAL_SET = [
  { id: 23, name: 'FILTRO DE COMBUSTIVEL (TRATOR) 3' },
  { id: 34, name: 'FILTRO DE OLEO (TRATOR) 3' },
  { id: 12, name: 'OLEO LUBRIFICANTE 15W40 (TRATORES & GERADORES)' },
]

// Cadastro de manutenções (Configurações → Manutenção)
const MAINTENANCES = [
  { id: 1, name: '5055E Padrão - 300Hrs', type: 'Preventiva', model: 'John Deere 5055E', machineryType: 'Trator', materials: MATERIAL_SET, frequency: 300, reviewLimit: 315, unit: 'Horas', active: true, attention: 15, overcoming: 5 },
  { id: 2, name: '5055E Padrão - 500Hrs', type: 'Preventiva', model: 'John Deere 5055E', machineryType: 'Trator', materials: MATERIAL_SET, frequency: 500, reviewLimit: 515, unit: 'Horas', active: true, attention: 15, overcoming: 5 },
  { id: 3, name: 'QUAD POLARIS - Padrão 100Hrs Garantia', type: 'Preventiva', model: 'Polaris Sportsman 570', machineryType: 'Quadriciclo e UTV', materials: [{ id: 34, name: 'FILTRO DE OLEO (QUADRICICLO)' }, { id: 12, name: 'OLEO LUBRIFICANTE 15W40 (TRATORES & GERADORES)' }], frequency: 100, reviewLimit: 110, unit: 'Horas', active: true, attention: 15, overcoming: 5 },
  { id: 4, name: 'UTV RANGER - Padrão - 80Hrs', type: 'Preventiva', model: 'Polaris Ranger', machineryType: 'Quadriciclo e UTV', materials: [{ id: 34, name: 'FILTRO DE OLEO (UTV)' }], frequency: 80, reviewLimit: 90, unit: 'Horas', active: true, attention: 15, overcoming: 5 },
  { id: 5, name: 'Hilux Padrão - 10.000km', type: 'Preventiva', model: 'Toyota Hilux', machineryType: 'Veículo de Apoio', materials: [{ id: 9, name: 'FILTRO DE OLEO (CAMIONETE)' }, { id: 12, name: 'OLEO LUBRIFICANTE 15W40 (TRATORES & GERADORES)' }], frequency: 10000, reviewLimit: 10500, unit: 'Km', active: true, attention: 15, overcoming: 5 },
  // Periódica — frequência e limite em dias, alertas em dias
  { id: 7, name: 'Gerador - Troca de óleo 60 dias', type: 'Periódica', model: 'Stemac ST180', machineryType: 'Gerador', materials: [{ id: 12, name: 'OLEO LUBRIFICANTE 15W40 (TRATORES & GERADORES)' }], frequency: 60, reviewLimit: 70, unit: 'Dias', active: true, attention: 15, overcoming: 5 },
  { id: 8, name: 'Gerador - Troca de filtros 120 dias', type: 'Periódica', model: 'Stemac ST180', machineryType: 'Gerador', materials: [{ id: 23, name: 'FILTRO DE COMBUSTIVEL (TRATOR) 3' }], frequency: 120, reviewLimit: 135, unit: 'Dias', active: true, attention: 20, overcoming: 7 },
  { id: 9, name: 'Motobomba - Inspeção 90 dias', type: 'Periódica', model: 'Buffalo BFDE 4', machineryType: 'Motor estacionário', materials: [], frequency: 90, reviewLimit: 100, unit: 'Dias', active: true, attention: 15, overcoming: 5 },
  // Garantia — única, sem recorrência; aplicada automaticamente a todos os maquinários do modelo
  { id: 10, name: 'QUAD POLARIS - Garantia 100Hrs', type: 'Garantia', model: 'Polaris Sportsman 570', machineryType: 'Quadriciclo e UTV', materials: [{ id: 34, name: 'FILTRO DE OLEO (QUADRICICLO)' }], frequency: 100, reviewLimit: 110, unit: 'Horas', active: true, attention: 15, overcoming: 5, single: true },
  { id: 11, name: 'Fiat Toro - Garantia 20.000Km', type: 'Garantia', model: 'Fiat Toro', machineryType: 'Transporte de Administração', materials: [{ id: 9, name: 'FILTRO DE OLEO (CAMIONETE)' }], frequency: 20000, reviewLimit: 21000, unit: 'Km', active: true, attention: 15, overcoming: 5, single: true },
  { id: 6, name: 'Troca de embreagem', type: 'Corretiva', model: 'John Deere 5055E', machineryType: 'Trator', materials: [], frequency: null, reviewLimit: null, unit: 'Horas', active: false, attention: null, overcoming: null },
]

// Ficha do maquinário — próximas programações do FG056
const FICHA_SCHEDULE = [
  { id: 1, type: 'Preventiva', status: 'Segura', name: 'Fiat Padrão - 10.000Km', lastDate: '21/02/2026', odometer: '156597km', statusNow: 'Faltam 3469km', frequency: '10000km', reviewLimit: 'Faltam 4469km' },
  { id: 2, type: 'Preventiva', status: 'Atenção', name: 'Fiat Padrão - Filtro de ar 20.000Km', lastDate: '04/09/2025', odometer: '146210km', statusNow: 'Faltam 1918km', frequency: '20000km', reviewLimit: 'Faltam 2918km' },
  { id: 3, type: 'Preventiva', status: 'Atrasada', name: 'Fiat Padrão - Correia 60.000Km', lastDate: '11/03/2024', odometer: '98420km', statusNow: 'Atrasada a 4.708km', frequency: '60000km', reviewLimit: 'Ultrapassada a 1.708km' },
  { id: 4, type: 'Garantia', status: 'A vencer', name: 'Fiat Toro - Garantia 20.000Km', lastDate: '—', odometer: '163128km', statusNow: 'Faltam 872km', frequency: '20000km', reviewLimit: 'Faltam 1872km', auto: true },
]

// Ficha de maquinário periódico (gerador / motor estacionário) — tudo em dias
const FICHA_SCHEDULE_PERIODIC = [
  { id: 1, type: 'Periódica', status: 'A vencer', name: 'Gerador - Troca de óleo 60 dias', lastDate: '12/07/2026', statusNow: 'Faltam 3 dias', frequency: '60 dias', reviewLimit: 'Faltam 13 dias' },
  { id: 2, type: 'Periódica', status: 'Atrasada', name: 'Gerador - Troca de filtros 120 dias', lastDate: '02/03/2026', statusNow: 'Atrasada a 69 dias', frequency: '120 dias', reviewLimit: 'Ultrapassada a 54 dias' },
  { id: 3, type: 'Periódica', status: 'Segura', name: 'Gerador - Inspeção geral 180 dias', lastDate: '05/05/2026', statusNow: 'Faltam 55 dias', frequency: '180 dias', reviewLimit: 'Faltam 65 dias' },
]

const FICHA_ODOMETER = [
  { date: '02/09/2026', title: 'Boletim 3108261 - Transporte de insumos', origin: 'Cadastro', author: 'ANA PRADO', previous: 161940, value: 163128 },
  { date: '18/08/2026', title: 'Manutenção - Troca de óleo (preventiva)', origin: 'Edição', author: 'OHANA LOHMANN', previous: 161312, value: 161940 },
  { date: '30/07/2026', title: 'Boletim 3108190 - Combate à erosão', origin: 'Exclusão', author: 'OHANA LOHMANN', previous: 160312, value: 159880 },
  { date: '12/07/2026', title: 'Importação de planilha de maquinários', origin: 'Cadastro', author: 'CARLOS DIAS', previous: 158874, value: 160312 },
]

const FICHA_BULLETINS = [
  { id: '3108261', date: '02/09/2026 11:32', service: 'Transporte de insumos', executor: 'CARLOS DIAS', duration: '03h 20min', location: 'Sede Guanabara', odometer: 163128, costCenter: 'Serviços Gerais - Guanabara', classification: 'Transporte de Administração', comment: null },
  { id: '1708262', date: '18/08/2026 10:12', service: 'Apoio ao manejo de gado', executor: 'ANA PRADO', duration: '05h 10min', location: 'Retiro Novo', odometer: 161940, costCenter: 'Serviços Gerais - Guanabara', classification: 'Transporte de Administração', comment: 'Retorno com carga parcial.' },
]

// Dashboard — abas Status / Fluxo / Ativos (séries agregadas)
const STATUS_BY_TYPE = [
  { label: 'Quadriciclo e UTV', overdue: 5, dueSoon: 0, attention: 1, safe: 9 },
  { label: 'Trator', overdue: 2, dueSoon: 1, attention: 0, safe: 6 },
  { label: 'Veículo de Apoio', overdue: 1, dueSoon: 0, attention: 0, safe: 12 },
  { label: 'Transporte de Administração', overdue: 1, dueSoon: 0, attention: 0, safe: 11 },
  { label: 'Motocicleta', overdue: 0, dueSoon: 0, attention: 0, safe: 5 },
  { label: 'Gerador', overdue: 1, dueSoon: 1, attention: 0, safe: 2 },
  { label: 'Motor estacionário', overdue: 0, dueSoon: 0, attention: 0, safe: 3 },
]

const MONTHLY_BY_TYPE = [
  { label: 'Out', preventive: 1, corrective: 0, periodic: 2, warranty: 0 },
  { label: 'Nov', preventive: 0, corrective: 0, periodic: 2, warranty: 0 },
  { label: 'Dez', preventive: 2, corrective: 0, periodic: 3, warranty: 1 },
  { label: 'Jan', preventive: 4, corrective: 0, periodic: 2, warranty: 0 },
  { label: 'Fev', preventive: 4, corrective: 0, periodic: 3, warranty: 1 },
  { label: 'Mar', preventive: 1, corrective: 0, periodic: 2, warranty: 0 },
  { label: 'Abr', preventive: 2, corrective: 0, periodic: 3, warranty: 0 },
  { label: 'Mai', preventive: 7, corrective: 0, periodic: 2, warranty: 1 },
  { label: 'Jun', preventive: 21, corrective: 0, periodic: 3, warranty: 0 },
  { label: 'Jul', preventive: 12, corrective: 0, periodic: 2, warranty: 1 },
  { label: 'Ago', preventive: 11, corrective: 8, periodic: 3, warranty: 2 },
  { label: 'Set', preventive: 1, corrective: 0, periodic: 1, warranty: 0 },
]

// Uso mensal por tipo de maquinário (linhas) — últimos 12 meses
const USAGE_MONTHS = ['Out', 'Nov', 'Dez', 'Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set']
const USAGE_BY_TYPE = [
  { label: 'Quadriciclo e UTV', unit: 'h', total: 66287, color: 'oklch(0.78 0.09 175)', values: [0, 0, 0, 0, 0, 0, 0, 0, 0, 1200, 66000, 800] },
  { label: 'Motocicleta', unit: 'Km', total: 137216, color: 'var(--color-neutral-300)', values: [0, 0, 0, 0, 0, 0, 0, 0, 0, 900, 3200, 400] },
  { label: 'Transporte de Administração', unit: 'Km', total: 140189, color: 'var(--color-alert-light)', values: [0, 0, 0, 0, 0, 0, 0, 0, 0, 2000, 138000, 1200] },
  { label: 'Trator', unit: 'h', total: 56693, color: 'var(--color-info-dark)', values: [400, 2400, 20000, 300, 400, 900, 8000, 11000, 600, 700, 1200, 500] },
  { label: 'Veículo de Apoio', unit: 'Km', total: 195649, color: 'oklch(0.82 0.06 250)', values: [0, 0, 0, 0, 0, 0, 0, 0, 0, 2600, 188000, 3000] },
  { label: 'Gerador', unit: 'h', total: 2310, color: 'oklch(0.75 0.13 140)', values: [120, 180, 210, 190, 200, 175, 205, 220, 190, 180, 230, 210] },
]

const FAILURE_COLORS = ['oklch(0.72 0.09 225)', 'oklch(0.80 0.14 135)', 'oklch(0.62 0.09 250)', 'oklch(0.80 0.03 155)', 'oklch(0.82 0.08 175)']

const TOP_FAILURES = [
  { label: 'Troca de óleo fora do prazo', value: 14 },
  { label: 'Filtro de combustível', value: 9 },
  { label: 'Sistema elétrico', value: 6 },
  { label: 'Embreagem', value: 4 },
  { label: 'Pneus', value: 3 },
]

const FLEET_COMPOSITION = [
  { label: 'Veículo de Apoio', value: 13 },
  { label: 'Transporte de Administração', value: 12 },
  { label: 'Quadriciclo e UTV', value: 15 },
  { label: 'Trator', value: 9 },
  { label: 'Motocicleta', value: 5 },
  { label: 'Gerador', value: 4 },
  { label: 'Motor estacionário', value: 3 },
]

const TOP_BY_MAINTENANCE = [
  { label: 'Quadriciclo Sportsman 570 Desert - FM062', preventive: 6, periodic: 0, warranty: 3, corrective: 2, value: 11 },
  { label: 'Trator John Deere 5055E - FM092', preventive: 5, periodic: 0, warranty: 1, corrective: 3, value: 9 },
  { label: 'Toyota Hilux Simples - FG017', preventive: 6, periodic: 0, warranty: 1, corrective: 1, value: 8 },
  { label: 'Gerador Stemac 180kVA - FG101', preventive: 0, periodic: 7, warranty: 0, corrective: 0, value: 7 },
  { label: 'Fiat Toro - FG056', preventive: 4, periodic: 0, warranty: 1, corrective: 1, value: 6 },
  { label: 'UTV Polaris - FG074', preventive: 4, periodic: 0, warranty: 1, corrective: 0, value: 5 },
  { label: 'Moto HD Bross 150 - FG006', preventive: 4, periodic: 0, warranty: 0, corrective: 1, value: 5 },
  { label: 'Trator John Deere 5055E - FG091', preventive: 3, periodic: 0, warranty: 1, corrective: 0, value: 4 },
  { label: 'Motobomba Diesel 4" - FM102', preventive: 0, periodic: 3, warranty: 0, corrective: 0, value: 3 },
  { label: 'Corolla Cross - FG084', preventive: 2, periodic: 0, warranty: 0, corrective: 0, value: 2 },
]

const TOP_BY_USAGE = [
  { label: 'Toyota Hilux Simples - FG017', value: 5400, unit: 'km' },
  { label: 'Toyota Hilux - FM076', value: 2100, unit: 'km' },
  { label: 'Fiat Toro - FG056', value: 1880, unit: 'km' },
  { label: 'Corolla Cross - FG084', value: 1240, unit: 'km' },
  { label: 'Volvo XC60 - FG064', value: 980, unit: 'km' },
  { label: 'Moto HD Bross 150 - FG006', value: 760, unit: 'km' },
  { label: 'Moto HD Bross 150 - FG007', value: 540, unit: 'km' },
  { label: 'Trator John Deere 5055E - FM092', value: 320, unit: 'h' },
  { label: 'UTV Polaris - FG074', value: 210, unit: 'h' },
  { label: 'Gerador Stemac 180kVA - FG101', value: 180, unit: 'h' },
]

const CHART_PALETTE = ['oklch(0.75 0.09 225)', 'oklch(0.82 0.15 135)', 'oklch(0.62 0.09 250)', 'oklch(0.80 0.03 155)', 'oklch(0.82 0.09 170)', 'oklch(0.85 0.13 90)', 'oklch(0.55 0.08 220)', 'oklch(0.85 0.05 250)', 'oklch(0.50 0.04 145)', 'oklch(0.78 0.07 195)']

const MACHINERY_TYPES = ['Quadriciclo e UTV', 'Trator', 'Veículo de Apoio', 'Transporte de Administração', 'Motocicleta', 'Gerador', 'Motor estacionário']
const MODELS = ['John Deere 5055E', 'Polaris Sportsman 570', 'Polaris Ranger', 'Toyota Hilux', 'Fiat Toro', 'Honda Bross 150', 'Toyota Corola Cross', 'Volvo XC 60', 'Honda HRV', 'Stemac ST180', 'Buffalo BFDE 4']
const MATERIALS = [
  { id: 12, code: '12', name: 'OLEO LUBRIFICANTE 15W40 (TRATORES & GERADORES)', maker: 'JOHN DEERE', stock: 41, unit: 'L', active: true },
  { id: 23, code: '23', name: 'FILTRO DE COMBUSTIVEL (TRATOR) 3', maker: 'JOHN DEERE', stock: 23, unit: 'UN', active: true },
  { id: 34, code: '34', name: 'FILTRO DE OLEO (TRATOR) 3', maker: 'DIVERSOS', stock: 34, unit: 'UN', active: true },
  { id: 9, code: '09', name: 'FILTRO DE OLEO (CAMIONETE)', maker: 'DIVERSOS', stock: 12, unit: 'UN', active: true },
  { id: 41, code: '41', name: 'GRAXA DE LITIO', maker: 'HUSQVARNA', stock: 8, unit: 'KG', active: false },
  { id: 53, code: '53', name: 'FILTRO DE AR (GERADORES)', maker: 'DIVERSOS', stock: 17, unit: 'UN', active: true },
]

window.MAQ = { FARMS, MACHINERY, NEXT_MAINTENANCES, TOTALIZERS, HISTORY, HISTORY_DETAIL, MAINTENANCES, MATERIALS, MATERIAL_SET, FICHA_SCHEDULE, FICHA_SCHEDULE_PERIODIC, MAINTENANCE_TYPES, SCHEDULED_TYPES, FICHA_ODOMETER, FICHA_BULLETINS, STATUS_BY_TYPE, MONTHLY_BY_TYPE, USAGE_MONTHS, USAGE_BY_TYPE, FAILURE_COLORS, TOP_FAILURES, FLEET_COMPOSITION, CHART_PALETTE, TOP_BY_MAINTENANCE, TOP_BY_USAGE, MACHINERY_TYPES, MODELS }
