:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-soft: #faf8f4;
  --ink: #161b22;
  --muted: #5b6573;
  --line: #e2dfd6;
  --line-strong: #cbc6b9;
  --navy: #172a3a;
  --navy-hover: #213a4f;
  --teal: #0f6b5e;
  --teal-soft: #e7f3f0;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --radius: 10px;
  --radius-sm: 7px;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.mono-muted {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.mono-accent {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
}

.muted {
  color: var(--muted);
  margin: 0;
}

.small {
  font-size: 12.5px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
}

h1, h2, h3 {
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

/* ==================== BUTTONS & INPUTS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  min-height: 34px;
  padding: 5px 11px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover {
  background: var(--navy-hover);
}

.btn-teal {
  background: var(--teal);
  color: #fff;
}
.btn-teal:hover {
  background: #0c584d;
}

.btn-amber {
  background: #fffbeb;
  color: var(--amber);
  border-color: #f3d082;
}
.btn-amber:hover {
  background: var(--amber-soft);
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-outline:hover {
  background: var(--surface-soft);
  border-color: #aeb7c2;
}

.btn-danger-soft {
  background: #fff5f5;
  color: var(--red);
  border-color: #f5c2c2;
}
.btn-danger-soft:hover {
  background: var(--red-soft);
}

.btn-link {
  background: none;
  border: 0;
  color: var(--teal);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
}

.btn-ghost-sm {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.btn-ghost-sm:hover {
  color: var(--red);
  border-color: #efb8b8;
  background: #fff5f5;
}

input[type="text"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 107, 94, 0.12);
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #36414f;
}

/* ==================== AUTH SCREEN ==================== */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.auth-layout {
  width: 100%;
  max-width: 1040px;
  display: grid;
  grid-template-columns: 1.15fr 0.9fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(23, 42, 58, 0.06);
}

.auth-spec {
  background: var(--navy);
  color: #f4f6f8;
  padding: 36px 34px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.spec-badge {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #a7dfd4;
}

.auth-spec h1 {
  font-size: 27px;
  font-weight: 800;
  color: #fff;
}

.spec-lead {
  margin: 0;
  font-size: 13.5px;
  color: #c9d4df;
  line-height: 1.6;
}

.spec-table-wrap {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 4px;
}

.spec-table-title {
  padding: 9px 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(15, 107, 94, 0.45);
  color: #dff5ef;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.spec-table th,
.spec-table td {
  padding: 7px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.spec-table th {
  color: #9fb0c1;
  font-weight: 600;
  font-size: 11px;
}

.spec-table td.num,
.spec-table th.num {
  text-align: right;
  font-family: var(--font-mono);
}

.spec-table tfoot td {
  font-weight: 700;
  color: #a7dfd4;
  background: rgba(0, 0, 0, 0.16);
}

.spec-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.spec-scale span {
  font-size: 11.5px;
  padding: 5px 9px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: #dce4ec;
}

.spec-scale strong {
  color: #8ee3d2;
  font-family: var(--font-mono);
  margin-right: 4px;
}

.auth-card {
  padding: 36px 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

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

.brand-logo {
  width: 40px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-logo-lg {
  width: 48px;
  height: 50px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}

.brand-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-tab {
  border: 0;
  background: transparent;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.auth-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-error {
  padding: 9px 12px;
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12.5px;
  font-weight: 600;
}

.auth-demo-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  font-size: 12px;
  color: var(--muted);
}

.auth-demo-box code {
  font-family: var(--font-mono);
  background: #ece8df;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink);
}

/* ==================== TOPBAR ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 62px;
  padding: 8px 22px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.main-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.nav-pill {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.nav-pill.active {
  background: var(--navy);
  color: #fff;
}

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

.save-pill {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 600;
}

.save-pill.saving {
  background: var(--amber-soft);
  color: var(--amber);
}

.save-pill.error {
  background: var(--red-soft);
  color: var(--red);
}

.examiner-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 12.5px;
  font-weight: 600;
}

/* ==================== LAYOUT & CARDS ==================== */
.page-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px 24px 56px;
}

.exam-workspace {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px 24px 44px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-head h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.card-header-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card-header-inline h3 {
  font-size: 15px;
  font-weight: 700;
}

.hint-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 3px 9px;
  border-radius: 5px;
}

/* ==================== STUDENT INPUT & ROSTER ==================== */
.student-form-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.35fr 0.65fr 1.15fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.bulk-assign-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--teal-soft);
  border: 1px solid #b6ddd4;
  border-radius: 8px;
  font-size: 13px;
  color: var(--teal);
}

.bulk-assign-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bulk-assign-controls select {
  width: auto;
  min-width: 210px;
  min-height: 34px;
  padding: 4px 10px;
  font-size: 12.5px;
}

.inline-examiner-select {
  width: auto !important;
  min-width: 165px;
  max-width: 220px;
  min-height: 32px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
}

.row-check {
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.excel-guide-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}

.excel-guide-box code {
  font-family: var(--font-mono);
  background: #ece8df;
  padding: 1px 5px;
  border-radius: 4px;
}

.excel-dropzone {
  display: grid;
  place-items: center;
  padding: 22px 16px;
  border: 2px dashed var(--line-strong);
  border-radius: 10px;
  background: #fcfbf8;
  cursor: pointer;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  transition: border-color 0.15s, background 0.15s;
}

.excel-dropzone:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--ink);
}

.excel-dropzone input[type="file"] {
  display: none;
}

.form-submit-group {
  display: flex;
  gap: 8px;
}

.class-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.roster-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.search-box {
  flex: 1 1 280px;
}

.filter-row {
  display: flex;
  gap: 8px;
}

.filter-row select {
  width: auto;
  min-width: 145px;
}

.roster-stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.stat-chip {
  padding: 6px 12px;
  border-radius: 7px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.stat-chip strong {
  color: var(--ink);
  font-family: var(--font-mono);
  margin-right: 4px;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 10px;
  background: var(--surface-soft);
  border-bottom: 2px solid var(--line);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #fbfaf7;
}

.data-table th.num,
.data-table td.num {
  text-align: right;
  font-family: var(--font-mono);
}

.class-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 5px;
  background: #eef2f6;
  color: var(--navy);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill.pending {
  background: #f1f3f5;
  color: var(--muted);
}

.status-pill.in_progress {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill.completed {
  background: var(--teal-soft);
  color: var(--teal);
}

.predicate-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  background: #f1f3f5;
  color: var(--muted);
}

.predicate-badge.p-4 { background: #dcfce7; color: #166534; }
.predicate-badge.p-3 { background: var(--teal-soft); color: var(--teal); }
.predicate-badge.p-2 { background: var(--amber-soft); color: var(--amber); }
.predicate-badge.p-1 { background: var(--red-soft); color: var(--red); }

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* ==================== LIVE EXAM WORKSPACE ==================== */
.empty-exam-state {
  min-height: 55vh;
  display: grid;
  place-items: center;
}

.empty-box {
  text-align: center;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
}

.empty-box h2 {
  margin-bottom: 8px;
}

.empty-box p {
  margin-bottom: 18px;
}

.session-bar {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.session-student {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 380px;
  min-width: 0;
}

.session-student .btn-outline {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.session-name-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.session-name-row h2 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.session-name-row .class-badge {
  background: rgba(255, 255, 255, 0.16);
  color: #e6f6f2;
}

.session-name-row .mono-muted {
  color: #b5c4d4;
}

.session-topic-row {
  margin-top: 6px;
}

.inline-topic-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: #b7c6d6;
  font-size: 12px;
}

.inline-topic-label span {
  white-space: nowrap;
}

.inline-topic-label input {
  min-height: 32px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 13px;
}

.inline-topic-label input::placeholder {
  color: #8fa3b8;
}

.session-metrics {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.timer-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1.5px solid rgba(245, 158, 11, 0.75);
  background: rgba(245, 158, 11, 0.14);
  transition: border-color 0.2s, background 0.2s;
}

.timer-box.is-running {
  border-color: #34d399;
  background: rgba(16, 185, 129, 0.16);
}

.timer-box.is-paused {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

.timer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.timer-state-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: #f59e0b;
  color: #161b22;
  letter-spacing: 0.04em;
}

.timer-box.is-running .timer-state-tag {
  background: #34d399;
  color: #06281e;
}

.timer-box.is-paused .timer-state-tag {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.score-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #cbd7e3;
}

.timer-controls,
.score-readout {
  display: flex;
  align-items: center;
  gap: 8px;
}

#exam-timer-display {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  min-width: 58px;
}

.timer-box.is-running #exam-timer-display {
  color: #6ee7b7;
}

#exam-final-score {
  font-size: 21px;
  color: #8ee3d2;
}

.btn-timer-start {
  border: 0;
  background: #f59e0b;
  color: #161b22;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55);
  animation: timerAttention 2s infinite;
}

.btn-timer-start:hover {
  background: #fbbf24;
}

.timer-box.is-running .btn-timer-start {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: none;
}

.timer-box.is-paused .btn-timer-start {
  background: #10b981;
  color: #052e22;
  animation: none;
}

@keyframes timerAttention {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); }
  50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

.btn-chip {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.session-actions {
  display: flex;
  gap: 8px;
}

/* ==================== SPLIT WORKSPACE ==================== */
.split-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.aspect-tabs-wrap {
  margin-bottom: 12px;
}

.aspect-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aspect-tab {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.aspect-tab:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.aspect-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.aspect-tab.active:hover {
  background: var(--navy);
}

.aspect-tab-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.aspect-tab-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--bg);
  color: var(--muted);
  flex-shrink: 0;
}

.aspect-tab.active .aspect-tab-num {
  background: rgba(255, 255, 255, 0.14);
  color: #b7d8d1;
}

.aspect-tab-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.aspect-tab-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  flex-shrink: 0;
  color: var(--muted);
}

