/* ============================================================
   LKPD PLATFORM — ULTRA-MODERN DESIGN SYSTEM
   Theme: Next-Gen Glassmorphism, Micro-Animations & Dark/Light System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

/* --- Reset & Global Variables --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* Color Palette - Vibrant Modern */
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --primary-hover: #4f46e5;
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.35);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.3);
  --danger: #f43f5e;
  --danger-glow: rgba(244, 63, 94, 0.35);
  
  /* Dark Theme (Default) */
  --bg-main: #090d16;
  --bg-gradient: radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 45%),
                 radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.1) 0%, transparent 45%),
                 radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 60%),
                 #090d16;
  
  --surface: rgba(18, 24, 39, 0.75);
  --surface-solid: #121827;
  --surface-hover: rgba(30, 41, 59, 0.85);
  --surface-active: rgba(45, 55, 72, 0.9);
  
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --sidebar-bg: rgba(13, 18, 30, 0.85);
  --topbar-bg: rgba(13, 18, 30, 0.75);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 35px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 25px var(--primary-glow);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;
  
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Switcher */
body.light-theme {
  --bg-main: #f4f6fb;
  --bg-gradient: radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.07) 0%, transparent 45%),
                 radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.06) 0%, transparent 45%),
                 #f4f6fb;
  
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #ffffff;
  --surface-hover: rgba(248, 250, 252, 0.95);
  --surface-active: #f1f5f9;
  
  --border: rgba(226, 232, 240, 0.85);
  --border-focus: rgba(99, 102, 241, 0.4);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --sidebar-bg: rgba(255, 255, 255, 0.9);
  --topbar-bg: rgba(255, 255, 255, 0.8);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.1);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);
}

/* --- Base Body & Scrollbar --- */
body {
  font-family: var(--font-main);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  letter-spacing: -0.01em;
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* --- Loading Screen --- */
.loading-screen {
  position: fixed;
  inset: 0;
  background: #090d16;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(99, 102, 241, 0.15);
  border-top-color: var(--primary);
  border-right-color: var(--secondary);
  animation: spin 0.85s linear infinite;
  filter: drop-shadow(0 0 12px var(--primary-glow));
}
.loading-brand {
  margin-top: 24px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}
.loading-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 6px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Main Layout Grid --- */
.layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* --- Modern Sidebar --- */
.sidebar {
  width: 270px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: var(--transition-slow);
}

.sidebar-header {
  padding: 24px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.logo-text span {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-sub {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

/* User Card in Sidebar */
.user-card-sidebar {
  margin: 16px 14px 8px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}
.user-card-sidebar:hover {
  background: var(--surface-hover);
  border-color: var(--border-focus);
}

.avatar-wrap {
  position: relative;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}
.user-status-dot {
  width: 10px;
  height: 10px;
  background: var(--success);
  border: 2px solid var(--surface-solid);
  border-radius: 50%;
  position: absolute;
  bottom: 0;
  right: 0;
}

.user-meta {
  flex: 1;
  min-width: 0;
}
.user-name-text {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  text-transform: capitalize;
  margin-top: 3px;
}

/* Nav Menu */
.sidebar-nav {
  flex: 1;
  padding: 12px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 12px 12px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.nav-link:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  transform: translateX(4px);
}
.nav-link.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.12));
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.12);
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 10px var(--primary);
}

.nav-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: var(--transition);
}
.nav-link:hover .nav-icon-box {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  transform: scale(1.1);
}
.nav-link.active .nav-icon-box {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.nav-pill-count {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --- Main Content Area --- */
.main-content {
  flex: 1;
  margin-left: 270px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition-slow);
}

/* Topbar Header */
.topbar {
  height: 72px;
  background: var(--topbar-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle-btn {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.breadcrumb-area {
  display: flex;
  flex-direction: column;
}
.page-title-badge {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.page-subtitle-crumb {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-btn, .quick-action-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}
.theme-toggle-btn:hover, .quick-action-btn:hover {
  background: var(--surface-hover);
  color: var(--primary);
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

.user-quick-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
}
.user-quick-pill:hover {
  background: var(--surface-hover);
  border-color: var(--border-focus);
}
.user-quick-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-quick-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Page Body Container */
.page-container {
  flex: 1;
  padding: 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.page-section {
  display: none;
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.page-section.active-page {
  display: block;
}

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

/* --- Hero & Welcome Banners --- */
.hero-welcome-card {
  position: relative;
  padding: 36px 40px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.9) 0%, rgba(124, 58, 237, 0.85) 50%, rgba(6, 182, 212, 0.75) 100%);
  border-radius: var(--radius-xl);
  color: white;
  margin-bottom: 30px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-welcome-card::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
  pointer-events: none;
}

.hero-welcome-card::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 20%;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
}
.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}
.hero-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 8px;
}
.hero-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

/* --- Stat Cards Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}
.stat-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-lg);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 10%, var(--card-glow, rgba(99,102,241,0.08)) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.stat-card:hover::before {
  opacity: 1;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: white;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.stat-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -1px;
}
.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* --- Section Heading --- */
.section-header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-heading i {
  color: var(--primary);
}

/* --- Cards & Grid Containers --- */
.lkpd-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

.lkpd-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: var(--transition);
}
.lkpd-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-lg), 0 0 20px var(--primary-glow);
}

