// data.jsx — shared dummy data (架空氏名のみ・実在類似なし)

const SCHOOLS = [
  { id:'all',    short:'全校舎',   name:'全校舎ビュー' },
  { id:'umeda',  short:'梅田',     name:'梅田福島校' },
  { id:'kyobashi', short:'京橋',   name:'京橋校' },
  { id:'shinsai',short:'心斎橋',   name:'心斎橋校' },
  { id:'namba',  short:'難波',     name:'難波校' },
  { id:'kobe',   short:'神戸',     name:'神戸校' },
  { id:'shinjuku',short:'新宿',    name:'新宿校' },
  { id:'kenshu', short:'研修',     name:'研修校' },
];

const COURSES = [
  { id:'basic',    name:'ベーシック',         price:285000, color:'#C9A98C' },
  { id:'advance',  name:'アドバンス',         price:385000, color:'#B69173' },
  { id:'pro',      name:'プロフェッショナル', price:485000, color:'#8C6A4F' },
  { id:'tanki',    name:'短期集中',           price:185000, color:'#E0C9B0' },
];

const STAFF = ['デモ副社長', 'デモ申込担当', 'デモ経理', 'デモ校長', 'デモ講師A', 'デモ講師B'];

// ステータス → カラーバンド (サロンボード作法・女性向けにローズ調整)
const STATUS = {
  visit:    { label:'見学予約',    band:'#9A8EAA', text:'#5A5070', bg:'#EFEAF1' },
  briefing: { label:'説明会予約',  band:'#D6A172', text:'#86592E', bg:'#FAEEDC' },
  brief_done: { label:'説明会済',  band:'#B5728C', text:'#7A4A60', bg:'#F2DDE5' },
  applied:  { label:'申込済',      band:'#D89AAA', text:'#8E4C66', bg:'#F5DDE3' },
  paywait:  { label:'入金待ち',    band:'#C9536A', text:'#9E3851', bg:'#FBE9EE' },
  enrolled: { label:'在籍',        band:'#7A9F7E', text:'#4F7559', bg:'#E8EEE6' },
  graduate: { label:'卒業',        band:'#A89098', text:'#6F5A65', bg:'#EFE4E8' },
  dropout:  { label:'離脱',        band:'#5D3848', text:'#5D3848', bg:'#E8D8DC' },
};

// 流入経路
const CHANNELS = [
  { id:'instagram', name:'Instagram広告', color:'#C9A98C' },
  { id:'web',       name:'Web検索',       color:'#B69173' },
  { id:'referral',  name:'紹介',          color:'#8C6A4F' },
  { id:'lstep',     name:'LINE広告',      color:'#C58A8A' },
  { id:'other',     name:'その他',        color:'#9B8E85' },
];

