/* ========================================================
   ADMIN CONTROL CENTER - MODERN DESIGN SYSTEM
   Design System: Enterprise Computer-Based Assessment (CBT)
   Institutional Management Console (WCAG AAA Compliance)
   ======================================================== */

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

:root {
  /* Pastel Purple & Pink Design Tokens for Admin - Bimbingan Belajar Kelas Senja */
  --admin-nav-bg: #44246F;
  --admin-nav-border: #5B329B;

  --admin-primary: #7041B8;
  --admin-primary-hover: #5B329B;
  --admin-primary-active: #44246F;

  --admin-accent: #7041B8;
  --admin-accent-hover: #5B329B;
  --admin-accent-subtle: #F5EDFF;
  --admin-accent-border: #EDE1F5;

  --admin-bg: #FFF8FD;
  --admin-card: #FFFFFF;
  --admin-text: #34264B;
  --admin-text-muted: #85758F;
  --admin-text-subtle: #A396AD;

  --admin-border: #EDE1F5;
  --admin-border-light: #F9F5FF;
  --admin-border-hover: #B995EF;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --admin-shadow-sm: 0 1px 3px rgba(112, 65, 184, 0.04);
  --admin-shadow-md: 0 4px 12px rgba(112, 65, 184, 0.06);
  --admin-shadow-lg: 0 12px 32px rgba(112, 65, 184, 0.08);
  --admin-shadow-modal: 0 20px 48px rgba(68, 36, 111, 0.16);
}

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