.lkpd-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.subject-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.status-pill.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.status-pill.active::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

.lkpd-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.35;
}
.lkpd-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lkpd-meta-chips {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.meta-chip {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.meta-chip i {
  color: var(--primary);
}

.lkpd-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* AI Glowing Button */
.btn-ai {
  background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 50%, #06b6d4 100%);
  color: white;
  box-shadow: 0 4px 18px rgba(217, 70, 239, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  position: relative;
}
.btn-ai:hover {
  box-shadow: 0 6px 25px rgba(217, 70, 239, 0.6);
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.15);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 14px var(--success-glow);
}
.btn-success:hover {
  box-shadow: 0 6px 20px var(--success-glow);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: white;
  box-shadow: 0 4px 14px var(--danger-glow);
}
.btn-danger:hover {
  box-shadow: 0 6px 20px var(--danger-glow);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 14px 26px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}
.btn-block {
  width: 100%;
}

/* --- Interactive Quiz Workspace --- */
.quiz-top-bar {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 88px;
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.quiz-meta-info h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}
.quiz-meta-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.quiz-timer-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
}
.quiz-timer-box.timer-warning {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  animation: pulseTimer 1.5s infinite;
}
.quiz-timer-box.timer-danger {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.45);
  animation: pulseTimer 0.8s infinite;
}
@keyframes pulseTimer {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.timer-digits {
  font-family: 'JetBrains Mono', monospace, inherit;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
}
.timer-warning .timer-digits { color: var(--warning); }
.timer-danger .timer-digits { color: var(--danger); }

/* Quiz Layout: Question + Navigator Map */
.quiz-body-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}

.quiz-main-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.question-number-pill {
  font-size: 0.88rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 10px var(--primary-glow);
}
.question-points-pill {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.question-text-area {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 28px;
}

/* Option Cards */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.option-card:hover {
  border-color: var(--border-focus);
  background: var(--surface-hover);
  transform: translateX(4px);
}
.option-card.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
  box-shadow: 0 4px 16px var(--primary-glow);
}

.option-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: var(--transition);
  flex-shrink: 0;
}
.option-card:hover .option-badge {
  color: var(--primary);
  border-color: var(--primary);
}
.option-card.selected .option-badge {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.option-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.option-check-icon {
  font-size: 1.2rem;
  color: var(--primary);
  opacity: 0;
  transform: scale(0.5);
  transition: var(--transition);
}
.option-card.selected .option-check-icon {
  opacity: 1;
  transform: scale(1);
}

/* Quiz Navigator Drawer */
.quiz-nav-drawer {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  height: fit-content;
  position: sticky;
  top: 88px;
}

.nav-drawer-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.question-nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.nav-q-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.nav-q-btn:hover {
  border-color: var(--border-focus);
  color: var(--text-primary);
}
.nav-q-btn.answered {
  background: var(--success);
  border-color: var(--success);
  color: white;
  box-shadow: 0 2px 8px var(--success-glow);
}
.nav-q-btn.current {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 12px var(--primary-glow);
  transform: scale(1.08);
}

.nav-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.legend-dot.answered { background: var(--success); }
.legend-dot.current { background: var(--primary); }
.legend-dot.empty { background: var(--surface-solid); border: 1px solid var(--border); }

/* --- Modern Score Result Card --- */
.result-gauge-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: center;
  max-width: 680px;
  margin: 0 auto 30px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.score-circle-wrapper {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 30px var(--primary-glow);
}
.score-big-num {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1;
}
.score-max-sub {
  font-size: 0.85rem;
  opacity: 0.8;
  font-weight: 600;
}

.result-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 24px;
}
.result-status-badge.pass {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.result-status-badge.fail {
  background: rgba(244, 63, 94, 0.15);
  color: var(--danger);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.result-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.breakdown-box {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  padding: 14px 10px;
  border-radius: var(--radius-md);
}
.breakdown-val {
  font-size: 1.4rem;
  font-weight: 800;
}
.breakdown-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* --- Dropzone & AI Generator Enhancements --- */
.upload-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 20px var(--primary-glow);
}

.upload-icon-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 12px;
}