// 架空の生徒（24名・梅田校在籍中心）
const STUDENTS = [
  { id:'s001', name:'佐藤 ハナ',   kana:'サトウ ハナ',   line:'hana_n',   tel:'080-****-2310', school:'umeda',  course:'basic',   status:'brief_done', channel:'instagram', staff:'デモ申込担当',    last:'3日前',  alert:true,  lesson:7,  joined:'2026-04-15' },
  { id:'s002', name:'鈴木 ユイ',   kana:'スズキ ユイ',   line:'yui.s',    tel:'090-****-1182', school:'umeda',  course:'advance', status:'enrolled',   channel:'referral',  staff:'デモ経理', last:'本日',   alert:false, lesson:12, joined:'2025-11-02' },
  { id:'s003', name:'田中 アヤ',   kana:'タナカ アヤ',   line:'aya_t',    tel:'080-****-3091', school:'kyobashi', course:'basic',   status:'paywait',    channel:'instagram', staff:'デモ申込担当',    last:'5日前',  alert:true,  lesson:0,  joined:'2026-04-22' },
  { id:'s004', name:'高橋 ミオ',   kana:'タカハシ ミオ', line:'mio_takahashi', tel:'090-****-4427', school:'umeda', course:'pro',     status:'enrolled',   channel:'web',       staff:'デモ校長',      last:'本日',   alert:false, lesson:18, joined:'2025-08-14' },
  { id:'s005', name:'伊藤 リン',   kana:'イトウ リン',   line:'rin_ito',  tel:'080-****-5530', school:'shinsai', course:'basic',   status:'briefing',   channel:'lstep',     staff:'デモ副社長',    last:'昨日',   alert:false, lesson:0,  joined:'2026-05-08' },
  { id:'s006', name:'山本 サクラ', kana:'ヤマモト サクラ',line:'sakura.y',tel:'090-****-6612', school:'umeda', course:'advance', status:'enrolled',   channel:'instagram', staff:'デモ校長',      last:'2日前',  alert:false, lesson:9,  joined:'2026-01-19' },
  { id:'s007', name:'中村 アオイ', kana:'ナカムラ アオイ',line:'aoi_n',   tel:'080-****-7723', school:'namba',  course:'tanki',   status:'enrolled',   channel:'web',       staff:'デモ講師A',    last:'本日',   alert:false, lesson:4,  joined:'2026-03-12' },
  { id:'s008', name:'小林 ハル',   kana:'コバヤシ ハル', line:'haru.k',   tel:'090-****-8834', school:'umeda',  course:'basic',   status:'enrolled',   channel:'referral',  staff:'デモ申込担当',    last:'本日',   alert:false, lesson:6,  joined:'2026-02-25' },
  { id:'s009', name:'加藤 ノア',   kana:'カトウ ノア',   line:'noa_k',    tel:'080-****-9945', school:'kobe',   course:'pro',     status:'briefing',   channel:'instagram', staff:'デモ副社長',    last:'昨日',   alert:false, lesson:0,  joined:'2026-05-10' },
  { id:'s010', name:'吉田 ユメ',   kana:'ヨシダ ユメ',   line:'yume_y',   tel:'090-****-1057', school:'umeda',  course:'advance', status:'applied',    channel:'web',       staff:'デモ経理', last:'本日',   alert:false, lesson:0,  joined:'2026-05-01' },
  { id:'s011', name:'渡辺 コハル', kana:'ワタナベ コハル',line:'koharu_w',tel:'080-****-2168', school:'shinjuku',course:'basic',  status:'visit',      channel:'instagram', staff:'デモ副社長',    last:'本日',   alert:false, lesson:0,  joined:'2026-05-12' },
  { id:'s012', name:'松本 リコ',   kana:'マツモト リコ', line:'riko.m',   tel:'090-****-3279', school:'umeda',  course:'basic',   status:'enrolled',   channel:'referral',  staff:'デモ校長',      last:'3日前',  alert:true,  lesson:5,  joined:'2026-03-04' },
  { id:'s013', name:'井上 モモ',   kana:'イノウエ モモ', line:'momo_i',   tel:'080-****-4380', school:'umeda',  course:'tanki',   status:'enrolled',   channel:'lstep',     staff:'デモ講師B',    last:'本日',   alert:false, lesson:3,  joined:'2026-04-04' },
  { id:'s014', name:'木村 スズ',   kana:'キムラ スズ',   line:'suzu.k',   tel:'090-****-5491', school:'kyobashi',course:'advance',status:'enrolled',   channel:'web',       staff:'デモ校長',      last:'本日',   alert:false, lesson:10, joined:'2025-12-08' },
  { id:'s015', name:'林 ナナ',     kana:'ハヤシ ナナ',   line:'nana_h',   tel:'080-****-6502', school:'umeda',  course:'basic',   status:'enrolled',   channel:'instagram', staff:'デモ申込担当',    last:'本日',   alert:false, lesson:8,  joined:'2026-02-15' },
  { id:'s016', name:'清水 ヒカリ', kana:'シミズ ヒカリ', line:'hikari_s', tel:'090-****-7613', school:'shinsai',course:'pro',     status:'enrolled',   channel:'referral',  staff:'デモ校長',      last:'本日',   alert:false, lesson:14, joined:'2025-10-22' },
  { id:'s017', name:'山口 アンナ', kana:'ヤマグチ アンナ',line:'anna_y',  tel:'080-****-8724', school:'umeda',  course:'advance', status:'enrolled',   channel:'web',       staff:'デモ経理', last:'本日',   alert:false, lesson:11, joined:'2025-12-29' },
  { id:'s018', name:'池田 ミライ', kana:'イケダ ミライ', line:'mirai.i',  tel:'090-****-9835', school:'namba',  course:'basic',   status:'brief_done', channel:'instagram', staff:'デモ申込担当',    last:'4日前',  alert:true,  lesson:0,  joined:'2026-05-05' },
  { id:'s019', name:'橋本 マリエ', kana:'ハシモト マリエ',line:'marie_h', tel:'080-****-0946', school:'umeda',  course:'basic',   status:'enrolled',   channel:'lstep',     staff:'デモ校長',      last:'本日',   alert:false, lesson:6,  joined:'2026-02-28' },
  { id:'s020', name:'石川 ナギ',   kana:'イシカワ ナギ', line:'nagi.i',   tel:'090-****-2057', school:'kobe',   course:'advance', status:'enrolled',   channel:'web',       staff:'デモ講師A',    last:'本日',   alert:false, lesson:7,  joined:'2026-01-30' },
  { id:'s021', name:'前田 ソラ',   kana:'マエダ ソラ',   line:'sora_m',   tel:'080-****-3168', school:'umeda',  course:'basic',   status:'enrolled',   channel:'instagram', staff:'デモ校長',      last:'本日',   alert:false, lesson:4,  joined:'2026-04-09' },
  { id:'s022', name:'藤田 カエデ', kana:'フジタ カエデ', line:'kaede.f',  tel:'090-****-4279', school:'shinjuku',course:'pro',     status:'enrolled',  channel:'referral',  staff:'デモ校長',      last:'本日',   alert:false, lesson:16, joined:'2025-09-17' },
  { id:'s023', name:'後藤 ツバキ', kana:'ゴトウ ツバキ', line:'tsubaki.g',tel:'080-****-5380', school:'umeda',  course:'tanki',   status:'enrolled',   channel:'web',       staff:'デモ講師B',    last:'本日',   alert:false, lesson:2,  joined:'2026-04-30' },
  { id:'s024', name:'岡田 リオ',   kana:'オカダ リオ',   line:'rio.o',    tel:'090-****-6491', school:'kobe',   course:'basic',   status:'enrolled',   channel:'instagram', staff:'デモ申込担当',    last:'本日',   alert:false, lesson:5,  joined:'2026-03-22' },
];