body.admin-body {
  background-color: var(--admin-bg);
  color: var(--admin-text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================================
   TOPBAR NAVIGATION
   ======================================================== */
.admin-navbar {
  background: var(--admin-nav-bg);
  color: #ffffff;
  padding: 12px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--admin-nav-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-brand h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: #f8fafc;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-brand span {
  font-size: 0.72rem;
  background: rgba(5, 150, 105, 0.15);
  color: #34d399;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(5, 150, 105, 0.3);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-badge {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-badge strong {
  color: #38bdf8;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-logout:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

/* ========================================================
   NAVIGATION TABS
   ======================================================== */
.admin-nav-tabs {
  background: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  padding: 0 28px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab-btn {
  padding: 14px 20px;
  border: none;
  background: transparent;
  color: var(--admin-text-subtle);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--admin-text);
  background: #f8fafc;
}

.tab-btn.active {
  color: var(--admin-primary);
  border-bottom-color: var(--admin-accent);
  background: #ffffff;
  font-weight: 700;
}

/* ========================================================
   MAIN CONTENT CONTAINER
   ======================================================== */
.admin-container {
  padding: 28px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.tab-content {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.tab-content.active {
  display: block;
}

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

/* ========================================================
   STATISTICS & METRIC CARDS
   ======================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--admin-shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #cbd5e1;
}

.stat-card:nth-child(1)::before { background: #3b82f6; }
.stat-card:nth-child(2)::before { background: #10b981; }
.stat-card:nth-child(3)::before { background: #8b5cf6; }
.stat-card:nth-child(4)::before { background: #f59e0b; }

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

.stat-title {
  color: var(--admin-text-subtle);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: block;
}

.stat-value {
  color: var(--admin-text);
  font-size: 2.1rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-sub {
  color: var(--admin-text-muted);
  font-size: 0.8rem;
  margin-top: 8px;
  display: block;
}

.stat-sub span {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--admin-accent);
}

/* ========================================================
   SECTION HEADERS & ACTIONS
   ======================================================== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 14px;
}

.section-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--admin-text);
  letter-spacing: -0.02em;
}

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

/* ========================================================
   BUTTONS & CONTROLS
   ======================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--admin-primary);
  color: #ffffff;
  border-color: var(--admin-primary);
}

.btn-primary:hover {
  background: var(--admin-primary-hover);
  border-color: var(--admin-primary-hover);
}

.btn-accent {
  background: var(--admin-accent);
  color: #ffffff;
  border-color: var(--admin-accent);
}

.btn-accent:hover {
  background: var(--admin-accent-hover);
  border-color: var(--admin-accent-hover);
}

.btn-outline {
  background: #ffffff;
  color: var(--admin-text);
  border-color: var(--admin-border);
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: var(--admin-border-hover);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--admin-text);
  border-color: #e2e8f0;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

/* Action Buttons inside Tables */
.admin-table .btn-action {
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 4px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-manage {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.btn-manage:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.btn-delete {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.btn-delete:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.btn-edit {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #6d28d9;
}
.btn-edit:hover {
  background: #ede9fe;
  border-color: #c4b5fd;
}

/* Export Dropdown Menu */
.export-dropdown {
  position: relative;
  display: inline-block;
}

.export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #ffffff;
  border: 1.5px solid var(--admin-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(112, 65, 184, 0.14);
  min-width: 220px;
  z-index: 1000;
  padding: 6px;
  display: none;
}

.export-menu.show {
  display: block;
  animation: fadeInDown 0.15s ease-out;
}

.export-menu-item {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: none;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--admin-text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.export-menu-item:hover {
  background: #f5f3ff;
  color: var(--admin-primary);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   TABLES & DATA CARDS
   ======================================================== */
.table-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  box-shadow: var(--admin-shadow-sm);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.admin-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}

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

.admin-table tbody tr {
  transition: background-color 0.15s ease;
}

.admin-table tbody tr:hover {
  background-color: #f8fafc;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* Table code identifiers */
.admin-table code, 
.admin-table .code-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: #334155;
  border: 1px solid #e2e8f0;
}

/* Status Badges */
.badge-status {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.02em;
}

.badge-active {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-inactive {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* ========================================================
   FORMS & INPUT CONTROLS
   ======================================================== */
.input-text,
.select-dropdown,
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--admin-text);
  background-color: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  box-sizing: border-box;
}

select.select-dropdown {
  max-width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
}

.input-text:focus,
.select-dropdown:focus,
.form-control:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--admin-text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

/* ========================================================
   MODALS & DIALOGS
   ======================================================== */
body.modal-open {
  overflow: hidden !important;
}

.admin-modal {
  display: none;
  position: fixed;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
  overscroll-behavior: contain;
}

.admin-modal-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--admin-shadow-modal);
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.admin-modal-card.modal-lg {
  max-width: 960px;
}

.admin-modal-card form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

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

.admin-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  flex-shrink: 0;
}

.admin-modal-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--admin-text);
  letter-spacing: -0.01em;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--admin-text-subtle);
  line-height: 1;
  padding: 4px;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

.admin-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.admin-modal-body::-webkit-scrollbar {
  width: 7px;
}
.admin-modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
.admin-modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.admin-modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.admin-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
  flex-shrink: 0;
}

/* ========================================================
   AI GENERATOR DROPZONE & REVIEW
   ======================================================== */
.file-dropzone {
  border: 2px dashed var(--admin-border);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.file-dropzone:hover,
.file-dropzone.dragover {
  border-color: var(--admin-accent);
  background: var(--admin-accent-subtle);
}

.file-dropzone-icon {
  margin-bottom: 10px;
  color: var(--admin-text-subtle);
  display: flex;
  justify-content: center;
}

.file-info-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e2e8f0;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-top: 10px;
}

/* AI Review Question Cards */
.ai-review-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--admin-shadow-sm);
  transition: border-color 0.15s ease;
}

.ai-review-card:hover {
  border-color: var(--admin-border-hover);
}

.ai-review-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--admin-border-light);
}

.ai-type-pill {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-type-mcq { 
  background: #eff6ff; 
  color: #1e40af; 
  border: 1px solid #bfdbfe; 
}
.ai-type-checkbox { 
  background: #fffbeb; 
  color: #92400e; 
  border: 1px solid #fcd34d; 
}
.ai-type-tf { 
  background: #ecfdf5; 
  color: #065f46; 
  border: 1px solid #a7f3d0; 
}

.options-builder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.tf-builder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  background: #f8fafc;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-border-light);
}

