/**
 * Mock Data Nilai Asesmen & Rapor Bulanan Kurikulum Merdeka
 * SMA BPI 1 Bandung
 * CATATAN: Seluruh data adalah data simulasi (DEMO) untuk keperluan pengujian antarmuka.
 */

export type MasteryStatus = "Sangat Baik" | "Tercapai" | "Perlu Bimbingan";
export type ReportStatus = "Draft" | "Dalam Pemeriksaan" | "Selesai";

export interface StudentGradeRecord {
  id: string;
  studentId: string;
  studentName: string;
  nis: string;
  className: string;
  gradeLevel: "X" | "XI" | "XII";
  subjectCode: string;
  subjectName: string;
  teacherId: string;
  teacherName: string;
  academicYear: string;
  semester: "Ganjil" | "Genap";
  tp1Score: number; // Tujuan Pembelajaran 1 (Formatif 1)
  tp2Score: number; // Tujuan Pembelajaran 2 (Formatif 2)
  tp3Score: number; // Tujuan Pembelajaran 3 (Formatif 3)
  formatifAvg: number;
  sumatifMateri: number; // Sumatif Lingkup Materi (STS)
  sumatifAkhir: number; // Sumatif Akhir Semester (SAS)
  finalScore: number; // Nilai Rapor Akhir
  kktp: number; // Standar KKTP (Default 75)
  masteryStatus: MasteryStatus;
  teacherNotes: string;
  updatedAt: string;
}