.aspect-tab.active .aspect-tab-meta {
  color: #c7d6e2;
}

.aspect-tab-weight {
  font-family: var(--font-mono);
  font-size: 11px;
}

.tab-score-dot {
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--bg);
  color: var(--muted);
  white-space: nowrap;
}

.tab-score-dot.scored {
  background: var(--teal-soft);
  color: var(--teal);
}

.aspect-tab.active .tab-score-dot {
  background: rgba(255, 255, 255, 0.12);
  color: #dbe6ef;
}

.aspect-tab.active .tab-score-dot.scored {
  background: var(--teal);
  color: #fff;
}

.aspect-focus-card {
  background: linear-gradient(180deg, #ffffff 0%, #fcfbf8 100%);
}

.aspect-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.aspect-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}

.weight-pill {
  background: var(--navy);
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

.aspect-card-head h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}

.score-selector-wrap {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.score-selector-label {
  font-size: 12px;
  font-weight: 700;
  color: #36414f;
  margin-bottom: 8px;
}

.score-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.score-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 11px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
}

.score-choice:hover {
  border-color: var(--teal);
  background: var(--surface-soft);
}

.score-choice .sc-num {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

.score-choice .sc-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.score-choice.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.score-choice.active .sc-num,
.score-choice.active .sc-label {
  color: #fff;
}

/* ==================== Q&A LIST ==================== */
.qa-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.qa-toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.qa-toolbar-top h3 {
  font-size: 15px;
  font-weight: 700;
}

.qa-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.seg-btn {
  border: 0;
  background: transparent;
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.seg-btn.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.qa-filters input[type="search"] {
  flex: 1 1 180px;
  min-height: 36px;
}

.q-level-select {
  width: auto !important;
  min-width: 140px;
  min-height: 36px !important;
  padding: 5px 10px !important;
  font-size: 12px !important;
  font-weight: 600;
}

.q-level-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}
.q-level-badge.lvl-dasar { background: #eef2f6; color: #334155; }
.q-level-badge.lvl-proses { background: var(--teal-soft); color: var(--teal); }
.q-level-badge.lvl-skenario { background: #eff6ff; color: #1d4ed8; }
.q-level-badge.lvl-kritis { background: var(--amber-soft); color: var(--amber); }

.question-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 540px;
  overflow-y: auto;
  padding-right: 4px;
}

.q-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}

.q-item.asked {
  background: #f3faf7;
  border-color: #bfe0d4;
}

.q-item.spotlight {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.14);
}