/* ========================================================
   ADMIN LOGIN CARD
   ======================================================== */
.admin-login-wrapper {
  max-width: 440px;
  width: 90%;
  margin: 70px auto;
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--admin-shadow-lg);
}

.admin-login-header {
  text-align: center;
  margin-bottom: 24px;
}

.admin-login-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--admin-text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.admin-login-header p {
  font-size: 0.85rem;
  color: var(--admin-text-subtle);
  line-height: 1.5;
}

/* ========================================================
   UTILITIES & FEEDBACK
   ======================================================== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(15, 23, 42, 0.2);
  border-radius: 50%;
  border-top-color: var(--admin-primary);
  animation: spin 0.7s linear infinite;
}

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

@media (max-width: 768px) {
  .admin-navbar {
    padding: 12px 16px;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  .admin-container {
    padding: 16px;
  }
  .admin-nav-tabs {
    padding: 0 16px;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========================================================
   ENHANCED QUESTION BUILDER: TIERS & ADD IMAGE STYLES
   ======================================================== */
.btn-pill-sm {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-pill-sm:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.btn-pill-sm.active {
  background: var(--admin-primary);
  border-color: var(--admin-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(112, 65, 184, 0.25);
}

.option-row-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 8px;
  transition: border-color 0.15s ease;
}

.option-row-card:focus-within {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 2px rgba(112, 65, 184, 0.12);
}

.opt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--admin-accent-subtle);
  color: var(--admin-primary);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  border: 1px solid var(--admin-accent-border);
}

.btn-opt-img {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-opt-img:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: var(--admin-primary);
}

.opt-img-thumb-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.opt-img-thumb {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 4px;
  border: 1.5px solid var(--admin-primary);
}

.opt-img-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: #ef4444;
  color: #ffffff;
  border-radius: 50%;
  border: none;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ========================================================
   STUDENT SEKAT (PARTITION DIVIDERS & FILTER PILLS)
   ======================================================== */
.student-filter-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--admin-border);
  background: #ffffff;
  color: var(--admin-text-main);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-filter-pill:hover {
  border-color: var(--admin-primary);
  background: var(--admin-accent-subtle);
  color: var(--admin-primary);
}

.btn-filter-pill.active {
  background: var(--admin-primary);
  color: #ffffff;
  border-color: var(--admin-primary);
  box-shadow: 0 1px 3px rgba(91, 33, 182, 0.2);
}

.btn-filter-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.pill-count {
  background: #f1f5f9;
  color: #475569;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.table-section-divider td {
  padding: 10px 0 6px 0 !important;
  background: transparent !important;
  border: none !important;
}

.student-section-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.student-section-banner.banner-ks {
  background: var(--admin-accent-subtle);
  border-left: 4px solid var(--admin-primary);
  color: var(--admin-primary-active);
}

.student-section-banner.banner-manual {
  background: #fffbeb;
  border-left: 4px solid #d97706;
  color: #92400e;
}

.badge-source {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.02em;
}

.badge-source.source-ks {
  background: var(--admin-accent-subtle);
  color: var(--admin-primary);
  border: 1px solid var(--admin-accent-border);
}

.badge-source.source-manual {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ========================================================
   COMPACT & ELEGANT BANK SOAL TOOLBAR (ALL DIMENSIONS)
   ======================================================== */
.bank-soal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.bank-soal-title-wrap {
  flex: 0 0 auto;
}

.bank-soal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.package-filter-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
}

.package-filter-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Custom Package Dropdown (Styled like Unduh button) */
.package-dropdown {
  position: relative;
  display: inline-block;
  min-width: 0;
  max-width: 360px;
}

