/* ===== RESET & BASE (LIGHT THEME) ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f8fafc;
  --bg2: #ffffff;
  --bg3: #f1f5f9;
  --card: #ffffff;
  --card2: #ffffff;
  --border: #e2e8f0;
  --border2: #cbd5e1;
  --text: #0f172a;
  --text2: #475569;
  --text3: #64748b;
  --blue: #2563eb;
  --blue2: #3b82f6;
  --blue-dim: rgba(37,99,235,0.08);
  --purple: #7c3aed;
  --purple2: #8b5cf6;
  --purple-dim: rgba(124,58,237,0.08);
  --green: #16a34a;
  --green2: #22c55e;
  --green-dim: rgba(22,163,74,0.08);
  --red: #dc2626;
  --orange: #ea580c;
  --orange2: #f97316;
  --gold: #d97706;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 4px 20px -2px rgba(0,0,0,0.05), 0 2px 6px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --tab-h: 56px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== MAIN HEADER (DARK THEME) ===== */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: #0f172a; /* Sleek dark navy */
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: 62px;
  box-shadow: 0 4px 20px -2px rgba(0,0,0,0.15);
}
.header-glow {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 600px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue2), var(--purple2), transparent);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 16px; }
.logo-wrap { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(139,92,246,0.2));
  border: 1px solid rgba(59,130,246,0.35);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
}
.logo-title { font-weight: 800; font-size: 16px; color: #ffffff; line-height: 1.1; letter-spacing: -0.01em; }
.logo-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-badge {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px; padding: 6px 14px;
  font-size: 12px; font-weight: 700; color: #93c5fd; white-space: nowrap;
}
.badge-dot { width: 8px; height: 8px; background: #22c55e; border-radius: 50%; animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%,100%{ box-shadow: 0 0 0 0 rgba(34,197,94,0.4); } 50%{ box-shadow: 0 0 0 6px rgba(34,197,94,0); } }

/* Refresh Button (At far right) */
.btn-refresh {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff; border-radius: 50px; padding: 7px 16px;
  font-family: var(--font); font-size: 12px; font-weight: 800;
  cursor: pointer; transition: all .2s;
  box-shadow: 0 2px 10px rgba(37,99,235,0.35);
}
.btn-refresh:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(37,99,235,0.5);
  background: linear-gradient(135deg, #1d4ed8, #6d28d9);
}
.btn-refresh:active { transform: translateY(0); }
.btn-refresh.loading .refresh-icon {
  animation: spin .7s linear infinite;
}

/* ===== TAB NAV ===== */
.tab-nav-wrap {
  position: sticky; top: 62px; z-index: 150;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.tab-nav {
  display: flex; align-items: center; gap: 4px;
  position: relative; height: var(--tab-h);
}
.tab-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 0 24px; height: 100%;
  background: none; border: none;
  color: var(--text2); font-family: var(--font);
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .2s;
  position: relative; white-space: nowrap;
}
.tab-btn:hover { color: var(--blue); }
.tab-btn.active { color: var(--blue); }
.tab-btn.active .tab-icon { color: var(--blue); }
.tab-icon { display: flex; align-items: center; }
.tab-indicator {
  position: absolute; bottom: 0; left: 0;
  height: 3px; background: linear-gradient(90deg, var(--blue), var(--purple));
  border-radius: 3px 3px 0 0;
  transition: left .3s cubic-bezier(.4,0,.2,1), width .3s cubic-bezier(.4,0,.2,1);
}

/* ===== TAB PANELS ===== */
.main-content { padding: 24px 0 50px; }
.tab-panel { display: none; animation: fadeInTab .3s ease; }
.tab-panel.active { display: block; }
@keyframes fadeInTab { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ===== CARD ===== */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow);
}
.section-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.section-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.section-icon.blue { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(37,99,235,0.2); }
.section-icon.purple { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(124,58,237,0.2); }
.section-icon.green { background: var(--green-dim); color: var(--green); border: 1px solid rgba(22,163,74,0.2); }
.section-title { font-size: 18px; font-weight: 800; color: var(--text); }
.section-sub { font-size: 13px; color: var(--text2); margin-top: 2px; }

/* ===== FORM ===== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 18px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-label { font-size: 12px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.lbl-icon { font-size: 14px; }
.required { color: var(--red); }
.form-input {
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font); font-size: 13px; font-weight: 600;
  padding: 11px 14px; transition: all .2s; outline: none; width: 100%;
  appearance: none;
}
.form-input::placeholder { color: #94a3b8; font-weight: 500; }
.form-input:focus { border-color: var(--blue); background: #ffffff; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.select-wrap { position: relative; }
.select-wrap .form-select { padding-right: 36px; cursor: pointer; }
.select-arrow {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text3); font-size: 11px; pointer-events: none;
}
.select-wrap.sm { width: 180px; }
.form-select.sm { font-size: 13px; padding: 8px 34px 8px 12px; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13px; font-weight: 700;
  cursor: pointer; border: none; transition: all .2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,99,235,0.35); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: #f1f5f9; color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { background: #e2e8f0; color: var(--text); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-edit { background: rgba(37,99,235,0.08); color: var(--blue); border: 1px solid rgba(37,99,235,0.2); }
.btn-edit:hover { background: rgba(37,99,235,0.16); }
.btn-danger { background: rgba(220,38,38,0.08); color: var(--red); border: 1px solid rgba(220,38,38,0.2); }
.btn-danger:hover { background: rgba(220,38,38,0.16); }
.btn-danger-full { background: var(--red); color: #fff; }
.btn-danger-full:hover { background: #b91c1c; }

/* ===== DIVIDER ===== */
.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0 18px; color: var(--text3);
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ===== TOOLBAR ===== */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.search-bar-wrap { position: relative; flex: 1; min-width: 220px; }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text3); pointer-events: none; }
.search-input {
  width: 100%; background: #f8fafc; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font); font-size: 13px; font-weight: 600;
  padding: 10px 40px; transition: all .2s; outline: none;
}
.search-input::placeholder { color: #94a3b8; font-weight: 500; }
.search-input:focus { border-color: var(--blue); background: #ffffff; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.search-clear {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  background: #e2e8f0; border: none; color: var(--text2);
  width: 22px; height: 22px; border-radius: 6px;
  cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.search-clear:hover { background: #cbd5e1; color: var(--text); }
.filter-wrap { display: flex; gap: 8px; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #ffffff; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: #f8fafc; color: var(--text2);
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table th.sortable { cursor: pointer; }
.data-table th.sortable:hover { color: var(--blue); }
.sort-icon { opacity: 0.4; font-size: 10px; }
.data-table td {
  padding: 11px 14px; border-bottom: 1px solid #f1f5f9;
  font-size: 13px; color: var(--text); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table td:first-child { color: var(--text3); font-size: 12px; font-weight: 700; width: 36px; }
.prog-text { color: var(--text2); font-size: 12px; font-weight: 600; max-width: 260px; line-height: 1.4; }
.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; flex-wrap: wrap; gap: 8px;
}
.count-text { color: var(--text3); font-size: 12px; font-weight: 600; }
.loading-wrap { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 40px; color: var(--text2); }
.spinner { width: 22px; height: 22px; border: 3px solid #e2e8f0; border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-msg { text-align: center; padding: 32px; color: var(--text3); font-size: 13px; font-weight: 600; }

/* Badges */
.uni-badge {
  display: inline-block; background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.2); color: var(--blue);
  border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 800;
  white-space: nowrap;
}
.year-badge {
  display: inline-block; background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.2); color: var(--purple);
  border-radius: 6px; padding: 2px 10px; font-size: 12px; font-weight: 800;
}

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 4px; }
.page-btn {
  width: 28px; height: 28px;
  background: #ffffff; border: 1px solid var(--border);
  border-radius: 7px; color: var(--text2);
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all .2s; display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { background: #f1f5f9; color: var(--text); border-color: var(--border2); }
.page-btn.active { background: linear-gradient(135deg, var(--blue), var(--purple)); border-color: transparent; color: #fff; }

/* ===== TAB 2: YEAR ===== */
.year-pills-wrap { margin-bottom: 20px; }
.year-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.year-pill {
  padding: 8px 20px;
  background: #ffffff; border: 1px solid var(--border);
  border-radius: 50px; color: var(--text2);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all .2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.year-pill:hover { border-color: var(--blue); color: var(--blue); background: #f8fafc; }
.year-pill.active {
  background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(124,58,237,0.1));
  border-color: var(--blue); color: var(--blue);
  box-shadow: 0 0 12px rgba(37,99,235,0.15);
}
.yearly-stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.yearly-stat-card {
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  transition: all .2s;
}
.yearly-stat-card:hover { border-color: var(--border2); background: #ffffff; }
.yearly-stat-num { font-size: 24px; font-weight: 800; }
.yearly-stat-label { font-size: 11px; color: var(--text3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px; }

.yearly-uni-breakdown {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px;
}
.yearly-uni-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #ffffff; border: 1px solid var(--border);
  border-radius: 50px; padding: 6px 14px;
  font-size: 12px; font-weight: 700; color: var(--text2);
  cursor: pointer; transition: all .2s; font-family: var(--font);
}
.yearly-uni-chip:hover {
  border-color: var(--blue); color: var(--blue); background: #f8fafc;
  transform: translateY(-1px);
}
.yearly-uni-chip.active {
  background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(124,58,237,0.12));
  border-color: var(--blue); color: var(--blue);
  box-shadow: 0 0 10px rgba(37,99,235,0.15);
}
.yearly-uni-chip-count {
  background: rgba(37,99,235,0.1); color: var(--blue);
  border-radius: 50px; padding: 1px 7px; font-size: 11px; font-weight: 800;
}
.yearly-uni-chip.active .yearly-uni-chip-count {
  background: var(--blue); color: #ffffff;
}

.empty-state { text-align: center; padding: 50px 20px; }
.empty-icon { font-size: 44px; margin-bottom: 12px; opacity: 0.6; }
.empty-text { color: var(--text3); font-size: 14px; font-weight: 600; }

/* ===== TAB 3: SUMMARY OVERVIEW ===== */
.summary-overview {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.overview-card {
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 18px 20px;
  transition: all .25s;
}
.overview-card:hover { border-color: var(--blue2); background: #ffffff; transform: translateY(-2px); box-shadow: var(--shadow); }
.overview-card-icon { font-size: 22px; margin-bottom: 8px; }
.overview-card-val { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.overview-card-label { font-size: 11px; color: var(--text3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px; }

.chart-section { margin-bottom: 32px; }
.chart-section:last-child { margin-bottom: 0; }
.chart-header { margin-bottom: 14px; }
.chart-title { font-size: 15px; font-weight: 800; color: var(--text); }

/* Bar Chart */
.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-label { font-size: 12px; font-weight: 800; color: var(--text2); width: 44px; text-align: right; flex-shrink: 0; }
.bar-track {
  flex: 1; height: 32px; background: #f1f5f9;
  border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border);
}
.bar-fill {
  height: 100%; border-radius: 7px;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  display: flex; align-items: center; padding-left: 12px;
  font-size: 12px; font-weight: 800; color: #fff;
  min-width: 28px; width: 0;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}
.bar-val { font-size: 12px; font-weight: 800; color: var(--text2); width: auto; flex-shrink: 0; }

/* Uni Chart */
.uni-chart { display: flex; flex-direction: column; gap: 7px; }
.uni-row { display: flex; align-items: center; gap: 10px; transition: background .15s; padding: 4px 8px; border-radius: 8px; }
.uni-row:hover { background: #f1f5f9; }
.uni-row-num { font-size: 11px; color: var(--text3); font-weight: 800; width: 20px; flex-shrink: 0; text-align: right; }
.uni-name { font-size: 12px; font-weight: 700; color: var(--text2); width: 200px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uni-bar-track { flex: 1; height: 26px; background: #f1f5f9; border-radius: 7px; overflow: hidden; border: 1px solid var(--border); cursor: pointer; }
.uni-bar-fill {
  height: 100%; border-radius: 6px;
  display: flex; align-items: center; padding-left: 10px;
  font-size: 11px; font-weight: 800; color: #fff;
  min-width: 24px; width: 0;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}
.uni-count { font-size: 12px; font-weight: 800; color: var(--text2); width: 30px; text-align: right; flex-shrink: 0; }

.uc-0{background:linear-gradient(90deg,#2563eb,#3b82f6)}.uc-1{background:linear-gradient(90deg,#7c3aed,#8b5cf6)}.uc-2{background:linear-gradient(90deg,#16a34a,#22c55e)}.uc-3{background:linear-gradient(90deg,#ea580c,#f97316)}.uc-4{background:linear-gradient(90deg,#dc2626,#ef4444)}.uc-5{background:linear-gradient(90deg,#0891b2,#06b6d4)}.uc-6{background:linear-gradient(90deg,#d97706,#f59e0b)}.uc-7{background:linear-gradient(90deg,#db2777,#ec4899)}.uc-8{background:linear-gradient(90deg,#0d9488,#14b8a6)}.uc-9{background:linear-gradient(90deg,#4f46e5,#6366f1)}

/* ===== MATRIX TABLE (LIGHT MODERN - NO VERTICAL SCROLL) ===== */
.matrix-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
  background: #ffffff;
  box-shadow: var(--shadow);
}
.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.matrix-table thead tr:first-child th {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 36px;
  background: #e0e7ff;
  color: #3730a3;
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border2);
  border-right: 1px solid var(--border2);
  font-weight: 800;
}
.matrix-table thead tr:nth-child(2) th {
  position: sticky;
  top: 36px;
  z-index: 18;
  height: 34px;
  background: #f1f5f9;
  color: #1e293b;
  padding: 8px 6px;
  text-align: center;
  border-bottom: 2px solid var(--border2);
  border-right: 1px solid var(--border);
  font-weight: 800;
}
.matrix-table th.matrix-th-main {
  background: #e0e7ff;
  color: #3730a3;
  letter-spacing: 0.04em;
}
.matrix-table th.matrix-th-bil,
.matrix-table td.matrix-td-bil {
  width: 44px;
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 12;
  background: #f8fafc;
  font-weight: 700;
  color: var(--text3);
}
.matrix-table th.matrix-th-bil {
  top: 0;
  z-index: 25;
  background: #e0e7ff;
  color: #3730a3;
}
.matrix-table th.matrix-th-name,
.matrix-table td.matrix-td-name {
  min-width: 260px;
  max-width: 320px;
  text-align: left;
  position: sticky;
  left: 44px;
  z-index: 12;
  background: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid var(--border2);
  font-weight: 700;
  color: var(--text);
}
.matrix-table th.matrix-th-name {
  top: 0;
  z-index: 25;
  background: #e0e7ff;
  color: #3730a3;
}
.matrix-table th.matrix-th-jumlah {
  top: 0;
  z-index: 25;
  background: #e0e7ff;
  color: #3730a3;
  width: 65px;
}
.matrix-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
}
.matrix-table tr:hover td {
  background: #f8fafc;
}
.matrix-table tr:hover td.matrix-td-bil {
  background: #f1f5f9;
}
.matrix-table tr:hover td.matrix-td-name {
  background: #f1f5f9;
}

/* Clickable matrix cell button */
.matrix-cell-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  background: rgba(37,99,235,0.1);
  border: 1px solid rgba(37,99,235,0.3);
  color: var(--blue);
  font-weight: 800;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .2s;
}
.matrix-cell-btn:hover {
  background: var(--blue);
  color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(37,99,235,0.4);
  border-color: var(--blue);
}
.matrix-cell-btn.total-btn {
  background: rgba(124,58,237,0.12);
  border-color: rgba(124,58,237,0.35);
  color: var(--purple);
}
.matrix-cell-btn.total-btn:hover {
  background: var(--purple);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(124,58,237,0.4);
  border-color: var(--purple);
}

/* Matrix Table Footer Summary Rows */
.matrix-table tfoot tr.matrix-row-jumlah td {
  background: #ede9fe;
  color: #4338ca;
  font-weight: 800;
  border-top: 2px solid var(--purple);
  position: sticky;
  bottom: 60px;
  z-index: 11;
}
.matrix-table tfoot tr.matrix-row-peratus td {
  background: #fef3c7;
  color: #92400e;
  font-weight: 800;
  position: sticky;
  bottom: 30px;
  z-index: 11;
}
.matrix-table tfoot tr.matrix-row-calon td {
  background: #ffe4e6;
  color: #9f1239;
  font-weight: 800;
  position: sticky;
  bottom: 0;
  z-index: 11;
}
.matrix-table tfoot tr td.matrix-td-bil,
.matrix-table tfoot tr td.matrix-td-name {
  z-index: 13;
}
.matrix-table tfoot tr.matrix-row-jumlah td.matrix-td-bil,
.matrix-table tfoot tr.matrix-row-jumlah td.matrix-td-name {
  background: #ede9fe;
}
.matrix-table tfoot tr.matrix-row-peratus td.matrix-td-bil,
.matrix-table tfoot tr.matrix-row-peratus td.matrix-td-name {
  background: #fef3c7;
}
.matrix-table tfoot tr.matrix-row-calon td.matrix-td-bil,
.matrix-table tfoot tr.matrix-row-calon td.matrix-td-name {
  background: #ffe4e6;
}

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: #ffffff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 18px;
  font-size: 13px; font-weight: 700; color: var(--text);
  box-shadow: var(--shadow-lg);
  transform: translateY(20px); opacity: 0;
  transition: all .3s cubic-bezier(.4,0,.2,1); pointer-events: none; max-width: 340px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--red); }
.toast.info { border-left: 4px solid var(--blue); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: all .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  width: 100%; max-width: 500px; box-shadow: var(--shadow-lg);
  transform: scale(0.96) translateY(10px); transition: all .25s;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-title-wrap { display: flex; align-items: center; gap: 10px; }
.modal-icon { font-size: 20px; }
.modal-header h3 { font-size: 17px; font-weight: 800; color: var(--text); }
.modal-close {
  width: 28px; height: 28px; background: #f1f5f9; border: none; color: var(--text2);
  border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 700;
  transition: all .2s; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: #e2e8f0; color: var(--text); }
.modal .form-group { margin-bottom: 13px; }

/* Confirm modal */
.confirm-modal { max-width: 380px; text-align: center; }
.confirm-icon { font-size: 40px; margin-bottom: 12px; }
.confirm-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.confirm-desc { color: var(--text2); font-size: 13px; margin-bottom: 22px; }

/* Students list modal */
.students-modal {
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.modal-table-wrap {
  overflow-y: auto;
  max-height: 52vh;
  margin-top: 10px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-stats { gap: 8px; }
  .stat-card { padding: 12px 14px; min-width: 100px; }
  .stat-num { font-size: 20px; }
  .tab-btn { padding: 0 14px; font-size: 12px; }
  .card { padding: 18px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; }
  .filter-wrap { width: 100%; }
  .select-wrap.sm { width: 100%; flex: 1; }
  .uni-name { width: 130px; }
  .matrix-table th.matrix-th-name,
  .matrix-table td.matrix-td-name {
    min-width: 160px;
    left: 36px;
  }
  .matrix-table th.matrix-th-bil,
  .matrix-table td.matrix-td-bil {
    width: 36px;
  }
}