export const initialMockGrades: StudentGradeRecord[] = [
  {
    id: "grd-001",
    studentId: "std-001",
    studentName: "Andi Pratama",
    nis: "242510001",
    className: "X-1",
    gradeLevel: "X",
    subjectCode: "MP-MAT-01",
    subjectName: "Matematika",
    teacherId: "tch-001",
    teacherName: "Drs. H. Mulyadi, M.Pd.",
    academicYear: "2026/2027",
    semester: "Ganjil",
    tp1Score: 88,
    tp2Score: 92,
    tp3Score: 86,
    formatifAvg: 88.7,
    sumatifMateri: 89,
    sumatifAkhir: 92,
    finalScore: 90,
    kktp: 75,
    masteryStatus: "Sangat Baik",
    teacherNotes: "Menunjukkan penguasaan istimewa dalam konsep aljabar dan pemecahan masalah matematis.",
    updatedAt: "2026-09-20T14:30:00Z",
  },
  {
    id: "grd-002",
    studentId: "std-002",
    studentName: "Bunga Cahyani",
    nis: "242510002",
    className: "X-1",
    gradeLevel: "X",
    subjectCode: "MP-MAT-01",
    subjectName: "Matematika",
    teacherId: "tch-001",
    teacherName: "Drs. H. Mulyadi, M.Pd.",
    academicYear: "2026/2027",
    semester: "Ganjil",
    tp1Score: 82,
    tp2Score: 85,
    tp3Score: 80,
    formatifAvg: 82.3,
    sumatifMateri: 84,
    sumatifAkhir: 86,
    finalScore: 84,
    kktp: 75,
    masteryStatus: "Tercapai",
    teacherNotes: "Mampu memahami konsep geometri dengan baik, perlu ketelitian dalam operasi perhitungan.",
    updatedAt: "2026-09-20T14:30:00Z",
  },
  {
    id: "grd-003",
    studentId: "std-003",
    studentName: "Cahyo Nugroho",
    nis: "242510003",
    className: "X-1",
    gradeLevel: "X",
    subjectCode: "MP-MAT-01",
    subjectName: "Matematika",
    teacherId: "tch-001",
    teacherName: "Drs. H. Mulyadi, M.Pd.",
    academicYear: "2026/2027",
    semester: "Ganjil",
    tp1Score: 72,
    tp2Score: 74,
    tp3Score: 70,
    formatifAvg: 72.0,
    sumatifMateri: 70,
    sumatifAkhir: 74,
    finalScore: 72,
    kktp: 75,
    masteryStatus: "Perlu Bimbingan",
    teacherNotes: "Perlu pendampingan khusus dan bimbingan remedial pada materi fungsi kuadrat.",
    updatedAt: "2026-09-20T14:30:00Z",
  },
  {
    id: "grd-004",
    studentId: "std-004",
    studentName: "Dewi Lestari",
    nis: "242510004",
    className: "X-1",
    gradeLevel: "X",
    subjectCode: "MP-MAT-01",
    subjectName: "Matematika",
    teacherId: "tch-001",
    teacherName: "Drs. H. Mulyadi, M.Pd.",
    academicYear: "2026/2027",
    semester: "Ganjil",
    tp1Score: 94,
    tp2Score: 96,
    tp3Score: 92,
    formatifAvg: 94.0,
    sumatifMateri: 95,
    sumatifAkhir: 96,
    finalScore: 95,
    kktp: 75,
    masteryStatus: "Sangat Baik",
    teacherNotes: "Sangat antusias, logika berpikir sangat kritis dan aktif membantu rekan sekelas.",
    updatedAt: "2026-09-20T14:30:00Z",
  },
  {
    id: "grd-005",
    studentId: "std-005",
    studentName: "Eko Prasetyo",
    nis: "242510005",
    className: "X-1",
    gradeLevel: "X",
    subjectCode: "MP-MAT-01",
    subjectName: "Matematika",
    teacherId: "tch-001",
    teacherName: "Drs. H. Mulyadi, M.Pd.",
    academicYear: "2026/2027",
    semester: "Ganjil",
    tp1Score: 78,
    tp2Score: 80,
    tp3Score: 82,
    formatifAvg: 80.0,
    sumatifMateri: 79,
    sumatifAkhir: 81,
    finalScore: 80,
    kktp: 75,
    masteryStatus: "Tercapai",
    teacherNotes: "Capaian belajar sesuai dengan target kriteria ketercapaian.",
    updatedAt: "2026-09-20T14:30:00Z",
  },
  // Sample Nilai Biologi
  {
    id: "grd-006",
    studentId: "std-001",
    studentName: "Andi Pratama",
    nis: "242510001",
    className: "X-1",
    gradeLevel: "X",
    subjectCode: "MP-BIO-01",
    subjectName: "Biologi",
    teacherId: "tch-002",
    teacherName: "Dra. Hj. Siti Rohmah, M.Si.",
    academicYear: "2026/2027",
    semester: "Ganjil",
    tp1Score: 86,
    tp2Score: 90,
    tp3Score: 88,
    formatifAvg: 88.0,
    sumatifMateri: 87,
    sumatifAkhir: 90,
    finalScore: 88,
    kktp: 75,
    masteryStatus: "Sangat Baik",
    teacherNotes: "Aktif dalam praktikum pengamatan mikroskop dan analisis ekosistem.",
    updatedAt: "2026-09-20T14:30:00Z",
  },
  {
    id: "grd-007",
    studentId: "std-002",
    studentName: "Bunga Cahyani",
    nis: "242510002",
    className: "X-1",
    gradeLevel: "X",
    subjectCode: "MP-BIO-01",
    subjectName: "Biologi",
    teacherId: "tch-002",
    teacherName: "Dra. Hj. Siti Rohmah, M.Si.",
    academicYear: "2026/2027",
    semester: "Ganjil",
    tp1Score: 92,
    tp2Score: 94,
    tp3Score: 90,
    formatifAvg: 92.0,
    sumatifMateri: 93,
    sumatifAkhir: 95,
    finalScore: 93,
    kktp: 75,
    masteryStatus: "Sangat Baik",
    teacherNotes: "Laporan praktikum biologi sangat komprehensif dan rapi.",
    updatedAt: "2026-09-20T14:30:00Z",
  },
];

// ========================================================
// TIPE & DATA RAPOR BULANAN RESMI SMA BPI 1 BANDUNG
// ========================================================

