:root {
  /* =================================================================
     Lisan Pop — Color System (docs/design/COLOR_SYSTEM.md)
     Indigo = LisanAI / primary · Purple = AI · Pink = voice
     Green = success · Yellow = warning · Cyan = info · Rose = danger
     ================================================================= */

  /* Light Mode */
  --bg: #FFFDF7;
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;

  --text: #202235;
  --text-muted: #73778C;
  --text-subtle: #9699AA;

  --border: #E9E7F2;
  --border-strong: #D9D6E6;

  --brand: #635BFF;
  --brand-hover: #5148E8;
  --brand-active: #453BC7;
  --brand-soft: #EEECFF;

  --ai: #A855F7;
  --ai-hover: #9333EA;
  --ai-soft: #F3E8FF;

  --voice: #FF6B9D;
  --voice-hover: #F05289;
  --voice-soft: #FFE8F0;

  --success: #20C997;
  --success-hover: #12B886;
  --success-soft: #E6FCF5;

  --warning: #FFB547;
  --warning-hover: #F59E0B;
  --warning-soft: #FFF4D6;

  --info: #38BDF8;
  --info-hover: #0EA5E9;
  --info-soft: #E0F5FF;

  --danger: #E85D75;
  --danger-hover: #D9485F;
  --danger-soft: #FFE8ED;

  /* Text-safe variants — satisfy WCAG AA when used as text on white.
     ACCESSIBILITY.md: color must never carry meaning alone. */
  --success-strong: #047857;
  --warning-strong: #B45309;
  --info-strong: #075985;
  --danger-strong: #BE123C;

  /* Legacy aliases (deprecated in favor of semantic tokens above) */
  --ink: var(--text);
  --muted: var(--text-muted);
  --line: var(--border);
  --paper: var(--bg);
  --panel: var(--surface);
  --accent: var(--brand);
  --accent-strong: var(--brand-hover);
  --accent-dark: var(--brand-active);
  --accent-light: var(--brand-soft);
  --blue: var(--brand);
  --sky: var(--info-strong);
  --amber: var(--warning-strong);
  --rose: var(--danger-strong);
  --emerald: var(--success-strong);

  --shadow-subtle: 0 4px 15px rgba(32, 34, 53, 0.05);
  --shadow-glow: 0 4px 15px rgba(99, 91, 255, 0.25);

  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  font-size: 16px; /* Lebih besar sedikit untuk keterbacaan */
  -webkit-font-smoothing: antialiased;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Dark mode support — class-based (Lisan Pop palette) */
html.dark-mode {
  --bg: #11121A;
  --surface: #1A1C27;
  --surface-elevated: #202331;

  --text: #F5F5FA;
  --text-muted: #A3A6B8;
  --text-subtle: #777B90;

  --border: #2B2E3D;
  --border-strong: #3A3E50;

  --brand: #8B83FF;
  --brand-hover: #A19AFF;
  --brand-active: #B0AAFF;
  --brand-soft: #27254A;

  --ai: #C084FC;
  --ai-hover: #D0A0FF;
  --ai-soft: #332044;

  --voice: #FF7EAA;
  --voice-hover: #FF96BA;
  --voice-soft: #432334;

  --success: #34D399;
  --success-hover: #6EE7B7;
  --success-soft: #163B32;

  --warning: #FFC866;
  --warning-hover: #FFD98A;
  --warning-soft: #43351A;

  --info: #5DD3FF;
  --info-hover: #82DEFF;
  --info-soft: #16394A;

  --danger: #FB7185;
  --danger-hover: #FF91A0;
  --danger-soft: #47202A;

  --success-strong: #34D399;
  --warning-strong: #FFC866;
  --info-strong: #5DD3FF;
  --danger-strong: #FB7185;

  --ink: var(--text);
  --muted: var(--text-muted);
  --line: var(--border);
  --paper: var(--bg);
  --panel: var(--surface);
  --accent: var(--brand);
  --accent-strong: var(--brand-hover);
  --accent-dark: var(--brand-active);
  --accent-light: var(--brand-soft);
  --blue: var(--brand);
  --sky: var(--info);
  --amber: var(--warning);
  --rose: var(--danger);
  --emerald: var(--success);

  --shadow-subtle: 0 4px 15px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 4px 15px rgba(139, 131, 255, 0.3);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not(.light-mode):not(.dark-mode) {
    --bg: #11121A;
    --surface: #1A1C27;
    --surface-elevated: #202331;

    --text: #F5F5FA;
    --text-muted: #A3A6B8;
    --text-subtle: #777B90;

    --border: #2B2E3D;
    --border-strong: #3A3E50;

    --brand: #8B83FF;
    --brand-hover: #A19AFF;
    --brand-active: #B0AAFF;
    --brand-soft: #27254A;

    --ai: #C084FC;
    --ai-hover: #D0A0FF;
    --ai-soft: #332044;

    --voice: #FF7EAA;
    --voice-hover: #FF96BA;
    --voice-soft: #432334;

    --success: #34D399;
    --success-hover: #6EE7B7;
    --success-soft: #163B32;

    --warning: #FFC866;
    --warning-hover: #FFD98A;
    --warning-soft: #43351A;

    --info: #5DD3FF;
    --info-hover: #82DEFF;
    --info-soft: #16394A;

    --danger: #FB7185;
    --danger-hover: #FF91A0;
    --danger-soft: #47202A;

    --success-strong: #34D399;
    --warning-strong: #FFC866;
    --info-strong: #5DD3FF;
    --danger-strong: #FB7185;

    --ink: var(--text);
    --muted: var(--text-muted);
    --line: var(--border);
    --paper: var(--bg);
    --panel: var(--surface);
    --accent: var(--brand);
    --accent-strong: var(--brand-hover);
    --accent-dark: var(--brand-active);
    --accent-light: var(--brand-soft);
    --blue: var(--brand);
    --sky: var(--info);
    --amber: var(--warning);
    --rose: var(--danger);
    --emerald: var(--success);

    --shadow-subtle: 0 4px 15px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 4px 15px rgba(139, 131, 255, 0.3);
    color-scheme: dark;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--line) 25%, var(--panel) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
  color: transparent;
}
.skeleton-card {
  height: 60px;
  margin-bottom: 8px;
}
.skeleton-line {
  height: 16px;
  width: 100%;
  margin-bottom: 8px;
}
.skeleton-line:last-child {
  width: 60%;
}
.skeleton-heading {
  height: 24px;
  width: 40%;
  margin-bottom: 16px;
}

/* Custom confirm modal */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}
.confirm-dialog {
  background: var(--panel);
  border-radius: 16px;
  padding: 28px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: grid;
  gap: 16px;
}
.confirm-dialog h3 {
  margin: 0;
  font-size: 1.1rem;
}
.confirm-dialog p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Password strength */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.password-strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  transition: background 0.3s;
}
.password-strength-bar.weak { background: var(--rose); }
.password-strength-bar.medium { background: var(--amber); }
.password-strength-bar.strong { background: var(--emerald); }
.password-strength-label {
  font-size: 0.8rem;
  margin-top: 2px;
  color: var(--muted);
}
.password-strength-label.weak { color: var(--rose); }
.password-strength-label.medium { color: var(--amber); }
.password-strength-label.strong { color: var(--emerald); }

/* Observability tab sections */
.ob-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ob-tab-btn {
  padding: 8px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.ob-tab-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.ob-tab-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.ob-section {
  display: none;
}
.ob-section.active {
  display: block;
}

/* Toast stacking limit - hide overflow */
#toastContainer {
  max-height: 80vh;
  overflow: hidden;
}

/* Layout */
.auth-view {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 1.1fr);
  gap: 40px;
  align-items: center;
  min-height: 100vh;
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn 0.6s ease-out forwards;
}

.auth-copy {
  display: grid;
  gap: 24px;
}

.auth-brand {
  margin-bottom: 20px;
}

.auth-brand span {
  color: var(--muted);
}

.auth-copy h1 {
  max-width: 650px;
  color: var(--accent-strong);
  font-size: 2.5rem;
  font-weight: 800;
}

.auth-copy p {
  max-width: 560px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.auth-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.auth-panel.single-panel {
  grid-template-columns: 1fr;
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  width: min(100%, 480px);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
}

.modal-form {
  margin: 0;
}

.auth-form {
  display: grid;
  gap: 16px;
  padding: 30px; /* Lebarkan sedikit padding */
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-subtle);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-form:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.auth-form h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: var(--ink);
}

button, input, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
  transition: all 0.2s ease;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  animation: fadeIn 0.5s ease-out forwards;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 28px 24px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: 4px 0 15px rgba(0,0,0,0.02);
}

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

.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand span, .eyebrow, .section-heading p, .assessment-item p, .analytics-panel p, .recordStatus p {
  color: var(--muted);
}