// 今日のアクション
const TODAYS_ACTIONS = [
  { time:'09:30', studentId:'s003', name:'田中 アヤ',   step:'入金確認 5日経過',          staff:'デモ申込担当',     priority:'alert',  note:'振込未着・要TEL' },
  { time:'10:30', studentId:'s001', name:'佐藤 ハナ',   step:'説明会後フォロー',           staff:'デモ申込担当',     priority:'alert',  note:'既読3日経過' },
  { time:'11:00', studentId:'s018', name:'池田 ミライ', step:'説明会後フォロー',           staff:'デモ申込担当',     priority:'alert',  note:'4日連絡なし' },
  { time:'13:00', studentId:'s005', name:'伊藤 リン',   step:'説明会日程確定',             staff:'デモ副社長',     priority:'normal', note:'5/16(土) 14:00候補' },
  { time:'14:30', studentId:'s009', name:'加藤 ノア',   step:'説明会（神戸校・現地）',     staff:'デモ副社長',     priority:'normal', note:'プロコース希望' },
  { time:'15:00', studentId:'s010', name:'吉田 ユメ',   step:'申込書受領 → 入金案内送付', staff:'デモ申込担当',     priority:'normal', note:'アドバンス ¥385,000' },
  { time:'16:00', studentId:'s011', name:'渡辺 コハル', step:'見学会受付（新宿校）',       staff:'デモ副社長',     priority:'normal', note:'初回来校' },
  { time:'17:30', studentId:'s012', name:'松本 リコ',   step:'レッスン3日未記録',          staff:'デモ校長',       priority:'warn',   note:'講師確認要' },
];

// 直近の入金消込
const RECENT_PAYMENTS = [
  { name:'吉田 ユメ',   amount:385000, course:'アドバンス',           method:'振込', date:'05/13' },
  { name:'山口 アンナ', amount:285000, course:'ベーシック',           method:'振込', date:'05/12' },
  { name:'清水 ヒカリ', amount:485000, course:'プロフェッショナル',   method:'クレカ', date:'05/12' },
];

// 30日 × 7校舎ヒートマップ（数値=その日のアクション件数）
const HEATMAP = (() => {
  const schools = ['umeda','kyobashi','shinsai','namba','kobe','shinjuku'];
  const out = {};
  const seed = [3,5,2,4,6,3,1,2,4,7,5,3,2,4,6,3,5,8,4,2,3,5,6,4,3,2,5,7,4,6,
                2,3,1,2,4,3,0,1,2,5,3,2,1,3,4,2,3,5,2,1,2,3,4,3,2,1,3,5,2,4,
                2,4,1,3,5,2,1,2,3,6,4,2,1,3,5,2,4,7,3,1,2,4,5,3,2,1,4,6,3,5,
                3,5,2,4,6,3,1,2,4,7,5,3,2,4,6,3,5,8,4,2,3,5,6,4,3,2,5,7,4,6,
                1,3,1,2,4,3,0,1,2,5,3,2,1,3,4,2,3,5,2,1,2,3,4,3,2,1,3,5,2,4,
                4,5,2,4,6,3,1,2,4,7,5,3,2,4,6,3,5,8,4,2,3,5,6,4,3,2,5,7,4,6];
  schools.forEach((sc, i) => out[sc] = seed.slice(i*30, (i+1)*30));
  return out;
})();

