/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;

  --primary: #4338ca;
  --primary-light: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.2);
  --accent-gold: #f59e0b;
  --accent-teal: #14b8a6;
  --accent-rose: #f43f5e;
  --accent-violet: #8b5cf6;

  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --grade-a: #10b981;
  --grade-b: #6366f1;
  --grade-c: #f59e0b;
  --grade-d: #f97316;
  --grade-e: #ef4444;
  --grade-g: #6b7280;
  --grade-t: #9ca3af;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 15px 0 0;
  background: #0f172a;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  overflow: hidden;
  text-align: center;
}

.header-bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 10% 100%, rgba(139, 92, 246, 0.1) 0%, transparent 60%);
  z-index: 0;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 40px,
    rgba(15,23,42,0.02) 40px, rgba(15,23,42,0.02) 41px
  );
  z-index: 0;
}

.header-content { position: relative; z-index: 1; }

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary-light);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 20px;
  border-radius: 100px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.header-title {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff 30%, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.header-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-weight: 400;
}

.header-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-menu {
  position: relative;
  z-index: 10;
}

.meta-item {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-divider {
  color: var(--text-muted);
  font-size: 12px;
}

/* ===== SECTIONS ===== */
.section { padding: 60px 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 36px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--card-accent, var(--primary));
}

.stat-icon {
  font-size: 28px;
  margin-bottom: 10px;
  display: block;
}

.stat-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== CHART CARDS ===== */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.chart-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.donut-card { display: flex; flex-direction: column; align-items: center; }
.donut-card canvas { max-width: 280px; }

@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ===== TOP STUDENTS ===== */
.top-students-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.student-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: transform 0.2s, border-color 0.2s;
}

.student-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
}

