/* ═══════════════════════════════════════════════════════════
   PJOK SYSTEM — PREMIUM THEME (OCEAN BLUE)
   Font: Inter | Glassmorphism | Smooth Animation
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ═══ ROOT VARIABLES ═══ */
:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;

  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --bg-sidebar: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  --bg-topbar: rgba(255, 255, 255, 0.85);

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --text-sidebar: #cbd5e1;
  --text-sidebar-active: #ffffff;

  --border-color: #e2e8f0;
  --border-radius: 14px;
  --border-radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 24px rgba(59, 130, 246, 0.35);

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

/* ═══ GLOBAL RESET & BODY ═══ */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrapper { display: flex; }

/* ═══ SIDEBAR ═══ */
.sidebar {
  width: 260px;
  height: 100vh;
  max-height: 100vh;
  background: var(--bg-sidebar);
  color: white;
  position: fixed;
  left: 0;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }
.sidebar { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent; }

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-header h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-header small {
  color: var(--text-light);
  font-size: 11px;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.sidebar-menu {
  list-style: none;
  padding: 12px 0 30px;
  margin: 0;
  flex: 1;
}

.sidebar-group {
  padding: 16px 22px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #64748b;
  font-weight: 700;
}

.sidebar-menu .nav-link {
  color: var(--text-sidebar);
  padding: 11px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 3px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
}

.sidebar-menu .nav-link:hover {
  background: rgba(59, 130, 246, 0.08);
  color: white;
  border-left-color: var(--primary-light);
  padding-left: 24px;
}

.sidebar-menu .nav-link.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.05));
  color: white;
  border-left: 3px solid var(--primary-light);
  font-weight: 600;
  box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.1);
}

.sidebar-menu .nav-link i {
  font-size: 17px;
  width: 22px;
  text-align: center;
  transition: var(--transition);
}

.sidebar-menu .nav-link:hover i,
.sidebar-menu .nav-link.active i {
  color: var(--primary-light);
  transform: scale(1.1);
}

.logout { color: #f87171 !important; }
.logout:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  border-left-color: #ef4444 !important;
}

/* ═══ MAIN CONTENT ═══ */
.main {
  margin-left: 260px;
  width: calc(100% - 260px);
  padding: 30px;
  min-height: 100vh;
}