// KPI 月次データ — 過去6ヶ月、6校舎別売上 (万円)
const MONTHLY_SALES = [
  { month:'2025/12', umeda:1620, kyobashi:980, shinsai:1150, namba:760, kobe:540, shinjuku:430 },
  { month:'2026/01', umeda:1740, kyobashi:1050, shinsai:1230, namba:820, kobe:610, shinjuku:520 },
  { month:'2026/02', umeda:1580, kyobashi:920, shinsai:1080, namba:740, kobe:580, shinjuku:490 },
  { month:'2026/03', umeda:1820, kyobashi:1140, shinsai:1310, namba:880, kobe:660, shinjuku:580 },
  { month:'2026/04', umeda:1960, kyobashi:1210, shinsai:1390, namba:940, kobe:720, shinjuku:640 },
  { month:'2026/05', umeda:2080, kyobashi:1280, shinsai:1450, namba:990, kobe:770, shinjuku:710 },
];

// 流入チャネル別ファネル（人数）
const CHANNEL_FUNNEL = [
  { id:'instagram', name:'Instagram広告',  flow:182, visit:124, brief:78, applied:41, enrolled:34 },
  { id:'web',       name:'Web検索',         flow:96,  visit:71,  brief:48, applied:28, enrolled:22 },
  { id:'referral',  name:'紹介',           flow:42,  visit:38,  brief:31, applied:22, enrolled:20 },
  { id:'lstep',     name:'LINE広告',       flow:74,  visit:46,  brief:24, applied:11, enrolled:9 },
  { id:'other',     name:'その他',         flow:33,  visit:18,  brief:9,  applied:4,  enrolled:3 },
];

// コース別構成 — rose palette
const COURSE_MIX = [
  { id:'basic',   name:'ベーシック',         students:148, share:0.45, color:'#D89AAA' },
  { id:'advance', name:'アドバンス',         students:92,  share:0.28, color:'#B5728C' },
  { id:'pro',     name:'プロフェッショナル', students:54,  share:0.16, color:'#8E4C66' },
  { id:'tanki',   name:'短期集中',           students:36,  share:0.11, color:'#F0C9D3' },
];

// 生徒 s001（佐藤ハナ）のタイムライン
const TIMELINE_HANA = [
  { date:'04/15', kind:'lstep',    title:'LINE登録',           detail:'流入：Instagram広告 → L-Step「見学会LP」経由',     staff:'システム',  done:true },
  { date:'04/16', kind:'visit',    title:'見学会予約受付',     detail:'希望校舎：梅田福島校／希望日：04/22(水) 14:00',    staff:'デモ副社長',    done:true },
  { date:'04/22', kind:'visit',    title:'見学会参加',         detail:'フィードバック ☆4「丁寧でした、ピンクの説明書が好印象」', staff:'デモ副社長',    done:true },
  { date:'04/25', kind:'briefing', title:'説明会予約_確定',    detail:'05/02(金) 13:00 梅田福島校／コース希望：ベーシック', staff:'デモ副社長',    done:true },
  { date:'05/02', kind:'briefing', title:'説明会参加',         detail:'担当：デモ申込担当／質疑：分割払い可否・卒業後シェアサロン制度', staff:'デモ申込担当',    done:true },
  { date:'05/05', kind:'applied',  title:'申込書受領',         detail:'コース：ベーシック ¥285,000／支払い：振込一括',     staff:'デモ申込担当',    done:true },
  { date:'05/11', kind:'alert',    title:'入金確認 — アラート', detail:'既読3日経過・振込未着。本日09:30 TEL予定。',         staff:'デモ申込担当',    done:false, alert:true },
];

// AI 示唆（顧客カード下部）
const AI_HINT = {
  title:'次のアクション推奨',
  body:'入金期限まで残り 2 日。3日以上未連絡のため、本日中にデモ副社長から直接TEL推奨。過去類似ケースでは TEL 後 24h 以内入金率 68%。',
};

Object.assign(window, {
  SCHOOLS, COURSES, STAFF, STATUS, CHANNELS,
  STUDENTS, TODAYS_ACTIONS, RECENT_PAYMENTS, HEATMAP,
  MONTHLY_SALES, CHANNEL_FUNNEL, COURSE_MIX,
  TIMELINE_HANA, AI_HINT,
});