export interface MonthGradeDetail {
  forScore?: number | null; // Formatif
  sumScore?: number | null; // Sumatif
  ptsScore?: number | null; // Penilaian Tengah Semester (Tentatif)
  finalScore?: number | null; // Nilai Akhir Bulan
  hasPTS?: boolean; // Status apakah PTS diaktifkan pada periode ini
}

export interface AcademicMonthInfo {
  key: string;
  name: string;
  semester: "Ganjil" | "Genap";
  academicYear: string;
  label: string;
  defaultHasPTS?: boolean;
}

export const ALL_12_MONTHS: AcademicMonthInfo[] = [
  { key: "januari", name: "Januari", semester: "Genap", academicYear: "2026/2027", label: "Januari 2027 (Semester Genap)", defaultHasPTS: false },
  { key: "februari", name: "Februari", semester: "Genap", academicYear: "2026/2027", label: "Februari 2027 (Semester Genap)", defaultHasPTS: false },
  { key: "maret", name: "Maret", semester: "Genap", academicYear: "2026/2027", label: "Maret 2027 (Semester Genap • PTS Tentatif)", defaultHasPTS: true },
  { key: "april", name: "April", semester: "Genap", academicYear: "2026/2027", label: "April 2027 (Semester Genap)", defaultHasPTS: false },
  { key: "mei", name: "Mei", semester: "Genap", academicYear: "2026/2027", label: "Mei 2027 (Semester Genap)", defaultHasPTS: false },
  { key: "juni", name: "Juni", semester: "Genap", academicYear: "2026/2027", label: "Juni 2027 (Semester Genap)", defaultHasPTS: false },
  { key: "juli", name: "Juli", semester: "Ganjil", academicYear: "2026/2027", label: "Juli 2026 (Semester Ganjil)", defaultHasPTS: false },
  { key: "agustus", name: "Agustus", semester: "Ganjil", academicYear: "2026/2027", label: "Agustus 2026 (Semester Ganjil)", defaultHasPTS: false },
  { key: "september", name: "September", semester: "Ganjil", academicYear: "2026/2027", label: "September 2026 (Semester Ganjil • PTS Tentatif)", defaultHasPTS: true },
  { key: "oktober", name: "Oktober", semester: "Ganjil", academicYear: "2026/2027", label: "Oktober 2026 (Semester Ganjil)", defaultHasPTS: false },
  { key: "november", name: "November", semester: "Ganjil", academicYear: "2026/2027", label: "November 2026 (Semester Ganjil)", defaultHasPTS: false },
  { key: "desember", name: "Desember", semester: "Ganjil", academicYear: "2026/2027", label: "Desember 2026 (Semester Ganjil)", defaultHasPTS: false },
];

export const DEFAULT_PTS_CONFIG: Record<string, boolean> = {
  januari: false,
  februari: false,
  maret: true,
  april: false,
  mei: false,
  juni: false,
  juli: false,
  agustus: false,
  september: true,
  oktober: false,
  november: false,
  desember: false,
};

export function normalizeMonthKey(monthStr: string): string {
  const lower = (monthStr || "").toLowerCase();
  for (const m of ALL_12_MONTHS) {
    if (lower.includes(m.key)) return m.key;
  }
  return "september";
}

export interface SubjectMonthlyGradeItem {
  subjectCode: string;
  subjectName: string;
  month1: MonthGradeDetail; // Bulan 1 (Agustus)
  month2: MonthGradeDetail; // Bulan 2 (September)
  month3: MonthGradeDetail; // Bulan 3 (Oktober)
  month4: MonthGradeDetail; // Bulan 4 (November)
  monthlyGrades?: Record<string, MonthGradeDetail>; // All 12 months dictionary
  finalAverage?: number | null; // Rata-rata kumulatif / bulan aktif
  predicate?: "A" | "B" | "C" | "D" | "-" | null;
  statusRemark?: string; // >=85: "Pertahankan prestasinya", >=70: "Tingkatkan semangat belajar", <70: "Lebih giat lagi belajar"
  competencyNotes?: string;
}