.btn-package-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 6px 14px;
  background: #ffffff;
  border: 1.5px solid var(--admin-border);
  border-radius: var(--radius-sm);
  color: var(--admin-text);
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  width: 280px;
  max-width: 340px;
  min-width: 200px;
  transition: all 0.15s ease;
  box-sizing: border-box;
  text-align: left;
}

.btn-package-trigger:hover {
  border-color: var(--admin-primary);
  background: var(--admin-accent-subtle);
  color: var(--admin-primary);
}

.package-btn-label {
  flex: 1 1 auto;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.btn-package-trigger .chevron-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--admin-text-subtle);
}

.package-dropdown.open .chevron-icon {
  transform: rotate(180deg);
}

.package-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--admin-shadow-modal);
  min-width: 280px;
  max-width: min(440px, calc(100vw - 32px));
  width: max-content;
  max-height: 380px;
  z-index: 1000;
  padding: 8px;
  display: none;
  box-sizing: border-box;
}

.package-menu.show {
  display: flex;
  flex-direction: column;
  animation: fadeInDown 0.15s ease-out;
}

.package-menu-search-wrap {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--admin-border);
  margin-bottom: 6px;
}

.package-search-input {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.package-search-input:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 2px rgba(91, 33, 182, 0.14);
}

.package-items-list {
  overflow-y: auto;
  max-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.package-menu-item {
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--admin-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.package-menu-item:hover {
  background: var(--admin-accent-subtle);
  color: var(--admin-primary);
}

.package-menu-item.active {
  background: var(--admin-accent-subtle);
  color: var(--admin-primary);
  font-weight: 700;
}

.package-menu-item .pkg-item-title {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.package-menu-item .pkg-item-badge {
  font-size: 0.7rem;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 7px;
  border-radius: 9999px;
  font-weight: 700;
  flex-shrink: 0;
}

.package-menu-item.active .pkg-item-badge {
  background: var(--admin-primary);
  color: #ffffff;
}

.package-filter-select {
  width: 280px;
  max-width: 340px;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 6px 12px;
  font-size: 0.85rem;
  border: 1.5px solid var(--admin-border);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: var(--admin-text);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
  flex: 0 1 auto;
  line-height: normal;
}

.package-filter-select:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(112, 65, 184, 0.15);
}

.bank-soal-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.bank-soal-btn-group .btn {
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  box-sizing: border-box;
  flex: 0 0 auto;
}

/* Modal Adaptive Form Grids */
.modal-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 16px;
  margin-bottom: 16px;
}

.ai-pkg-grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.ai-pkg-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 12px;
}

/* Option Row Card responsiveness inside Question Builder */
.option-row-card {
  box-sizing: border-box;
  max-width: 100%;
}

.option-row-card .input-text {
  min-width: 0;
}

/* ========================================================
   COMPREHENSIVE MULTI-DIMENSION RESPONSIVE RULES
   ======================================================== */