.student-rank {
  font-size: 18px;
  font-weight: 900;
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.rank-3 { background: linear-gradient(135deg, #cd7c3c, #b45309); color: #fff; }
.rank-other { background: #334155; color: #ffffff; font-size: 13px; font-weight: bold; }

.student-info { flex: 1; min-width: 0; }

.student-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-class {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.student-score {
  font-size: 22px;
  font-weight: 900;
  color: var(--accent-gold);
}

.student-score-label {
  font-size: 10px;
  color: var(--text-muted);
}

.student-grades {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-input, .filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 10px 16px;
  outline: none;
  transition: border-color 0.2s;
}

.filter-input { flex: 1; min-width: 200px; }
.filter-select { min-width: 160px; cursor: pointer; }

.filter-input:focus, .filter-select:focus {
  border-color: var(--primary);
}

/* ===== TABLES ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  background: var(--border-hover);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

.data-table tbody tr {
  background: var(--surface);
  transition: background 0.1s;
}

.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Grade badges */
.grade-badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 36px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  margin: 2px;
}
.subj-grade-badge {
  min-width: 65px;
}

.gr-ap { background: rgba(16,185,129,0.15); color: #059669; }
.gr-a  { background: rgba(16,185,129,0.15); color: #10b981; }
.gr-am { background: rgba(16,185,129,0.15); color: #34d399; }
.gr-bp { background: rgba(99,102,241,0.15); color: #4338ca; }
.gr-b  { background: rgba(99,102,241,0.15); color: #6366f1; }
.gr-cp { background: rgba(245,158,11,0.15); color: #b45309; }
.gr-c  { background: rgba(245,158,11,0.15); color: #d97706; }
.gr-d  { background: rgba(249,115,22,0.15); color: #c2410c; }
.gr-e  { background: rgba(239,68,68,0.15); color: #b91c1c; }
.gr-g  { background: rgba(225, 29, 72, 0.15); color: #e11d48; }
.gr-t  { background: rgba(107,114,128,0.15); color: #4b5563; }

/* Category badges */
.cat-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.cat-cemerlang  { background: rgba(16,185,129,0.15); color: #059669; border: 1px solid rgba(16,185,129,0.3); }
.cat-kepujian   { background: rgba(99,102,241,0.15); color: #4f46e5; border: 1px solid rgba(99,102,241,0.3); }
.cat-memuaskan  { background: rgba(245,158,11,0.15); color: #b45309; border: 1px solid rgba(245,158,11,0.3); }
.cat-lemah      { background: rgba(239,68,68,0.15); color: #b91c1c; border: 1px solid rgba(239,68,68,0.3); }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 12px;
}

.table-footer {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
}

/* ===== FOOTER ===== */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== SIDEBAR & MENU TOGGLE ===== */
.menu-toggle-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle-btn svg {
  width: 24px;
  height: 24px;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  overflow-y: auto;
}

.sidebar.show {
  transform: translateX(0);
}

.sidebar .container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px;
  width: 100%;
}

.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.nav-btn:hover { 
  background: rgba(255, 255, 255, 0.1); 
  color: #ffffff; 
}
.nav-btn.active { 
  background: var(--primary); 
  color: #ffffff; 
  box-shadow: var(--shadow-sm); 
}

/* Submenu Styles */
.menu-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-header .caret {
  font-size: 10px;
  transition: transform 0.3s ease;
}

.menu-group.open .caret {
  transform: rotate(180deg);
}

.submenu {
  display: flex;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 16px;
  gap: 4px;
}

.menu-group.open .submenu {
  max-height: 500px;
  margin-top: 4px;
}

.submenu .nav-btn {
  font-size: 13px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.6);
}

.submenu .nav-btn:hover {
  color: #ffffff;
}
#btn-gagal-bmsj.active {
  background: #ef4444 !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4) !important;
}
.view-hidden { display: none !important; }

/* ===== ANALISIS KESELURUHAN (MODERN UI) ===== */
.ak-header-modern {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.ak-title-block h3 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.ak-title-block p {
  font-size: 13px;
  color: var(--text-secondary);
}
.ak-gps-block {
  display: flex;
  gap: 16px;
}
.ak-gps-card {
  background: var(--bg);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ak-gps-card.highlight {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}
.ak-gps-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; margin-bottom: 4px; }
.ak-gps-value { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1; }
.highlight .ak-gps-value { color: #10b981; }
.ak-gps-trend { font-size: 11px; font-weight: 700; margin-top: 4px; padding: 2px 6px; border-radius: 4px; }
.trend-up { background: rgba(16, 185, 129, 0.15); color: #059669; }
.trend-down { background: rgba(244, 63, 94, 0.15); color: #e11d48; }
.trend-small { font-size: 10px; font-weight: 700; display: inline-block; padding: 2px 4px; border-radius: 4px; margin-top: 4px; }

.modern-table-wrapper {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
}
.modern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.modern-table th {
  background: var(--border-hover);
  color: var(--text);
  font-weight: 700;
  padding: 6px 6px;
  text-align: center;
  border-bottom: 2px solid var(--border);
}
.modern-table th.nowrap-col {
  white-space: nowrap;
}
.modern-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.modern-table thead tr:nth-child(2) th {
  font-size: 11px;
  padding: 4px 6px;
  color: var(--text-secondary);
}
.modern-table .col-subject {
  white-space: normal !important;
  word-wrap: break-word;
  text-align: left !important;
  line-height: 1.4;
  min-width: 150px;
  max-width: 250px;
}
.modern-table tbody tr:hover {
  background: var(--surface-2);
}
.modern-table tfoot td {
  background: var(--surface-3);
  font-weight: 700;
  border-top: 2px solid var(--border);
  border-bottom: none;
}
.modern-table .cell-val { font-weight: 800; font-size: 14px; }
.modern-table .cell-pct { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* Table Columns Highlighting */
.modern-table th.col-a, .modern-table td.col-a { background: rgba(16, 185, 129, 0.08); }
.modern-table th.col-b, .modern-table td.col-b { background: rgba(99, 102, 241, 0.08); }
.modern-table th.col-c, .modern-table td.col-c { background: rgba(245, 158, 11, 0.08); }
.modern-table th.col-d, .modern-table td.col-d,
.modern-table th.col-e, .modern-table td.col-e { background: rgba(249, 115, 22, 0.08); }
.modern-table th.col-lulus, .modern-table td.col-lulus { background: rgba(16, 185, 129, 0.15); color: #059669; }
.modern-table th.col-g, .modern-table td.col-g,
.modern-table th.col-t, .modern-table td.col-t { background: rgba(244, 63, 94, 0.08); }
.modern-table th.col-gpmp, .modern-table td.col-gpmp { background: var(--surface-3); font-weight: 700; }

.ak-rumusan-section { margin-top: 32px; }
.rumusan-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 16px; padding-left: 8px; border-left: 4px solid var(--primary); }
.rumusan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.rum-card {
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.rum-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); }
.rum-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.4; }
.rum-bottom { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.rum-val { font-size: 24px; font-weight: 800; color: var(--text); }
.rum-pct { font-size: 13px; font-weight: 600; color: var(--text-muted); padding: 2px 8px; background: var(--bg); border-radius: 20px; }
.rum-card.success .rum-val { color: #10b981; }
.rum-card.success .rum-pct { background: rgba(16,185,129,0.1); color: #10b981; }
.rum-card.danger .rum-val { color: #f43f5e; }
.rum-card.danger .rum-pct { background: rgba(244,63,94,0.1); color: #f43f5e; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stat-card, .chart-card, .student-card {
  animation: fadeUp 0.4s ease both;
}

/* Merged comparison cell container */
.comp-cell-wrapper {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 4px;
  width: 100%;
}
.comp-val-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
}
.comp-val-box.primary .val {
  font-weight: 800;
  font-size: 13px;
  color: inherit;
}
.comp-val-box.primary .pct {
  font-size: 10px;
  opacity: 0.8;
  font-weight: 600;
}
.comp-val-box.secondary {
  opacity: 0.6;
}
.comp-val-box.secondary .val {
  font-weight: 700;
  font-size: 12px;
}
.comp-val-box.secondary .pct {
  font-size: 9px;
  font-weight: 500;
}
.comp-vs-divider {
  font-size: 9px;
  opacity: 0.4;
  font-weight: 600;
}
.comp-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.2;
}
.comp-badge.up {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}
.comp-badge.down {
  background: rgba(244, 63, 94, 0.15);
  color: #e11d48;
}
.comp-badge.neutral {
  background: var(--surface-3);
  color: var(--text-muted);
}

/* Rumusan Layout */
.rumusan-layout-vertical {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 10px 0 40px 0;
}

.rumusan-card {
  width: 100%;
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.rumusan-table-mockup {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.rumusan-table-mockup td {
  padding: 8px 0;
  vertical-align: middle;
}

.rumusan-table-mockup td.lbl-col {
  text-align: left;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.rumusan-table-mockup td.lbl-col-main {
  text-align: left;
  font-weight: 800;
  letter-spacing: 0.5px;
  width: 30%;
  line-height: 1.4;
}

.rumusan-table-mockup td.lbl-col-sub {
  text-align: left;
  font-weight: 800;
  width: 20%;
  padding-left: 24px;
}

.rumusan-table-mockup td.val-col-wrapper {
  text-align: right;
  width: 50%;
}

.rumusan-table-mockup .val-box {
  display: inline-block;
  width: 100%;
  max-width: 320px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 8px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.rumusan-table-mockup .val-box.header-val {
  background: var(--surface-3);
  border-color: var(--primary);
  color: var(--primary);
}

/* Data Tables */
.rumusan-sec-title {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text);
  border-left: 4px solid var(--primary);
  padding-left: 10px;
}

.rumusan-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--text);
}

.rumusan-data-table th {
  background: var(--text-secondary);
  color: #ffffff;
  font-weight: 800;
  padding: 6px 8px;
  text-align: center;
  border: 1px solid var(--border);
  font-size: 12px;
}

.rumusan-data-table td {
  padding: 10px 12px;
  text-align: center;
  border: 1px solid var(--border);
  font-weight: 600;
}

.rumusan-data-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.02);
}

/* Button Spin Animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
#btn-update.loading .update-icon {
  animation: spin 0.8s linear infinite;
  transform-origin: center;
}

/* Custom Row Colors */
tr.row-rank-1 {
  background-color: rgba(245, 158, 11, 0.15) !important;
}
tr.row-rank-1 td {
  background-color: rgba(245, 158, 11, 0.15) !important;
}
tr.row-fail-lms {
  background-color: rgba(244, 63, 94, 0.1) !important;
}
tr.row-fail-lms td {
  background-color: rgba(244, 63, 94, 0.1) !important;
}

/* NAME MODAL */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.active {
  opacity: 1; pointer-events: auto;
}
.modal-content {
  background: var(--surface);
  width: 90%; max-width: 500px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
  max-height: 80vh;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}
.modal-header {
  padding: 16px 20px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 {
  margin: 0; font-size: 16px; color: #ffffff;
}
.modal-count-pill {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  font-size: 14px; color: var(--text);
  line-height: 1.6;
}
.modal-student-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--surface-2);
  display: flex; justify-content: space-between;
}
.modal-student-row:last-child { border-bottom: none; }
.modal-student-name { font-weight: 600; }
.modal-student-class { color: var(--text-secondary); font-size: 12px; }

.clickable-val {
  cursor: pointer;
}
.clickable-val:hover {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 4px;
}

.grade-pill {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 32px;
  padding: 4px 6px;
  border-radius: 6px;
  background-color: var(--surface-2);
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
  margin-left: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.grade-pill.pill-a { background-color: rgba(16, 185, 129, 0.15); color: #059669; border-color: rgba(16, 185, 129, 0.3); }
.grade-pill.pill-b { background-color: rgba(99, 102, 241, 0.15); color: #4f46e5; border-color: rgba(99, 102, 241, 0.3); }
.grade-pill.pill-c { background-color: rgba(245, 158, 11, 0.15); color: #d97706; border-color: rgba(245, 158, 11, 0.3); }
.grade-pill.pill-d { background-color: rgba(249, 115, 22, 0.15); color: #c2410c; border-color: rgba(249, 115, 22, 0.3); }
.grade-pill.pill-g { background-color: rgba(244, 63, 94, 0.15); color: #e11d48; border-color: rgba(244, 63, 94, 0.3); }
.grade-pill.pill-t { background-color: rgba(107, 114, 128, 0.15); color: #4b5563; border-color: rgba(107, 114, 128, 0.3); }

/* Zoom stat card */
.stat-card.zoomable-card {
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, z-index 0s;
  cursor: pointer;
  position: relative;
  z-index: 1;
}
.stat-card.zoomable-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}
.stat-card.zoomable-card.zoomed {
  transform: scale(1.4);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  z-index: 100;
  background: var(--surface-1) !important;
}
.rumusan-grid {
  position: relative;
  z-index: 10;
}