export function getGradeForMonth(sbj: SubjectMonthlyGradeItem, monthStr: string): MonthGradeDetail {
  const key = normalizeMonthKey(monthStr);
  if (sbj.monthlyGrades && sbj.monthlyGrades[key]) {
    return sbj.monthlyGrades[key];
  }
  if (key === "agustus" && sbj.month1) return sbj.month1;
  if (key === "september" && sbj.month2) return sbj.month2;
  if (key === "oktober" && sbj.month3) return sbj.month3;
  if (key === "november" && sbj.month4) return sbj.month4;
  return { forScore: null, sumScore: null, ptsScore: null, finalScore: null };
}

export interface ExtracurricularItem {
  type: "Wajib" | "Pilihan";
  name: string;
  score: string;
  predicate: string;
  grade?: string;
  description?: string;
}

export interface CompetitionItem {
  name: string;
  level: string;
  achievement: string;
}

export interface MonthlyReportRecord {
  id: string;
  studentId: string;
  studentName: string;
  nis: string;
  nisn: string;
  className: string;
  gradeLevel: "X" | "XI" | "XII";
  homeroomTeacherName: string;
  homeroomTeacherNip?: string;
  reportMonthNumber: 1 | 2 | 3 | 4; // 1: Agustus, 2: September, 3: Oktober, 4: Nopember
  reportMonth: string; // Misal "September 2026"
  academicYear: string;
  semester: "1" | "2" | "Ganjil" | "Genap";
  attendance: {
    hadir: number;
    sakit: number;
    izin: number;
    alpa: number;
    telat: number;
    totalAbsen: number;
    kehadiranPct: number;
  };
  subjects: SubjectMonthlyGradeItem[];
  overallAverage?: number | null;
  highestScore?: number | null;
  highestSubject?: string;
  lowestScore?: number | null;
  lowestSubject?: string;
  rankInClass?: number;
  totalClassStudents?: number;
  learningStyle: "Visual" | "Auditorial" | "Kinestetik" | "Membaca/Menulis" | "Campuran";
  competitions: CompetitionItem[];
  extracurriculars: ExtracurricularItem[];
  kokurikuler?: {
    predicate: "Sangat Baik" | "Baik" | "Cukup" | "Kurang" | string;
    description: string;
  };
  prolifeActivity?: {
    name: string;
    score: string;
    notes?: string;
  };
  collegeMajorPlan: string;
  homeroomNotes: string;
  bkNotes: string;
  recommendedTKASubjects: string;
  characterDevelopment: string;
  status: ReportStatus;
  publishedAt?: string;
  reportDate?: string;
}

export interface StudentReportRemarkRecord {
  id?: number;
  student_id: string;
  student_nis: string;
  student_name: string;
  student_class: string;
  period_type: string;
  period_key: string;
  academic_year: string;
  kokurikuler_predicate?: string;
  kokurikuler_narrative?: string;
  homeroom_notes?: string;
  bk_notes?: string;
  created_at?: string;
  updated_at?: string;
}