.upload-progress-container {
  margin-top: 16px;
  background: var(--surface-solid);
  border-radius: var(--radius-pill);
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: none;
}
.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
}

/* Tab Navigation inside Modals */
.tab-pills {
  display: flex;
  gap: 8px;
  background: var(--surface);
  padding: 6px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.tab-pill {
  flex: 1;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tab-pill:hover {
  color: var(--text-primary);
}
.tab-pill.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* AI Generating Loading Overlay */
.ai-generating-overlay {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  text-align: center;
}
.ai-generating-overlay.show {
  display: flex;
}
.ai-pulsing-orb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #d946ef, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  animation: pulseAi 1.6s ease-in-out infinite;
  box-shadow: 0 0 35px rgba(217, 70, 239, 0.5);
  margin-bottom: 20px;
}
@keyframes pulseAi {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.15) rotate(180deg); }
}

/* --- Modern Form & Input Elements --- */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.form-control, input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  transition: var(--transition);
}
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* --- Modern Table --- */
.table-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.custom-table th {
  background: var(--surface-solid);
  padding: 16px 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.custom-table td {
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}
.custom-table tr:hover td {
  background: var(--surface-hover);
}

/* --- Modern Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show {
  display: flex;
}

.modal-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
}
.modal-card.modal-lg {
  max-width: 820px;
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-close-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.1rem;
}
.modal-close-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  transform: rotate(90deg);
}

.modal-body {
  padding: 28px;
}
.modal-footer {
  padding: 18px 28px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Quick Role Selectors in Login Modal */
.demo-role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.demo-role-btn {
  padding: 10px 8px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.demo-role-btn:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

/* --- Toast Notification System --- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideToastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: var(--transition);
}
.toast.toast-leave {
  opacity: 0;
  transform: translateX(40px);
}

@keyframes slideToastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}
.toast-success .toast-icon { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.toast-error .toast-icon { background: rgba(244, 63, 94, 0.2); color: var(--danger); }
.toast-warning .toast-icon { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.toast-info .toast-icon { background: rgba(99, 102, 241, 0.2); color: var(--primary); }

.toast-content {
  flex: 1;
}
.toast-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}
.toast-msg {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* --- Generator & Modul Upload Styles (GenSoal Integration) --- */
.gen-page-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.gen-hero {
  background: linear-gradient(135deg, #312e81 0%, #4338ca 50%, #06b6d4 100%);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.25);
}
.gen-hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.gen-hero-sub {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 650px;
  margin-bottom: 18px;
  line-height: 1.6;
}
.gen-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gen-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
}

.gen-panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.gen-panel:hover {
  border-color: rgba(99, 102, 241, 0.3);
}
.gen-panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.gen-panel-num {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px var(--primary-glow);
  flex-shrink: 0;
}
.gen-panel-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}
.gen-panel-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Source Selection Toggle (PDF vs Manual) */
.src-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.src-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--surface-solid);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.src-btn:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
  transform: translateY(-2px);
}
.src-btn.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}
.src-btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.src-btn-text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.src-btn-text span {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.src-btn.active .src-btn-check {
  display: flex !important;
}
.src-btn-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  display: none;
  align-items: center;
  justify-content: center;
}

/* Upload Zone Drop Area */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(99, 102, 241, 0.03);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  transform: scale(1.008);
}
.upload-zone .uz-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 1.6rem;
  color: white;
  box-shadow: 0 8px 20px var(--primary-glow);
}
.upload-zone p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}
.upload-zone strong {
  color: var(--primary);
}

/* Progress Bar */
.progress-wrap {
  margin-top: 18px;
  padding: 16px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.progress-bar {
  width: 100%;
  height: 10px;
  background: var(--border);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 20px;
  transition: width 0.3s ease;
}
.progress-text {
  font-size: 0.84rem;
  color: var(--primary);
  font-weight: 700;
  text-align: center;
}

/* Bloom Taxonomy Grid */
.bloom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.bloom-card {
  background: var(--surface-solid);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.bloom-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  background: var(--surface-hover);
}
.bloom-card.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.25);
}
.bloom-badge {
  font-size: 1.25rem;
  margin-bottom: 4px;
}
.bloom-level {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
}
.bloom-name {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Stepper & Chips */
.jumlah-stepper {
  display: flex;
  align-items: center;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.jumlah-stepper button {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}
.jumlah-stepper button:hover {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}
.jumlah-stepper input {
  width: 50px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  outline: none;
}
.jumlah-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.jumlah-chip {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.jumlah-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.jumlah-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Radiant Generate Button */
.btn-generate-modern {
  width: 100%;
  padding: 16px 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
  border: none;
  color: white;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.45);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.btn-generate-modern:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(99, 102, 241, 0.6);
  filter: brightness(1.1);
}
.btn-generate-modern:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Generated LKPD Review Cards */
.generated-preview-wrap {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.generated-soal-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}
.generated-soal-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
}
.generated-soal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.generated-opsi-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  margin: 14px 0;
}
.generated-opsi-item {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.generated-opsi-item.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  font-weight: 700;
}
.pembahasan-box {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(6, 182, 212, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Modul Table Actions */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
table.custom-modul-table {
  width: 100%;
  border-collapse: collapse;
}
table.custom-modul-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}
table.custom-modul-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-primary);
  vertical-align: middle;
}
table.custom-modul-table tr:hover td {
  background: var(--surface-hover);
}