.q-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.q-check {
  appearance: none;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  margin-top: 1px;
  border: 1.5px solid #aab4c0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.q-check:checked {
  background: var(--teal);
  border-color: var(--teal);
}

.q-check:checked::after {
  content: "✓";
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.q-body {
  flex: 1;
  min-width: 0;
}

.q-top-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.q-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
}

.q-tag.custom {
  background: var(--amber-soft);
  color: var(--amber);
}

.q-aspect-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
}

.q-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.q-hint {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  padding: 5px 8px;
  border-left: 2px solid var(--line-strong);
  border-radius: 0 4px 4px 0;
}

.q-response-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed #cfe3da;
}

.rating-pills {
  display: flex;
  gap: 5px;
}

.rate-pill {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 5px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.rate-pill.active[data-rate="baik"] {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.rate-pill.active[data-rate="cukup"] {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
}

.rate-pill.active[data-rate="kurang"] {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.q-note-input {
  flex: 1 1 180px;
  min-height: 30px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
}

.custom-q-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ==================== STYLUS SKETCHPAD ==================== */
.sketch-pane {
  position: sticky;
  top: 76px;
}

.sketch-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0;
}

.sketch-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.sketch-head h3 {
  font-size: 15px;
  font-weight: 700;
}

.sketch-head-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#pen-only-toggle[aria-pressed="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.push-right {
  margin-left: auto;
}

.tool-btn,
.size-btn {
  min-height: 32px;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tool-btn.active,
.size-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.tool-btn.danger {
  color: var(--red);
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 99px;
  border: 2px solid #fff;
  background: var(--c);
  box-shadow: 0 0 0 1px var(--line-strong);
  cursor: pointer;
}

.color-dot.active {
  box-shadow: 0 0 0 2px var(--navy);
  transform: scale(1.1);
}

.paper-select {
  width: auto;
  min-height: 32px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
}

.canvas-stage {
  position: relative;
  width: 100%;
  height: 480px;
  border: 1.5px solid var(--line-strong);
  border-radius: 9px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  background-color: #fffdf9;
  user-select: none;
  -webkit-user-select: none;
  -webkit-overflow-scrolling: touch;
}

.canvas-sheet {
  position: relative;
  width: 100%;
  aspect-ratio: 1000 / 2160;
  background-color: #fffdf9;
}

.canvas-sheet.paper-dot {
  background-image: radial-gradient(#d3cec3 1.25px, transparent 1.25px);
  background-size: 20px 20px;
}

.canvas-sheet.paper-lined {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 27px,
    #eae5da 27px,
    #eae5da 28px
  );
}

.canvas-sheet.paper-grid {
  background-image:
    linear-gradient(to right, #ede9df 1px, transparent 1px),
    linear-gradient(to bottom, #ede9df 1px, transparent 1px);
  background-size: 22px 22px;
}

#sketch-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

#sketch-canvas.is-panning {
  cursor: grab;
}

#sketch-canvas.is-panning:active {
  cursor: grabbing;
}

.canvas-empty-hint {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 360px;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: #9ba3ae;
  pointer-events: none;
}

.canvas-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.canvas-scroll-actions {
  display: flex;
  gap: 6px;
}

/* Fullscreen Zen Sketchpad on Tablets / Desktop */
.sketch-pane.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(22, 27, 34, 0.72);
  padding: 14px;
  display: flex;
}

.sketch-pane.is-fullscreen .sketch-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sketch-pane.is-fullscreen .canvas-stage {
  flex: 1;
  height: auto;
  min-height: 0;
}

.sketch-pane.is-fullscreen .typed-notes-box {
  display: none;
}

/* ==================== RECAP VIEW ==================== */
.recap-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.kpi-card span {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.kpi-card strong {
  font-family: var(--font-mono);
  font-size: 24px;
  color: var(--navy);
}

.recap-table th,
.recap-table td {
  text-align: center;
  padding: 9px 7px;
  font-size: 12.5px;
}

.recap-table th:nth-child(2),
.recap-table td:nth-child(2) {
  text-align: left;
  min-width: 185px;
}

.recap-table tr.super-head th {
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.06em;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.th-w {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--teal);
  font-size: 10.5px;
}

/* ==================== MODALS & TOAST ==================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(22, 27, 34, 0.55);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  padding: 22px;
  border: 1px solid var(--line);
}

.modal-wide {
  max-width: 820px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  align-items: end;
}

.pw-input-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pw-input-wrap input {
  flex: 1;
}

.pw-field {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-field input {
  padding-right: 42px;
}

.pw-eye-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.pw-eye-btn:hover {
  background: var(--bg);
  color: var(--ink);
}

.pw-eye-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.admin-form-submit {
  display: flex;
  align-items: end;
}

@media (max-width: 640px) {
  .admin-form-grid {
    grid-template-columns: 1fr;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.modal-close {
  border: 0;
  background: var(--bg);
  width: 32px;
  height: 32px;
  border-radius: 7px;
  font-size: 20px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.rubric-modal-body table,
.detail-modal-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-bottom: 16px;
}

.rubric-modal-body th,
.rubric-modal-body td,
.detail-modal-body th,
.detail-modal-body td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.rubric-modal-body th,
.detail-modal-body th {
  background: var(--surface-soft);
}

.detail-sketch-img {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== RESPONSIVE (TABLET & MOBILE) ==================== */
@media (max-width: 1120px) {
  .split-workspace {
    grid-template-columns: 1fr;
  }
  .sketch-pane {
    position: static;
  }
  .student-form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .form-submit-group {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }
  .score-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  .recap-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 10px 14px;
  }
  .main-nav {
    width: 100%;
    order: 3;
  }
  .nav-pill {
    flex: 1;
    padding: 7px 6px;
    font-size: 12px;
  }
  .student-form-grid {
    grid-template-columns: 1fr;
  }
  .page-container,
  .exam-workspace {
    padding: 14px 12px 44px;
  }
}

@media print {
  .topbar,
  .no-print,
  .head-actions {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .card {
    border: 0;
    padding: 0;
  }
  .recap-table tr.super-head th {
    background: #172a3a !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
