/* ============================================================================
   TYPECODE - ADMIN VIEW: EXAM MANAGEMENT (UTS & UAS)
   Fully Theme-Adaptive · CSS Custom Properties from variables.css
   ============================================================================ */

/* ============================================================================
   A. Module Header & Subnav Pill Tabs
   ============================================================================ */
.exam-subnav-pills {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated);
  padding: 4px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-strong);
}

.exam-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid transparent;
  background: transparent !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-ui);
  font-size: var(--font-size-sm, 13px);
  font-weight: var(--font-weight-medium, 500);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.exam-pill-btn:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}

.exam-pill-btn.active {
  background: var(--btn-bg) !important;
  color: var(--btn-color) !important;
  border-color: var(--btn-bg) !important;
  font-weight: var(--font-weight-semibold, 600);
}

/* ============================================================================
   B. Stat Overview Cards (Grading subtab)
   ============================================================================ */
.exam-stat-card {
  padding: 14px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exam-stat-label {
  font-size: var(--font-size-xs, 12px);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  font-weight: var(--font-weight-medium, 500);
}

.exam-stat-value {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold, 700);
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1;
}

.exam-stat-value.warning  { color: var(--accent-amber); }
.exam-stat-value.info     { color: var(--accent-blue, #7EAFBA); }
.exam-stat-value.success  { color: var(--accent-emerald); }
.exam-stat-value.danger   { color: var(--danger); }

.exam-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

/* ============================================================================
   C. Grading: Student Header Card
   ============================================================================ */
.exam-grading-student-header {
  padding: 14px 18px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-strong);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.exam-grading-student-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: var(--font-weight-bold, 700);
  color: var(--text-primary);
}

.exam-grading-student-meta {
  font-size: var(--font-size-xs, 12px);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.exam-grading-final-score-wrap {
  text-align: right;
}

.exam-grading-final-score-label {
  font-size: var(--font-size-xs, 12px);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.exam-grading-final-score-value {
  font-size: 1.6rem;
  font-weight: var(--font-weight-extrabold, 800);
  color: var(--brand-indigo);
  font-family: var(--font-mono);
  line-height: 1;
}

/* ============================================================================
   D. Grading: Per-Question Card (Enhanced Modern Layout)
   ============================================================================ */
.exam-grade-card {
  padding: 22px 24px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border-strong, var(--border-subtle));
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08));
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  transition: border-color var(--transition-fast, 0.2s);
}

.exam-grade-card-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.exam-grade-card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.exam-grade-card-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.exam-pill-qnum {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
}