/* --- Responsive Breakpoints --- */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close-btn {
    display: block;
  }
  .menu-toggle-btn {
    display: flex;
  }
  .main-content {
    margin-left: 0;
  }
  .quiz-body-grid {
    grid-template-columns: 1fr;
  }
  .quiz-nav-drawer {
    position: static;
  }
  .src-toggle {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-container {
    padding: 20px 16px;
  }
  .topbar {
    padding: 0 16px;
  }
  .hero-welcome-card {
    padding: 26px 20px;
  }
  .hero-title {
    font-size: 1.5rem;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .lkpd-card-grid {
    grid-template-columns: 1fr;
  }
  .result-breakdown-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   AI GENERATOR — Step Tabs, PDF Upload, Preview, Print
   ============================================================ */

/* Step Tab Navigation */
.ai-step-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 20px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 6px;
  flex-wrap: wrap;
}

.ai-step-tab {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius-lg);
  transition: all 0.25s;
}

.ai-step-tab.active {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.ai-step-tab:not(.active):hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.ai-step-divider {
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0 4px;
}

/* Step Content */
.ai-step-content {
  display: none;
}
.ai-step-content.active {
  display: block;
  animation: fadeSlideUp 0.35s ease;
}

/* PDF Drop Zone */
.pdf-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: var(--surface);
  position: relative;
}

.pdf-dropzone:hover,
.pdf-dropzone.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.07);
}

.pdf-dropzone i.fa-cloud-arrow-up {
  font-size: 2.8rem;
  color: var(--primary);
  margin-bottom: 16px;
  display: block;
}

.pdf-dropzone p {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.pdf-dropzone span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pdf-dropzone.file-loaded {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.07);
}

.pdf-dropzone.file-loaded i.fa-cloud-arrow-up {
  color: var(--success);
}

/* Progress Bar */
.progress-bar-wrap {
  height: 8px;
  background: var(--surface);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #7c3aed);
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* Source Badge */
.ai-source-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--success);
  font-weight: 600;
}

/* AI Loading Spinner */
.ai-loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spinAi 0.9s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spinAi {
  to { transform: rotate(360deg); }
}

.ai-thinking-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

.ai-thinking-dots span {
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  animation: thinkBounce 1.2s ease-in-out infinite;
}

.ai-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinkBounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40%            { transform: scale(1.2); opacity: 1; }
}

/* Modul List Item */
.modul-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.2s;
  cursor: pointer;
}

.modul-item:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.06);
}

.modul-item.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 0 1px var(--primary);
}

.modul-item-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
}

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

.modul-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modul-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* LKPD Print Preview */
.lkpd-print-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 860px;
  margin: 0 auto;
}

.lkpd-print-header {
  text-align: center;
  border-bottom: 2px solid var(--border);
  padding-bottom: 24px;
  margin-bottom: 28px;
}

.lkpd-print-logo {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.lkpd-print-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.lkpd-print-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.lkpd-print-meta-item {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.lkpd-print-section {
  margin-bottom: 28px;
}

.lkpd-print-section-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lkpd-soal-item {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
}

.lkpd-soal-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.lkpd-soal-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.lkpd-soal-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lkpd-soal-option {
  font-size: 0.85rem;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
}

.lkpd-soal-option.correct {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  font-weight: 600;
}

.lkpd-soal-pembahasan {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.07);
  border-left: 3px solid var(--warning);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* @media print */
@media print {
  .sidebar, .topbar, .ai-step-tabs, .btn, .toast-container,
  #loadingScreen, #loginModal, header, aside { display: none !important; }
  
  .main-content { margin: 0 !important; padding: 0 !important; }
  .lkpd-print-area { 
    border: none !important; 
    border-radius: 0 !important;
    padding: 20px !important;
    background: white !important;
    color: black !important;
  }
  .lkpd-soal-item { background: #f9f9f9 !important; border: 1px solid #ddd !important; }
  .lkpd-print-title, .lkpd-soal-text { color: black !important; }
  .lkpd-soal-option { background: #f5f5f5 !important; color: #333 !important; }
  .lkpd-soal-option.correct { background: #e6f7f0 !important; color: #1a7a54 !important; }
}