.brand span {
  display: block;
  margin-top: 2px;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.nav {
  display: grid;
  gap: 8px; /* Lebih lebar antar menu */
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 600; /* Font menu lebih tebal sedikit */
  text-align: left;
}

.nav-button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: inherit;
  transition: color 0.2s;
}

.nav-button.active, .nav-button:hover {
  background: var(--accent-light);
  color: var(--accent-strong);
}

.nav-button.active span {
  color: var(--accent);
}



.main {
  min-width: 0;
  padding: 40px;
}

.topbar, .section-heading, .student-actions, .question-meta, .recorder, .topbar-actions {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
}

h2 { margin-bottom: 8px; font-size: 1.8rem; font-weight: 700; color: var(--ink); }
h3 { margin-bottom: 16px; font-size: 1.25rem; font-weight: 600; color: var(--ink); }

.topbar-actions { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.account-chip {
  display: grid;
  gap: 4px;
  min-width: 160px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.account-chip span { color: var(--muted); font-size: 0.85rem; }

.utility-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.utility-button:hover { background: var(--paper); border-color: var(--muted); }
.utility-button-danger { color: var(--rose); border-color: #fecdd3; }
.utility-button-danger:hover { background: #fff1f2; border-color: #fda4af; }

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.4s ease-out forwards; }

.section-heading { justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-heading p { margin-bottom: 0; font-size: 1.1rem; }

.metric-pill {
  white-space: nowrap;
  padding: 8px 16px;
  border: 1px solid var(--accent-light);
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 0.95rem;
}
.metric-pill strong { color: var(--accent); margin-right: 4px; }

.teacher-grid, .student-workspace, .monitor-grid, .account-grid {
  display: grid; gap: 24px;
}

.teacher-grid { grid-template-columns: minmax(360px, 1.1fr) minmax(320px, 0.9fr); }
.account-grid { grid-template-columns: minmax(340px, 0.8fr) minmax(320px, 1fr); }

.form-panel, .preview-panel, .question-card, .session-panel, .result-panel, .analytics-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-subtle);
  padding: 28px; /* Lebih lega */
}

form, .form-panel, .question-card { display: grid; gap: 24px; } /* Jarak elemen lebih besar */

label {
  display: grid; gap: 8px;
  color: var(--ink); font-size: 1rem; font-weight: 600;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 80px; }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}
@supports not (color: color-mix(in srgb, red, transparent)) {
  button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
  }
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  display: inline-block;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

textarea[readonly] {
  background-color: var(--paper);
  border-color: var(--line);
  cursor: not-allowed;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 140px;
  gap: 16px;
}

.class-panel { display: grid; gap: 16px; margin-bottom: 24px; }

.mini-form {
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
}

.primary-button, .secondary-button {
  min-height: 48px;
  border-radius: 10px;
  padding: 0 24px;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-button {
  border: none;
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

.primary-button:disabled { opacity: 0.7; cursor: not-allowed; }
.primary-button.is-loading, .secondary-button.is-loading { gap: 10px; }
.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: button-spin 0.7s linear infinite;
}
@keyframes button-spin { to { transform: rotate(360deg); } }

.secondary-button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.secondary-button:hover:not(:disabled) {
  background: var(--line);
}

.inline-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-start; }
.full { width: 100%; }

.visual-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--accent-light);
  border-radius: 12px;
  background: var(--accent-light);
}

.visual-card p { margin: 6px 0 0; font-size: 0.95rem; color: var(--accent-strong); }

.voice-waves {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 64px; width: 64px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.voice-waves span {
  width: 4px; border-radius: 4px;
  background: var(--accent);
  animation: wave 1.4s ease-in-out infinite;
}

.voice-waves span:nth-child(1) { height: 16px; animation-delay: 0s; }
.voice-waves span:nth-child(2) { height: 32px; animation-delay: 0.15s; }
.voice-waves span:nth-child(3) { height: 48px; animation-delay: 0.3s; }
.voice-waves span:nth-child(4) { height: 24px; animation-delay: 0.45s; }
.voice-waves span:nth-child(5) { height: 16px; animation-delay: 0.6s; }

@keyframes wave { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1); background: var(--blue); } }

.list-stack { display: grid; gap: 16px; } /* Jarak antar kartu lebih jauh sedikit */

.assessment-item, .submission-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.assessment-item:hover, .submission-item:hover {
  background: var(--paper);
  border-color: #cbd5e1; /* sedikit lebih gelap */
  box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.user-role {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.assessment-item p, .submission-item p { margin: 8px 0 0; font-size: 0.95rem; }

.assessment-item > span {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid var(--line);
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--muted);
  text-align: center;
  font-size: 1rem;
}
.empty-state strong { display: block; color: var(--ink); margin-bottom: 4px; }
.empty-state p { margin: 0; line-height: 1.5; }
.empty-state-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1.25rem;
}

.empty-state.large { padding: 48px 24px; font-size: 1.15rem; }
.hidden { display: none !important; }

/* Student Workspace */
.student-workspace {
  grid-template-columns: minmax(360px, 1fr) 300px;
  align-items: start;
}

.question-meta { justify-content: space-between; color: var(--accent-strong); font-weight: 700; font-size: 0.95rem; margin-bottom: 12px;}

.question-card h3 { margin-bottom: 12px; font-size: 1.5rem; line-height: 1.5; color: var(--ink); }

#activeHint { color: var(--muted); margin-bottom: 24px; font-size: 1.05rem; }

/* ===== Probing (pertanyaan lanjutan) ===== */
#activeQuestion.probing-active {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#activeQuestion.probing-active .probing-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
  background: linear-gradient(135deg, #635BFF 0%, #A855F7 100%);
  box-shadow: 0 2px 8px rgba(99, 91, 255, 0.35);
  animation: probingBadgeIn 400ms ease-out;
}
#activeQuestion.probing-active .probing-text {
  color: var(--ink);
}
/* Animasi muncul badge */
@keyframes probingBadgeIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* Efek "ketik" saat streaming prompt lanjutan: kursor berkedip di ujung teks */
#activeQuestion.probing-active.probing-live .probing-text {
  border-right: 2px solid var(--accent);
  padding-right: 2px;
  animation: probingCaret 0.8s steps(1) infinite;
}
@keyframes probingCaret {
  0%, 100% { border-color: var(--accent); }
  50%      { border-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  #activeQuestion.probing-active .probing-badge,
  #activeQuestion.probing-active.probing-live .probing-text {
    animation: none;
  }
}

.question-outcome, .question-rubric {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.question-outcome {
  background: #eff6ff; /* blue-50 */
  border: 1px solid #bfdbfe; /* blue-200 */
  color: #1e3a8a; /* blue-900 */
}
.question-rubric {
  background: #f5f3ff; /* violet-50 */
  border: 1px solid #ddd6fe; /* violet-200 */
  color: #4c1d95; /* violet-900 */
}
.question-outcome::before { content: "🎯 Kompetensi: "; font-weight: 700; }
.question-rubric::before { content: "📋 Rubrik: "; font-weight: 700; }

.recorder {
  gap: 16px; padding: 20px;
  border: 1px solid #fecdd3; /* rose-200 */
  border-radius: 12px;
  background: #fff1f2; /* rose-50 */
  margin-bottom: 24px;
}

.recorder p { margin: 6px 0 0; font-size: 0.95rem; color: var(--rose); font-weight: 500; }

.recorder-controls { display: flex; align-items: center; gap: 16px; }
.recorder-info { display: flex; flex-direction: column; gap: 6px; }

.record-button {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 18px; height: 64px;
  border: none; border-radius: 999px;
  background: var(--rose);
  box-shadow: 0 4px 15px rgba(225, 29, 72, 0.3);
  color: #ffffff; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}
.record-button:disabled { opacity: 0.6; cursor: not-allowed; }
.record-button:not(:disabled):hover { background: #be123c; }
.record-button:not(:disabled):active { transform: scale(0.96); }

.record-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: #ffffff; transition: border-radius 0.2s;
  flex-shrink: 0;
}

.record-button.recording { animation: pulseRed 1.5s ease-in-out infinite; background: #be123c; } /* rose-700 */
.record-button.recording .record-dot { border-radius: 4px; }

.record-timer {
  font-size: 1.1rem; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: 0.5px;
}

.volume-indicator {
  display: flex; align-items: flex-end; gap: 3px; height: 18px;
}
.volume-bar {
  width: 5px; border-radius: 2px; background: #fecdd3;
  transition: background 0.1s, height 0.1s;
}
.volume-bar:nth-child(1) { height: 6px; }
.volume-bar:nth-child(2) { height: 9px; }
.volume-bar:nth-child(3) { height: 12px; }
.volume-bar:nth-child(4) { height: 15px; }
.volume-bar:nth-child(5) { height: 18px; }
.volume-bar.active { background: var(--emerald); }

.recorder-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.mic-status { font-size: 0.9rem; font-weight: 600; }
.mic-status.ok { color: var(--emerald); }
.mic-status.error { color: var(--rose); }

.mic-diagnostics {
  margin-top: 12px; padding: 12px 14px; border-radius: 8px; font-size: 0.9rem;
}
.mic-diagnostics.ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.mic-diagnostics.error { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; }
.mic-diagnostics strong { display: block; margin-bottom: 4px; }
.mic-diagnostics ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.6; }
.mic-diagnostics p { margin: 4px 0 0; line-height: 1.5; }

@keyframes pulseRed {
  0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(225, 29, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

.student-actions { justify-content: space-between; gap: 16px; margin-top: 10px; }

.answer-map {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 24px;
}

.answer-dot {
  display: grid; place-items: center; min-height: 46px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--muted); font-weight: 700;
  transition: all 0.3s ease;
}

.answer-dot.done {
  border-color: var(--emerald); background: #ecfdf5; /* emerald-50 */
  color: var(--emerald);
}

.answer-dot.unanswered {
  border-color: #fecdd3; background: #fff1f2; /* rose-50 */
  color: var(--rose);
}

/* Monitoring */
.monitor-grid { grid-template-columns: 1fr; }
.analytics-panel.wide { min-width: 0; }

@property --score {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

.score-ring {
  position: relative;
  z-index: 1;
  display: grid; place-items: center;
  width: 150px; height: 150px; margin: 20px auto;
  color: var(--ink); font-size: 2.8rem; font-weight: 800;
  border-radius: 50%;
  --score: 0;
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--emerald) calc(var(--score, 0) * 1%), var(--line) 0);
  -webkit-mask: radial-gradient(circle, transparent 58%, black 58.5%);
  mask: radial-gradient(circle, transparent 58%, black 58.5%);
  z-index: -1;
  transition: --score 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.trend-list { display: grid; gap: 16px; }
.trend-item { display: grid; gap: 8px; }
.trend-item header { display: flex; justify-content: space-between; font-size: 1rem; font-weight: 600; }

.trend-track {
  height: 10px; overflow: hidden; border-radius: 999px; background: var(--line);
}
.trend-fill {
  height: 100%; border-radius: inherit; background: var(--emerald);
}

/* Results */
.result-panel { margin-top: 24px; }

/* Research trace viewer — reuse the same compact centered-card modal as the
   student evaluation result (dark overlay + centered card). */
#researchResultPanel {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 20px;
  overflow-y: auto;
}
#researchResultPanel .result-modal-content {
  background: var(--panel);
  max-width: 800px;
  width: 100%;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  position: relative;
}
#researchResultPanel h3 { margin: 0 0 4px; }
#researchResultPanel h4 { margin: 20px 0 8px; }

/* Reliability dimension cards with hover tooltip */
#researchResultPanel .rt-dim {
  position: relative;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: help;
}
#researchResultPanel .rt-dim .rt-dim-label {
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}
#researchResultPanel .rt-dim::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 220px;
  padding: 8px 10px;
  background: var(--surface-elevated);
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.35;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
  white-space: normal;
}
#researchResultPanel .rt-dim:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.result-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 20px;
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.result-modal.hidden {
  opacity: 0;
  visibility: hidden;
  display: flex !important; /* Override the default .hidden to keep transitions */
}
.result-modal > * {
  background: var(--panel);
  max-width: 800px;
  width: 100%;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  margin: auto 0;
}
.result-close-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 1.6rem;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all 0.25s ease;
  padding: 0;
  z-index: 10;
}

/* Modal persiapan sebelum ujian dimulai (tes mikrofon + tombol mulai) */
.pre-exam-modal { z-index: 1050; }