.exam-pill-stage {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.exam-pill-stage.stage-3-pill {
  color: var(--brand-indigo, #6366f1);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.exam-pill-stage.stage-4-pill {
  color: var(--accent-amber, #f59e0b);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.exam-grade-card-title {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-weight: var(--font-weight-bold, 700);
  color: var(--text-primary);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

/* Kotak Instruksi & Deskripsi Soal yang Elegan (Box Polos Minimalis) */
.exam-grade-desc-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 10px);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.desc-box-header {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 7px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.desc-box-content {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* Header Komparasi Kode */
.exam-compare-header {
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.exam-compare-header.student {
  color: var(--brand-indigo, #6366f1);
}

.exam-compare-header.expected {
  color: var(--accent-emerald, #10b981);
}

/* Code comparison grid - dinamis: kolom menyusut tanpa mendesak kode,
   lalu menumpuk otomatis di layar sempit agar tidak terpotong. */
.exam-code-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
  min-width: 0;
}

.exam-code-compare-grid > * {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1100px) {
  .exam-code-compare-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .exam-code-compare-grid {
    grid-template-columns: 1fr;
  }
}

.exam-code-compare-label {
  font-size: var(--font-size-xs, 12px);
  font-weight: var(--font-weight-semibold, 600);
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
}

/* ============================================================================
   Code & Terminal Display for Student Grading Review (VS Code Style)
   ============================================================================ */

/* 1. Global Reset untuk Tag <code> di dalam seluruh area review kode & terminal (HILANGKAN FIELD KOTAK) */
.exam-code-pre code,
.exam-output-pre code,
.exam-review-editor code,
.exam-review-terminal code,
.exam-review-code code,
.exam-t3-keys-container code {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  color: inherit !important;
  font-size: inherit !important;
  font-family: inherit !important;
  line-height: inherit !important;
  box-shadow: none !important;
  display: inline !important;
  white-space: inherit !important;
}

/* 2. Komponen Editor Review Ala VS Code */
.exam-review-editor {
  border: 1px solid var(--border-editor, var(--border-subtle));
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  background: var(--bg-editor, #1e1e2e);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.12));
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
}

.exam-review-editor-top {
  min-height: 38px;
  height: auto;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-editor, var(--border-subtle));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 6px;
  padding: 6px 14px;
  user-select: none;
}

.exam-review-editor-tab {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-mono, monospace);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 7px;
}

.exam-review-editor-tab i {
  color: var(--brand-indigo, #6366f1);
  font-size: 14px;
}

.exam-review-editor-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-family: var(--font-ui, sans-serif);
}

.exam-review-editor-body {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  overflow: auto;
  background: var(--bg-editor, #181824);
  min-height: 140px;
  max-height: 420px;
  min-width: 0;
}

.exam-review-gutter {
  width: 50px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-editor, var(--border-subtle));
  color: var(--text-tertiary);
  font: 14px/24px var(--font-mono, monospace);
  line-height: 24px;
  padding: 12px 10px 12px 0;
  text-align: right;
  user-select: none;
  flex-shrink: 0;
  overflow: hidden;
  box-sizing: border-box;
  position: sticky;
  left: 0;
  z-index: 2;
  align-self: flex-start;
  min-height: 100%;
}

.exam-review-gutter div {
  height: 24px;
  line-height: 24px;
  padding-right: 4px;
}

.exam-review-code {
  margin: 0 !important;
  padding: 12px 16px !important;
  font-family: var(--font-mono, monospace) !important;
  font-size: 14px !important;
  line-height: 24px !important;
  color: var(--text-primary) !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  white-space: pre !important;
  tab-size: 4 !important;
  -moz-tab-size: 4 !important;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.exam-review-code::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.exam-review-editor-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.exam-review-code::-webkit-scrollbar-track,
.exam-review-editor-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
.exam-review-code::-webkit-scrollbar-thumb,
.exam-review-editor-body::-webkit-scrollbar-thumb {
  background: var(--border-strong, #64748b);
  border-radius: 4px;
}

/* Syntax Highlight Colors in Review Code */
.exam-review-code .keyword { color: #60a5fa !important; font-weight: 600 !important; }
.exam-review-code .type { color: #7dd3fc !important; }
.exam-review-code .number { color: #f59e0b !important; }
.exam-review-code .string { color: #86efac !important; }
.exam-review-code .comment { color: #8fae7f !important; font-style: italic !important; }
.exam-review-code .func { color: #fbbf24 !important; font-weight: 600 !important; }
.exam-review-code .preproc { color: #c084fc !important; font-weight: 600 !important; }
.exam-review-code .blank-slot {
  background: rgba(212, 167, 44, 0.25) !important;
  color: #d97706 !important;
  outline: 1px dashed #d97706 !important;
  border-radius: 2px !important;
  padding: 0 2px !important;
  font-weight: 600 !important;
}

[data-theme="light"] .exam-review-code .keyword,
[data-theme="minimal"] .exam-review-code .keyword,
[data-theme="chatgpt"] .exam-review-code .keyword,
[data-theme="sakura-light"] .exam-review-code .keyword {
  color: var(--brand-indigo, #1d4e89) !important;
}
[data-theme="light"] .exam-review-code .type,
[data-theme="minimal"] .exam-review-code .type,
[data-theme="chatgpt"] .exam-review-code .type,
[data-theme="sakura-light"] .exam-review-code .type {
  color: #1d6f8a !important;
}
[data-theme="light"] .exam-review-code .number,
[data-theme="minimal"] .exam-review-code .number,
[data-theme="chatgpt"] .exam-review-code .number,
[data-theme="sakura-light"] .exam-review-code .number {
  color: #1e7a45 !important;
}
[data-theme="light"] .exam-review-code .string,
[data-theme="minimal"] .exam-review-code .string,
[data-theme="chatgpt"] .exam-review-code .string,
[data-theme="sakura-light"] .exam-review-code .string {
  color: #b03a2e !important;
}
[data-theme="light"] .exam-review-code .comment,
[data-theme="minimal"] .exam-review-code .comment,
[data-theme="chatgpt"] .exam-review-code .comment,
[data-theme="sakura-light"] .exam-review-code .comment {
  color: #57524a !important;
  font-style: italic !important;
}
[data-theme="light"] .exam-review-code .func,
[data-theme="minimal"] .exam-review-code .func,
[data-theme="chatgpt"] .exam-review-code .func,
[data-theme="sakura-light"] .exam-review-code .func {
  color: #94691f !important;
}
[data-theme="light"] .exam-review-code .preproc,
[data-theme="minimal"] .exam-review-code .preproc,
[data-theme="chatgpt"] .exam-review-code .preproc,
[data-theme="sakura-light"] .exam-review-code .preproc {
  color: #6b21a8 !important;
}

/* 3. Komponen Terminal Review Ala VS Code */
.exam-review-terminal {
  border: 1px solid var(--border-editor, var(--border-subtle));
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  background: var(--bg-editor, #14141e);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.12));
}

.exam-review-terminal-top {
  height: 34px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-editor, var(--border-subtle));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.exam-review-terminal-top.student {
  color: var(--accent-amber);
}

.exam-review-terminal-top.expected {
  color: var(--accent-emerald);
}

.exam-review-terminal-badge {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-weight: 600;
  font-family: var(--font-ui, sans-serif);
}

.exam-review-terminal-content {
  margin: 0 !important;
  padding: 12px 14px !important;
  font-family: var(--font-mono, monospace) !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  color: var(--accent-emerald, #34d399) !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  white-space: pre-wrap !important;
  word-break: break-word;
  max-height: 240px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* 4. Tahap 3 Kunci Jawaban Slot Pills */
.exam-t3-keys-container {
  background: var(--bg-editor, #181824);
  border: 1px solid var(--border-editor, var(--border-subtle));
  border-radius: var(--radius-md, 8px);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.12));
}

.exam-t3-keys-header {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.exam-t3-keys-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exam-t3-key-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono, monospace);
  font-size: 13px;
}

.exam-t3-key-chip .chip-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-amber);
}

.exam-t3-key-chip .chip-val {
  font-weight: 700;
  color: var(--accent-emerald);
}

/* Backward compatibility classes (clean & borderless) */
.exam-code-pre {
  font-size: 14px;
  margin: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-editor);
  border: 1px solid var(--border-editor);
  border-radius: var(--radius-md, 8px);
  padding: 12px 14px;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.exam-output-pre {
  font-size: 15px !important;
  line-height: 1.65;
  margin: 0;
  background: var(--bg-editor);
  border: 1px solid var(--border-editor);
  border-radius: var(--radius-md, 8px);
  padding: 12px 14px;
  font-family: var(--font-mono);
  color: var(--accent-emerald);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

/* Output labels for grading - using design tokens */
.exam-output-label {
  font-size: var(--font-size-sm, 13px);
  font-weight: var(--font-weight-bold, 700);
  display: block;
  margin-bottom: 6px;
}

.exam-output-label.student { color: var(--accent-amber); }
.exam-output-label.expected { color: var(--accent-emerald); }

/* Rubrik form */
.exam-rubric-form {
  background: var(--bg-surface);
  padding: 14px 16px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-subtle);
  margin-top: 14px;
}

.exam-rubric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}

.exam-rubric-item label {
  font-size: var(--font-size-xs, 12px);
  font-weight: var(--font-weight-semibold, 600);
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
}

.exam-rubric-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exam-rubric-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--brand-indigo);
}

.exam-rubric-slider-val {
  font-family: var(--font-mono);
  font-weight: var(--font-weight-bold, 700);
  color: var(--text-primary);
  min-width: 24px;
  text-align: right;
}

.exam-rubric-notes-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.exam-rubric-notes-row .admin-input {
  flex: 1;
  font-size: var(--font-size-sm, 13px);
}

/* Output comparison section divider */
.exam-output-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

/* ============================================================================
   E. Session table: violation count coloring
   ============================================================================ */
.exam-violation-count {
  color: var(--text-tertiary);
}

.exam-violation-count.has-violations {
  color: var(--danger);
}

/* ============================================================================
   F. Session/question toolbar section header
   ============================================================================ */
.exam-subtab-header {
  margin: 0 0 2px;
  font-size: var(--font-size-md, 14px);
  font-weight: var(--font-weight-semibold, 600);
  color: var(--text-primary);
}

.exam-subtab-sub {
  margin: 0;
  font-size: var(--font-size-xs, 12px);
  color: var(--text-secondary);
}

/* ============================================================================
   G. Theme-Adaptive Badges & Tags System
   ============================================================================ */
.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm, 6px);
  font-size: 11px;
  font-weight: var(--font-weight-semibold, 600);
  font-family: var(--font-ui);
  line-height: 1.35;
  white-space: nowrap;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.badge-tag.color-blue,
.badge-tag.badge-info {
  background: rgba(126, 175, 186, 0.12);
  border-color: rgba(126, 175, 186, 0.28);
  color: var(--accent-blue, #7EAFBA) !important;
}

.badge-tag.color-amber,
.badge-tag.badge-warning {
  background: rgba(230, 172, 75, 0.12);
  border-color: rgba(230, 172, 75, 0.28);
  color: var(--accent-amber, #E6AC4B) !important;
}

.badge-tag.color-emerald,
.badge-tag.badge-success {
  background: rgba(94, 184, 134, 0.12);
  border-color: rgba(94, 184, 134, 0.28);
  color: var(--accent-emerald, #5EB886) !important;
}

.badge-tag.badge-danger {
  background: rgba(224, 90, 71, 0.12);
  border-color: rgba(224, 90, 71, 0.28);
  color: var(--color-danger, #E05A47) !important;
}

.badge-tag.badge-secondary {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-tertiary) !important;
}

/* Standalone badges compatibility */
.badge-success { color: var(--accent-emerald, #5EB886) !important; }
.badge-warning { color: var(--accent-amber, #E6AC4B) !important; }
.badge-danger  { color: var(--color-danger, #E05A47) !important; }
.badge-info    { color: var(--accent-blue, #7EAFBA) !important; }
.badge-secondary { color: var(--text-tertiary) !important; }

/* ============================================================================
   H. Theme-Adaptive Color & Font Utility Helpers
   ============================================================================ */
.color-blue   { color: var(--accent-blue, #7EAFBA) !important; }
.color-amber  { color: var(--accent-amber, #E6AC4B) !important; }
.color-emerald{ color: var(--accent-emerald, #5EB886) !important; }
.text-danger  { color: var(--color-danger, #E05A47) !important; }
.font-bold    { font-weight: var(--font-weight-bold, 700) !important; }

/* ============================================================================
   I. Form Controls: .admin-input & .admin-select
   ============================================================================ */
.admin-input {
  box-sizing: border-box;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: normal;
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.admin-input:focus {
  border-color: var(--brand-indigo);
  box-shadow: 0 0 0 3px var(--brand-indigo-glow);
  background-color: var(--bg-surface);
}

textarea.admin-input {
  height: auto;
  min-height: 84px;
  padding: 10px 13px;
  line-height: 1.5;
  resize: vertical;
}

select.admin-input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23ABA396' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  padding-right: 36px !important;
}

[data-theme="light"] select.admin-input,
[data-theme="minimal"] select.admin-input,
[data-theme="chatgpt"] select.admin-input,
[data-theme="sakura-light"] select.admin-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%235C554B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}

/* ============================================================================
   J. Segmented Toggle Group (.seg-btn-group) & Action Buttons
   ============================================================================ */
.seg-btn-group {
  display: inline-flex;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 6px);
  padding: 3px;
  gap: 4px;
  align-items: center;
}

.btn-toggle-publish {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 4px 10px !important;
  height: 28px !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-sm, 6px) !important;
  color: var(--text-secondary) !important;
  font-size: 11.5px !important;
  font-weight: var(--font-weight-medium, 500);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.btn-toggle-publish:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-strong) !important;
}

/* ============================================================================
   K. Full Content Form Page Layout (Tambah / Edit Soal Ujian)
   ============================================================================ */
.exam-form-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeIn 0.18s ease-out;
}

.exam-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
}

.exam-form-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.exam-form-header-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.exam-form-header-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.exam-form-header-title p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.exam-form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.exam-form-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.exam-form-card-head i {
  font-size: 16px;
  color: var(--accent-blue, #7EAFBA);
}

.exam-form-card-head strong {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.exam-form-card-head small {
  font-size: 12px;
  color: var(--text-tertiary);
  display: block;
  margin-top: 2px;
}

.exam-form-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.exam-form-side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
}

@media (max-width: 960px) {
  .exam-form-side-by-side {
    grid-template-columns: 1fr;
  }
}

.exam-code-editor-textarea {
  font-family: var(--font-mono) !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  tab-size: 4 !important;
  background: var(--bg-editor) !important;
  border: 1px solid var(--border-editor) !important;
  border-radius: var(--radius-sm, 6px) !important;
  padding: 12px 14px !important;
  color: var(--text-primary) !important;
  min-height: 220px;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}

.exam-code-editor-textarea:focus {
  border-color: var(--brand-indigo) !important;
  box-shadow: 0 0 0 3px var(--brand-indigo-glow) !important;
}

.exam-form-actions-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
}

/* ============================================================================
   L. Full-Page Grading Panel  (#modal-exam-grading)
   Replaces the old modal-overlay/modal-card pattern.
   Sits inside .admin-view-container (or .view-panel) and takes over the full
   visible admin area with a sticky header + scrollable content body.
   ============================================================================ */
.exam-grading-panel {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.18s ease-out;
}

.exam-grading-panel.hidden {
  display: none !important;
}

/* Sticky panel header - mirrors exam workspace header aesthetic */
.exam-grading-panel-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: var(--shadow-nav);
  flex-shrink: 0;
}

.exam-grading-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: var(--font-weight-bold, 700);
  font-size: 1.05rem;
  color: var(--text-primary);
}

.exam-grading-panel-title i {
  color: var(--brand-indigo);
  font-size: 1rem;
}

/* Scrollable content body */
.exam-grading-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  background: var(--bg-base);
}

.exam-grading-panel-body::-webkit-scrollbar {
  width: 6px;
}
.exam-grading-panel-body::-webkit-scrollbar-track {
  background: transparent;
}
.exam-grading-panel-body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

/* When the grading panel is open, lock body scroll */
body:has(#modal-exam-grading:not(.hidden)) {
  overflow: hidden;
}

/* ============================================================================
   Markdown Prose Styling for Admin Bank Soal & Review Panel
   ============================================================================ */
.md-prose {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.65;
  word-break: break-word;
}

.md-prose .md-p {
  margin: 0 0 8px 0;
  line-height: 1.65;
}

.md-prose .md-p:last-child {
  margin-bottom: 0;
}

.md-prose .md-heading {
  margin: 14px 0 6px 0;
  font-weight: var(--font-weight-semibold, 600);
  color: var(--text-primary);
  line-height: 1.35;
}

.md-prose .md-heading:first-child {
  margin-top: 0;
}

.md-prose .md-h1 { font-size: 1.15rem; }
.md-prose .md-h2 { font-size: 1.05rem; }
.md-prose .md-h3 { font-size: 0.98rem; }
.md-prose .md-h4 { font-size: 0.92rem; }
.md-prose .md-h5 { font-size: 0.86rem; }
.md-prose .md-h6 { font-size: 0.82rem; }

.md-prose .md-list {
  margin: 4px 0 10px 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.md-prose .md-list li {
  line-height: 1.55;
  color: var(--text-secondary);
}

.md-prose .md-inline-code {
  font-family: var(--font-code, monospace);
  background: var(--bg-surface-elevated, var(--bg-surface));
  border: 1px solid var(--border-subtle);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--accent-emerald, #10b981);
}

.md-prose .md-code-wrap {
  margin: 10px 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  background: var(--bg-editor, var(--bg-surface));
  overflow: hidden;
}

.md-prose .md-code-lang {
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-weight: 600;
}

.md-prose .md-code-block {
  margin: 0;
  padding: 8px 12px;
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-primary);
  overflow-x: auto;
  white-space: pre;
}

.md-prose .md-blockquote {
  margin: 10px 0;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  color: var(--text-secondary);
}

.md-prose .md-blockquote p {
  margin: 0;
  line-height: 1.55;
}

.md-prose .md-table-wrap {
  margin: 10px 0;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
}

.md-prose .md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.md-prose .md-table th {
  padding: 8px 10px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
  color: var(--text-primary);
}

.md-prose .md-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.md-prose .md-table tr:last-child td {
  border-bottom: none;
}

.md-prose .md-hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 14px 0;
}

.md-prose .md-link {
  color: var(--brand-indigo, #6366f1);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-md-tab:hover {
  color: var(--text-primary) !important;
}

/* ============================================================================
   Bulk Import Soal Ujian (AI / Markdown File)
   ============================================================================ */
.exam-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md, 8px);
  padding: 28px 16px;
  text-align: center;
  background: var(--bg-surface);
  transition: border-color var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
}

.exam-dropzone:hover,
.exam-dropzone.dragover {
  border-color: var(--brand-indigo, #6366f1);
  background: var(--bg-elevated);
}

.badge-status-valid {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald, #10b981);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status-warning {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber, #f59e0b);
  border: 1px solid rgba(245, 158, 11, 0.3);
}




/* ============================================================================
   M. Lembar Kunci Jawaban (cross-check T3 & T4)
   ============================================================================ */
.exam-key-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exam-key-item-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13.5px;
  color: var(--text-primary);
}

/* Lembar kisi-kisi: kotak kosong latihan Tahap 4 */
.exam-kisi-blank {
  border: 2px dashed var(--border-strong, #505050);
  border-radius: 10px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: transparent;
}

.exam-kisi-blank-output {
  min-height: 70px;
}

.exam-kisi-blank-label {
  font-size: 12.5px;
  color: var(--text-tertiary);
  font-style: italic;
  text-align: center;
}