@media (max-width: 1100px) {
  .bank-soal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .bank-soal-actions {
    justify-content: flex-start;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .admin-navbar {
    padding: 12px 16px;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  .admin-user-info {
    width: 100%;
    justify-content: space-between;
  }
  .admin-container {
    padding: 14px 12px;
  }
  .admin-nav-tabs {
    padding: 0 12px;
  }
  .tab-btn {
    padding: 12px 14px;
    font-size: 0.82rem;
  }
  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .header-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .header-actions .btn {
    flex: 0 1 auto;
    font-size: 0.82rem;
  }
  .package-filter-box {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }
  .package-dropdown {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  .btn-package-trigger {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    box-sizing: border-box;
  }
  .package-menu {
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
    max-width: calc(100vw - 28px);
  }
  .package-filter-select {
    flex: 1 1 auto;
    max-width: 100%;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
  }
  .bank-soal-btn-group {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .bank-soal-btn-group .btn {
    flex: 1 1 auto;
    font-size: 0.8rem;
    padding: 6px 12px;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    box-sizing: border-box;
  }
  .modal-top-grid,
  .ai-pkg-grid-3,
  .ai-pkg-grid-2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .admin-modal-card {
    margin: 10px;
    max-height: 94vh;
    border-radius: var(--radius-md);
  }
  .admin-modal-header {
    padding: 14px 18px;
  }
  .admin-modal-body {
    padding: 16px;
  }
  .admin-modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .admin-modal-footer .btn {
    flex: 1 1 auto;
  }
  .option-row-card {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
  }
  .option-row-card .input-text {
    flex: 1 1 calc(100% - 50px);
    order: 2;
  }
  .btn-opt-img {
    order: 3;
    margin-left: auto;
  }
  .opt-img-thumb-wrap {
    order: 4;
  }
}

@media (max-width: 480px) {
  .package-filter-box {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }
  .package-filter-label {
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .package-dropdown {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  .btn-package-trigger {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 6px 10px;
    font-size: 0.8rem;
    box-sizing: border-box;
  }
  .package-menu {
    left: 0;
    width: 100%;
    min-width: 0;
    max-width: calc(100vw - 24px);
  }
  .package-filter-select {
    flex: 1 1 auto;
    max-width: 100%;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
  }
  .bank-soal-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }
  .bank-soal-btn-group .btn {
    flex: 1 1 calc(50% - 6px);
    font-size: 0.78rem;
    padding: 6px 10px;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    box-sizing: border-box;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .stat-card {
    padding: 16px 18px;
  }
  .stat-value {
    font-size: 1.75rem;
  }
}

/* ========================================================
   STUDENT CLASS FILTER & QUICK TOGGLE TOOLBAR
   ======================================================== */
.student-class-filter-container {
  background: #ffffff;
  border: 1.5px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(112, 65, 184, 0.04);
}

.class-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.class-filter-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--admin-text);
}

.class-filter-title-wrap svg {
  color: var(--admin-primary);
}

.class-filter-quick-btns {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.class-selected-indicator {
  font-size: 0.8rem;
  color: var(--admin-text-subtle);
  margin-right: 4px;
}

.class-selected-indicator strong {
  color: var(--admin-primary);
  font-weight: 800;
}

.btn-class-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-class-activate {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.btn-class-activate:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.btn-class-deactivate {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.btn-class-deactivate:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.class-pills-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-class-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  user-select: none;
}

.btn-class-pill:hover {
  border-color: var(--admin-primary);
  background: #faf5ff;
  color: var(--admin-primary);
}

.btn-class-pill.active {
  background: var(--admin-primary);
  color: #ffffff;
  border-color: var(--admin-primary);
  box-shadow: 0 2px 6px rgba(112, 65, 184, 0.22);
}

.btn-class-pill .class-status-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 9999px;
  line-height: 1;
}

.btn-class-pill .class-status-badge.badge-active {
  background: #dcfce7;
  color: #15803d;
}

.btn-class-pill.active .class-status-badge.badge-active {
  background: #22c55e;
  color: #ffffff;
}

.btn-class-pill .class-status-badge.badge-inactive {
  background: #f1f5f9;
  color: #94a3b8;
}

.btn-class-pill.active .class-status-badge.badge-inactive {
  background: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* Clickable Status Toggle in Student Table */
.btn-status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  user-select: none;
}

.btn-status-toggle.is-active {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.btn-status-toggle.is-active:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}

.btn-status-toggle.is-inactive {
  background: #f8fafc;
  color: #64748b;
  border-color: #cbd5e1;
}

.btn-status-toggle.is-inactive:hover {
  background: #f1f5f9;
  color: #334155;
  border-color: #94a3b8;
  box-shadow: 0 2px 6px rgba(100, 116, 139, 0.2);
}

.btn-status-toggle .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.btn-status-toggle.is-active .status-dot {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.btn-status-toggle.is-inactive .status-dot {
  background: #94a3b8;
}