.pre-exam-card {
  width: min(100%, 560px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
}

.pre-exam-eyebrow {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pre-exam-card h2 { margin: 6px 0 12px; padding-right: 40px; }
.pre-exam-card h3 { margin: 0 0 6px; font-size: 1rem; }

.pre-exam-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.pre-exam-meta span {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.85rem;
  color: var(--muted);
}

.pre-exam-mic {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.pre-exam-hint { margin: 0 0 12px; font-size: 0.88rem; line-height: 1.5; color: var(--muted); }

.pre-exam-mic-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.pre-exam-playback { display: block; width: 100%; margin-top: 12px; }

.pre-exam-rules {
  margin: 18px 0 0;
  padding-left: 20px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--muted);
}

.pre-exam-note { margin: 14px 0 0; font-size: 0.85rem; color: var(--muted); }
.pre-exam-note.warn { color: var(--rose); font-weight: 600; }

.pre-exam-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

@media (max-width: 540px) {
  .pre-exam-actions { flex-direction: column-reverse; }
  .pre-exam-actions button { width: 100%; }
}

.evaluation-loading-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
}

.evaluation-loading-card {
  width: min(100%, 560px);
  max-height: 84vh;
  overflow-y: auto;
  padding: 24px 28px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
  text-align: left;
}

.evaluation-loading-head {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}
.evaluation-loading-head .evaluation-spinner { margin: 0; flex-shrink: 0; }
.evaluation-loading-head h3 { margin: 0; }

.evaluation-progress-text {
  margin: 12px 0 16px;
  color: var(--ai);
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 1.4em;
}

/* Preview: soal + jawaban siswa dengan nilai loading skeleton */
.evaluation-preview-list { display: grid; gap: 12px; }
.ev-preview-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.ev-preview-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
.ev-preview-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.ev-preview-card summary::-webkit-details-marker { display: none; }
.ev-preview-title { color: var(--accent-strong); }
.ev-preview-score { display: inline-flex; align-items: center; }
.ev-score-skeleton {
  display: inline-block;
  width: 44px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--line) 25%, var(--surface-elevated, #fff) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: ev-score-shimmer 1.2s infinite;
}
@keyframes ev-score-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
.ev-preview-body { padding: 0 14px 14px; }
.ev-preview-answer { margin-top: 8px; font-size: 0.95rem; }
.ev-preview-empty { color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .ev-score-skeleton { animation: none; }
}

.evaluation-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border: 5px solid var(--accent-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: evaluation-spin 0.8s linear infinite;
}

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

/* AI streaming panel (wizard + recommend + evaluation) */
.ai-stream-panel {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.ai-stream-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 0.9rem;
}

.ai-stream-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid var(--accent-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: evaluation-spin 0.8s linear infinite;
  flex-shrink: 0;
}

.ai-stream-content {
  margin: 0;
  padding: 12px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Animated placeholder skeletons shown while AI is streaming */
.ai-stream-placeholder {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-skeleton-card {
  height: 64px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--line) 25%, var(--accent-light) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: ai-skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes ai-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Progressive question cards rendered while streaming */
.ai-stream-questions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-stream-question {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: var(--panel);
  animation: ai-question-in 0.35s ease-out both;
}

.ai-stream-question .ai-q-num {
  display: inline-block;
  min-width: 22px;
  padding: 2px 6px;
  margin-right: 8px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.ai-stream-question .ai-q-text {
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.5;
}

@keyframes ai-question-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Slide + focus animation when generation completes */
.ai-stream-done .ai-stream-question {
  animation: ai-question-slide 0.5s ease-out both;
}

@keyframes ai-question-slide {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.ai-stream-question.ai-stream-focus {
  border-left-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.evaluation-stream-content {
  margin-top: 14px;
  max-height: 200px;
  overflow-y: auto;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ai);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.evaluation-stream-content:empty {
  display: none;
}
.result-close-btn:hover {
  background: var(--line);
  color: var(--rose);
  transform: rotate(90deg);
  border-color: rgba(225, 29, 72, 0.2);
}
.result-footer {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}
.result-footer button {
  min-width: 160px;
}
.result-header { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 24px; align-items: center; }

/* Student Dashboard */
.student-dashboard {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 30px;
  align-items: start;
}
.assessment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.assessment-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.assessment-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-subtle);
  border-color: var(--accent);
}
.assessment-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1.1rem;
}

.score-badge {
  display: grid; place-items: center;
  width: 100px; height: 100px; border-radius: 20px;
  background: #ecfdf5; /* emerald-50 */
  border: 2px solid var(--emerald);
  color: var(--emerald); font-size: 2.2rem; font-weight: 800;
  margin-right: 32px;
}

.feedback-grid { display: grid; gap: 16px; }
.feedback-card {
  padding: 20px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--paper); transition: transform 0.2s;
}
.feedback-card:hover { transform: translateX(4px); border-color: #cbd5e1; }
.feedback-card strong { display: block; margin-bottom: 8px; color: var(--accent-strong); font-size: 1.1rem;}
.feedback-card b { color: var(--ink); font-weight: 700; }
.feedback-card p { margin-bottom: 8px; line-height: 1.6; color: var(--ink); }

/* Question editor card header (title + delete button) */
.question-card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.question-card-header strong { margin-bottom: 0; }
.question-card-header .delete-question { flex-shrink: 0; }

/* Student complaint box */
.complaint-box {
  margin: 12px 0; padding: 12px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface, #f8fafc);
}
.complaint-box.complaint-pending { border-left: 4px solid #f59e0b; }
.complaint-box.complaint-resolved { border-left: 4px solid #10b981; }
.complaint-box.complaint-rejected { border-left: 4px solid #ef4444; }
.complaint-box p { margin: 6px 0 0; }
.complaint-box .complaint-response { color: var(--ink); }

/* Nav notification badge */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 0.7rem; font-weight: 700; line-height: 1;
}

/* Centralized complaint list (teacher view) */
.complaint-list { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.complaint-group h4 { margin: 0 0 12px; color: var(--accent-strong); }
.complaint-item {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--paper); margin-bottom: 12px;
}
.complaint-item.complaint-pending { border-left: 4px solid #f59e0b; }
.complaint-item.complaint-resolved { border-left: 4px solid #10b981; }
.complaint-item.complaint-rejected { border-left: 4px solid #ef4444; }

/* Student complaint notification banner */
.complaint-notification {
  margin: 0 0 16px; padding: 14px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: #fefce8;
  border-left: 4px solid #f59e0b;
}
.complaint-notification p { margin: 4px 0; line-height: 1.5; }

/* Student notification cards (Notifikasi tab) */
.notif-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.notif-card.complaint-resolved { border-left-color: #10b981; }
.notif-card.complaint-rejected { border-left-color: #ef4444; }
.notif-header { display: flex; align-items: flex-start; gap: 12px; }
.notif-icon {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 8px; font-size: 1.05rem;
  background: var(--surface);
}
.notif-card.complaint-resolved .notif-icon { background: #ecfdf5; }
.notif-card.complaint-rejected .notif-icon { background: #fef2f2; }
.notif-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-title strong { font-size: 0.98rem; line-height: 1.35; color: var(--ink); }
.notif-date { font-size: 0.78rem; color: var(--muted); }
.notif-body {
  margin: 12px 0 0 46px;
  display: flex; flex-direction: column; gap: 6px;
}
.notif-row {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 0.9rem; line-height: 1.5; color: var(--ink);
}
.notif-label {
  flex: 0 0 auto; min-width: 96px;
  font-size: 0.74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); padding-top: 1px;
}

/* Markdown-rendered rich text */
.rich-text h1, .rich-text h2, .rich-text h3,
.rich-text h4, .rich-text h5, .rich-text h6 {
  margin: 14px 0 8px; color: var(--accent-strong); line-height: 1.3;
}
.rich-text h1 { font-size: 1.35rem; }
.rich-text h2 { font-size: 1.2rem; }
.rich-text h3 { font-size: 1.1rem; }
.rich-text h4, .rich-text h5, .rich-text h6 { font-size: 1rem; }
.rich-text p { margin: 0 0 8px; line-height: 1.6; color: var(--ink); }
.rich-text ul, .rich-text ol { margin: 0 0 10px; padding-left: 22px; line-height: 1.6; color: var(--ink); }
.rich-text li { margin-bottom: 4px; }
.rich-text blockquote {
  margin: 8px 0; padding: 8px 14px; border-left: 3px solid var(--accent);
  background: var(--accent-light); color: var(--ink); border-radius: 0 8px 8px 0;
}
.rich-text code {
  padding: 2px 6px; border-radius: 4px; background: #f1f5f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em;
}
.rich-text hr { border: none; border-top: 1px solid var(--line); margin: 12px 0; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag {
  padding: 6px 12px; border-radius: 6px; background: var(--accent-light);
  color: var(--accent-strong); font-size: 0.8rem; font-weight: 700; border: 1px solid rgba(37, 99, 235, 0.2);
}

/* Action buttons for CRUD */
.action-button, .danger-button {
  padding: 8px 14px; border: 1px solid #cbd5e1; border-radius: 8px;
  background: var(--panel); color: var(--ink); font-size: 0.9rem; font-weight: 600;
}
.action-button:hover { background: var(--paper); border-color: var(--muted); }
.danger-button { color: var(--rose); border-color: #fecdd3; background: #fff1f2; }
.danger-button:hover { background: #ffe4e6; border-color: #fda4af; }

/* Disabled button state */
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary-button:disabled {
  background: var(--paper);
  border-color: var(--border);
  color: var(--muted);
}

.item-actions { display: flex; gap: 8px; margin-top: 14px; }

/* Assessment Status Badges */
.badge-draft { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; } /* amber */
.badge-published { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; } /* emerald */
.badge-closed { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }

/* Human approval badges (research) */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-warn { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-muted { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.badge-bad { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* ===== Wizard (3 langkah) ===== */
.wizard { display: grid; gap: 20px; }
.wizard-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}
.wizard-step:disabled { cursor: not-allowed; opacity: 0.5; }
.wizard-step-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.wizard-step.active {
  background: var(--accent-light);
  color: var(--accent-strong);
  border-color: #bfdbfe;
}
.wizard-step.active .wizard-step-num {
  background: var(--accent);
  color: #ffffff;
}
.wizard-form { padding: 24px; }
.wizard-panel-head h3 { margin: 0 0 4px; }
.wizard-panel-head p { margin: 0 0 20px; color: var(--muted); font-size: 0.95rem; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wizard-checks { display: grid; gap: 8px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.check-row { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.probing-toggle {
  margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); align-items: flex-start;
}
.probing-toggle input { margin-top: 2px; flex-shrink: 0; }
.probing-toggle span { line-height: 1.4; font-size: 0.9rem; color: var(--ink); }
.probing-toggle strong { color: var(--accent-strong); }
.wizard-nav { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.wizard-generate { display: flex; gap: 12px; flex-wrap: wrap; }
.question-editor { display: grid; gap: 20px; margin-top: 8px; }
.question-editor-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.question-editor-head h3 { margin: 0 0 4px; }
.question-editor-head p { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; }

/* Review summary */
.review-summary { display: grid; gap: 16px; }
.review-block { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.review-block h4 { margin: 0 0 12px; color: var(--accent-strong); }
.review-list { display: grid; gap: 8px; margin: 0; }
.review-list > div { display: flex; justify-content: space-between; gap: 16px; }
.review-list dt { color: var(--muted); font-weight: 500; }
.review-list dd { margin: 0; font-weight: 600; text-align: right; }
.review-count { color: var(--muted); font-size: 0.9rem; margin: 0 0 8px; }
.review-align-warning { color: #b45309; background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 12px; font-size: 0.85rem; margin: 0 0 10px; }
.review-align-warning strong { color: #92400e; }
.q-criteria-chip { margin: 2px 0 10px; padding: 6px 10px; background: var(--paper-tint, rgba(67, 144, 255, 0.08)); border: 1px dashed var(--line); border-left: 3px solid var(--accent); border-radius: 8px; font-size: 0.85rem; color: var(--accent-strong); }
.review-questions { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.review-questions li { display: grid; gap: 2px; }
.review-questions li.review-empty { opacity: 0.6; }
.review-questions span { color: var(--muted); font-size: 0.9rem; }

/* More menu (secondary actions) */
.more-menu { position: relative; }
.more-menu-trigger { min-width: 40px; }
.more-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
  display: grid;
  gap: 4px;
}
.more-menu-item { width: 100%; text-align: left; }

/* Student assessment card metadata */
.assessment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Result summary */
.result-summary {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  margin-bottom: 20px;
}
.summary-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 2px solid var(--emerald);
}
.summary-score strong { font-size: 2.4rem; font-weight: 800; color: var(--emerald); line-height: 1; }
.summary-score-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.summary-score-sub { font-size: 0.75rem; color: var(--muted); }
.summary-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.summary-col h4 { margin: 0 0 8px; font-size: 1rem; }
.summary-col ul { margin: 0; padding-left: 18px; line-height: 1.6; }
.summary-col li { margin-bottom: 4px; }
.summary-strengths h4 { color: var(--emerald); }
.summary-gaps h4 { color: var(--amber); }
.summary-empty { color: var(--muted); font-size: 0.9rem; margin: 0; }
.result-details { margin-top: 20px; }
.result-details-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}
.result-details-toggle:hover { background: var(--paper); }
.result-details-caret { color: var(--muted); }
.result-details-body { margin-top: 12px; }

/* Monitoring trend history */
.trend-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.trend-delta.trend-up { color: var(--emerald); }
.trend-delta.trend-down { color: var(--rose); }
.trend-delta.trend-flat { color: var(--muted); }
.trend-history {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 60px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.trend-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.trend-point-bar {
  width: 100%;
  max-width: 22px;
  border-radius: 4px 4px 0 0;
  background: var(--accent);
  opacity: 0.75;
}
.trend-point-score { display: none; }
.monitor-filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.monitor-top-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; }

/* Student Dashboard clean layout */
body.student-mode { background-image: none; background: var(--paper); }
body.student-mode .topbar { padding-bottom: 24px; border-bottom: 2px solid var(--line); margin-bottom: 32px; }

@media (max-width: 960px) {
  .auth-view, .auth-panel { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); padding: 20px; box-shadow: none; }
  .nav { grid-template-columns: repeat(3, 1fr); }
  .teacher-grid, .student-workspace, .monitor-grid, .account-grid { grid-template-columns: 1fr; }
  .monitor-top-grid { grid-template-columns: 1fr; }
  .student-dashboard { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .main { padding: 20px; }
  .topbar, .section-heading, .result-header { align-items: stretch; flex-direction: column; gap: 16px; }
  .nav { grid-template-columns: 1fr; }
  .form-row, .visual-card { grid-template-columns: 1fr; }
  .mini-form { grid-template-columns: 1fr; }
  .topbar-actions { justify-content: stretch; }
  .account-chip, .topbar-actions > button { flex: 1 1 auto; }
  .utility-button { justify-content: center; }
  .empty-state { align-items: flex-start; text-align: left; }

  /* Wizard mobile */
  .wizard-steps { grid-template-columns: 1fr; }
  .wizard-step { justify-content: flex-start; }
  .form-row-2 { grid-template-columns: 1fr; }
  .wizard-nav { flex-direction: column-reverse; }
  .wizard-nav button { width: 100%; }
  .wizard-generate { flex-direction: column; }
  .wizard-generate button { width: 100%; }
  .question-editor-head { flex-direction: column; }
  .question-editor-head .student-actions { width: 100%; }
  .question-editor-head .student-actions button { flex: 1; }

  /* Result summary mobile */
  .result-summary { grid-template-columns: 1fr; }
  .summary-columns { grid-template-columns: 1fr; }

  /* Monitoring filters */
  .monitor-filters { flex-direction: column; align-items: stretch; }
  .monitor-filters select, .monitor-filters button { width: 100%; }

  /* Assessment item actions wrap */
  .assessment-item { flex-direction: column; }
  .assessment-item > span { align-self: flex-start; }
  .item-actions { flex-wrap: wrap; }

  /* Tables become cards on mobile */
  .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table th, .data-table td { white-space: nowrap; }

  /* Mobile-first: convert monitoring & history tables to cards */
  #submissionList, #studentHistoryList {
    display: block;
  }
  #submissionList tr, #studentHistoryList tr {
    display: block;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
  }
  #submissionList td, #studentHistoryList td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--line);
    white-space: normal;
    text-align: right;
  }
  #submissionList td:last-child, #studentHistoryList td:last-child {
    border-bottom: none;
  }
  #submissionList td::before, #studentHistoryList td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
    flex-shrink: 0;
  }
  #submissionList td.empty-state, #studentHistoryList td.empty-state {
    display: block;
    text-align: center;
  }
  #submissionList td.empty-state::before, #studentHistoryList td.empty-state::before {
    content: none;
  }
}

.data-table th, .data-table td { white-space: nowrap; }

/* Toast Notifications */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  animation: slideIn 0.3s ease-out forwards;
  min-width: 300px;
  max-width: 450px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.4;
}

.toast.fade-out {
  animation: fadeOut 0.3s ease-in forwards;
}

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

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.9); }
}

.toast-error { border-left: 4px solid var(--rose); }
.toast-success { border-left: 4px solid var(--emerald); }
.toast-info { border-left: 4px solid var(--accent); }
.toast-icon { font-size: 1.2rem; }
.toast-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}
.toast-close:hover { color: var(--rose); }

/* Data Table Styles */
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.data-table th, .data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap; /* Prevent overlapping */
}
.data-table th {
  background-color: var(--paper);
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.data-table tr:hover td {
  background-color: var(--paper);
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table td.empty-state {
  display: table-cell;
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

/* Role based nav visibility */
body.teacher-mode .student-only,
body.teacher-mode .admin-only { display: none !important; }

body.student-mode .teacher-only,
body.student-mode .admin-only { display: none !important; }

body.admin-mode .teacher-only,
body.admin-mode .student-only { display: none !important; }

/* Simulator Panel Styles */
.simulator-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  font-family: inherit;
}

#toastContainer {
  bottom: 88px;
}

.simulator-toggle {
  background: var(--ink);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.simulator-toggle:hover {
  transform: translateY(-2px);
  background: #334155;
}

.simulator-panel {
  position: absolute;
  bottom: 60px;
  right: 0;
  width: 380px;
  max-height: 500px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  color: var(--ink);
}

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

.simulator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.simulator-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.simulator-header .close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.simulator-header .close-btn:hover {
  color: var(--rose);
}

.simulator-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.simulator-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.simulator-tenant-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.simulator-tenant-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.6);
  border: 1px solid rgba(226, 232, 240, 0.5);
}

.simulator-tenant-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-strong);
  margin-bottom: 4px;
}

.simulator-user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.simulator-user-row:hover {
  border-color: var(--accent-light);
}

.simulator-user-row.active {
  border-color: var(--emerald);
  background: #f0fdf4;
}

.simulator-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.simulator-user-name {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.simulator-user-detail {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.simulator-user-role-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
  align-self: flex-start;
}

.simulator-role-admin { background: #fee2e2; color: #991b1b; }
.simulator-role-teacher { background: #e0f2fe; color: #075985; }
.simulator-role-student { background: #d1fae5; color: #065f46; }

.simulator-login-btn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.simulator-login-btn:hover {
  background: var(--accent-dark);
}

.simulator-login-btn.active {
  background: var(--emerald);
  cursor: default;
}

/* Observability Dashboard Premium Styles */
#observabilityView .metric-card {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  border: 1px solid var(--line);
}
#observabilityView .metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08);
  border-color: var(--accent);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}
.status-badge.success {
  background-color: #ecfdf5;
  color: var(--emerald);
  border: 1px solid #a7f3d0;
}
.status-badge.error {
  background-color: #fff1f2;
  color: var(--rose);
  border: 1px solid #fecdd3;
}

#observabilityView .score-ring {
  width: 130px;
  height: 130px;
  font-size: 2.2rem;
  margin: 10px auto;
}

/* ============================================================
   Observability & Research Dashboard Redesign (PRD v1.0)
   ============================================================ */

/* Status semantics (PRD §36): never rely on color alone. */
.sem-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--line);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.sem-actual {
  background: #ecfdf5;
  color: var(--emerald);
  border-color: #a7f3d0;
}
.sem-estimated {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
.sem-derived {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.sem-research {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.ob-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ob-last-updated {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ob-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.ob-kpi {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}
.ob-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ob-kpi-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.ob-kpi strong {
  font-size: 1.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ob-kpi-delta {
  font-size: 0.75rem;
  color: var(--muted);
}
.ob-good {
  color: var(--emerald) !important;
}
.ob-warn {
  color: #b45309 !important;
}

.ob-alert {
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid;
}
.ob-alert strong {
  font-size: 0.95rem;
}
.ob-alert p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.ob-alert .sem-badge {
  align-self: flex-start;
  margin-top: 6px;
}
.ob-alert-warn {
  background: #fffbeb;
  border-color: #fde68a;
}
.ob-alert-warn strong {
  color: #92400e;
}
.ob-alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.ob-alert-info strong {
  color: #1e40af;
}

.ob-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.ob-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1024px) {
  .ob-grid-2 {
    grid-template-columns: 1fr;
  }
  .ob-grid-3 {
    grid-template-columns: 1fr;
  }
}

.ob-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ob-panel-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.ob-big-number {
  font-size: 2rem;
  font-weight: 700;
  display: block;
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}

.ob-histogram {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.ob-hist-row {
  display: grid;
  grid-template-columns: 56px 1fr 44px;
  align-items: center;
  gap: 10px;
}
.ob-hist-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ob-hist-track {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 18px;
  overflow: hidden;
}
.ob-hist-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #7c9cf0);
  border-radius: 6px;
  min-width: 2px;
  transition: width 0.4s ease;
}
.ob-hist-count {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ob-table-compact {
  font-size: 0.85rem;
}
.ob-table-compact td,
.ob-table-compact th {
  padding: 7px 12px;
}

.ob-tail-ratio {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.ob-tail-ratio-text {
  font-size: 0.8rem;
  color: #92400e;
  font-weight: 600;
}

.ob-token-split {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ob-split-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
}
.ob-split-prompt {
  background: var(--accent);
}
.ob-split-completion {
  background: var(--emerald);
}
.ob-split-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}
.ob-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.ob-dot-prompt {
  background: var(--accent);
}
.ob-dot-completion {
  background: var(--emerald);
}

.ob-mini {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.ob-mini span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 2px;
}
.ob-mini strong {
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ob-mini-emerald strong {
  color: var(--emerald);
}

.ob-block {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.ob-block h4 {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ob-block > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 4px 0;
}
.ob-block > div strong {
  color: var(--text, inherit);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.ob-kv-status {
  font-size: 0.8rem;
  line-height: 1.5;
}
.ob-kv-status-ok {
  color: var(--emerald);
}
.ob-kv-status-muted {
  color: var(--muted);
}

.ob-sys-item {
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.ob-sys-label {
  font-size: 0.8rem;
  color: var(--muted);
}
.ob-sys-item strong {
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.ob-log-filters select,
.ob-log-filters input {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 0.85rem;
  background: var(--bg);
  color: inherit;
}
.ob-log-count {
  font-size: 0.8rem;
  color: var(--muted);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   LisanAI — Trustworthy Assessment Intelligence UX (PRD v1.0)
   ============================================================ */

/* ---- Sidebar settings footer ---- */
.sidebar-settings {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.sidebar-settings .utility-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.82rem;
  justify-content: flex-start;
}

/* ---- Nav submenu (Penilaian) ---- */
.nav-group { position: relative; }
.nav-caret { margin-left: auto; font-size: 0.7rem; opacity: 0.7; }
.nav-sub {
  display: grid;
  gap: 2px;
  margin: 2px 0 4px 20px;
  padding: 6px 8px;
  border-left: 2px solid var(--accent-light);
  border-radius: 0 10px 10px 0;
  background: var(--paper);
}
.nav-sub-item[data-nav-view="teacherView"] { color: var(--accent-strong); font-weight: 700; }
.nav-sub.hidden { display: none; }
.nav-sub-item {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
}
.nav-sub-item:hover { background: var(--accent-light); color: var(--accent-strong); }

/* ---- Tab filter ---- */
.tab-filter {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.tab-filter-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}
.tab-filter-btn.active { background: var(--accent-light); color: var(--accent-strong); }

/* ---- KPI cards ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-subtle);
}
.kpi-label { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.kpi-value { font-size: 2.2rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.kpi-sub { color: var(--muted); font-size: 0.85rem; }
.kpi-hint {
  position: absolute; top: 14px; right: 14px;
  color: var(--muted); font-size: 0.9rem; cursor: help;
}

/* ---- Dashboard grids ---- */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.dash-grid-2 .analytics-panel { min-width: 0; }
.panel-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.panel-hint { color: var(--muted); font-size: 0.85rem; margin-bottom: 14px; }

/* ---- Charts ---- */
.chart-area, .distribution-area, .competency-area { min-height: 40px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; margin-bottom: 8px; font-size: 0.8rem; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { width: 18px; height: 3px; border-radius: 2px; background: var(--accent); }
.legend-bar { width: 12px; height: 10px; border-radius: 3px; background: #dbeafe; }

.dist-bars { display: grid; gap: 10px; }
.dist-row { display: grid; grid-template-columns: 48px 1fr 28px; gap: 10px; align-items: center; }
.dist-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.dist-track { height: 18px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.dist-fill { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.dist-count { font-weight: 700; font-size: 0.85rem; text-align: right; font-variant-numeric: tabular-nums; }

.comp-row { display: grid; gap: 6px; margin-bottom: 14px; }
.comp-head { display: flex; justify-content: space-between; font-size: 0.9rem; font-weight: 600; }
.comp-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.comp-track { height: 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.comp-fill { display: block; height: 100%; border-radius: inherit; background: var(--emerald); }

/* ---- Status badges (semantic, never color-only) ---- */
.status-badge.status-evaluated { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.status-badge.status-review { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.status-badge.status-failed { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.status-badge.status-evaluating { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.status-badge.status-incomplete { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.status-badge.status-published { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.status-badge.status-draft { background: var(--paper); color: var(--muted); border: 1px dashed var(--line); }
.status-badge.status-started { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.status-badge.status-submitted { background: #f5f3ff; color: #5b21b6; border: 1px solid #ddd6fe; }
.status-badge.status-muted { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }

.score-muted-text { color: var(--muted); font-weight: 700; }
.trend-up { color: var(--emerald); }
.trend-down { color: var(--rose); }
.trend-flat { color: var(--muted); }
.trend-cell { font-weight: 700; }
.ok-state .empty-state-icon { border-color: var(--emerald); color: var(--emerald); }
.ok-state strong { color: var(--emerald); }

/* ---- Skeletons ---- */
.skeleton {
  border-radius: 12px;
  background: linear-gradient(90deg, var(--border) 25%, var(--text-subtle) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  margin-bottom: 8px;
}
.skeleton-line { height: 18px; margin-bottom: 10px; }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---- Assessment Detail ---- */
.detail-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  padding: 28px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-subtle);
}
.detail-hero-main { min-width: 0; flex: 1; }
.detail-title { margin: 0 0 12px; }
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.92rem;
  color: var(--muted);
}
.detail-meta strong { color: var(--ink); }
.detail-score-block { text-align: center; min-width: 200px; }
.detail-score-block .score-badge {
  margin: 0 auto 10px;
  width: 120px; height: 120px;
  display: grid;
  place-items: center;
  font-size: 2.6rem;
}
.score-badge.score-muted { background: var(--paper); border-color: var(--line); color: var(--muted); }
.score-max { font-size: 0.9rem; font-weight: 600; color: var(--muted); margin-left: 2px; }
.detail-trust-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.trust-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 600;
}
.verification-mini { display: inline-block; margin-top: 8px; }
.verification-mini-badge-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.verification-mini-badge-warn { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.verification-mini-badge-bad { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
  align-items: start;
}
.detail-grid .analytics-panel { min-width: 0; }

.criterion-stack { display: grid; gap: 14px; }
.criterion-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.criterion-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.criterion-title { display: grid; gap: 4px; }
.criterion-title strong { color: var(--ink); }
.criterion-score { font-size: 1.25rem; font-weight: 800; color: var(--ink); white-space: nowrap; }
.criterion-score.low { color: var(--rose); }
.font-max { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.meter { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 12px; }
.meter-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.criterion-rationale { font-size: 0.9rem; color: var(--ink); margin: 10px 0 0; line-height: 1.55; }
.criterion-evidence { margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.criterion-evidence ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.criterion-evidence li { font-size: 0.88rem; line-height: 1.5; }
.evidence-status { display: inline-block; font-size: 0.78rem; font-weight: 700; }
.evidence-grounded { color: var(--emerald); }
.evidence-review { color: var(--amber); }
.evidence-quote { color: var(--ink); font-style: italic; }
.evidence-tag { font-size: 0.7rem; font-weight: 700; padding: 2px 6px; border-radius: 999px; margin-left: 6px; }
.tag-ok { background: #ecfdf5; color: #047857; }
.tag-warn { background: #fef3c7; color: #b45309; }

.ai-note { color: var(--muted); font-size: 0.82rem; margin-bottom: 12px; }
.insight-paragraph { line-height: 1.6; margin-bottom: 10px; }
.insight-paragraph li { margin-left: 18px; }

/* ---- Verification ---- */
.verification-badge { font-weight: 800; font-size: 0.85rem; padding: 6px 12px; border-radius: 999px; }
.verification-pass { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.verification-review { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.verification-fail { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.v-warning { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 10px 12px; border-radius: 10px; font-size: 0.88rem; margin-bottom: 12px; }
.verification-checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.verification-checks li { display: flex; gap: 8px; align-items: flex-start; font-size: 0.9rem; color: var(--ink); }
.verification-checks li.ok > span:first-child { color: var(--emerald); font-weight: 800; }
.verification-checks li.warn > span:first-child { color: var(--amber); font-weight: 800; }

/* ---- Assessment trace ---- */
.trace-steps { display: grid; gap: 2px; margin: 4px 0 14px; font-size: 0.9rem; }
.trace-step { display: flex; gap: 8px; align-items: baseline; padding: 6px 10px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); }
.trace-step-arrow { color: var(--accent); font-weight: 700; }
.trace-details { margin-top: 12px; }
.trace-details summary { cursor: pointer; font-weight: 600; color: var(--accent-strong); }
.trace-meta { display: grid; grid-template-columns: 180px 1fr; gap: 6px 12px; margin: 10px 0; font-size: 0.85rem; }
.trace-meta dt { color: var(--muted); }
.trace-meta dd { margin: 0; word-break: break-all; }
.trace-meta code { font-size: 0.78rem; background: var(--paper); padding: 2px 6px; border-radius: 6px; }

/* ---- Back button ---- */
.back-button { margin-bottom: 24px; min-height: 40px; }

/* ---- Link button inside detail meta ---- */
.link-button {
  border: none; background: none; padding: 0;
  color: var(--accent); font-weight: 600; font-size: inherit; text-decoration: underline;
}

/* ---- Feedback mini (profile) ---- */
.feedback-mini { margin-bottom: 14px; }
.feedback-mini h4 { margin: 0 0 6px; font-size: 0.95rem; }
.feedback-mini ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.feedback-mini li { font-size: 0.9rem; line-height: 1.5; }

/* ---- At-risk table area ---- */
.atrisk-table-wrap { min-height: 60px; }
.atrisk-table-wrap .data-table th, .atrisk-table-wrap .data-table td { white-space: nowrap; }

/* ---- Empty state subhint ---- */
.empty-state .sub { display: block; margin-top: 4px; font-size: 0.85rem; color: var(--muted); }

/* ---- Print styles for PDF export ---- */
@media print {
  body { background: white; color: black; }
  .sidebar, .topbar, .result-close-btn, .result-footer, .nav, .simulator-widget, .toast-container { display: none !important; }
  .result-modal { position: static; background: none; backdrop-filter: none; padding: 0; overflow: visible; }
  .result-modal-content { box-shadow: none; border: 1px solid #ddd; max-width: 100%; }
  .score-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .comp-fill, .dist-fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .status-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .feedback-card { break-inside: avoid; }
}

/* ---- Rubrik Gradation Table ---- */
.rubrik-gradation-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.rubrik-gradation {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.rubrik-gradation th {
  background: var(--paper);
  color: var(--muted);
  font-weight: 600;
  padding: 10px 8px;
  text-align: left;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.rubrik-gradation th.rubrik-level-4 { background: #ecfdf5; color: #065f46; }
.rubrik-gradation th.rubrik-level-3 { background: #eff6ff; color: #1e40af; }
.rubrik-gradation th.rubrik-level-2 { background: #fefce8; color: #92400e; }
.rubrik-gradation th.rubrik-level-1 { background: #fef2f2; color: #991b1b; }
.rubrik-gradation td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.rubrik-gradation .rubrik-row:last-child td {
  border-bottom: none;
}
.rubrik-level-cell textarea {
  width: 100%;
  min-width: 120px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.82rem;
  resize: vertical;
  background: var(--panel);
}
.rubrik-level-cell.rubrik-level-4 textarea:focus { border-color: #059669; box-shadow: 0 0 0 2px rgba(5,150,105,0.15); }
.rubrik-level-cell.rubrik-level-3 textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }
.rubrik-level-cell.rubrik-level-2 textarea:focus { border-color: #d97706; box-shadow: 0 0 0 2px rgba(217,119,6,0.15); }
.rubrik-level-cell.rubrik-level-1 textarea:focus { border-color: #e11d48; box-shadow: 0 0 0 2px rgba(225,29,72,0.15); }

/* Rubrik dark mode */
:root.dark-mode .rubrik-display .rubrik-lev-4,
:root.dark-mode .rubrik-gradation th.rubrik-level-4 { background: #064e3b; color: #a7f3d0; }
:root.dark-mode .rubrik-display .rubrik-lev-3,
:root.dark-mode .rubrik-gradation th.rubrik-level-3 { background: #1e3a5f; color: #93c5fd; }
:root.dark-mode .rubrik-display .rubrik-lev-2,
:root.dark-mode .rubrik-gradation th.rubrik-level-2 { background: #78350f; color: #fde68a; }
:root.dark-mode .rubrik-display .rubrik-lev-1,
:root.dark-mode .rubrik-gradation th.rubrik-level-1 { background: #7f1d1d; color: #fca5a5; }
:root.dark-mode .rubrik-level-cell textarea { background: var(--bg); color: var(--text); border-color: var(--border-strong); }

/* Rubrik dark mode — system preference (no explicit class toggle) */
@media (prefers-color-scheme: dark) {
  :root:not(.light-mode):not(.dark-mode) .rubrik-display .rubrik-lev-4,
  :root:not(.light-mode):not(.dark-mode) .rubrik-gradation th.rubrik-level-4 { background: #064e3b; color: #a7f3d0; }
  :root:not(.light-mode):not(.dark-mode) .rubrik-display .rubrik-lev-3,
  :root:not(.light-mode):not(.dark-mode) .rubrik-gradation th.rubrik-level-3 { background: #1e3a5f; color: #93c5fd; }
  :root:not(.light-mode):not(.dark-mode) .rubrik-display .rubrik-lev-2,
  :root:not(.light-mode):not(.dark-mode) .rubrik-gradation th.rubrik-level-2 { background: #78350f; color: #fde68a; }
  :root:not(.light-mode):not(.dark-mode) .rubrik-display .rubrik-lev-1,
  :root:not(.light-mode):not(.dark-mode) .rubrik-gradation th.rubrik-level-1 { background: #7f1d1d; color: #fca5a5; }
  :root:not(.light-mode):not(.dark-mode) .rubrik-level-cell textarea { background: var(--bg); color: var(--text); border-color: var(--border-strong); }
}

/* Pre-exam topic/outcome */
.pre-exam-topic { font-size: 1rem; margin-bottom: 4px; }
.pre-exam-outcome { font-size: 0.9rem; color: var(--muted); margin-bottom: 8px; padding: 8px 12px; background: var(--accent-light); border-radius: 8px; }
.pre-exam-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.9rem; }
.pre-exam-stats span { color: var(--muted); }

/* Dark mode toggle */
.dark-mode-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.dark-mode-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Rubrik display table (student view / assessment detail) */
.rubrik-display {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 8px;
}
.rubrik-display th {
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--line);
  color: var(--muted);
}
.rubrik-display td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.4;
}
.rubrik-display .rubrik-lev-4 { background: #f0fdf4; }
.rubrik-display .rubrik-lev-3 { background: #eff6ff; }
.rubrik-display .rubrik-lev-2 { background: #fefce8; }
.rubrik-display .rubrik-lev-1 { background: #fef2f2; }
.rubrik-score-badge {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
}
.rubrik-score-badge.sb-4 { background: #059669; }
.rubrik-score-badge.sb-3 { background: #2563eb; }
.rubrik-score-badge.sb-2 { background: #d97706; }
.rubrik-score-badge.sb-1 { background: #e11d48; }

/* ---- Kompetensi profile (compact list) ---- */
.competency-simple {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.competency-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.competency-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.competency-info strong {
  font-size: 0.9rem;
}
.competency-row .rubrik-skor {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.competency-profile td.rubrik-achieved,
.competency-profile td.rubrik-achieved.rubrik-lev-4,
.competency-profile td.rubrik-achieved.rubrik-lev-3,
.competency-profile td.rubrik-achieved.rubrik-lev-2,
.competency-profile td.rubrik-achieved.rubrik-lev-1 {
  outline: 2px solid currentColor;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.rubrik-achieved-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  margin-bottom: 4px;
  background: rgba(0,0,0,0.10);
  color: inherit;
}
.rubrik-dominant-tag {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rubrik-muted { color: var(--muted); font-size: 0.75rem; }
.rubrik-skor { text-align: center; white-space: nowrap; }
.rubrik-display td.rubrik-lev-4.rubrik-achieved,
.rubrik-lev-4.rubrik-achieved { color: #065f46; }
.rubrik-lev-3.rubrik-achieved { color: #1e40af; }
.rubrik-lev-2.rubrik-achieved { color: #92400e; }
.rubrik-lev-1.rubrik-achieved { color: #991b1b; }

/* ---- Tryout badge ---- */
.tag-tryout { background: #fef3c7; color: #92400e; }
.tag-practice { background: #dbeafe; color: #1e40af; }

/* ---- Notifikasi ---- */
.notif-tab { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.notif-tab-btn { padding: 8px 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); cursor: pointer; font-size: 0.9rem; }
.notif-tab-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.notif-badge { background: var(--rose); color: white; border-radius: 12px; padding: 2px 8px; font-size: 0.75rem; margin-left: 6px; }

/* ---- Kompetensi Longitudinal ---- */
.comp-trend-chart { height: 200px; position: relative; margin: 16px 0; }
.comp-trend-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.85rem; margin-bottom: 8px; }
.comp-trend-legend span { display: flex; align-items: center; gap: 4px; }
.comp-trend-legend .swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
/* ---- Hamburger menu ---- */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 1px;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 1200px) {
  .dash-grid-2, .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; height: auto; flex-direction: column; z-index: 100; }
  .brand { padding: 12px 20px; border-bottom: 1px solid var(--line); margin: -20px -24px 0; }
  .hamburger { display: block; }
  .nav, .dark-mode-toggle, .sidebar-settings { display: none; }
  .sidebar.nav-open .nav,
  .sidebar.nav-open .dark-mode-toggle,
  .sidebar.nav-open .sidebar-settings { display: flex; }
  .sidebar.nav-open { height: auto; max-height: 100vh; overflow-y: auto; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .detail-hero { flex-direction: column; }
  .detail-score-block { text-align: left; min-width: 0; }
  .detail-score-block .score-badge { margin: 0 0 10px; }
}

/* ---- Dark mode comprehensive ---- */
html.dark-mode { color-scheme: dark; }
html.dark-mode body,
html.dark-mode body.student-mode,
html.dark-mode body.teacher-mode,
html.dark-mode body.admin-mode { background: var(--paper) !important; }
html.dark-mode .main { background: var(--paper) !important; }
html.dark-mode .sidebar { background: var(--panel) !important; }
html.dark-mode .topbar { background: var(--panel) !important; }
html.dark-mode .brand span { color: var(--muted) !important; }
html.dark-mode .form-panel,
html.dark-mode .preview-panel,
html.dark-mode .question-card,
html.dark-mode .session-panel,
html.dark-mode .analytics-panel,
html.dark-mode .feedback-card,
html.dark-mode .assessment-card,
html.dark-mode .auth-form,
html.dark-mode .modal-card,
html.dark-mode .evaluation-loading-card,
html.dark-mode .review-block,
html.dark-mode .result-modal-content,
html.dark-mode .ai-stream-panel,
html.dark-mode .complaint-box,
html.dark-mode .question-editor,
html.dark-mode .review-summary,
html.dark-mode .wizard-panel,
html.dark-mode .wizard-form,
html.dark-mode .more-menu-dropdown,
html.dark-mode .simulator-panel,
html.dark-mode .api-key-result,
html.dark-mode .rubrik-gradation-wrap,
html.dark-mode .visual-card,
html.dark-mode .detail-hero,
html.dark-mode .pre-exam-card,
html.dark-mode .confirm-dialog,
html.dark-mode .nav-sub,
html.dark-mode .brand { background: var(--panel) !important; }
html.dark-mode .nav-button:hover,
html.dark-mode .nav-button.active,
html.dark-mode .nav-sub-item:hover,
html.dark-mode .nav-sub-item.active { background: var(--accent-light) !important; }
html.dark-mode input,
html.dark-mode textarea,
html.dark-mode select { background: var(--bg) !important; color: var(--text) !important; border-color: var(--border-strong) !important; }
html.dark-mode table,
html.dark-mode th,
html.dark-mode td { border-color: var(--border) !important; }
html.dark-mode .data-table th { background: var(--bg) !important; }
html.dark-mode .data-table tbody td { background: var(--panel) !important; }
html.dark-mode .toast { background: var(--surface-elevated) !important; color: var(--text) !important; }
html.dark-mode .notif-badge { background: var(--danger) !important; }
html.dark-mode .simulator-login-btn.active { background: var(--success) !important; }
html.dark-mode .brand-mark { filter: brightness(1.2); }
html.dark-mode .rubrik-display td { background: transparent !important; }

/* =================================================================
   Design System Alignment (Lisan Pop)
   ----------------------------------------------------------------
   AI  = purple  · Voice = pink  · Success = green · Warning = yellow
   Info = cyan   · Danger = rose · Primary = indigo
   Color is never the only status signal (text/icon always present).
   ================================================================= */

/* ---- AI semantics (purple = AI / intelligence) ---- */
.ai-button,
#recommendOutcomes.ai-button {
  border: none;
  background: var(--ai);
  color: #fff;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.25);
}
.ai-button:hover:not(:disabled) { background: var(--ai-hover); }
.ai-button:disabled { opacity: 0.6; cursor: not-allowed; }

.ai-stream-panel {
  border-color: var(--ai-soft);
  background: color-mix(in srgb, var(--ai-soft) 45%, var(--surface));
}
.ai-stream-spinner,
.evaluation-spinner { border-color: var(--ai-soft); border-top-color: var(--ai); }
.ai-skeleton-card {
  background: linear-gradient(90deg, var(--border) 25%, var(--ai-soft) 50%, var(--border) 75%);
}
.ai-stream-question { border-left-color: var(--ai); }
.ai-stream-question .ai-q-num { background: var(--ai-soft); color: var(--ai); }
.ai-stream-question.ai-stream-focus {
  border-left-color: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent);
}
.ai-note {
  color: var(--ai);
  background: var(--ai-soft);
  border-left: 3px solid var(--ai);
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
}
html.dark-mode .ai-stream-panel {
  background: color-mix(in srgb, var(--ai-soft) 55%, var(--surface));
}

/* ---- Voice semantics (pink = voice / recording) ---- */
.recorder {
  border-color: var(--voice-soft);
  background: color-mix(in srgb, var(--voice-soft) 60%, var(--surface));
}
.recorder p { color: var(--text-muted); font-weight: 500; }
.record-button {
  background: var(--voice);
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.35);
}
.record-button:not(:disabled):hover { background: var(--voice-hover); }
.record-button.recording {
  animation: pulseVoice 1.5s ease-in-out infinite;
  background: var(--voice-hover);
}
@keyframes pulseVoice {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 157, 0.35); }
  70% { box-shadow: 0 0 0 15px rgba(255, 107, 157, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 157, 0); }
}
.volume-bar { background: var(--voice-soft); }
.volume-bar.active { background: var(--voice); }
.mic-diagnostics.ok { background: var(--success-soft); border-color: var(--success); color: var(--success-strong); }
.mic-diagnostics.error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-strong); }
.voice-waves span { background: var(--voice); }
@keyframes wave { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1); background: var(--voice-hover); } }

/* ---- Semantic status/badges (Lisan Pop) ---- */
.badge-draft { background: var(--warning-soft); color: var(--warning-strong); border-color: var(--warning); }
.badge-published { background: var(--success-soft); color: var(--success-strong); border-color: var(--success); }
.badge-ok { background: var(--success-soft); color: var(--success-strong); border-color: var(--success); }
.badge-warn { background: var(--warning-soft); color: var(--warning-strong); border-color: var(--warning); }
.badge-bad { background: var(--danger-soft); color: var(--danger-strong); border-color: var(--danger); }

.status-badge.status-evaluated,
.status-badge.status-published { background: var(--success-soft); color: var(--success-strong); border-color: var(--success); }
.status-badge.status-review { background: var(--warning-soft); color: var(--warning-strong); border-color: var(--warning); }
.status-badge.status-failed { background: var(--danger-soft); color: var(--danger-strong); border-color: var(--danger); }
.status-badge.status-evaluating,
.status-badge.status-started { background: var(--info-soft); color: var(--info-strong); border-color: var(--info); }
.status-badge.status-submitted { background: var(--brand-soft); color: var(--brand-active); border-color: var(--brand); }

.sem-actual { background: var(--success-soft); color: var(--success-strong); border-color: var(--success); }
.sem-estimated { background: var(--warning-soft); color: var(--warning-strong); border-color: var(--warning); }
.sem-derived { background: var(--info-soft); color: var(--info-strong); border-color: var(--info); }
.sem-research { background: var(--ai-soft); color: var(--ai); border-color: var(--ai); }

.tag-ok,
.verification-mini-badge-ok,
.verification-pass { background: var(--success-soft); color: var(--success-strong); border-color: var(--success); }
.tag-warn,
.verification-mini-badge-warn,
.verification-review { background: var(--warning-soft); color: var(--warning-strong); border-color: var(--warning); }
.verification-mini-badge-bad,
.verification-fail { background: var(--danger-soft); color: var(--danger-strong); border-color: var(--danger); }
.verification-checks li.ok > span:first-child { color: var(--success-strong); }
.verification-checks li.warn > span:first-child { color: var(--warning-strong); }

.ob-alert-warn { background: var(--warning-soft); border-color: var(--warning); }
.ob-alert-warn strong { color: var(--warning-strong); }
.ob-alert-info { background: var(--info-soft); border-color: var(--info); }
.ob-alert-info strong { color: var(--info-strong); }
.ob-warn { color: var(--warning-strong) !important; }
.ob-tail-ratio-text { color: var(--warning-strong); }

.complaint-box.complaint-pending,
.complaint-item.complaint-pending { border-left-color: var(--warning); }
.complaint-box.complaint-resolved,
.complaint-item.complaint-resolved,
.notif-card.complaint-resolved { border-left-color: var(--success); }
.complaint-box.complaint-rejected,
.complaint-item.complaint-rejected,
.notif-card.complaint-rejected { border-left-color: var(--danger); }
.complaint-notification { background: var(--warning-soft); border-color: var(--warning); }

/* ---- Primary/neutral micro-token swaps ---- */
.wizard-step.active { border-color: var(--brand); }
.tag { border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.utility-button-danger { border-color: var(--danger-soft); }
.utility-button-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.rich-text blockquote { border-left-color: var(--brand); background: var(--brand-soft); }
.trust-chip { background: var(--brand-soft); color: var(--brand-active); }
.legend-bar { background: var(--brand-soft); }
.legend-line { background: var(--brand); }
.q-criteria-chip { background: var(--brand-soft); border-left-color: var(--brand); color: var(--brand-active); }
.simulator-role-admin { background: var(--danger-soft); color: var(--danger-strong); }
.simulator-role-teacher { background: var(--info-soft); color: var(--info-strong); }
.simulator-role-student { background: var(--success-soft); color: var(--success-strong); }
.meter-fill { background: var(--brand); }
.ob-hist-bar { background: linear-gradient(90deg, var(--brand), var(--ai)); }
.ob-split-prompt { background: var(--brand); }
