/* ============================================
   E-Rapor Digital - Modern CSS Design System
   ============================================ */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --orange: #f97316;

  --bg: #0f0f1a;
  --bg-2: #16162a;
  --bg-3: #1e1e35;
  --surface: rgba(255,255,255,0.05);
  --surface-hover: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(99,102,241,0.4);

  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-faint: #64748b;

  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px rgba(99,102,241,0.3);

  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== PAGES ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== LOGIN ===== */
.login-bg {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a0a2e 50%, #0d1627 100%);
  z-index: 0;
  overflow: hidden;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbFloat 8s ease-in-out infinite;
}
.orb1 { width: 500px; height: 500px; background: rgba(99,102,241,0.2); top: -150px; left: -100px; }
.orb2 { width: 400px; height: 400px; background: rgba(139,92,246,0.15); bottom: -100px; right: -80px; animation-delay: -3s; }
.orb3 { width: 300px; height: 300px; background: rgba(6,182,212,0.1); top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -6s; }

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}
.orb3 { animation: orbFloat3 8s ease-in-out infinite -6s; }
@keyframes orbFloat3 {
  0%, 100% { transform: translate(-50%,-50%) scale(1); }
  50% { transform: translate(-50%,-50%) scale(1.1); }
}

.login-container {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%; max-width: 440px;
  padding: 40px;
  animation: slideUp 0.5s cubic-bezier(0.4,0,0.2,1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.glass-card {
  background: rgba(22,22,42,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.05);
}

.login-logo {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 32px;
}
.logo-icon {
  width: 48px; height: 48px;
  filter: drop-shadow(0 0 12px rgba(99,102,241,0.5));
}
.logo-icon svg { width: 100%; height: 100%; }
.logo-icon.small { width: 36px; height: 36px; }
.logo-text h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px; font-weight: 800;
  background: linear-gradient(135deg, #818cf8, #c4b5fd);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-text span { font-size: 12px; color: var(--text-muted); }

.login-tabs {
  display: flex; gap: 4px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 28px;
}
.tab-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  margin-bottom: 8px;
}
.input-wrap {
  position: relative;
  display: flex; align-items: center;
}
.input-icon {
  position: absolute; left: 14px;
  width: 16px; height: 16px;
  color: var(--text-faint);
  pointer-events: none;
}
.input-wrap input, .input-wrap select {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px; font-family: inherit;
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.input-wrap select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2394a3b8' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}
.input-wrap input:focus, .input-wrap select:focus {
  border-color: var(--primary);
  background: rgba(99,102,241,0.08);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.input-wrap input::placeholder { color: var(--text-faint); }
.input-wrap select option { background: var(--bg-3); }

.toggle-pass {
  position: absolute; right: 14px;
  background: none; border: none;
  color: var(--text-faint); cursor: pointer;
  padding: 0; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s;
}
.toggle-pass:hover { color: var(--text-muted); }
.toggle-pass svg { width: 16px; height: 16px; }

.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99,102,241,0.5);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary svg { width: 18px; height: 18px; }

.btn-login { margin-top: 8px; }

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px; color: var(--text-faint);
}

/* ===== APP LAYOUT ===== */
#page-app {
  display: none;
}
#page-app.active {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed; left: 0; top: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-header {
  padding: 20px 20px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px; font-weight: 700;
  background: linear-gradient(135deg, #818cf8, #c4b5fd);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-close {
  display: none;
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  width: 32px; height: 32px;
  border-radius: var(--radius-xs);
  align-items: center; justify-content: center;
  transition: var(--transition);
}
.sidebar-close svg { width: 16px; height: 16px; }
.sidebar-close:hover { background: var(--surface); color: var(--text); }

.sidebar-user {
  padding: 20px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.user-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.user-name { font-size: 14px; font-weight: 600; color: var(--text); }
.user-role { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.sidebar-nav {
  flex: 1; padding: 16px 12px;
}
.nav-section-title {
  font-size: 10px; font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 0 8px; margin-bottom: 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover {
  background: var(--surface);
  color: var(--text);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.1));
  color: var(--primary-light);
  border: 1px solid rgba(99,102,241,0.2);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.btn-logout {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  color: #f87171;
  font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.btn-logout svg { width: 18px; height: 18px; }
.btn-logout:hover {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.4);
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-h);
  background: rgba(22,22,42,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.menu-btn {
  display: none;
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.menu-btn svg { width: 20px; height: 20px; }
.menu-btn:hover { background: var(--surface); color: var(--text); }

.topbar-title {
  font-size: 17px; font-weight: 600;
  flex: 1;
}
.topbar-right {
  display: flex; align-items: center; gap: 12px;
}
.semester-badge {
  padding: 6px 14px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  color: var(--primary-light);
  white-space: nowrap;
}
.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white;
  cursor: pointer;
  flex-shrink: 0;
}

/* ===== CONTENT SECTIONS ===== */
.content-area { flex: 1; overflow: auto; }
.content-section { display: none; padding: 24px; animation: fadeIn 0.3s ease; }
.content-section.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.section-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 22px; font-weight: 700;
  color: var(--text);
}
.section-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}
.card:hover { border-color: var(--border-hover); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.card-header h3 {
  font-size: 15px; font-weight: 600;
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  border: 1px solid transparent;
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; inset: 0;
  opacity: 0; transition: opacity var(--transition);
}
.stat-card:hover::before { opacity: 1; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }

.stat-blue { background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(99,102,241,0.05)); border-color: rgba(99,102,241,0.2); }
.stat-green { background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(16,185,129,0.05)); border-color: rgba(16,185,129,0.2); }
.stat-purple { background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(139,92,246,0.05)); border-color: rgba(139,92,246,0.2); }
.stat-orange { background: linear-gradient(135deg, rgba(249,115,22,0.15), rgba(249,115,22,0.05)); border-color: rgba(249,115,22,0.2); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-blue .stat-icon { background: rgba(99,102,241,0.2); color: var(--primary-light); }
.stat-green .stat-icon { background: rgba(16,185,129,0.2); color: #34d399; }
.stat-purple .stat-icon { background: rgba(139,92,246,0.2); color: #c4b5fd; }
.stat-orange .stat-icon { background: rgba(249,115,22,0.2); color: #fb923c; }
.stat-icon svg { width: 24px; height: 24px; }

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 28px; font-weight: 700;
  line-height: 1;
}
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ===== BAR CHART ===== */
.chart-card { }
.legend {
  display: flex; gap: 16px;
  font-size: 12px; color: var(--text-muted);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.blue { background: var(--primary); }
.dot.purple { background: var(--secondary); }
.dot.green { background: var(--success); }
.dot.orange { background: var(--orange); }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 48px;
}
.bar-pair { display: flex; gap: 3px; align-items: flex-end; height: 130px; }
.bar {
  width: 14px;
  border-radius: 4px 4px 0 0;
  transition: height 0.8s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  cursor: pointer;
}
.bar:hover { filter: brightness(1.2); }
.bar.p { background: linear-gradient(to top, var(--primary-dark), var(--primary-light)); }
.bar.k { background: linear-gradient(to top, #7c3aed, #c4b5fd); }
.bar-label { font-size: 9px; color: var(--text-faint); text-align: center; line-height: 1.2; max-width: 48px; }

/* ===== GRADE DISTRIBUTION ===== */
.grade-distribution {
  display: flex; flex-direction: column; gap: 12px;
}
.grade-row {
  display: flex; align-items: center; gap: 10px;
}
.grade-letter {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.grade-A { background: rgba(16,185,129,0.2); color: #34d399; }
.grade-B { background: rgba(99,102,241,0.2); color: var(--primary-light); }
.grade-C { background: rgba(245,158,11,0.2); color: #fbbf24; }
.grade-D { background: rgba(239,68,68,0.2); color: #f87171; }
.grade-bar-wrap { flex: 1; height: 8px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.grade-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}
.grade-A .grade-bar-fill, .ga { background: linear-gradient(to right, #059669, #34d399); }
.grade-B .grade-bar-fill, .gb { background: linear-gradient(to right, var(--primary-dark), var(--primary-light)); }
.grade-C .grade-bar-fill, .gc { background: linear-gradient(to right, #d97706, #fbbf24); }
.grade-D .grade-bar-fill, .gd { background: linear-gradient(to right, #dc2626, #f87171); }
.grade-count { font-size: 12px; color: var(--text-muted); width: 30px; text-align: right; }

/* ===== INFO CARDS ===== */
.info-card { }
.info-list { display: flex; flex-direction: column; gap: 12px; }
.info-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.info-item .label { color: var(--text-muted); }
.info-item .value { font-weight: 600; color: var(--text); }

/* ===== ABSEN CIRCLES ===== */
.absen-circles {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.absen-circle {
  flex: 1; min-width: 60px;
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 8px;
  background: var(--surface);
  border-radius: var(--radius-sm);
}
.absen-num { font-size: 22px; font-weight: 700; }
.absen-lbl { font-size: 10px; color: var(--text-muted); margin-top: 2px; text-align: center; }
.absen-s .absen-num { color: #60a5fa; }
.absen-i .absen-num { color: #fbbf24; }
.absen-a .absen-num { color: #f87171; }
.absen-h .absen-num { color: #34d399; }

/* ===== PRESTASI MINI ===== */
.prestasi-list { display: flex; flex-direction: column; gap: 8px; }
.prestasi-item {
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warning);
}
.prestasi-item .p-name { font-size: 13px; font-weight: 600; }
.prestasi-item .p-info { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.prestasi-empty { font-size: 13px; color: var(--text-faint); text-align: center; padding: 20px; }

/* ===== FILTER GROUP ===== */
.filter-group {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.filter-select {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px; font-family: inherit;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2394a3b8' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px;
  transition: var(--transition);
}
.filter-select:focus { border-color: var(--primary); }
.filter-select option { background: var(--bg-3); }

/* ===== RAPOR SUMMARY BAR ===== */
.rapor-summary-bar {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.summary-chip {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.summary-chip .chip-label { color: var(--text-muted); }
.summary-chip .chip-val { font-weight: 700; }
.chip-blue .chip-val { color: var(--primary-light); }
.chip-green .chip-val { color: #34d399; }
.chip-purple .chip-val { color: #c4b5fd; }
.chip-orange .chip-val { color: #fb923c; }

/* ===== RAPOR TABLE ===== */
.table-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-wrap { overflow-x: auto; }
.rapor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rapor-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.rapor-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
}
.rapor-table tr:last-child td { border-bottom: none; }
.rapor-table tr:hover td { background: var(--surface); }

.predikat-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  font-size: 12px; font-weight: 700;
}
.pred-A { background: rgba(16,185,129,0.2); color: #34d399; }
.pred-B { background: rgba(99,102,241,0.2); color: #818cf8; }
.pred-C { background: rgba(245,158,11,0.2); color: #fbbf24; }
.pred-D { background: rgba(239,68,68,0.2); color: #f87171; }

.nilai-cell {
  display: flex; align-items: center; gap: 8px;
}
.nilai-num { font-weight: 700; font-size: 15px; }
.nilai-bar-wrap { width: 48px; height: 4px; background: var(--surface); border-radius: 2px; overflow: hidden; }
.nilai-bar { height: 100%; border-radius: 2px; }

.deskripsi-text { font-size: 12px; color: var(--text-muted); max-width: 200px; line-height: 1.5; }
.mapel-name { font-weight: 600; }
.mapel-group { font-size: 11px; color: var(--text-faint); }

/* ===== ABSENSI PAGE ===== */
.absen-cards {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}
.absen-big-card {
  padding: 28px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-align: center;
  transition: var(--transition);
}
.absen-big-card:hover { transform: translateY(-2px); }
.absen-icon { font-size: 36px; margin-bottom: 12px; }
.absen-count { font-size: 40px; font-weight: 800; font-family: 'Outfit', sans-serif; line-height: 1; }
.absen-label { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.sakit { background: linear-gradient(135deg, rgba(96,165,250,0.1), rgba(96,165,250,0.05)); border-color: rgba(96,165,250,0.2); }
.sakit .absen-count { color: #60a5fa; }
.izin { background: linear-gradient(135deg, rgba(251,191,36,0.1), rgba(251,191,36,0.05)); border-color: rgba(251,191,36,0.2); }
.izin .absen-count { color: #fbbf24; }
.alpha { background: linear-gradient(135deg, rgba(248,113,113,0.1), rgba(248,113,113,0.05)); border-color: rgba(248,113,113,0.2); }
.alpha .absen-count { color: #f87171; }
.hadir { background: linear-gradient(135deg, rgba(52,211,153,0.1), rgba(52,211,153,0.05)); border-color: rgba(52,211,153,0.2); }
.hadir .absen-count { color: #34d399; }

/* ===== DONUT CHART ===== */
.donut-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  margin: 16px 0;
}
.donut-chart {
  width: 180px; height: 180px;
}
.donut-center {
  position: absolute;
  text-align: center;
}
.donut-pct {
  font-family: 'Outfit', sans-serif;
  font-size: 28px; font-weight: 700;
  color: var(--success);
}
.donut-lbl { font-size: 12px; color: var(--text-muted); }
.donut-legend {
  display: flex; justify-content: center; gap: 20px;
  flex-wrap: wrap; margin-top: 8px;
}
.donut-leg-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
}
.donut-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ===== CATATAN BOX ===== */
.catatan-box {
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  font-size: 14px; line-height: 1.7;
  color: var(--text-muted);
  font-style: italic;
}

/* ===== EKSTRA GRID ===== */
.ekstra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.ekstra-card {
  padding: 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.ekstra-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
}
.ekstra-card:hover { transform: translateY(-3px); border-color: var(--border-hover); box-shadow: var(--shadow-glow); }
.ekstra-icon { font-size: 32px; margin-bottom: 12px; }
.ekstra-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.ekstra-type { font-size: 12px; color: var(--text-faint); margin-bottom: 16px; }
.ekstra-score-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ekstra-score { font-size: 32px; font-weight: 800; font-family: 'Outfit', sans-serif; }
.ekstra-stars { color: var(--warning); font-size: 16px; }
.ekstra-progress { height: 6px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.ekstra-progress-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* ===== PRESTASI GRID ===== */
.prestasi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.prestasi-card {
  padding: 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  display: flex; gap: 16px;
}
.prestasi-card:hover { transform: translateY(-2px); border-color: rgba(245,158,11,0.3); }
.prestasi-trophy {
  font-size: 36px;
  flex-shrink: 0;
}
.prestasi-body {}
.prestasi-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.prestasi-desc { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.prestasi-tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tag {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px; font-weight: 500;
}
.tag-ta { background: rgba(99,102,241,0.2); color: var(--primary-light); }
.tag-class { background: rgba(16,185,129,0.2); color: #34d399; }

/* ===== PROFIL ===== */
.profil-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.profil-card { text-align: center; }
.profil-avatar-wrap { margin-bottom: 16px; position: relative; display: inline-block; }
.profil-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700; color: white;
  margin: 0 auto;
  box-shadow: 0 0 24px rgba(99,102,241,0.4);
}
.profil-badge {
  position: absolute; bottom: -4px; right: -4px;
  padding: 2px 8px;
  background: var(--success);
  border-radius: 10px;
  font-size: 10px; font-weight: 600; color: white;
}
.profil-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.profil-nis { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.profil-stats {
  display: flex; gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.profil-stat {
  flex: 1; padding: 12px 8px;
  border-right: 1px solid var(--border);
  text-align: center;
}
.profil-stat:last-child { border-right: none; }
.profil-stat-val { font-size: 18px; font-weight: 700; color: var(--primary-light); }
.profil-stat-lbl { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.detail-item {}
.detail-label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.detail-value { font-size: 14px; font-weight: 500; }

.ortu-card { margin-top: 0; }
.ortu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.ortu-col {}
.ortu-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--primary-light);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.ortu-field { margin-bottom: 10px; }
.ortu-field .lbl { font-size: 11px; color: var(--text-faint); }
.ortu-field .val { font-size: 13px; font-weight: 500; margin-top: 2px; }

/* ===== CETAK / PRINT ===== */
.cetak-actions { margin-bottom: 24px; }
.cetak-actions .btn-primary { width: auto; display: inline-flex; }

.rapor-print {
  background: white;
  color: #1a1a2e;
  border-radius: var(--radius);
  padding: 48px;
  max-width: 800px;
  margin: 0 auto;
  font-family: 'Times New Roman', serif;
  box-shadow: var(--shadow-lg);
}
.print-header {
  display: flex; align-items: center; gap: 24px;
  border-bottom: 3px double #1a1a2e;
  padding-bottom: 16px; margin-bottom: 16px;
}
.print-logo { font-size: 48px; }
.print-school-name { font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.print-school-sub { font-size: 13px; margin-top: 2px; }
.print-school-addr { font-size: 12px; color: #555; margin-top: 2px; }
.print-title {
  text-align: center; font-size: 16px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  margin: 12px 0 8px;
}
.print-semester { text-align: center; font-size: 14px; color: #555; margin-bottom: 20px; }
.print-bio { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 13px; }
.print-bio td { padding: 4px 8px; }
.print-bio td:first-child { width: 160px; }
.print-bio td:nth-child(2) { width: 10px; }
.print-section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  margin: 16px 0 8px;
  padding: 4px 0;
  border-bottom: 1px solid #999;
}
.print-table {
  width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 12px;
}
.print-table th, .print-table td {
  border: 1px solid #999; padding: 6px 10px; text-align: center;
}
.print-table th { background: #e8e8f0; font-weight: 700; }
.print-table td:nth-child(2) { text-align: left; }
.sub-header th { background: #f0f0f8; font-size: 11px; }
.print-absen { font-size: 13px; border-collapse: collapse; }
.print-absen td { padding: 4px 10px; }
.print-catatan {
  font-size: 13px; padding: 10px;
  border: 1px solid #ccc; border-radius: 4px;
  min-height: 60px; margin-bottom: 16px;
  line-height: 1.7; font-style: italic;
}
.print-sign {
  display: flex; justify-content: space-around; margin-top: 40px;
}
.sign-box { text-align: center; font-size: 12px; }
.sign-space { height: 70px; }

@media print {
  body > * { display: none !important; }
  #page-app { display: none !important; }
  .rapor-print { display: block !important; box-shadow: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .profil-layout { grid-template-columns: 1fr; }
  .ortu-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-close { display: flex; }
  .sidebar-overlay.open { display: block; }
  .menu-btn { display: flex; }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .absen-cards { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .semester-badge { display: none; }
  .section-header { flex-direction: column; }
  .rapor-print { padding: 24px; }
  .print-sign { flex-direction: column; gap: 24px; }
  .ortu-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .content-section { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .absen-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .login-card { padding: 28px 20px; }
}

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

/* ===== LOADING ANIMATION ===== */
.shimmer {
  background: linear-gradient(90deg, var(--surface) 25%, rgba(255,255,255,0.08) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== TOOLTIP ===== */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 999;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-faint);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }
