// Demo data for the CRM mock.

const REVENUE_SERIES = [
  { day: "01.05", rev: 142, plan: 150 },
  { day: "02.05", rev: 168, plan: 150 },
  { day: "03.05", rev: 121, plan: 150 },
  { day: "04.05", rev: 95,  plan: 150 },
  { day: "05.05", rev: 132, plan: 150 },
  { day: "06.05", rev: 178, plan: 150 },
  { day: "07.05", rev: 196, plan: 150 },
  { day: "08.05", rev: 184, plan: 150 },
  { day: "09.05", rev: 162, plan: 150 },
  { day: "10.05", rev: 145, plan: 150 },
  { day: "11.05", rev: 209, plan: 150 },
  { day: "12.05", rev: 188, plan: 150 },
  { day: "13.05", rev: 174, plan: 150 },
  { day: "14.05", rev: 215, plan: 150 },
  { day: "15.05", rev: 232, plan: 150 },
];

const DOCS = [
  { id: 1, name: "План_продаж_май_2026.xlsx",         type: "xlsx", size: "248 КБ", date: "15.05.2026 14:22", author: "Иванов И.А.",   status: "ok",    dept: "Продажи" },
  { id: 2, name: "Отчёт_маркетинг_Q1.pdf",             type: "pdf",  size: "1.8 МБ", date: "15.05.2026 11:04", author: "Петрова М.С.", status: "ok",    dept: "Маркетинг" },
  { id: 3, name: "KPI_отдел_разработки.docx",          type: "docx", size: "92 КБ",  date: "14.05.2026 18:51", author: "Сидоров К.В.", status: "warn",  dept: "Разработка" },
  { id: 4, name: "Бюджет_2026_сводный.xlsx",           type: "xlsx", size: "412 КБ", date: "14.05.2026 09:30", author: "Козлова Е.Д.", status: "ok",    dept: "Финансы" },
  { id: 5, name: "Договор_поставки_Альфа.pdf",         type: "pdf",  size: "684 КБ", date: "13.05.2026 16:12", author: "Иванов И.А.",   status: "ok",    dept: "Продажи" },
  { id: 6, name: "Воронка_продаж_апрель.xlsx",         type: "xlsx", size: "186 КБ", date: "13.05.2026 10:45", author: "Иванов И.А.",   status: "ok",    dept: "Продажи" },
  { id: 7, name: "Сравнение_конкурентов.docx",         type: "docx", size: "315 КБ", date: "12.05.2026 14:08", author: "Петрова М.С.", status: "err",   dept: "Маркетинг" },
  { id: 8, name: "Отчёт_HR_апрель.pdf",                type: "pdf",  size: "1.2 МБ", date: "12.05.2026 11:24", author: "Козлова Е.Д.", status: "ok",    dept: "HR" },
  { id: 9, name: "Roadmap_Q2_продукт.docx",            type: "docx", size: "204 КБ", date: "11.05.2026 17:30", author: "Сидоров К.В.", status: "ok",    dept: "Разработка" },
  { id: 10, name: "Платежи_контрагенты_май.xlsx",      type: "xlsx", size: "522 КБ", date: "11.05.2026 09:15", author: "Козлова Е.Д.", status: "warn",  dept: "Финансы" },
];

const STATUS_LABELS = {
  ok:   { label: "Обработан",  cls: "ok"   },
  warn: { label: "В очереди",  cls: "warn" },
  err:  { label: "Ошибка",     cls: "err"  },
};

const EMPLOYEES = [
  { id: 1, name: "Иванов И. А.",    role: "Старший менеджер по продажам", dept: "Продажи",    plan: 104, revenue: "612 ₽ K", deals: 18, color: "#5e7eb6" },
  { id: 2, name: "Петрова М. С.",   role: "Руководитель маркетинга",      dept: "Маркетинг",  plan: 92,  revenue: "—",       deals: 9,  color: "#a87dbf" },
  { id: 3, name: "Сидоров К. В.",   role: "Tech Lead",                     dept: "Разработка", plan: 88,  revenue: "—",       deals: 0,  color: "#5fa3a7" },
  { id: 4, name: "Козлова Е. Д.",   role: "Финансовый аналитик",          dept: "Финансы",    plan: 96,  revenue: "—",       deals: 0,  color: "#c79154" },
  { id: 5, name: "Мельников А. П.", role: "Менеджер по продажам",          dept: "Продажи",    plan: 81,  revenue: "385 ₽ K", deals: 11, color: "#7090c9" },
  { id: 6, name: "Громова Н. И.",   role: "Контент-маркетолог",            dept: "Маркетинг",  plan: 73,  revenue: "—",       deals: 0,  color: "#b88abf" },
  { id: 7, name: "Зайцев Д. О.",    role: "Backend-инженер",               dept: "Разработка", plan: 90,  revenue: "—",       deals: 0,  color: "#74a8ab" },
  { id: 8, name: "Орлова С. М.",    role: "HR-партнёр",                    dept: "HR",         plan: 100, revenue: "—",       deals: 0,  color: "#b08b6c" },
];

const DEPT_COMPARE = [
  { name: "Продажи",     v: 87, prev: 79 },
  { name: "Маркетинг",   v: 73, prev: 81 },
  { name: "Разработка",  v: 91, prev: 84 },
  { name: "Финансы",     v: 96, prev: 92 },
];

function initials(name) {
  return name.split(/\s+/).filter(Boolean).slice(0, 2).map(p => p[0]).join("").toUpperCase();
}
function formatRu(n) {
  return n.toLocaleString("ru-RU");
}

Object.assign(window, { REVENUE_SERIES, DOCS, STATUS_LABELS, EMPLOYEES, DEPT_COMPARE, initials, formatRu });