export const initialMockMonthlyReports: MonthlyReportRecord[] = [
  {
    id: "rpt-001",
    studentId: "std-001",
    studentName: "Andi Pratama",
    nis: "242510001",
    nisn: "0078912301",
    className: "X-1",
    gradeLevel: "X",
    homeroomTeacherName: "Drs. H. Mulyadi, M.Pd.",
    homeroomTeacherNip: "197205121998021002",
    reportMonthNumber: 2,
    reportMonth: "September 2026",
    academicYear: "2026-2027",
    semester: "1",
    attendance: {
      hadir: 22,
      sakit: 0,
      izin: 0,
      alpa: 0,
      telat: 0,
      totalAbsen: 0,
      kehadiranPct: 100,
    },
    subjects: [
      {
        subjectCode: "MP-MAT-01",
        subjectName: "Matematika",
        month1: { forScore: 88, sumScore: 90, finalScore: 89 },
        month2: { forScore: 90, sumScore: 92, ptsScore: 91, finalScore: 91 },
        month3: { forScore: 89, sumScore: 91, finalScore: 90 },
        month4: { forScore: 90, sumScore: 92, finalScore: 91 },
        finalAverage: 90.3,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
        competencyNotes: "Sangat terampil dalam konsep aljabar, trigonometri, dan kalkulus.",
      },
      {
        subjectCode: "MP-MATL-01",
        subjectName: "Matematika Lanjutan",
        month1: { forScore: 85, sumScore: 87, finalScore: 86 },
        month2: { forScore: 88, sumScore: 89, ptsScore: 87, finalScore: 88 },
        month3: { forScore: 86, sumScore: 88, finalScore: 87 },
        month4: { forScore: 88, sumScore: 90, finalScore: 89 },
        finalAverage: 87.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-BIO-01",
        subjectName: "Biologi",
        month1: { forScore: 86, sumScore: 88, finalScore: 87 },
        month2: { forScore: 88, sumScore: 90, ptsScore: 89, finalScore: 89 },
        month3: { forScore: 87, sumScore: 89, finalScore: 88 },
        month4: { forScore: 89, sumScore: 91, finalScore: 90 },
        finalAverage: 88.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-FIS-01",
        subjectName: "Fisika",
        month1: { forScore: 84, sumScore: 86, finalScore: 85 },
        month2: { forScore: 86, sumScore: 88, ptsScore: 87, finalScore: 87 },
        month3: { forScore: 85, sumScore: 87, finalScore: 86 },
        month4: { forScore: 87, sumScore: 89, finalScore: 88 },
        finalAverage: 86.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-KIM-01",
        subjectName: "Kimia",
        month1: { forScore: 85, sumScore: 87, finalScore: 86 },
        month2: { forScore: 87, sumScore: 89, ptsScore: 88, finalScore: 88 },
        month3: { forScore: 86, sumScore: 88, finalScore: 87 },
        month4: { forScore: 88, sumScore: 90, finalScore: 89 },
        finalAverage: 87.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-IND-01",
        subjectName: "Bahasa Indonesia",
        month1: { forScore: 86, sumScore: 88, finalScore: 87 },
        month2: { forScore: 88, sumScore: 90, ptsScore: 89, finalScore: 89 },
        month3: { forScore: 87, sumScore: 89, finalScore: 88 },
        month4: { forScore: 89, sumScore: 91, finalScore: 90 },
        finalAverage: 88.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-ING-01",
        subjectName: "Bahasa Inggris",
        month1: { forScore: 88, sumScore: 90, finalScore: 89 },
        month2: { forScore: 90, sumScore: 92, ptsScore: 91, finalScore: 91 },
        month3: { forScore: 89, sumScore: 91, finalScore: 90 },
        month4: { forScore: 91, sumScore: 93, finalScore: 92 },
        finalAverage: 90.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-INGL-01",
        subjectName: "Bahasa Inggris Lanjutan",
        month1: { forScore: 85, sumScore: 87, finalScore: 86 },
        month2: { forScore: 87, sumScore: 89, ptsScore: 88, finalScore: 88 },
        month3: { forScore: 86, sumScore: 88, finalScore: 87 },
        month4: { forScore: 88, sumScore: 90, finalScore: 89 },
        finalAverage: 87.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-SOS-01",
        subjectName: "Sosiologi",
        month1: { forScore: 82, sumScore: 84, finalScore: 83 },
        month2: { forScore: 84, sumScore: 86, ptsScore: 85, finalScore: 85 },
        month3: { forScore: 83, sumScore: 85, finalScore: 84 },
        month4: { forScore: 85, sumScore: 87, finalScore: 86 },
        finalAverage: 84.5,
        predicate: "B",
        statusRemark: "Tingkatkan semangat belajar",
      },
      {
        subjectCode: "MP-EKO-01",
        subjectName: "Ekonomi",
        month1: { forScore: 84, sumScore: 86, finalScore: 85 },
        month2: { forScore: 86, sumScore: 88, ptsScore: 87, finalScore: 87 },
        month3: { forScore: 85, sumScore: 87, finalScore: 86 },
        month4: { forScore: 87, sumScore: 89, finalScore: 88 },
        finalAverage: 86.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-GEO-01",
        subjectName: "Geografi",
        month1: { forScore: 82, sumScore: 84, finalScore: 83 },
        month2: { forScore: 84, sumScore: 86, ptsScore: 85, finalScore: 85 },
        month3: { forScore: 83, sumScore: 85, finalScore: 84 },
        month4: { forScore: 85, sumScore: 87, finalScore: 86 },
        finalAverage: 84.5,
        predicate: "B",
        statusRemark: "Tingkatkan semangat belajar",
      },
      {
        subjectCode: "MP-SEJ-01",
        subjectName: "Sejarah Indonesia",
        month1: { forScore: 85, sumScore: 87, finalScore: 86 },
        month2: { forScore: 87, sumScore: 89, ptsScore: 88, finalScore: 88 },
        month3: { forScore: 86, sumScore: 88, finalScore: 87 },
        month4: { forScore: 88, sumScore: 90, finalScore: 89 },
        finalAverage: 87.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-PAI-01",
        subjectName: "Pendidikan Agama Islam",
        month1: { forScore: 90, sumScore: 92, finalScore: 91 },
        month2: { forScore: 92, sumScore: 94, ptsScore: 93, finalScore: 93 },
        month3: { forScore: 91, sumScore: 93, finalScore: 92 },
        month4: { forScore: 93, sumScore: 95, finalScore: 94 },
        finalAverage: 92.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-INF-01",
        subjectName: "Informatika",
        month1: { forScore: 92, sumScore: 94, finalScore: 93 },
        month2: { forScore: 94, sumScore: 96, ptsScore: 95, finalScore: 95 },
        month3: { forScore: 93, sumScore: 95, finalScore: 94 },
        month4: { forScore: 95, sumScore: 97, finalScore: 96 },
        finalAverage: 94.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-SNB-01",
        subjectName: "Seni Budaya",
        month1: { forScore: 82, sumScore: 84, finalScore: 83 },
        month2: { forScore: 84, sumScore: 86, ptsScore: 85, finalScore: 85 },
        month3: { forScore: 83, sumScore: 85, finalScore: 84 },
        month4: { forScore: 85, sumScore: 87, finalScore: 86 },
        finalAverage: 84.5,
        predicate: "B",
        statusRemark: "Tingkatkan semangat belajar",
      },
      {
        subjectCode: "MP-PJK-01",
        subjectName: "PJOK",
        month1: { forScore: 86, sumScore: 88, finalScore: 87 },
        month2: { forScore: 88, sumScore: 90, ptsScore: 89, finalScore: 89 },
        month3: { forScore: 87, sumScore: 89, finalScore: 88 },
        month4: { forScore: 89, sumScore: 91, finalScore: 90 },
        finalAverage: 88.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-BK-01",
        subjectName: "Bimbingan Konseling (BK)",
        month1: { forScore: 88, sumScore: 90, finalScore: 89 },
        month2: { forScore: 90, sumScore: 92, ptsScore: 91, finalScore: 91 },
        month3: { forScore: 89, sumScore: 91, finalScore: 90 },
        month4: { forScore: 91, sumScore: 93, finalScore: 92 },
        finalAverage: 90.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-EC-01",
        subjectName: "EC",
        month1: { forScore: 88, sumScore: 90, finalScore: 89 },
        month2: { forScore: 90, sumScore: 92, ptsScore: 91, finalScore: 91 },
        month3: { forScore: 89, sumScore: 91, finalScore: 90 },
        month4: { forScore: 91, sumScore: 93, finalScore: 92 },
        finalAverage: 90.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-SND-01",
        subjectName: "Bahasa Sunda",
        month1: { forScore: 84, sumScore: 86, finalScore: 85 },
        month2: { forScore: 86, sumScore: 88, ptsScore: 87, finalScore: 87 },
        month3: { forScore: 85, sumScore: 87, finalScore: 86 },
        month4: { forScore: 87, sumScore: 89, finalScore: 88 },
        finalAverage: 86.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-PPKN-01",
        subjectName: "PPKn",
        month1: { forScore: 86, sumScore: 88, finalScore: 87 },
        month2: { forScore: 88, sumScore: 90, ptsScore: 89, finalScore: 89 },
        month3: { forScore: 87, sumScore: 89, finalScore: 88 },
        month4: { forScore: 89, sumScore: 91, finalScore: 90 },
        finalAverage: 88.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
    ],
    overallAverage: 88.6,
    highestScore: 95,
    highestSubject: "Informatika",
    lowestScore: 83,
    lowestSubject: "Sosiologi",
    rankInClass: 2,
    totalClassStudents: 36,
    learningStyle: "Visual",
    competitions: [
      {
        name: "Olimpiade Sains Nasional (OSN) Informatika",
        level: "Kota Bandung",
        achievement: "Juara 1",
      },
      {
        name: "Lomba Cerdas Cermat Wawasan Kebangsaan",
        level: "Provinsi Jawa Barat",
        achievement: "Finalis",
      },
    ],
    extracurriculars: [
      {
        type: "Wajib",
        name: "Pramuka Penegak",
        score: "A",
        predicate: "Sangat Aktif",
      },
      {
        type: "Pilihan",
        name: "KIR (Kelompok Ilmiah Remaja)",
        score: "A",
        predicate: "Sangat Baik",
      },
      {
        type: "Pilihan",
        name: "Basket Club BPI",
        score: "A",
        predicate: "Sangat Baik",
      },
    ],
    prolifeActivity: {
      name: "Leadership Camp & Character Building BPI 2026",
      score: "A",
      notes: "Menunjukkan inisiatif kepemimpinan luar biasa dan kepedulian sosial tinggi.",
    },
    collegeMajorPlan: "Teknik Informatika - Institut Teknologi Bandung (ITB)",
    homeroomNotes: "Ananda Andi menunjukkan performa akademik yang sangat konsisten, disiplin tinggi, berkarakter santun, dan selalu menjadi teladan di kelas.",
    bkNotes: "Potensi logika analitis sangat kuat. Direkomendasikan mengambil mata pelajaran pendukung TKA: Matematika Tingkat Lanjut & Informatika untuk persiapan SNBP/SNBT ITB.",
    recommendedTKASubjects: "Matematika Lanjutan, Informatika, Fisika",
    characterDevelopment: "Profil Pelajar Pancasila: Bernalar Kritis, Mandiri, Gotong Royong, dan Berakhlak Mulia.",
    status: "Selesai",
    publishedAt: "2026-09-22T08:00:00Z",
    reportDate: "Bandung, September 2026",
  },
  {
    id: "rpt-002",
    studentId: "std-002",
    studentName: "Bunga Cahyani",
    nis: "242510002",
    nisn: "0078912302",
    className: "X-1",
    gradeLevel: "X",
    homeroomTeacherName: "Drs. H. Mulyadi, M.Pd.",
    homeroomTeacherNip: "197205121998021002",
    reportMonthNumber: 2,
    reportMonth: "September 2026",
    academicYear: "2026-2027",
    semester: "1",
    attendance: {
      hadir: 21,
      sakit: 1,
      izin: 0,
      alpa: 0,
      telat: 1,
      totalAbsen: 1,
      kehadiranPct: 95.5,
    },
    subjects: [
      {
        subjectCode: "MP-MAT-01",
        subjectName: "Matematika",
        month1: { forScore: 84, sumScore: 86, finalScore: 85 },
        month2: { forScore: 86, sumScore: 88, ptsScore: 87, finalScore: 87 },
        month3: { forScore: 85, sumScore: 87, finalScore: 86 },
        month4: { forScore: 87, sumScore: 89, finalScore: 88 },
        finalAverage: 86.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-BIO-01",
        subjectName: "Biologi",
        month1: { forScore: 92, sumScore: 94, finalScore: 93 },
        month2: { forScore: 94, sumScore: 96, ptsScore: 95, finalScore: 95 },
        month3: { forScore: 93, sumScore: 95, finalScore: 94 },
        month4: { forScore: 95, sumScore: 97, finalScore: 96 },
        finalAverage: 94.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-KIM-01",
        subjectName: "Kimia",
        month1: { forScore: 90, sumScore: 92, finalScore: 91 },
        month2: { forScore: 92, sumScore: 94, ptsScore: 93, finalScore: 93 },
        month3: { forScore: 91, sumScore: 93, finalScore: 92 },
        month4: { forScore: 93, sumScore: 95, finalScore: 94 },
        finalAverage: 92.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-IND-01",
        subjectName: "Bahasa Indonesia",
        month1: { forScore: 88, sumScore: 90, finalScore: 89 },
        month2: { forScore: 90, sumScore: 92, ptsScore: 91, finalScore: 91 },
        month3: { forScore: 89, sumScore: 91, finalScore: 90 },
        month4: { forScore: 91, sumScore: 93, finalScore: 92 },
        finalAverage: 90.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-ING-01",
        subjectName: "Bahasa Inggris",
        month1: { forScore: 90, sumScore: 92, finalScore: 91 },
        month2: { forScore: 92, sumScore: 94, ptsScore: 93, finalScore: 93 },
        month3: { forScore: 91, sumScore: 93, finalScore: 92 },
        month4: { forScore: 93, sumScore: 95, finalScore: 94 },
        finalAverage: 92.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
      {
        subjectCode: "MP-PAI-01",
        subjectName: "Pendidikan Agama Islam",
        month1: { forScore: 88, sumScore: 90, finalScore: 89 },
        month2: { forScore: 90, sumScore: 92, ptsScore: 91, finalScore: 91 },
        month3: { forScore: 89, sumScore: 91, finalScore: 90 },
        month4: { forScore: 91, sumScore: 93, finalScore: 92 },
        finalAverage: 90.5,
        predicate: "A",
        statusRemark: "Pertahankan prestasinya",
      },
    ],
    overallAverage: 91.2,
    highestScore: 96,
    highestSubject: "Biologi",
    lowestScore: 84,
    lowestSubject: "Matematika",
    rankInClass: 1,
    totalClassStudents: 36,
    learningStyle: "Auditorial",
    competitions: [
      {
        name: "Lomba Karya Tulis Ilmiah Remaja (LKTI) Hayati",
        level: "Nasional",
        achievement: "Juara 2",
      },
    ],
    extracurriculars: [
      {
        type: "Wajib",
        name: "Pramuka Penegak",
        score: "A",
        predicate: "Sangat Aktif",
      },
      {
        type: "Pilihan",
        name: "PMR (Palang Merah Remaja)",
        score: "A",
        predicate: "Sangat Baik",
      },
    ],
    prolifeActivity: {
      name: "Aksi Peduli Lingkungan & Kesehatan BPI 2026",
      score: "A",
      notes: "Aktif menjadi koordinator relawan medis kesehatan sekolah.",
    },
    collegeMajorPlan: "Pendidikan Dokter - Universitas Padjadjaran (UNPAD)",
    homeroomNotes: "Bunga adalah siswi yang cerdas, teliti dalam praktikum biologi, dan memiliki jiwa kepedulian tinggi terhadap teman sekelas.",
    bkNotes: "Minat kuat pada bidang sains dan kesehatan (Kedokteran). Nilai Biologi dan Kimia sangat menonjol.",
    recommendedTKASubjects: "Biologi, Kimia, Matematika Lanjutan",
    characterDevelopment: "Profil Pelajar Pancasila: Bernalar Kritis, Kreatif, dan Berakhlak Mulia.",
    status: "Selesai",
    publishedAt: "2026-09-22T08:00:00Z",
    reportDate: "Bandung, September 2026",
  },
];