/* ═══ CARDS ═══ */
.card {
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  background: var(--bg-card);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
  padding: 18px 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body { padding: 24px; }

/* ═══ STAT CARDS (Dashboard) ═══ */
.stat-card {
  text-align: center;
  padding: 24px;
  border-radius: var(--border-radius);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  font-size: 42px;
  margin-bottom: 12px;
  display: inline-block;
}

.stat-value {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

/* ═══ TABLES ═══ */
.table {
  font-size: 13.5px;
  margin-bottom: 0;
}

.table thead th {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
  padding: 12px;
  vertical-align: middle;
}

.table tbody tr {
  transition: var(--transition);
}

.table tbody tr:hover {
  background: rgba(59, 130, 246, 0.04);
}

.table td {
  padding: 12px;
  vertical-align: middle;
}

/* ═══ BUTTONS ═══ */
.btn {
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  transition: var(--transition);
  border: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.btn-info {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white;
}

.btn-secondary {
  background: linear-gradient(135deg, #64748b, #475569);
}

/* ═══ FORMS ═══ */
.form-control, .form-select {
  border-radius: var(--border-radius-sm);
  border: 1.5px solid var(--border-color);
  padding: 10px 14px;
  font-size: 13.5px;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 13px;
  margin-bottom: 6px;
}

/* ═══ BADGES ═══ */
.badge {
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  letter-spacing: 0.3px;
}

/* ═══ MODALS ═══ */
.modal-content {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 20px 24px;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 16px 24px;
}

/* ═══ TOAST NOTIFICATION ═══ */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-item {
  min-width: 300px;
  max-width: 400px;
  padding: 16px 20px;
  border-radius: var(--border-radius-sm);
  background: white;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  border-left: 4px solid;
  animation: slideIn 0.3s ease;
}

.toast-success { border-color: var(--success); color: #065f46; background: linear-gradient(135deg, #ecfdf5, #d1fae5); }
.toast-error { border-color: var(--danger); color: #991b1b; background: linear-gradient(135deg, #fef2f2, #fee2e2); }
.toast-warning { border-color: var(--warning); color: #92400e; background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.toast-info { border-color: var(--info); color: #155e75; background: linear-gradient(135deg, #ecfeff, #cffafe); }

@keyframes slideIn {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(400px); opacity: 0; }
}

/* ═══ PAGE TITLE ═══ */
.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
  color: var(--text-primary);
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-group, .sidebar-header small, .sidebar-menu .nav-link span { display: none; }
  .sidebar-header { padding: 16px 8px; }
  .sidebar-header h4 { font-size: 14px; }
  .main { margin-left: 60px; width: calc(100% - 60px); padding: 15px; }
  .stat-value { font-size: 24px; }
  .stat-icon { font-size: 28px; }
}

/* ═══ SMOOTH ANIMATION ═══ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: fadeInUp 0.4s ease; }

/* ═══════════════════════════════════════════════════════════
   TOPBAR — Fase 3
   ═══════════════════════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 900;
  height: 60px; padding: 0 28px;
  background: var(--bg-topbar);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.topbar-title {
  font-size: 15px; font-weight: 600; color: #1e293b;
  letter-spacing: -0.01em;
}
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.topbar-user {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px;
  background: rgba(59, 130, 246, 0.08);
  color: var(--primary); border-radius: 999px;
  font-size: 13px; font-weight: 500;
  transition: background 0.2s;
}
.topbar-user:hover { background: rgba(59, 130, 246, 0.16); }
@media (max-width: 768px) {
  .topbar { padding: 0 16px; height: 56px; }
  .topbar-title { font-size: 14px; }
  .topbar-user { padding: 5px 12px; font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════════
   FASE4-DASHBOARD-MARKER
   Dashboard premium components
   ═══════════════════════════════════════════════════════════ */

/* ─── Dashboard Header ─── */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.dashboard-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dashboard-title i {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Welcome Box (Glassmorphism Ocean) ─── */
.welcome-box {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #06b6d4 100%);
  color: #fff;
  border-radius: 22px;
  padding: 34px 36px;
  box-shadow:
    0 20px 40px -10px rgba(30, 64, 175, 0.45),
    0 8px 20px -5px rgba(6, 182, 212, 0.3);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.welcome-box::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
}
.welcome-box::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -40px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
}
.welcome-box h4 {
  font-weight: 700;
  font-size: 24px;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.welcome-box p {
  margin: 0;
  opacity: 0.92;
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 640px;
}

/* ─── Stat Cards (Super Premium) ─── */
.stat-card {
  border: none !important;
  border-radius: 22px !important;
  padding: 28px !important;
  color: #fff;
  box-shadow:
    0 15px 35px -10px rgba(15, 23, 42, 0.25),
    0 4px 12px -4px rgba(15, 23, 42, 0.1);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 140px;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,0.22) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  transition: transform 0.6s ease;
}
.stat-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 25px 55px -12px rgba(15, 23, 42, 0.35),
    0 12px 28px -8px rgba(15, 23, 42, 0.15);
}
.stat-card:hover::before {
  transform: scale(1.3);
}

/* Varian warna stat card */
.card-kelas {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 60%, #60a5fa 100%) !important;
}
.card-siswa {
  background: linear-gradient(135deg, #047857 0%, #10b981 60%, #34d399 100%) !important;
}
.card-nilai {
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 60%, #fbbf24 100%) !important;
}
.card-komponen {
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 60%, #a78bfa 100%) !important;
}

.stat-icon {
  font-size: 48px !important;
  opacity: 0.95;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.5s ease;
}
.stat-card:hover .stat-icon {
  transform: scale(1.15) rotate(-5deg);
}

.stat-number {
  font-size: 42px !important;
  font-weight: 800;
  margin-top: 6px;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-variant-numeric: tabular-nums;
}

/* ─── Chart Card ─── */
.chart-card {
  border: none !important;
  border-radius: 22px !important;
  box-shadow:
    0 10px 30px -8px rgba(15, 23, 42, 0.12),
    0 2px 8px -2px rgba(15, 23, 42, 0.06);
  background: #fff !important;
  transition: box-shadow 0.3s ease;
}
.chart-card:hover {
  box-shadow:
    0 18px 42px -10px rgba(15, 23, 42, 0.18),
    0 4px 14px -4px rgba(15, 23, 42, 0.08);
}
.chart-card h5 {
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.chart-card h5 i {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Ranking (Medal) ─── */
.rank-1 { background: linear-gradient(90deg, #FFD700 0%, #FFF8DC 100%) !important; font-weight: 600; }
.rank-2 { background: linear-gradient(90deg, #C0C0C0 0%, #F0F0F0 100%) !important; font-weight: 600; }
.rank-3 { background: linear-gradient(90deg, #CD7F32 0%, #F5DEB3 100%) !important; font-weight: 600; }

/* ─── Footer ─── */
.footer {
  margin-top: 48px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ─── Progress bar premium ─── */
.progress {
  border-radius: 999px !important;
  background: rgba(15, 23, 42, 0.06) !important;
  overflow: hidden;
}
.progress-bar {
  border-radius: 999px !important;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Animasi ─── */
@keyframes fadeUpPremium {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.stat-card {
  animation: fadeUpPremium 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.15s; }
.stat-card:nth-child(3) { animation-delay: 0.25s; }
.stat-card:nth-child(4) { animation-delay: 0.35s; }

.welcome-box {
  animation: fadeUpPremium 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.chart-card {
  animation: fadeUpPremium 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.3s backwards;
}

/* ═══════════════════════════════════════════════════════════
   FASE5-STATISTIK-MARKER
   Statistik dashboard — stat cards berwarna + chart premium
   ═══════════════════════════════════════════════════════════ */

/* ─── Stat card varian warna (khusus dashboard_stat) ─── */
.stat-card.stat-card-primary {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 60%, #60a5fa 100%) !important;
}
.stat-card.stat-card-success {
  background: linear-gradient(135deg, #047857 0%, #10b981 60%, #34d399 100%) !important;
}
.stat-card.stat-card-info {
  background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 60%, #38bdf8 100%) !important;
}
.stat-card.stat-card-warning {
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 60%, #fbbf24 100%) !important;
}
.stat-card.stat-card-primary,
.stat-card.stat-card-success,
.stat-card.stat-card-info,
.stat-card.stat-card-warning {
  color: #fff !important;
}
.stat-card.stat-card-primary .stat-icon,
.stat-card.stat-card-success .stat-icon,
.stat-card.stat-card-info .stat-icon,
.stat-card.stat-card-warning .stat-icon {
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.stat-card.stat-card-primary .stat-value,
.stat-card.stat-card-success .stat-value,
.stat-card.stat-card-info .stat-value,
.stat-card.stat-card-warning .stat-value {
  color: #fff !important;
  font-size: 38px !important;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.stat-card.stat-card-primary .stat-label,
.stat-card.stat-card-success .stat-label,
.stat-card.stat-card-info .stat-label,
.stat-card.stat-card-warning .stat-label {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  letter-spacing: 0.03em;
  font-size: 12.5px;
  text-transform: uppercase;
}
.stat-card.stat-card-primary small,
.stat-card.stat-card-success small,
.stat-card.stat-card-info small,
.stat-card.stat-card-warning small {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 11.5px;
}
.stat-card .progress {
  background: rgba(255, 255, 255, 0.22) !important;
  border-radius: 999px !important;
  overflow: hidden;
}
.stat-card .progress-bar {
  background: #fff !important;
  border-radius: 999px !important;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

/* ─── Chart canvas heights ─── */
#chartKelas {
  height: 300px !important;
  max-height: 300px;
}
#chartGrade {
  height: 260px !important;
  max-height: 260px;
}

/* ─── Chart cards premium ─── */
.card .card-body h6 {
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  font-size: 15px;
  margin-bottom: 16px;
}
.card .card-body h6 i {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Top 10 table premium ─── */
.table-responsive .table {
  margin-bottom: 0;
  border-radius: 12px;
  overflow: hidden;
}
.table thead.table-dark th {
  background: linear-gradient(135deg, #0f172a, #1e293b) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 600;
  padding: 14px 16px;
  letter-spacing: 0.02em;
  font-size: 13px;
}
.table tbody tr {
  transition: all 0.3s ease;
  background: #fff;
}
.table tbody tr:hover {
  transform: translateX(4px);
  background: rgba(59, 130, 246, 0.04);
}
.table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  color: #334155;
  font-size: 14px;
}

/* ─── Medal glow (rank 1/2/3) ─── */
tr.rank-1 { box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.5); }
tr.rank-2 { box-shadow: inset 0 0 0 1px rgba(192, 192, 192, 0.5); }
tr.rank-3 { box-shadow: inset 0 0 0 1px rgba(205, 127, 50, 0.5); }
tr.rank-1:hover { box-shadow: inset 0 0 0 2px #FFD700, 0 0 20px rgba(255, 215, 0, 0.25); }
tr.rank-2:hover { box-shadow: inset 0 0 0 2px #C0C0C0, 0 0 20px rgba(192, 192, 192, 0.25); }
tr.rank-3:hover { box-shadow: inset 0 0 0 2px #CD7F32, 0 0 20px rgba(205, 127, 50, 0.25); }

/* ─── Form select premium ─── */
.form-select-sm {
  border-radius: 10px !important;
  border: 1px solid rgba(148, 163, 184, 0.4);
  transition: all 0.2s;
  padding: 6px 12px;
}
.form-select-sm:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ═══════════════════════════════════════════════════════════
   FASE6-MARKER
   Komponen premium untuk nilai, rekap, ranking, komponen, tahun
   ═══════════════════════════════════════════════════════════ */

/* ─── Input Nilai (inline table) ─── */
.nilai-input {
  width: 64px;
  text-align: center;
  padding: 6px 8px;
  border: 1.5px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  background: #fff;
  color: #0f172a;
  transition: all 0.2s ease;
  outline: none;
}
.nilai-input:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.03);
}
.nilai-input:focus {
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  transform: scale(1.05);
}
.nilai-input::-webkit-outer-spin-button,
.nilai-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.nilai-input[type=number] { -moz-appearance: textfield; }

/* ─── Autosave indicator ─── */
tr.saving {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.12), rgba(251, 191, 36, 0.02)) !important;
  transition: background 0.3s ease;
}
tr.saving::after {
  content: '⏳ menyimpan...';
  position: absolute;
  right: 12px;
  color: #b45309;
  font-size: 11px;
  font-weight: 600;
}
tr.saved {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.02)) !important;
  transition: background 1s ease;
}
tr.saved::after {
  content: '✓ tersimpan';
  position: absolute;
  right: 12px;
  color: #047857;
  font-size: 11px;
  font-weight: 600;
}
tr { position: relative; }

/* ─── Tabel premium (untuk 5 halaman) ─── */
.table {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}
.table thead.table-dark th {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
  color: #fff !important;
  border: none !important;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 5;
}
.table tbody td {
  padding: 10px 14px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 13.5px;
  color: #334155;
}
.table tbody tr {
  transition: background 0.2s ease;
}
.table tbody tr:hover {
  background: rgba(59, 130, 246, 0.04);
}

/* ─── Badge grade A/B/C/D ─── */
.badge-grade {
  display: inline-block;
  min-width: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-align: center;
}
.grade-A { background: linear-gradient(135deg, #10b981, #34d399); color: #fff; box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3); }
.grade-B { background: linear-gradient(135deg, #3b82f6, #60a5fa); color: #fff; box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3); }
.grade-C { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #fff; box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3); }
.grade-D { background: linear-gradient(135deg, #ef4444, #f87171); color: #fff; box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3); }

/* ─── Badge jenis komponen ─── */
.badge-jenis {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-uh       { background: rgba(59, 130, 246, 0.12); color: #1e40af; }
.badge-tugas    { background: rgba(16, 185, 129, 0.12); color: #047857; }
.badge-praktek  { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.badge-uts      { background: rgba(139, 92, 246, 0.12); color: #6d28d9; }
.badge-uas      { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }

/* ─── Alert premium glassmorphism ─── */
.alert {
  border: none !important;
  border-radius: 14px !important;
  padding: 14px 18px;
  font-weight: 500;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.08);
}
.alert-info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(6, 182, 212, 0.08)) !important;
  color: #1e40af !important;
  border-left: 3px solid #3b82f6 !important;
}
.alert-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(52, 211, 153, 0.08)) !important;
  color: #047857 !important;
  border-left: 3px solid #10b981 !important;
}
.alert-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(248, 113, 113, 0.08)) !important;
  color: #b91c1c !important;
  border-left: 3px solid #ef4444 !important;
}
.alert-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(251, 191, 36, 0.08)) !important;
  color: #b45309 !important;
  border-left: 3px solid #f59e0b !important;
}

/* ─── Form Control Premium (global) ─── */
.form-control, .form-select {
  border-radius: 10px !important;
  border: 1.5px solid rgba(148, 163, 184, 0.3);
  transition: all 0.2s;
  padding: 8px 12px;
  font-size: 13.5px;
}
.form-control:focus, .form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ─── Tombol Premium ─── */
.btn-sm {
  border-radius: 8px !important;
  font-weight: 500;
  padding: 5px 12px;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
  border: none !important;
  box-shadow: 0 2px 8px -2px rgba(37, 99, 235, 0.4);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.5);
}
.btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
  border: none !important;
  box-shadow: 0 2px 8px -2px rgba(220, 38, 38, 0.4);
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px -2px rgba(220, 38, 38, 0.5);
}
.btn-success {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  border: none !important;
}

/* ─── Badge Bootstrap override ─── */
.badge.bg-primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge.bg-info     { background: linear-gradient(135deg, #0891b2, #06b6d4) !important; border-radius: 8px; }
.badge.bg-success  { background: linear-gradient(135deg, #059669, #10b981) !important; border-radius: 8px; }
.badge.bg-secondary{ background: linear-gradient(135deg, #64748b, #94a3b8) !important; border-radius: 8px; }

/* ─── Card premium ─── */
.card {
  border: none !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 20px -6px rgba(15, 23, 42, 0.08), 0 1px 4px -1px rgba(15, 23, 42, 0.04) !important;
  transition: box-shadow 0.3s ease;
}
.card:hover {
  box-shadow: 0 8px 28px -8px rgba(15, 23, 42, 0.12), 0 2px 8px -2px rgba(15, 23, 42, 0.06) !important;
}
.card-body { padding: 22px 24px; }

/* ─── Page title style (konsisten di 5 file) ─── */
.card h5, .card h6 {
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h5 i, .card h6 i {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Sticky table header (nilai_v2 khusus) ─── */
.table-responsive {
  max-height: 70vh;
  overflow-y: auto;
  border-radius: 12px;
}

/* ═══════════════════════════════════════════════════════════
   FASE8-POLISH-MARKER
   Final polish — micro-interaction, scrollbar, print-friendly
   ═══════════════════════════════════════════════════════════ */

/* ─── Smooth scroll global ─── */
html { scroll-behavior: smooth; }

/* ─── Selection color (biru ocean) ─── */
::selection {
  background: rgba(59, 130, 246, 0.25);
  color: #0f172a;
}
::-moz-selection {
  background: rgba(59, 130, 246, 0.25);
  color: #0f172a;
}

/* ─── Custom scrollbar (webkit) ─── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.03); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #94a3b8, #64748b);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #64748b, #475569);
  background-clip: content-box;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 rgba(15, 23, 42, 0.03);
}

/* ─── Focus outline konsisten ─── */
:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 6px;
}

/* ─── Page transition loading overlay ─── */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}
#page-loader.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}
#page-loader .loader-spinner {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(59, 130, 246, 0.15);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Print-friendly (rekap_pdf_massal & halaman lain) ─── */
@media print {
  .sidebar,
  .topbar,
  .no-print,
  .btn,
  .alert,
  nav,
  footer.footer { display: none !important; }

  .main { margin-left: 0 !important; padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; }

  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    page-break-inside: avoid;
  }

  .table {
    font-size: 11px;
    border-collapse: collapse !important;
  }
  .table th,
  .table td {
    border: 1px solid #999 !important;
    padding: 4px 6px !important;
    color: #000 !important;
  }
  .table thead.table-dark th {
    background: #333 !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  a { color: #000 !important; text-decoration: none; }
  @page { margin: 1.2cm; }
}

/* ═══════════════════════════════════════════════════════════
   FASE9-UI-MARKER
   Topbar buttons + search modal
   ═══════════════════════════════════════════════════════════ */

/* ─── Topbar buttons ─── */
.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.topbar-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  border-color: rgba(59, 130, 246, 0.25);
  transform: translateY(-1px);
}
.topbar-btn:active { transform: translateY(0); }
.topbar-btn i { font-size: 15px; }
.topbar-btn kbd {
  padding: 2px 6px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 5px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-light);
}
.topbar-btn-text {
  display: inline;
}

/* ─── Search modal ─── */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.search-modal.active { display: flex; }

.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.search-modal-panel {
  position: relative;
  width: 92%;
  max-width: 620px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px -10px rgba(15, 23, 42, 0.5);
  overflow: hidden;
  animation: slideDown 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

html[data-theme="dark"] .search-modal-panel {
  background: #131c31;
  border: 1px solid #1e293b;
}

.search-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}
.search-modal-input-wrap i {
  font-size: 18px;
  color: var(--text-light);
  flex-shrink: 0;
}
.search-modal-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
}
.search-modal-input-wrap input::placeholder {
  color: var(--text-light);
}
.search-kbd {
  padding: 3px 8px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
}

.search-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 8px;
}
.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  cursor: pointer;
}
.search-item:hover,
.search-item.selected {
  background: rgba(59, 130, 246, 0.1);
}
.search-item.selected {
  box-shadow: inset 3px 0 0 var(--primary);
}
.search-item i {
  font-size: 18px;
  color: var(--primary);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.search-item-body { flex: 1; min-width: 0; }
.search-item-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-item-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-empty,
.search-loading {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
}
.search-spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 3px solid rgba(59, 130, 246, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.search-footer {
  display: flex;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 11.5px;
  color: var(--text-light);
  background: rgba(148, 163, 184, 0.04);
}
.search-footer kbd {
  padding: 2px 6px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 4px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  margin-right: 4px;
}

/* Mobile */
@media (max-width: 768px) {
  .topbar-btn-text,
  .topbar-btn kbd { display: none; }
  .topbar-btn { padding: 7px 10px; }
  .search-modal-panel { width: 96%; }
  .search-modal { padding-top: 6vh; }
}

/* ═══════════════════════════════════════════════════════════
   FASE10-MARKER
   Dashboard actions (Live, Export PDF), notif banner
   ═══════════════════════════════════════════════════════════ */

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Tombol LIVE */
#live-toggle.active {
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulseLive 2s infinite;
}
#live-toggle.active i {
  animation: liveBlink 1.4s infinite;
}
@keyframes pulseLive {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@keyframes liveBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* Status text */
.live-status {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-light);
  min-width: 0;
  white-space: nowrap;
  transition: color 0.3s;
}
.live-status.on {
  color: #ef4444;
}
.live-status.flash {
  color: #10b981;
}

/* Tombol Export PDF */
#export-pdf-btn {
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
  color: #fff !important;
  border-color: transparent !important;
}
#export-pdf-btn:hover {
  background: linear-gradient(135deg, #b91c1c, #dc2626) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(220, 38, 38, 0.4);
}
#export-pdf-btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none !important;
}

/* Notif banner nilai belum lengkap */
.nilai-notif-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(251, 191, 36, 0.06));
  border-left: 4px solid #f59e0b;
  border-radius: 14px;
  color: #b45309;
  font-size: 14px;
  animation: fadeUpPremium 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.nilai-notif-banner i {
  font-size: 20px;
  color: #f59e0b;
  flex-shrink: 0;
}
.nilai-notif-banner .notif-link {
  margin-left: auto;
  padding: 5px 14px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12.5px;
  transition: all 0.2s;
  white-space: nowrap;
}
.nilai-notif-banner .notif-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(245, 158, 11, 0.5);
}

/* Dark mode */
html[data-theme="dark"] .nilai-notif-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.05));
  color: #fcd34d;
}

/* Mobile */
@media (max-width: 768px) {
  .dashboard-actions { width: 100%; justify-content: flex-start; }
  .live-status { display: none; }
  .nilai-notif-banner { flex-wrap: wrap; font-size: 13px; }
  .nilai-notif-banner .notif-link { margin-left: 0; width: 100%; text-align: center; }
}
