/* ====================================================
   CBT-SD DESIGN SYSTEM & CSS VARIABLES
   ==================================================== */

:root {
  /* Font Family — Unified to Inter */
  --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Color System (Light Theme Default) */
  --primary-hue: 250;
  --primary: hsl(var(--primary-hue), 70%, 55%);
  --primary-hover: hsl(var(--primary-hue), 70%, 45%);
  --primary-light: hsl(var(--primary-hue), 70%, 95%);
  
  --success: hsl(145, 65%, 42%);
  --success-hover: hsl(145, 65%, 32%);
  --success-light: hsl(145, 65%, 94%);
  
  --warning: hsl(42, 95%, 50%);
  --warning-hover: hsl(42, 95%, 40%);
  --warning-light: hsl(42, 95%, 92%);

  --danger: hsl(355, 75%, 55%);
  --danger-hover: hsl(355, 75%, 45%);
  --danger-light: hsl(355, 75%, 95%);

  --dark: hsl(225, 25%, 15%);
  --dark-hover: hsl(225, 25%, 8%);
  
  /* Gradients */
  --grad-primary: linear-gradient(135deg, hsl(260, 80%, 55%) 0%, hsl(230, 80%, 55%) 100%);
  --grad-teacher: linear-gradient(135deg, hsl(160, 80%, 40%) 0%, hsl(140, 80%, 40%) 100%);
  --grad-dark: linear-gradient(135deg, hsl(225, 25%, 18%) 0%, hsl(225, 25%, 10%) 100%);
  --grad-warning: linear-gradient(135deg, hsl(42, 95%, 55%) 0%, hsl(30, 95%, 50%) 100%);

  /* Neutral Colors */
  --bg-app: hsl(220, 30%, 97%);
  --bg-sidebar: hsl(0, 0%, 100%);
  --bg-card: hsla(0, 0%, 100%, 0.75);
  --border-color: hsl(220, 20%, 88%);
  --text-main: hsl(225, 25%, 20%);
  --text-muted: hsl(220, 15%, 50%);
  --text-light: hsl(0, 0%, 100%);
  --shadow-color: hsla(220, 30%, 15%, 0.08);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-blur: blur(16px);

  /* Layout Constants */
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====================================================
   DARK THEME VARIABLES
   ==================================================== */
.dark-theme {
  --bg-app: hsl(225, 25%, 8%);
  --bg-sidebar: hsl(225, 25%, 12%);
  --bg-card: hsla(225, 25%, 14%, 0.75);
  --border-color: hsl(225, 20%, 18%);
  --text-main: hsl(220, 30%, 94%);
  --text-muted: hsl(220, 10%, 65%);
  --shadow-color: hsla(0, 0%, 0%, 0.25);
  
  --primary-light: hsl(var(--primary-hue), 40%, 15%);
  --success-light: hsl(145, 40%, 12%);
  --warning-light: hsl(42, 40%, 12%);
  --danger-light: hsl(355, 40%, 15%);

  /* Glassmorphism Dark */
  --glass-bg: rgba(22, 24, 30, 0.65);
  --glass-border: rgba(255, 255, 255, 0.06);
}

/* ====================================================
   BASE STYLES
   ==================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

input, select, textarea, button, table, th, td, code {
  font-family: inherit;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--primary-hover);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border: 4px solid transparent;
  background-clip: padding-box;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
  border: 4px solid transparent;
  background-clip: padding-box;
}

/* ====================================================
   LAYOUT & UTILITIES
   ==================================================== */
.view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: 0 8px 32px var(--shadow-color);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), background-color var(--transition-normal);
}

.glass {
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.margin-top-sm { margin-top: 0.5rem; }
.margin-top-md { margin-top: 1.5rem; }
.margin-top-lg { margin-top: 3rem; }
.margin-bottom-sm { margin-bottom: 0.5rem; }
.margin-bottom-md { margin-bottom: 1.5rem; }
.margin-left-md { margin-left: 1.5rem; }

.padding-lg { padding: 2rem; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-uppercase { text-transform: uppercase; }
.bold { font-weight: 600; }
.font-lg { font-size: 1.25rem; }
.font-sm { font-size: 0.85rem; }
.text-muted { color: var(--text-muted); }

.max-width-md { max-width: 600px; margin-left: auto; margin-right: auto; }
.max-width-lg { max-width: 900px; margin-left: auto; margin-right: auto; }

/* ====================================================
   BUTTONS
   ==================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-light);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-success {
  background-color: var(--success);
  color: var(--text-light);
}
.btn-success:hover {
  background-color: var(--success-hover);
  transform: translateY(-1px);
}

.btn-warning {
  background-color: var(--warning);
  color: var(--text-light);
}
.btn-warning:hover {
  background-color: var(--warning-hover);
  transform: translateY(-1px);
}

.btn-danger {
  background-color: var(--danger);
  color: var(--text-light);
}
.btn-danger:hover {
  background-color: var(--danger-hover);
  transform: translateY(-1px);
}

.btn-dark {
  background-color: var(--dark);
  color: var(--text-light);
}
.btn-dark:hover {
  background-color: var(--dark-hover);
}

.btn-outline-dark {
  background-color: transparent;
  border-color: var(--text-main);
  color: var(--text-main);
}
.btn-outline-dark:hover {
  background-color: var(--text-main);
  color: var(--bg-app);
}

.btn-outline-primary {
  background-color: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline-primary:hover {
  background-color: var(--primary);
  color: var(--text-light);
}

.btn-outline-success {
  background-color: transparent;
  border-color: var(--success);
  color: var(--success);
}
.btn-outline-success:hover {
  background-color: var(--success);
  color: var(--text-light);
}

.btn-outline-danger {
  background-color: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-outline-danger:hover {
  background-color: var(--danger);
  color: var(--text-light);
}

.btn-outline-purple {
  background-color: transparent;
  border-color: #8b5cf6;
  color: #8b5cf6;
}
.btn-outline-purple:hover {
  background-color: #8b5cf6;
  color: var(--text-light);
  transform: translateY(-1px);
}

.btn-group {
  display: flex;
  gap: 0.75rem;
}

.btn-group-center {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

/* ====================================================
   FORM CONTROLS
   ==================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper i {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1rem;
}

.form-control,
.input-wrapper input,
.input-wrapper select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-app);
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-wrapper input,
.input-wrapper select {
  padding-left: 2.75rem;
}

.form-control:focus,
.input-wrapper input:focus,
.input-wrapper select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.form-control {
  resize: vertical;
}

.flex-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.flex-row {
  display: flex;
  gap: 0.5rem;
}

/* ====================================================
   TOAST NOTIFICATIONS
   ==================================================== */
.toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius-sm);
  color: var(--text-light);
  font-weight: 500;
  box-shadow: 0 8px 16px var(--shadow-color);
  animation: slideIn var(--transition-normal) forwards;
  min-width: 300px;
}

.toast-success { background-color: var(--success); }
.toast-error { background-color: var(--danger); }
.toast-warning { background-color: var(--warning); }
.toast-info { background-color: var(--primary); }

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

/* ====================================================
   APP HEADER
   ==================================================== */
.app-header {
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  height: 70px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
}

.header-brand h2 {
  font-size: clamp(0.7rem, 3.5vw, 1.4rem);
  margin-bottom: -0.2rem;
  white-space: nowrap;
  text-align: center;
}

/* Baris di bawah judul: label panel + nama sekolah */
.header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.header-school-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

.header-school-name:empty {
  display: none;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 500;
}

/* Theme Switcher */
.btn-theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.nav-theme-toggle {
  padding: 0.4rem;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  justify-content: center;
}

/* ====================================================
   SIDEBAR & CONTENT CONTAINER
   ==================================================== */
.app-container {
  display: flex;
  flex: 1;
  height: calc(100vh - 70px);
}

.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  overflow-y: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: var(--border-radius-sm);
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  background-color: var(--bg-app);
  color: var(--text-main);
}

.nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.content-area {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background-color: var(--bg-app);
}

.tab-pane {
  display: none;
  animation: fadeIn var(--transition-normal);
}

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

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

.tab-header {
  margin-bottom: 2rem;
}
.tab-header h1 {
  font-size: 2rem;
}
.tab-header-action {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}
.tab-header-action h1 {
  font-size: 2rem;
}

/* ====================================================
   DASHBOARD STATS
   ==================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: var(--border-radius-md);
  box-shadow: 0 4px 16px var(--shadow-color);
  color: var(--text-light);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.card-purple { background: var(--grad-primary); }
.card-blue { background: linear-gradient(135deg, hsl(200, 80%, 50%) 0%, hsl(220, 80%, 55%) 100%); }
.card-orange { background: var(--grad-warning); }
.card-green { background: var(--grad-teacher); }

.stat-icon {
  font-size: 2.25rem;
}

.stat-info h3 {
  font-size: 2.25rem;
  margin-bottom: 0;
  line-height: 1;
}
.stat-info p {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.85;
}

/* ====================================================
   TABLE STYLING
   ==================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th,
.table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 0.85rem;
  white-space: nowrap;
}

.table th {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

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

.table tbody tr {
  transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
  background-color: rgba(var(--primary-hue), 70%, 98%);
}

.dark-theme .table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.75rem;
  border-radius: 50px;
  white-space: nowrap;
  box-shadow: none !important;
}

.badge-dark { background-color: var(--border-color); color: var(--text-main); }
.badge-primary { background-color: var(--primary-light); color: var(--primary); }
.badge-success { background-color: var(--success-light); color: var(--success); }
.badge-warning { background-color: var(--warning-light); color: var(--warning); }
.badge-danger { background-color: var(--danger-light); color: var(--danger); }
.badge-purple { background-color: hsl(280, 70%, 95%); color: hsl(280, 70%, 50%); }

.dark-theme .badge-purple { background-color: hsl(280, 40%, 15%); color: hsl(280, 70%, 75%); }

/* ====================================================
   LOGIN SCREEN
   ==================================================== */
#login-view {
  justify-content: center;
  align-items: center;
  position: relative;
  background: url('assets/login-bg.webp') center / cover no-repeat, hsl(260, 60%, 95%);
}

/* Mode gelap: gambar yang sama diredupkan agar form tetap jelas */
.dark-theme #login-view {
  background: linear-gradient(rgba(14, 12, 32, 0.82), rgba(14, 12, 32, 0.82)), url('assets/login-bg.webp') center / cover no-repeat, hsl(260, 40%, 10%);
}

/* Sambutan sebelum sekolah dipilih */
.brand-welcome,
.brand-welcome-hint {
  display: none;
}

.login-brand.is-welcome .brand-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.login-brand.is-welcome .brand-welcome-hint {
  display: block;
}

/* Sebelum sekolah dipilih, nama sekolah/portal diganti petunjuk */
.login-brand.is-welcome > p:not(.brand-welcome-hint) {
  display: none;
}

.brand-welcome-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(41, 123, 191, 0.25));
}

.brand-welcome-title {
  font-size: clamp(1.5rem, 6vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
  color: hsl(250, 45%, 25%);
  margin: 0;
}

.dark-theme .brand-welcome-title {
  color: #F2EFFF;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
  padding: 1.5rem;
  z-index: 10;
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-logo {
  width: 60px;
  height: 60px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1rem;
  box-shadow: none;
  overflow: hidden;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-brand h1 {
  font-size: clamp(0.7rem, 4vw, 1.8rem);
  line-height: 1.1;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  text-align: center;
}

.login-brand p {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.login-card {
  padding: 2rem;
  border-radius: var(--border-radius-lg);
}

/* Kotak login lebih jelas di atas gambar latar */
#login-view .login-card {
  background-color: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(124, 92, 224, 0.18);
  box-shadow: 0 18px 48px rgba(60, 40, 140, 0.18), 0 2px 8px rgba(60, 40, 140, 0.08);
}

.dark-theme #login-view .login-card {
  background-color: rgba(24, 24, 36, 0.94);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

/* Form login muncul memudar saat berpindah Murid / Guru / Proktor */
.login-form-enter {
  animation: loginFormIn 260ms ease both;
}

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

@media (prefers-reduced-motion: reduce) {
  .login-form-enter { animation: none; }
}

.login-tabs {
  display: flex;
  background-color: var(--bg-app);
  padding: 0.35rem;
  border-radius: var(--border-radius-sm);
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.login-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  background: none;
  padding: 0.6rem;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.login-tab.active {
  background-color: var(--bg-sidebar);
  color: var(--primary);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.theme-switch-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* ====================================================
   MODALS
   ==================================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn var(--transition-fast);
}

.modal-content {
  width: 90%;
  max-width: 500px;
  background-color: var(--bg-sidebar);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
  padding: 1.75rem;
  position: relative;
  animation: scaleUp var(--transition-normal);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-large {
  max-width: 800px;
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  position: sticky;
  top: -1.75rem;
  background-color: var(--bg-sidebar);
  z-index: 10;
  margin: -1.75rem -1.75rem 1.5rem -1.75rem;
  padding: 1.75rem 1.75rem 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  font-size: 1.75rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition-fast);
}
.modal-close:hover {
  color: var(--text-main);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
}

/* Form layout inside Modal */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.form-col {
  display: flex;
  flex-direction: column;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

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

/* CSV import templates block */
.import-instructions {
  background-color: var(--bg-app);
  border: 1px dashed var(--border-color);
  padding: 1rem;
  border-radius: var(--border-radius-sm);
  margin-bottom: 1rem;
}
.import-instructions h3 {
  font-size: 1rem;
}
.code-block {
  font-family: var(--font-body);
  background-color: var(--border-color);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-top: 0.2rem;
  word-break: break-all;
}

/* ====================================================
   STUDENT EXAM ENVIRONMENT
   ==================================================== */
.exam-header {
  background-color: var(--bg-sidebar);
  border-bottom: 2px solid var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  min-height: 64px;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.exam-title-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.exam-title-container i {
  font-size: 1.75rem;
  color: var(--primary);
}
.exam-title-container h2 {
  font-size: 1.15rem;
  margin-bottom: 0;
}
.subject-badge {
  font-size: 0.8rem;
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 0.15rem 0.6rem;
  border-radius: 50px;
  font-weight: 600;
}

.student-info-bar {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.student-meta {
  font-size: 0.95rem;
  font-family: var(--font-heading);
}
.student-meta .label {
  color: var(--text-muted);
}

.timer-box {
  background: var(--grad-warning);
  color: var(--text-light);
  padding: 0.3rem 0.6rem;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 4px 12px hsla(42, 95%, 50%, 0.25);
}

/* Pulse animation for timer */
.pulse {
  animation: pulseGrad 2s infinite;
}
@keyframes pulseGrad {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.exam-room-center {
  margin-top: 6rem;
  padding: 3rem;
  text-align: center;
  border-radius: var(--border-radius-lg);
  position: relative;
}

/* ---- Exam Preview Grid ---- */
.exam-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.exam-preview-card {
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
}

/* Active Card - Glowing & Colorful */
.exam-preview-card.status-active {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(168,85,247,0.08));
  border-color: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(99,102,241,0.3);
  animation: examCardPulse 2.5s ease-in-out infinite;
}
.exam-preview-card.status-active:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 30px rgba(99,102,241,0.25);
  border-color: var(--accent);
}
.exam-preview-card.status-active .exam-card-status-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  animation: badgePulse 1.5s ease-in-out infinite;
}
.exam-preview-card.status-active .exam-card-icon {
  color: var(--primary);
  filter: none;
}

@keyframes examCardPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.15); }
  50% { box-shadow: 0 0 20px 4px rgba(99,102,241,0.12); }
}
@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Inactive (Upcoming) Card - Grayscale */
.exam-preview-card.status-inactive {
  background: var(--bg-card);
  border-color: var(--border-color);
  filter: grayscale(0.6);
  opacity: 0.65;
  cursor: not-allowed;
}
.exam-preview-card.status-inactive .exam-card-status-badge {
  background: var(--bg-sidebar);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.exam-preview-card.status-inactive .exam-card-icon {
  color: var(--text-muted);
}

/* Ended Card - Dimmed */
.exam-preview-card.status-ended {
  background: var(--bg-card);
  border-color: var(--border-color);
  filter: grayscale(0.85);
  opacity: 0.45;
  cursor: not-allowed;
}
.exam-preview-card.status-ended .exam-card-status-badge {
  background: rgba(220,38,38,0.1);
  color: #ef4444;
  border: 1px solid rgba(220,38,38,0.2);
}

/* Card Internal Layout */
.exam-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.exam-card-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.exam-card-status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  white-space: nowrap;
}

.exam-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-main);
  line-height: 1.3;
}
.exam-card-subject {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.exam-card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.exam-card-details span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.exam-card-details i {
  font-size: 0.75rem;
  width: 14px;
  text-align: center;
}

.exam-card-schedule-note {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0,0,0,0.04);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

@media (max-width: 600px) {
  .exam-preview-grid {
    grid-template-columns: 1fr;
  }
}

.exam-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 80px);
  transition: grid-template-columns 0.3s ease;
}

.exam-layout.sidebar-hidden {
  grid-template-columns: 1fr;
}

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

.exam-sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.exam-sidebar.hidden {
  display: none;
}

.exam-sidebar h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.exam-grid-scroll {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1.5rem;
}

.exam-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}

.grid-box {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  background-color: var(--bg-app);
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.grid-box:hover {
  transform: scale(1.05);
}

.grid-box.active {
  border: 3px solid var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

/* Navigational color-coding */
.grid-box.answered {
  background-color: var(--primary);
  color: var(--text-light);
  border-color: var(--primary);
}
.grid-box.doubt {
  background: var(--grad-warning);
  color: var(--text-light);
  border-color: var(--warning);
}

.grid-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.legend-box {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 0.4rem;
}
.legend-answered { background-color: var(--primary); }
.legend-doubt { background-color: var(--warning); }
.legend-unanswered { background-color: var(--bg-app); border: 1px solid var(--border-color); }

/* Question Display Content Area */
.exam-content {
  padding: 2.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.question-card {
  padding: 2rem;
  box-shadow: 0 4px 20px var(--shadow-color);
  flex: 1;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.question-number {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--primary);
}

.question-image-box {
  margin-bottom: 1.5rem;
  text-align: center;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  max-height: 250px;
}

.question-image-box img {
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
  border-radius: var(--border-radius-sm);
}

.question-body {
  font-size: 1.05rem;
  line-height: 1.7;
  font-weight: 400;
  margin-bottom: 1.5rem;
}

.answer-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Radio/Checkbox custom styled options */
.option-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background-color: var(--bg-app);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.option-item:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.option-item.selected {
  border-color: var(--primary);
  background-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.option-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  font-family: var(--font-heading);
  font-weight: 600;
  margin-right: 1rem;
  background-color: var(--bg-sidebar);
  transition: all var(--transition-fast);
}

.option-item.selected .option-badge {
  background-color: var(--primary);
  color: var(--text-light);
  border-color: var(--primary);
}

.option-text {
  font-size: 1rem;
  font-weight: 400;
}

/* Essay Textarea & Short Answer styling for students */
.essay-textarea {
  width: 100%;
  min-height: 180px;
  padding: 1rem;
  font-size: 1.1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background-color: var(--bg-app);
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition-fast);
}
.essay-textarea:focus {
  border-color: var(--primary);
}

.short-answer-input {
  width: 100%;
  max-width: 400px;
  padding: 1rem;
  font-size: 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-app);
  color: var(--text-main);
  outline: none;
  font-family: var(--font-heading);
  transition: border-color var(--transition-fast);
}
.short-answer-input:focus {
  border-color: var(--primary);
}

.exam-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Custom doubt checkbox button style */
.btn-doubt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.75rem 1.2rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--warning);
  color: var(--warning-hover);
  background-color: var(--warning-light);
  font-family: var(--font-heading);
  font-weight: 500;
  user-select: none;
}
.btn-doubt input {
  display: none;
}

/* ====================================================
   HALAMAN SOAL MURID — diselaraskan dengan halaman awal & dialog selesai
   ==================================================== */
.exam-header {
  border-bottom: 1px solid var(--border-color);
  gap: 1rem;
}

.exam-head-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.exam-head-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
}

.exam-head-text {
  min-width: 0;
}

.exam-head-text h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exam-head-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.exam-head-meta strong {
  color: var(--text-main);
  font-weight: 700;
}

.exam-head-meta i {
  color: var(--primary);
  margin-right: 2px;
}

.timer-box {
  background: hsl(42, 95%, 92%);
  color: hsl(30, 90%, 30%);
  border: 2px solid hsl(42, 95%, 60%);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: none;
}

.dark-theme .timer-box {
  background: hsla(42, 95%, 50%, 0.15);
  color: hsl(42, 95%, 70%);
  border-color: hsla(42, 95%, 50%, 0.5);
}

.question-card {
  border-radius: 24px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px var(--shadow-color);
}

.question-head-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.question-number {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.question-number strong {
  color: var(--primary);
}

.question-total {
  margin-left: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.question-type-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: 999px;
}

.dark-theme .question-type-pill {
  color: hsl(var(--primary-hue), 85%, 80%);
}

.question-body {
  font-size: 1.1rem;
}

.option-item {
  border-width: 2px;
  border-radius: 16px;
  padding: 0.9rem 1.2rem;
  background-color: var(--bg-sidebar);
}

.option-item.selected {
  box-shadow: none;
}

.option-badge {
  width: 34px;
  height: 34px;
  font-weight: 800;
}

.btn-chunky-sm {
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
  border-radius: 12px;
}

/* Tombol bawah: Sebelumnya · Ragu-ragu · Berikutnya/Selesai */
.exam-actions {
  gap: 0.75rem;
}

.exam-actions .btn-chunky {
  min-width: 150px;
}

#btn-prev-question:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-doubt {
  padding: 0.75rem 1.1rem;
  border-radius: 14px;
  border: 2px solid hsl(42, 95%, 60%);
  color: hsl(30, 90%, 30%);
  background-color: hsl(42, 95%, 94%);
  box-shadow: 0 4px 0 hsl(42, 80%, 75%);
  font-weight: 800;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.btn-doubt:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 hsl(42, 80%, 75%);
}

.btn-doubt.is-on {
  color: #fff;
  background-color: hsl(38, 95%, 50%);
  border-color: hsl(38, 95%, 45%);
  box-shadow: 0 4px 0 hsl(30, 90%, 38%);
}

.dark-theme .btn-doubt:not(.is-on) {
  background-color: hsla(42, 95%, 50%, 0.12);
  color: hsl(42, 95%, 70%);
  border-color: hsla(42, 95%, 50%, 0.5);
  box-shadow: 0 4px 0 hsla(42, 95%, 50%, 0.25);
}

/* Daftar soal */
.grid-box {
  border-radius: 12px;
  border-width: 2px;
  font-weight: 800;
}

.grid-box.answered {
  background-color: var(--success);
  border-color: var(--success);
}

.legend-answered { background-color: var(--success); }

/* ====================================================
   ANTI-CHEAT SYSTEM
   ==================================================== */
.cheat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(22, 24, 30, 0.95);
  backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--transition-fast);
}

.cheat-card {
  text-align: center;
  background-color: hsl(225, 25%, 14%);
  border: 2px solid var(--danger);
  border-radius: var(--border-radius-lg);
  padding: 3rem;
  max-width: 500px;
  width: 90%;
  color: hsl(220, 30%, 94%);
  box-shadow: 0 0 40px rgba(235, 87, 87, 0.3);
  animation: shake 0.5s ease-in-out;
}

.warning-icon {
  font-size: 4.5rem;
  color: var(--danger);
  margin-bottom: 1.5rem;
}

.escape-warning-sub {
  color: var(--danger);
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

/* Anti-cheat animations */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

/* Modal specific custom warning */
.success-icon {
  font-size: 2.5rem;
  color: var(--success);
  margin-bottom: 0.5rem;
}

.submit-warning-card {
  background-color: var(--warning-light);
  border: 1px solid var(--warning);
  padding: 0.75rem;
  border-radius: var(--border-radius-sm);
  color: var(--warning-hover);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ---- Dialog selesai ujian & halaman terima kasih (murid) ---- */
.finish-dialog {
  max-width: 420px;
  text-align: center;
  padding: 2rem 1.75rem 1.75rem;
  border-radius: 24px;
}

.finish-dialog h3,
.thank-you-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.finish-dialog-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  color: var(--primary);
  background: var(--primary-light); /* ikut tema: terang / gelap */
}

.finish-dialog-icon.is-done {
  color: #fff;
  background: var(--success);
  box-shadow: 0 0 0 8px hsla(145, 65%, 42%, 0.15);
}

.finish-dialog-text {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.finish-summary {
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  text-align: left;
  border-radius: 16px;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
}

.finish-progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-main);
}

.finish-progress-row span:last-child {
  font-weight: 700;
  color: var(--primary);
}

.finish-progress {
  height: 8px;
  margin: 0.5rem 0 0.75rem;
  border-radius: 999px;
  background: var(--border-color);
  overflow: hidden;
}

.finish-progress > div {
  height: 100%;
  border-radius: 999px;
  background: var(--success);
}

.finish-notes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-main);
}

.finish-notes li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.finish-notes li > i { width: 16px; text-align: center; }
.finish-notes .is-warn > i { color: #EA580C; }
.finish-notes .is-doubt > i { color: #D97706; }
.finish-notes .is-ok > i { color: #F59E0B; }

.finish-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

/* Tombol "chunky": tebal, membulat, efek ditekan sederhana (tanpa animasi berat) */
.btn-chunky {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.btn-chunky:active:not(:disabled) { transform: translateY(3px); }
.btn-chunky:focus-visible { outline: 3px solid hsla(var(--primary-hue), 70%, 55%, 0.4); outline-offset: 3px; }
.btn-chunky:disabled { opacity: 0.7; cursor: wait; }

.btn-chunky-green {
  color: #fff;
  background: var(--success);
  box-shadow: 0 5px 0 hsl(145, 65%, 30%);
}
.btn-chunky-green:hover:not(:disabled) { background: var(--success-hover); }
.btn-chunky-green:active:not(:disabled) { box-shadow: 0 2px 0 hsl(145, 65%, 30%); }

.btn-chunky-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 5px 0 hsl(var(--primary-hue), 60%, 40%);
}
.btn-chunky-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-chunky-primary:active:not(:disabled) { box-shadow: 0 2px 0 hsl(var(--primary-hue), 60%, 40%); }

.btn-chunky-soft {
  color: var(--text-main);
  background: var(--bg-app);
  border: 2px solid var(--border-color);
  box-shadow: 0 4px 0 var(--border-color);
}
.btn-chunky-soft:hover { border-color: var(--primary); color: var(--primary); }
.btn-chunky-soft:active { box-shadow: 0 1px 0 var(--border-color); }

/* Halaman "ujian selesai" */
.thank-you-card {
  width: calc(100% - 2rem);
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px var(--shadow-color);
}

.thank-you-card .btn-chunky {
  width: 100%;
  margin-top: 1.5rem;
}

.thank-you-score {
  margin: 1rem 0 0;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

.thank-you-score:empty { display: none; }

@media (max-width: 400px) {
  .finish-dialog-actions { grid-template-columns: 1fr; }
  .finish-dialog-actions .btn-chunky-green { order: -1; }
}

/* Essay Grading Modal content */
.student-grading-header {
  display: flex;
  gap: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  font-family: var(--font-heading);
}

.essay-grading-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 450px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.essay-grading-item {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  background-color: var(--bg-app);
}

.essay-question-text {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.essay-student-answer {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: var(--border-radius-sm);
  margin-bottom: 1rem;
  font-family: var(--font-body);
}

.grading-score-input {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.grading-score-input input {
  width: 80px;
}

/* ====================================================
   TEACHER WORKSPACE & QUESTION PREVIEW SYSTEM
   ==================================================== */
.filter-card {
  position: relative;
  z-index: 10;
  border-left: 4px solid var(--primary);
  background-color: var(--bg-card);
  box-shadow: 0 4px 20px var(--shadow-color);
  padding: 1.5rem;
}

.preview-question-card {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
  margin-top: 1rem;
}

.dark-theme .preview-question-card {
  background: rgba(255, 255, 255, 0.02);
}

/* Alert boxes */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.alert-success {
  background-color: var(--success-light);
  border-color: var(--success);
  color: var(--success-hover);
}

.dark-theme .alert-success {
  background-color: var(--success-light);
  border-color: hsl(145, 60%, 25%);
  color: hsl(145, 70%, 75%);
}

/* Question Option Highlights */
.option-item.correct-answer-highlight {
  border-color: var(--success) !important;
  background-color: var(--success-light) !important;
  box-shadow: 0 0 0 3px var(--success-light) !important;
}

.option-item.correct-answer-highlight .option-badge {
  background-color: var(--success) !important;
  color: var(--text-light) !important;
  border-color: var(--success) !important;
}

.option-item.disabled {
  cursor: default !important;
  opacity: 0.95;
}

/* Modal Content Height Management */
.modal-content {
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

/* Kelola Kelas Tab Layout */
.classes-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 992px) {
  .classes-layout {
    grid-template-columns: 1fr;
  }
}

/* Custom Checkbox Group Container for Mappings */
.checkbox-group-container {
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1rem;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-main);
  user-select: none;
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* Drag and Drop Subject Rows Styling */
#table-subjects-body tr {
  cursor: grab;
  transition: opacity var(--transition-fast), background-color var(--transition-fast);
}
#table-subjects-body tr.dragging {
  opacity: 0.4;
  background-color: var(--primary-light) !important;
}
.drag-handle {
  width: 40px;
  text-align: center;
}
.drag-trigger {
  cursor: move;
  padding: 0.25rem;
}

/* Profile Avatar Layout */
.profile-avatar-container {
  margin-bottom: 2rem;
  text-align: center;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  background: var(--grad-primary);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 2.5rem;
  box-shadow: 0 8px 16px rgba(110, 68, 255, 0.25);
  margin: 0 auto;
}
.dark-theme .profile-avatar {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ====================================================
   FILTER CARD - BANK SOAL HEADER
   ==================================================== */
.filter-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0.5rem;
}

.filter-card-label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ====================================================
   PAKET SOAL CUSTOM DROPDOWN
   ==================================================== */
.paket-dropdown-wrapper {
  position: relative;
}

.paket-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-app);
  color: var(--text-main);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  user-select: none;
  min-height: 44px;
}

.paket-dropdown-toggle:hover,
.paket-dropdown-toggle:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

.paket-dropdown-toggle i:first-child {
  color: var(--text-muted);
  font-size: 0.95rem;
}

#paket-selected-label {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 500;
}

.paket-chevron {
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: transform var(--transition-fast);
}

.paket-dropdown-menu:not(.hidden) ~ .paket-dropdown-toggle .paket-chevron,
.paket-dropdown-wrapper:has(.paket-dropdown-menu:not(.hidden)) .paket-chevron {
  transform: rotate(180deg);
}

.paket-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: 0 16px 40px var(--shadow-color);
  z-index: 500;
  overflow: hidden;
  animation: fadeIn 0.15s ease;
  min-width: 260px;
}

.paket-search-row {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.paket-search-row input {
  font-size: 0.9rem;
}

.paket-options-list {
  max-height: 240px;
  overflow-y: auto;
}

.paket-option-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  border-bottom: 1px solid var(--border-color);
}

.paket-option-item:last-child {
  border-bottom: none;
}

.paket-option-item:hover {
  background-color: var(--primary-light);
}

.paket-option-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.paket-option-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.paket-option-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
}

.paket-option-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.paket-check-icon {
  color: var(--primary);
  font-size: 0.9rem;
}

.paket-empty-msg {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.paket-empty-msg i {
  font-size: 1.5rem;
  opacity: 0.5;
}

.paket-add-row {
  padding: 0.6rem;
  border-top: 1px solid var(--border-color);
}

/* ====================================================
   PACKET LIST IN MANAGE MODAL
   ==================================================== */
.packets-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 320px;
  overflow-y: auto;
}

.packet-list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-app);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.packet-list-item:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.packet-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.packet-item-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main);
}

.packet-item-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.packet-item-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.packet-item-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Dark theme adjustments */
.dark-theme .paket-dropdown-toggle {
  background-color: var(--bg-sidebar);
}

.dark-theme .paket-dropdown-menu {
  background-color: var(--bg-sidebar);
}

.dark-theme .packet-list-item {
  background-color: var(--bg-sidebar);
}

.dark-theme .paket-option-item:hover {
  background-color: var(--primary-light);
}

/* bg-elevated for dark theme inner cards */
.dark-theme .card[style*="bg-elevated"],
.dark-theme [style*="var(--bg-elevated)"] {
  background-color: var(--bg-card) !important;
}

:root { --bg-elevated: hsl(220, 20%, 96%); }
.dark-theme { --bg-elevated: hsl(225, 25%, 16%); }

/* ====================================================
   AI GRADING PANEL STYLES
   ==================================================== */
.ai-grade-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  margin-top: 10px;
  font-size: 0.9rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.ai-grade-panel.loading {
  opacity: 0.7;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
  background: repeating-linear-gradient(
    45deg,
    var(--bg-card),
    var(--bg-card) 10px,
    var(--bg-elevated) 10px,
    var(--bg-elevated) 20px
  );
  animation: bg-scroll 2s linear infinite;
}

@keyframes bg-scroll {
  0% { background-position: 0 0; }
  100% { background-position: 28px 0; }
}

.ai-grade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.ai-grade-title {
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-grade-score-pill {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 1rem;
}

.ai-feedback-section {
  margin-bottom: 10px;
}

.ai-feedback-section h4 {
  margin: 0 0 4px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-feedback-section p {
  margin: 0;
  line-height: 1.4;
  color: var(--text-color);
}

.ai-strengths p { color: var(--success); }
.ai-improvements p { color: var(--warning); }

.ai-action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.ai-btn-apply {
  background-color: var(--success);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ai-btn-apply:hover { background-color: var(--success-hover); }

.ai-btn-reject {
  background-color: var(--bg-elevated);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.ai-btn-reject:hover { background-color: var(--danger-light); color: var(--danger); }

/* ====================================================
   COMPREHENSIVE MOBILE RESPONSIVE
   ==================================================== */

/* Tablet */
@media (max-width: 992px) {
  .app-header {
    padding: 0.75rem 1rem;
    height: auto;
    min-height: 56px;
  }
  .header-brand h2 {
    font-size: clamp(1rem, 4vw, 1.15rem);
  }
  .sidebar {
    width: 220px;
    padding: 1rem 0.75rem;
  }
  .content-area {
    padding: 1.25rem;
  }
  .tab-header h1,
  .tab-header-action h1 {
    font-size: 1.5rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  /* Header */
  .app-header {
    padding: 0.5rem 0.75rem;
    min-height: 48px;
    gap: 0.5rem;
    box-sizing: border-box;
    max-width: 100vw;
  }
  .header-brand h2 {
    font-size: clamp(0.9rem, 4vw, 1rem);
  }
  /* Judul & nama sekolah boleh menyusut (dipotong "…") agar tombol kanan tidak keluar layar */
  .app-header .header-brand {
    min-width: 0;
    flex: 1 1 auto;
  }
  .app-header .header-brand > div {
    min-width: 0;
  }
  .app-header .header-brand h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
  }
  .app-header .header-user {
    flex-shrink: 0;
  }
  /* Tombol Keluar cukup ikon di HP (seperti halaman murid) */
  .app-header .header-user .btn-logout {
    font-size: 0;
    padding: 6px 10px;
  }
  .app-header .header-user .btn-logout i {
    font-size: 0.95rem;
  }
  /* Nama sekolah turun ke baris berikutnya bila tidak muat, agar terbaca utuh */
  .header-meta {
    flex-wrap: wrap;
    row-gap: 2px;
  }
  .header-school-name {
    font-size: 0.78rem;
    max-width: none;
    min-width: 0;
    white-space: normal;
    line-height: 1.2;
  }
  .header-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }
  .header-user {
    gap: 0.5rem;
    font-size: 0.85rem;
    flex-shrink: 0;
  }
  .header-user span {
    display: none;
  }
  .btn-logout {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .nav-theme-toggle {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  /* Sidebar - collapse to horizontal */
  .app-container {
    flex-direction: column;
    height: auto;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .sidebar-nav {
    flex-direction: row;
    gap: 0.25rem;
  }
  .nav-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    white-space: nowrap;
    gap: 0.4rem;
  }
  .content-area {
    padding: 1rem;
    height: auto;
    overflow-y: visible;
  }
  .tab-header h1,
  .tab-header-action h1 {
    font-size: 1.25rem;
  }
  .tab-header-action {
    flex-direction: column;
    gap: 0.75rem;
  }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  .stat-card {
    padding: 1rem;
    gap: 0.75rem;
  }
  .stat-icon {
    font-size: 1.5rem;
  }
  .stat-info h3 {
    font-size: 1.5rem;
  }
  .stat-info p {
    font-size: 0.8rem;
  }

  /* Tables */
  .table th, .table td {
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
  }

  /* Buttons */
  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
  .btn-group {
    flex-wrap: wrap;
  }

  /* Modal */
  .modal-content {
    width: 95%;
    padding: 1.25rem;
    max-height: 90vh;
    border-radius: var(--border-radius-md);
  }
  .modal-large {
    max-width: 95%;
  }

  /* Login */
  .login-wrapper {
    max-width: 100%;
    padding: 1rem;
  }
  .login-brand h1 {
    font-size: clamp(1rem, 5vw, 1.75rem);
  }
  .login-card {
    padding: 1.5rem;
  }

  /* ===== STUDENT EXAM VIEW - MOBILE ===== */

  /* Exam Header */
  .exam-header {
    padding: 0.6rem 0.75rem;
    min-height: auto;
    gap: 0.4rem;
  }
  .exam-title-container {
    gap: 0.5rem;
  }
  .exam-title-container i {
    font-size: 1.25rem;
  }
  .exam-title-container h2 {
    font-size: 0.95rem;
  }
  .subject-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
  }
  .student-info-bar {
    justify-content: flex-end;
    gap: 0.5rem;
  }
  .student-meta {
    font-size: 0.75rem;
  }
  .student-meta .margin-left-md {
    margin-left: 0.5rem;
  }
  .timer-box {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    gap: 0.3rem;
  }

  /* Exam Layout - Stack vertically */
  .exam-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 110px);
  }

  /* Exam Sidebar - Collapsible horizontal bar */
  .exam-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem;
    order: -1;
  }
  .exam-sidebar h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }
  .exam-grid-scroll {
    margin-bottom: 0.5rem;
    max-height: 100px;
    overflow-y: auto;
  }
  .exam-grid {
    grid-template-columns: repeat(10, 1fr);
    gap: 0.35rem;
  }
  .grid-box {
    font-size: 0.8rem;
    border-radius: 6px;
  }
  .grid-legend {
    flex-direction: row;
    gap: 0.75rem;
    font-size: 0.75rem;
  }

  /* Question Content Area */
  .exam-content {
    padding: 0.75rem;
  }
  .question-card {
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: var(--border-radius-sm);
  }
  .question-header {
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
  }
  .question-number {
    font-size: 1rem;
  }
  .question-body {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
  }

  /* Answer Options */
  .option-item {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
  }
  .option-badge {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
    margin-right: 0.75rem;
  }
  .option-text {
    font-size: 0.9rem;
  }
  .answer-options {
    gap: 0.5rem;
  }

  /* Exam Actions Footer */
  .exam-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }
  .exam-actions .btn,
  .exam-actions .btn-chunky {
    flex: 1;
    min-width: 120px;
    font-size: 0.9rem;
    padding: 0.7rem 0.75rem;
  }
  /* Soal menjodohkan: kiri & kanan disusun atas-bawah agar pilihan tidak terpotong */
  .match-pair { flex-direction: column; gap: 10px !important; }
  .match-pair-left { border-right: none !important; padding-right: 0 !important; border-bottom: 1px dashed var(--border-color); padding-bottom: 10px; }
  .exam-head-logo { width: 32px; height: 32px; }
  .exam-head-text h2 { font-size: 0.95rem; }
  .exam-head-meta { font-size: 0.75rem; gap: 0.15rem 0.6rem; }
  .timer-box { padding: 0.35rem 0.7rem; font-size: 0.9rem; }
  .question-card { border-radius: 18px; }
  .btn-doubt {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    order: 3;
    flex-basis: 100%;
    justify-content: center;
  }

  /* Essay & Short Answer */
  .essay-textarea {
    min-height: 120px;
    font-size: 0.95rem;
  }
  .short-answer-input {
    max-width: 100%;
    font-size: 1rem;
  }

  /* Exam Preview Cards */
  .exam-room-center {
    margin-top: 2rem;
    padding: 1.5rem;
  }
  .student-identity-preview {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  /* Token Verification */
  #exam-token-verification {
    margin-top: 1rem !important;
    padding: 1.5rem !important;
  }

  /* Thank You View */
  #thank-you-view > div {
    padding: 2rem 1.25rem !important;
    margin: 1rem;
  }
  #thank-you-view i.fa-circle-check {
    font-size: 3rem !important;
  }
  #thank-you-view h1 {
    font-size: 1.5rem !important;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .exam-grid {
    grid-template-columns: repeat(8, 1fr);
  }
  .exam-actions .btn {
    min-width: 100px;
    font-size: 0.75rem;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ==================================================== */
/* PRINT EXAM CARDS STYLES                             */
/* ==================================================== */
#exam-cards-print-area, #teachers-print-area {
  display: none;
}

@media print {
  html, body {
    background: white !important;
    color: black !important;
    font-family: 'Inter', Arial, sans-serif !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  #app, .toast-container, .modal, #cheat-overlay {
    display: none !important;
  }

  #exam-cards-print-area:not(:empty), #teachers-print-area:not(:empty), #attendance-print-area:not(:empty) {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  #exam-cards-print-area:empty, #teachers-print-area:empty, #attendance-print-area:empty {
    display: none !important;
  }

  #teachers-print-area table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 12pt; }
  #teachers-print-area th, #teachers-print-area td { border: 1px solid #000; padding: 8px; text-align: left; }
  #teachers-print-area th { background: #e0e0e0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-weight: bold; }
  #teachers-print-area .print-header { display: flex; align-items: center; justify-content: flex-start; gap: 20px; margin-bottom: 20px; border-bottom: 2px solid #000; padding-bottom: 15px; }
  #teachers-print-area .print-header img { width: 80px; height: 80px; object-fit: contain; }
  #teachers-print-area .print-header-text { text-align: left; }
  #teachers-print-area .print-header h2 { margin: 0; font-size: 20pt; text-transform: uppercase; color: #000; }
  #teachers-print-area .print-header p { margin: 5px 0 0; font-size: 14pt; color: #000; }

  @page {
    size: A4;
    margin: 10mm;
  }
}

/* Exam Card Grid Layout */
.print-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  width: 100%;
  box-sizing: border-box;
}

/* Cut guide helper for printing */
.exam-card-wrapper {
  position: relative;
  box-sizing: border-box;
  page-break-inside: avoid;
  break-inside: avoid;
  padding: 5px;
  border: 1px dashed #cbd5e1; /* The dashed cut helper line */
}

/* Single Exam Card */
.exam-card {
  border: 1.5px solid #4a5568;
  border-radius: 8px;
  padding: 12px;
  background-color: #ffffff;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  height: 180px; /* A bit shorter so we can comfortably fit 6 cards per A4 page */
}

/* Header/Kop Kartu */
.exam-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 2px double #1a202c;
  margin-bottom: 8px;
}

.exam-card-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.exam-card-school-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.exam-card-school-name {
  font-weight: 700;
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  color: #1a202c;
}

.exam-card-exam-title {
  font-weight: 600;
  font-size: 9px;
  line-height: 1.2;
  color: #2b6cb0;
}

.exam-card-academic-year {
  font-size: 8px;
  line-height: 1.2;
  color: #4a5568;
}

/* Title Label */
.exam-card-title {
  align-self: center;
  font-weight: 700;
  font-size: 9px;
  padding: 2px 10px;
  background-color: #edf2f7;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  color: #2d3748;
}

/* Card Body */
.exam-card-body {
  display: flex;
  gap: 10px;
  flex: 1;
  align-items: flex-start;
  position: relative;
}

.exam-card-barcode {
  position: absolute;
  bottom: -4px;
  right: 0;
  width: 50px;
  height: 50px;
}
.student-qrcode {
  width: 100% !important;
  height: 100% !important;
}

/* Photo Box */
.exam-card-photo-container {
  width: 55px;
  height: 70px;
  border: 1.5px solid #4a5568;
  border-radius: 4px;
  background-color: #f7fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.exam-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.exam-card-photo-placeholder {
  font-size: 24px;
  color: #a0aec0;
}

/* Details Table/List */
.exam-card-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 9.5px;
}


.report-q-badge {
  background: #f1f5f9;
  color: #475569;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
}

.report-q-text {
  margin-bottom: 15px;
  font-size: 1rem;
  color: #1e293b;
}

.report-q-img {
  max-width: 100%;
  max-height: 250px;
  margin-bottom: 15px;
  border-radius: 4px;
}

/* Options */
.report-opts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.report-opt.is-key {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

.report-opt.is-student-wrong {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.report-opt-letter {
  font-weight: 700;
  color: #475569;
  margin-top: 2px;
}

.report-opt-content {
  flex: 1;
}

.report-opt-badge {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.report-opt-badge.key {
  background: #22c55e;
  color: white;
}

.report-opt-badge.stu-wrong {
  background: #ef4444;
  color: white;
}

/* Benar/Salah Table */
.report-bs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.report-bs-table th, .report-bs-table td {
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  text-align: left;
}

.report-bs-table th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Result Box */
.report-result-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 6px;
  margin-top: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.report-result-box.correct {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #15803d;
}

.report-result-box.wrong {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #b91c1c;
}

/* Print Overrides */
@media print {
  .no-print { display: none !important; }
  .report-overlay { position: static !important; overflow: visible !important; background: white !important; }
  .report-overlay[style*="display: block"], .report-overlay[style*="display: flex"] { display: block !important; }
  .report-paper-wrapper { padding: 0 !important; display: block !important; overflow: visible !important; }
  .report-paper {
    box-shadow: none !important; border: none !important; padding: 0 !important; max-width: 100% !important; width: 100% !important;
    margin: 0 !important;
  }
  .report-q { page-break-inside: avoid; break-inside: avoid; }
}

.detail-row {
  display: flex;
  align-items: flex-start;
}

.detail-label {
  width: 60px;
  font-weight: 600;
  color: #4a5568;
}

.detail-colon {
  width: 8px;
  color: #4a5568;
}

.detail-value {
  flex: 1;
  font-weight: 700;
  color: #1a202c;
  word-break: break-word;
}

/* ==================================================== */
/* STUDENT REPORT OVERLAY STYLES                        */
/* ==================================================== */
.report-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #f1f5f9;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.report-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.25rem;
  height: 56px;
  min-height: 56px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-sizing: border-box;
  width: 100%;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.report-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.report-toolbar-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.report-title-text {
  font-weight: 700;
  color: #1e293b;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.report-subtitle {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.report-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-report-action-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1rem;
  flex-shrink: 0;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

.btn-report-action-icon:hover {
  transform: translateY(-1px);
  filter: brightness(0.95);
}

.btn-report-action-icon:active {
  transform: translateY(0);
}

.report-paper-wrapper {
  flex: 1;
  padding: 24px 20px;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
}

.report-paper {
  background: #ffffff;
  width: 100%;
  max-width: 800px;
  min-height: 1056px; /* Approx A4 height at 96dpi */
  padding: 40px 50px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  box-sizing: border-box;
  position: relative;
  /* Kertas laporan selalu berwarna terang seperti hasil cetak, juga saat Mode Gelap.
     Variabel tema dikunci ke nilai mode terang agar teks tidak ikut menjadi putih. */
  --bg-app: hsl(220, 30%, 97%);
  --bg-sidebar: hsl(0, 0%, 100%);
  --bg-card: hsla(0, 0%, 100%, 0.75);
  --bg-elevated: hsl(220, 30%, 98%);
  --border-color: hsl(220, 20%, 88%);
  --text-main: hsl(225, 25%, 20%);
  --text-muted: hsl(220, 15%, 50%);
  --shadow-color: hsla(220, 30%, 15%, 0.08);
  --primary-light: hsl(var(--primary-hue), 70%, 95%);
  --success-light: hsl(145, 65%, 94%);
  --warning-light: hsl(42, 95%, 92%);
  --danger-light: hsl(355, 75%, 95%);
  color: var(--text-main);
  color-scheme: light;
}

/* Report Kop (Header) */
.report-kop {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 3px solid #0f172a;
  position: relative;
}

.report-kop-logo {
  width: 90px;
  height: 90px;
  object-fit: contain;
  flex-shrink: 0;
}

.report-kop-text {
  flex: 1;
  text-align: left;
  padding-left: 1.5rem; /* Add some spacing between logo and text */
  padding-right: 90px; /* Space reserved for score badge so text never gets covered */
  min-width: 0;
}

.report-teacher-note {
  position: absolute;
  right: 100px;
  top: 18px;
  max-width: 200px;
  font-family: 'Caveat', cursive;
  font-weight: 600;
  color: #0056b3;
  font-size: 1.1rem;
  line-height: 1.2;
  transform: rotate(-3deg);
  z-index: 2;
}

.report-kop-text h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-kop-text p {
  margin: 5px 0 0;
  font-size: 1rem;
  color: #334155;
}

/* Score Badge */
.report-score-wrap {
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-score-svg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
}

.report-score-value {
  font-size: 3.2rem;
  font-weight: 400;
  color: hsl(355, 80%, 45%);
  z-index: 1;
  font-family: 'Just Me Again Down Here', cursive;
  margin-top: 5px;
}

/* Report Identity */
.report-identity {
  font-size: 1rem;
  margin-bottom: 30px;
  color: #1e293b;
}

.report-identity table {
  border-collapse: collapse;
}

.report-identity td {
  padding: 5px 12px 5px 0;
  vertical-align: top;
}

/* Questions */
.report-q {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px dashed #e2e8f0;
}

.report-q-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.report-q-num {
  font-weight: 700;
  font-size: 1.1rem;
}

/* Options */
.report-opts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.report-opt.is-key {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

.report-opt.is-student-wrong {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.report-opt-letter {
  font-weight: 700;
  color: #475569;
  margin-top: 2px;
}

.report-opt-content {
  flex: 1;
}

.report-opt-badge {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.report-opt-badge.key {
  background: #22c55e;
  color: white;
}

.report-opt-badge.stu-wrong {
  background: #ef4444;
  color: white;
}

/* Benar/Salah Table */
.report-bs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.report-bs-table th, .report-bs-table td {
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  text-align: left;
}

.report-bs-table th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Result Box */
.report-result-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 6px;
  margin-top: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.report-result-box.correct {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #15803d;
}

.report-result-box.wrong {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #b91c1c;
}

/* Print Overrides */
@media print {
  .no-print { display: none !important; }
  .report-overlay { position: static !important; overflow: visible !important; background: white !important; display: block !important; }
  .report-paper-wrapper { padding: 0 !important; display: block !important; overflow: visible !important; }
  .report-paper {
    box-shadow: none !important; border: none !important; padding: 0 !important; max-width: 100% !important; width: 100% !important;
    margin: 0 !important; min-height: 0 !important;
  }
  .report-q { page-break-inside: avoid; break-inside: avoid; }
  .report-kop, .report-identity { page-break-inside: avoid; break-inside: avoid; }
}

/* ====================================================
   FULL PAGE PREVIEW (FPP)
   ==================================================== */
.fpp-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-body, #f4f6f9);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fpp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--bg-sidebar, #ffffff);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.fpp-header-left .fpp-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-main, #1e293b);
}

.fpp-header-left .fpp-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
  margin-top: 0.25rem;
}

.fpp-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.fpp-count {
  font-weight: 600;
  background: var(--primary, #3b82f6);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

.fpp-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  justify-content: center;
}

.fpp-paper {
  background: var(--bg-sidebar, #ffffff);
  width: 100%;
  max-width: 900px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: 2.5rem;
  min-height: 100%;
}

.fpp-q {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px dashed var(--border-color, #cbd5e1);
}
.fpp-q:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.fpp-q-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.fpp-q-num {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--text-main, #0f172a);
}

.fpp-q-badge {
  font-size: 0.75rem;
  background: var(--purple-light, #f3e8ff);
  color: var(--purple, #a855f7);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: bold;
}

.fpp-q-img {
  max-width: 100%;
  max-height: 300px;
  display: block;
  margin-bottom: 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color, #e2e8f0);
}

.fpp-q-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-main, #334155);
  margin-bottom: 1rem;
}

.fpp-opts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fpp-opt {
  display: flex;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-body, #f8fafc);
}

.fpp-opt.correct {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--success-color, #10b981);
}

.fpp-opt-label {
  font-weight: bold;
  margin-right: 0.75rem;
  color: var(--text-main, #1e293b);
  min-width: 20px;
}

.fpp-opt-content {
  flex: 1;
  line-height: 1.5;
}

.fpp-opt-img {
  max-width: 200px;
  max-height: 150px;
  margin-top: 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.fpp-bs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.fpp-bs-table th, .fpp-bs-table td {
  border: 1px solid var(--border-color, #cbd5e1);
  padding: 0.75rem;
  text-align: left;
}

.fpp-bs-table th {
  background: var(--bg-body, #f1f5f9);
  font-weight: bold;
}

.fpp-bs-table th:nth-child(2),
.fpp-bs-table th:nth-child(3),
.fpp-bs-table td:nth-child(2),
.fpp-bs-table td:nth-child(3) {
  text-align: center;
  width: 80px;
}

.fpp-bs-correct {
  color: var(--success-color, #10b981);
  font-weight: bold;
  font-size: 1.25rem;
}

.fpp-isian-box, .fpp-esai-box, .fpp-rubric {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 6px;
  background: var(--bg-body, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  line-height: 1.5;
}

.fpp-isian-box strong, .fpp-rubric strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-main, #0f172a);
}

.fpp-esai-box {
  color: var(--text-muted, #94a3b8);
  font-style: italic;
  min-height: 80px;
}

/* Quill Custom Image Resize Overlay */
.quill-image-resize-overlay {
  position: absolute;
  border: 2px dashed #3b82f6;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 100;
}

.quill-image-resize-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background-color: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  pointer-events: none;
  white-space: nowrap;
  z-index: 101;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.quill-image-resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #ffffff;
  border: 2px solid #3b82f6;
  border-radius: 50%;
  pointer-events: auto;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.quill-image-resize-handle.ql-resize-nw {
  top: -6px;
  left: -6px;
  cursor: nwse-resize;
}

.quill-image-resize-handle.ql-resize-ne {
  top: -6px;
  right: -6px;
  cursor: nesw-resize;
}

.quill-image-resize-handle.ql-resize-se {
  bottom: -6px;
  right: -6px;
  cursor: nwse-resize;
}

.quill-image-resize-handle.ql-resize-sw {
  bottom: -6px;
  left: -6px;
  cursor: nesw-resize;
}

/* Stacked Vertical Fraction Styling */
.cbt-frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  font-size: 0.85em;
  padding: 0 0.15em;
  line-height: 1.1;
  position: relative;
  top: -0.1em;
}

.cbt-frac span:first-child {
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 1px;
}

.cbt-frac span:last-child {
  padding-top: 1px;
}

/* Student Lobby Tabs */
.student-tab-btn {
  background: none;
  border: none;
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.student-tab-btn:hover {
  color: var(--primary);
}

.student-tab-btn.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 4px 12px hsla(var(--primary-hue), 70%, 55%, 0.25);
}

.student-tab-btn.active:hover {
  color: #fff;
}

.student-tab-pane {
  display: none;
  animation: fadeIn var(--transition-normal);
}

.student-tab-pane.active {
  display: block;
}

/* ==================================================== */
/* STUDENT GRADES RECAP & MOBILE CARD SYSTEM            */
/* ==================================================== */
.student-lobby-header {
  margin-bottom: 2rem;
  transition: all var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.student-user-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  margin-left: auto;
  margin-right: 1.25rem;
  line-height: 1.3;
}

.student-lobby-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.student-lobby-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.meta-sep {
  opacity: 0.5;
  margin: 0 4px;
}

.student-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.student-header-actions #btn-student-logout,
.btn-student-logout-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.95rem;
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.student-header-actions .nav-theme-toggle {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Tab murid: pil sederhana di tengah */
.lobby-tabs-bar {
  display: flex;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  margin: 1.5rem auto 1.75rem;
  padding: 5px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 999px;
}

/* ---- Halaman awal murid: sapaan + kode ujian ---- */
.student-start-card {
  max-width: 460px;
  margin: 0 auto 2rem;
  padding: 2rem 1.75rem;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: 0 10px 30px var(--shadow-color);
  text-align: center;
}

.student-hello-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #F59E0B;
  background: hsl(42, 95%, 92%);
}

.student-hello h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  line-height: 1.25;
}

.student-hello p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.student-hello-meta {
  display: inline-flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.student-hello-meta span {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 3px 12px;
}

.student-hello-meta strong {
  color: var(--text-main);
}

.token-label {
  display: block;
  margin: 1.75rem 0 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.token-input {
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  display: block;
  padding: 0.7rem 1rem;
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0.45em;
  text-indent: 0.45em; /* imbangi letter-spacing agar tetap di tengah */
  text-align: center;
  text-transform: uppercase;
  color: var(--text-main);
  background: var(--bg-app);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.token-input::placeholder {
  color: var(--text-muted);
  opacity: 0.45;
}

.token-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px hsla(var(--primary-hue), 70%, 55%, 0.15);
}

.token-help {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.exam-found {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  text-align: left;
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: var(--success-light);
  border: 1px solid hsla(145, 65%, 42%, 0.35);
}

.exam-found > i {
  color: var(--success);
  font-size: 1.3rem;
  margin-top: 2px;
}

.exam-found-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.exam-found-title {
  font-weight: 700;
  color: var(--text-main);
}

.exam-found-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-start-exam {
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.95rem 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 16px;
  box-shadow: 0 6px 0 hsl(var(--primary-hue), 60%, 40%);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.btn-start-exam:hover {
  background: var(--primary-hover);
}

/* Efek "ditekan" seperti tombol sungguhan, tanpa animasi berat */
.btn-start-exam:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 hsl(var(--primary-hue), 60%, 40%);
}

.btn-start-exam:focus-visible {
  outline: 3px solid hsla(var(--primary-hue), 70%, 55%, 0.4);
  outline-offset: 3px;
}

.btn-start-exam:disabled {
  opacity: 0.6;
  cursor: wait;
}

.student-rules {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  text-align: left;
  border-radius: 16px;
  background: var(--bg-app);
  border: 1px dashed var(--border-color);
}

.student-rules-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.student-rules ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.student-rules li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text-main);
}

.student-rules li > i {
  color: var(--success);
  margin-top: 3px;
  width: 14px;
  text-align: center;
}

.student-rules li.rule-warn > i {
  color: #EA580C;
}

.student-rules-note {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: pre-line;
}

@media (max-width: 480px) {
  .student-start-card {
    padding: 1.5rem 1.1rem;
    border-radius: 20px;
  }
  .student-hello h2 { font-size: 1.3rem; }
  .token-input { font-size: 1.6rem; }
}

.student-grades-card {
  padding: 2rem;
  border-radius: 16px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px var(--shadow-color);
  width: 100%;
  box-sizing: border-box;
}

.student-grades-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.student-grades-title-area {
  flex: 1;
  min-width: 260px;
}

.student-grades-filter-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  box-shadow: 0 2px 6px var(--shadow-color);
  flex-shrink: 0;
}

.student-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  margin: 0;
}

.student-filter-label i {
  color: var(--primary);
}

.student-filter-select-wrap {
  min-width: 190px;
}

.student-filter-select {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  background-color: var(--bg-app);
  cursor: pointer;
  outline: none;
  width: 100%;
  height: 38px;
  transition: all var(--transition-fast);
}

.student-filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

/* Desktop Table View */
.student-grades-table-wrapper {
  display: block;
  width: 100%;
  overflow-x: auto;
}

.grade-table-score {
  display: inline-block;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  line-height: 1.2;
}

/* Mobile Cards View */
.student-grades-mobile-cards {
  display: none;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.student-grade-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.15rem;
  box-shadow: 0 2px 10px var(--shadow-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.student-grade-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--shadow-color);
}

/* Accent strip on the left edge */
.student-grade-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--primary);
  border-radius: 14px 0 0 14px;
}

.student-grade-card.score-high::before {
  background: var(--success);
}

.student-grade-card.score-mid::before {
  background: var(--primary);
}

.student-grade-card.score-low::before {
  background: var(--warning);
}

/* Grade Card Top Header */
.grade-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.grade-subject-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex: 1;
  min-width: 0;
}

.grade-subject-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grade-score-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  border-radius: 10px;
  min-width: 65px;
  text-align: center;
  flex-shrink: 0;
}

.grade-score-badge .score-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  margin-bottom: 2px;
  opacity: 0.85;
}

.grade-score-badge .score-value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

/* Score Badge Variants */
.score-badge-high {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.score-badge-mid {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.score-badge-low {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.score-badge-none {
  background: var(--bg-app);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Exam Title */
.grade-exam-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  word-break: break-word;
}

/* Card Meta Row */
.grade-card-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.grade-card-meta i {
  color: var(--primary);
  font-size: 0.85rem;
}

/* Teacher Note Box */
.grade-teacher-note-box {
  background: rgba(0, 0, 0, 0.025);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 0.6rem 0.85rem;
  font-size: 0.825rem;
}

.dark-theme .grade-teacher-note-box {
  background: rgba(255, 255, 255, 0.035);
}

.grade-teacher-note-box .note-title {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.grade-teacher-note-box .note-body {
  color: var(--text-main);
  font-style: italic;
  line-height: 1.4;
  word-break: break-word;
}

/* Full Width PDF Button */
.btn-student-pdf-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  background-color: var(--danger);
  color: white;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 0.25rem;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

.btn-student-pdf-action:hover {
  background-color: var(--danger-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
}

.btn-student-pdf-action:active {
  transform: translateY(0);
}

/* Mobile & Small Screen Breakpoint */
@media (max-width: 768px) {
  .student-lobby-header {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    grid-template-areas:
      "brand actions"
      "badge badge" !important;
    gap: 0.45rem 0.5rem !important;
    padding: 0.5rem 0.75rem !important;
    height: auto !important;
    min-height: unset !important;
    margin-bottom: 1rem !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  
  .student-lobby-header .header-brand {
    grid-area: brand;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .student-lobby-header .header-brand h2 {
    font-size: 0.95rem;
    line-height: 1.2;
    margin: 0;
  }

  .student-lobby-header .header-brand .badge {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .student-lobby-header .student-header-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-self: end;
    flex-shrink: 0;
  }

  .student-lobby-header .student-header-actions .btn-logout {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    font-size: 0.85rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .student-lobby-header .student-header-actions .nav-theme-toggle {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .student-lobby-header .student-user-badge {
    grid-area: badge;
    width: 100%;
    margin: 0 !important;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    box-sizing: border-box;
    text-align: left;
  }

  .student-lobby-header .student-lobby-name {
    max-width: 52%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.825rem;
    font-weight: 700;
  }

  .student-lobby-header .student-lobby-meta {
    margin-top: 0;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
  }

  .student-lobby-container {
    padding: 0 0.6rem !important;
  }

  .lobby-tabs-bar {
    gap: 6px;
    margin-bottom: 1.25rem !important;
  }

  .student-tab-btn {
    flex: 1;
    justify-content: center;
    padding: 0.65rem 0.5rem;
    font-size: 0.875rem;
    gap: 6px;
  }

  .student-grades-card {
    padding: 1rem 0.85rem;
    border-radius: 12px;
  }

  .student-grades-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .student-grades-title-area h3 {
    font-size: 1.05rem;
  }

  .student-grades-title-area p {
    font-size: 0.8rem;
    line-height: 1.35;
    margin-bottom: 0;
  }

  .student-grades-filter-box {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
  }

  .student-filter-label {
    font-size: 0.8rem;
  }

  .student-filter-select-wrap {
    width: 100%;
    min-width: 100%;
  }

  .student-filter-select {
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box;
    font-size: 0.85rem;
    height: 38px;
  }

  /* Completely switch table off on mobile in favor of 100% fit cards */
  .student-grades-table-wrapper {
    display: none !important;
  }

  .student-grades-mobile-cards {
    display: flex !important;
  }

  /* Adjust report overlay on mobile */
  .report-toolbar {
    padding: 0 0.65rem;
    height: 52px;
    min-height: 52px;
    gap: 0.5rem;
    flex-wrap: nowrap !important;
  }
  .report-toolbar-left {
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
  }
  .report-toolbar-right {
    gap: 0.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
  }
  .btn-report-action-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    font-size: 0.95rem;
    border-radius: 8px;
  }
  .report-title-text {
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .report-subtitle {
    font-size: 0.725rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .report-paper-wrapper {
    padding: 14px 8px 30px 8px;
    width: 100%;
    box-sizing: border-box;
  }
  .report-paper {
    padding: 16px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .report-kop {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    position: relative;
    border-bottom: 2px solid #0f172a;
  }
  .report-kop-logo {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
  }
  .report-kop-text {
    padding-left: 0.25rem;
    padding-right: 65px; /* Ensures text never overlaps with score badge */
    flex: 1;
    min-width: 0;
  }
  .report-kop-text h2 {
    font-size: 0.95rem;
    line-height: 1.25;
    word-break: break-word;
  }
  .report-kop-text p {
    font-size: 0.75rem;
    line-height: 1.2;
    margin: 2px 0 0;
  }
  .report-kop-text h3 {
    font-size: 0.8rem;
    line-height: 1.2;
  }
  .report-teacher-note {
    position: static !important;
    transform: none !important;
    max-width: 100% !important;
    margin: 8px 0 0 0 !important;
    padding: 6px 10px;
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    border-radius: 4px;
    font-size: 0.95rem !important;
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .report-score-wrap {
    width: 58px;
    height: 58px;
    top: 0;
    right: 0;
    position: absolute;
    flex-shrink: 0;
  }
  .report-score-value {
    font-size: 2rem;
  }
  .report-identity {
    font-size: 0.85rem;
    margin-bottom: 18px;
  }
  .report-identity td {
    padding: 3px 6px 3px 0;
  }
}

/* ==================================================== */
/* CHAT GURU & ADMIN STYLES                             */
/* ==================================================== */
.chat-container {
  display: flex;
  height: calc(100vh - 200px);
  min-height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-top: 1rem;
}

.chat-sidebar {
  width: 250px;
  background: #f8fafc;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.chat-sidebar h3 {
  padding: 1rem;
  margin: 0;
  font-size: 1rem;
  border-bottom: 1px solid var(--border-color);
  background: white;
  color: var(--text-main);
  font-weight: 700;
}

.online-users-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}

.online-users-list li {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.online-users-list li .avatar {
  width: 32px;
  height: 32px;
  background: var(--grad-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.8rem;
}

.online-users-list li.admin .avatar {
  background: var(--danger);
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #f1f5f9;
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.chat-message.self {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-message.other {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-message.system {
  align-self: center;
  align-items: center;
  max-width: 90%;
  margin: 10px 0;
}

.chat-message.system p {
  background: rgba(0,0,0,0.05);
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 5px 15px;
  border-radius: 20px;
  margin: 0;
}

.chat-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.chat-bubble {
  padding: 10px 15px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-message.self .chat-bubble {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 2px;
}

.chat-message.other .chat-bubble {
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 2px;
}

.chat-input-area {
  display: flex;
  padding: 1rem;
  background: white;
  border-top: 1px solid var(--border-color);
  gap: 10px;
}

.chat-input-area input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  outline: none;
  font-size: 0.95rem;
}

.chat-input-area input:focus {
  border-color: var(--primary);
}

.chat-input-area button {
  border-radius: 20px;
  padding: 0 1.5rem;
}

/* ==================================================== */
/* FLOATING CHAT WIDGET STYLES                          */
/* ==================================================== */
.fab-chat {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background 0.3s ease;
}

.fab-chat:hover {
  transform: scale(1.05);
  background: var(--primary-dark);
}

.chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--danger);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 20px;
  border: 2px solid white;
}

#floating-chat-widget {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 350px;
  height: 500px;
  max-height: calc(100vh - 120px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform-origin: bottom right;
}

#floating-chat-widget.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.floating-chat-header {
  background: var(--primary);
  color: white;
  padding: 12px 15px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-close-chat {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.2s;
}

.btn-close-chat:hover {
  opacity: 1;
}

.floating-chat-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.floating-chat-sidebar {
  display: none; /* Hide sidebar in floating widget or make it a dropdown? Let's hide it by default or make it a small horizontal bar */
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 15px;
  font-size: 0.85rem;
}

/* We can show online users horizontally or just a count */
.online-title {
  font-weight: 600;
  margin-bottom: 5px;
}

.floating-chat-sidebar .online-users-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
}
.floating-chat-sidebar .online-users-list li {
  padding: 0;
  border: none;
}
.floating-chat-sidebar .user-info {
  display: none; /* Only show avatars in floating */
}

.floating-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}

#floating-chat-widget .chat-messages {
  padding: 1rem;
}

#floating-chat-widget .chat-input-area {
  padding: 0.75rem;
}
#floating-chat-widget .chat-input-area input {
  padding: 0.5rem 1rem;
}

/* ====================================================
   MENU KOREKSI: SORTBY & TAMPILAN GRID (KARTU) & LIST
   ==================================================== */
.grading-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.grading-view-toggle {
  display: inline-flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 4px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
}

.grading-view-toggle .btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.grading-view-toggle .btn.active {
  background-color: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  font-weight: 600;
  box-shadow: 0 2px 8px hsla(var(--primary-hue), 70%, 55%, 0.35);
}

/* Exam Card (Kartu Ujian untuk Dikoreksi) */
.grading-exam-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  box-shadow: 0 4px 16px var(--shadow-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.grading-exam-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px var(--shadow-color);
  border-color: var(--primary);
}

.grading-exam-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.grading-exam-subject {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.grading-exam-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.grading-exam-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.grading-exam-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grading-exam-stats-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-app);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.grading-exam-stat-col {
  display: flex;
  flex-direction: column;
}

.grading-exam-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.grading-exam-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Student Attempt Card (Kartu Jawaban Siswa) */
.grading-student-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  box-shadow: 0 4px 16px var(--shadow-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.grading-student-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow-color);
}

.grading-student-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.grading-student-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.grading-student-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.grading-student-score-box {
  margin: 0.85rem 0;
  padding: 10px 14px;
  background: var(--bg-app);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-color);
}

.grading-student-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
}

@media (max-width: 768px) {
  .grading-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Attendance Scan Popup & Row Highlighting */
#attendance-scan-popup {
  box-shadow: 0 12px 32px rgba(22, 101, 52, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.attendance-row-present {
  background-color: rgba(34, 197, 94, 0.16) !important;
  border-left: 5px solid #22c55e !important;
  transition: all 0.3s ease;
}

.attendance-row-present:hover {
  background-color: rgba(34, 197, 94, 0.22) !important;
}

/* ====================================================
   BANK SOAL: VIEW MODE TOGGLE SWITCHER (TABEL VS DOC)
   ==================================================== */
.view-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  gap: 3px;
}

.btn-view-toggle {
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  user-select: none;
}

.btn-view-toggle:hover:not(.active) {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.05);
}

.btn-view-toggle.active {
  background: #6366f1 !important;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.btn-view-toggle.active i {
  color: #ffffff !important;
}

.btn-view-toggle:not(.active) i {
  color: inherit;
}

.word-doc-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0 2rem 0;
  width: 100%;
}

.word-doc-paper {
  background: #ffffff;
  color: #1e293b;
  width: 100%;
  max-width: 860px;
  min-height: 1056px;
  padding: 44px 52px;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
  position: relative;
  font-family: 'Times New Roman', Times, serif, 'Segoe UI', sans-serif;
}

/* Document Kop */
.word-doc-kop {
  border-bottom: 3px double #1e293b;
  padding-bottom: 14px;
  margin-bottom: 24px;
  position: relative;
}

.word-doc-kop-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

.word-doc-kop-logo {
  width: 65px;
  height: 65px;
  object-fit: contain;
  flex-shrink: 0;
}

.word-doc-kop-text h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0f172a;
  font-family: inherit;
}

.word-doc-kop-text h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 2px 0 0 0;
  color: #334155;
  font-family: inherit;
}

.word-doc-kop-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
  margin-top: 14px;
  font-size: 0.85rem;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.word-doc-meta-item {
  display: flex;
  gap: 8px;
}

.word-doc-meta-label {
  font-weight: 600;
  min-width: 110px;
  color: #475569;
}

.word-doc-meta-val {
  font-weight: 500;
  color: #0f172a;
}

/* Question Item in Document */
.doc-question-item {
  position: relative;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: 6px;
  border: 1px solid #f1f5f9;
  background: #ffffff;
  transition: all 0.2s ease;
}

.doc-question-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.doc-question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.doc-question-number {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-question-type-badge {
  font-size: 0.72rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  background: #ede9fe;
  color: #6d28d9;
}

.doc-question-actions {
  display: flex;
  gap: 5px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.doc-question-item:hover .doc-question-actions {
  opacity: 1;
}

.doc-question-body {
  font-size: 0.98rem;
  line-height: 1.65;
  color: #1e293b;
}

.doc-question-text {
  margin-bottom: 10px;
  word-break: break-word;
}

.doc-question-img {
  max-width: 100%;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  margin: 6px 0 12px 0;
  display: block;
}

/* Options List */
.doc-options-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.doc-option-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: background 0.15s;
}

.doc-option-item.is-key {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.3);
}

.doc-option-letter {
  font-weight: 700;
  min-width: 22px;
  color: #334155;
}

.doc-option-text {
  flex: 1;
}

.doc-key-tag {
  font-size: 0.72rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #16a34a;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.doc-key-box {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.doc-rubric-box {
  margin-top: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #475569;
}

/* Inline Edit Card */
.doc-inline-edit-card {
  background: #f8fafc;
  border: 1.5px solid var(--primary, #3b82f6);
  border-radius: 6px;
  padding: 16px;
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.doc-inline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.doc-inline-opt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.doc-inline-opt-row label {
  min-width: 26px;
  font-weight: 700;
  margin: 0;
}

.doc-inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
  flex-wrap: wrap;
}

.doc-inline-stimulus-box {
  transition: all 0.2s ease;
}

.doc-inline-stimulus-box:hover {
  border-color: var(--primary, #3b82f6) !important;
  background: rgba(59, 130, 246, 0.03) !important;
}

.doc-inline-opt-row input[type="text"]:focus {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.doc-question-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  margin: 8px 0;
  display: block;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

#table-questions-body td img {
  max-height: 28px;
  max-width: 50px;
  vertical-align: middle;
  border-radius: 3px;
  border: 1px solid #cbd5e1;
  margin-right: 4px;
  display: inline-block;
  object-fit: contain;
}

.inline-quill-wrapper .ql-toolbar.ql-snow {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  background: #f8fafc;
  border-color: #cbd5e1;
  padding: 6px 8px;
}

.inline-quill-wrapper .ql-container.ql-snow {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  border-color: #cbd5e1;
  background: #ffffff;
  font-family: inherit;
}

.inline-quill-wrapper .ql-editor {
  min-height: 140px;
  font-size: 0.98rem;
  line-height: 1.6;
}

.inline-quill-wrapper .ql-editor img {
  max-width: 100%;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  margin: 4px 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Print Overrides for Document View */
@media print {
  .no-print, .bank-view-switcher-bar, .tab-header, .sidebar, .app-header, .doc-question-actions {
    display: none !important;
  }
  .word-doc-container {
    padding: 0 !important;
    display: block !important;
  }
  .word-doc-paper {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .doc-question-item {
    page-break-inside: avoid;
    break-inside: avoid;
    border: none !important;
    padding: 8px 0 !important;
  }
}

/* Export Word Modal & Tab Styles */
.btn-modal-export-tab {
  transition: all 0.2s ease;
  font-size: 0.9rem;
  border-radius: 6px 6px 0 0;
}
.btn-modal-export-tab:hover {
  background: rgba(43, 87, 154, 0.08) !important;
  color: #2b579a !important;
}
.btn-modal-export-tab.active {
  color: #2b579a !important;
  border-bottom: 3px solid #2b579a !important;
}
.modal-export-tab-content.hidden {
  display: none !important;
}

.export-word-modal-card select.form-control,
.export-word-modal-card input.form-control {
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.export-word-modal-card select.form-control:focus,
.export-word-modal-card input.form-control:focus {
  border-color: #2b579a;
  box-shadow: 0 0 0 2px rgba(43, 87, 154, 0.15);
  outline: none;
}

.export-word-modal-card label:hover {
  border-color: rgba(43, 87, 154, 0.4) !important;
}

/* Two-logo Kop in On-screen Word Doc Preview */
.word-doc-kop-twologos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.word-doc-kop-twologos .kop-logo-img {
  width: 65px;
  height: 75px;
  object-fit: contain;
}
.word-doc-kop-twologos .kop-center-text {
  flex: 1;
  text-align: center;
}
.word-doc-kop-twologos .kop-center-text h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 2px 0;
  text-transform: uppercase;
  color: #111827;
}
.word-doc-kop-twologos .kop-center-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 2px 0;
  text-transform: uppercase;
  color: #111827;
}
.word-doc-kop-twologos .kop-center-text h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 2px 0;
  text-transform: uppercase;
  color: #111827;
}
.word-doc-kop-twologos .kop-center-text h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  color: #111827;
}
.word-doc-kop-line {
  height: 2px;
  background-color: #000;
  margin: 6px 0 12px 0;
}
.word-doc-identity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 30px;
  font-size: 0.95rem;
  color: #111827;
  padding: 4px 0;
}
.word-doc-identity-line {
  height: 3px;
  background-color: #000;
  margin: 10px 0 20px 0;
}




/* ====================================================
   MULTI-SEKOLAH: LAYAR AWAL & ADMIN PUSAT
   ==================================================== */
.btn-superadmin-corner {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-sidebar);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--shadow-color);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.btn-superadmin-corner:hover,
.btn-superadmin-corner:focus-visible {
  color: var(--primary);
  border-color: var(--primary);
}

.login-step-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.login-step-title i { color: var(--primary); }
.login-step-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: -0.5rem 0 1.25rem;
}

.login-school-group { margin-bottom: 1.25rem; }

.link-btn {
  border: none;
  background: none;
  padding: 0.25rem;
  color: var(--primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.link-btn:hover,
.link-btn:focus-visible { text-decoration: underline; }

.login-operator-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  margin-top: 1.25rem;
  color: var(--text-muted);
}
.login-operator-link:hover { color: var(--primary); }

.login-form-caption {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.form-hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.superadmin-content {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}
.superadmin-stats { margin-bottom: 1.5rem; }
.superadmin-card { padding: 1.25rem; }
.superadmin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.superadmin-search { flex: 1; min-width: 200px; max-width: 360px; }
.superadmin-search input { padding-left: 2.75rem; }
.sa-school-name { font-weight: 600; white-space: normal; }
.sa-school-id { display: block; font-size: 0.75rem; color: var(--text-muted); }
.sa-actions { display: flex; gap: 0.4rem; justify-content: flex-end; flex-wrap: wrap; }

@media (max-width: 640px) {
  .superadmin-content { padding: 1rem; }
  .btn-superadmin-corner { top: 0.75rem; right: 0.75rem; }
}

/* Dialog aplikasi (pengganti confirm/prompt/alert) — di atas modal lain */
.modal.app-dialog { z-index: 10001; }
.app-dialog-content { max-width: 460px; width: calc(100% - 32px); }
.app-dialog-message {
  white-space: pre-line;
  line-height: 1.5;
  color: var(--text-main);
  margin: 0.25rem 0 1rem;
}
.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}
#app-dialog-input { margin-bottom: 0.25rem; }

/* Papan Info (dari Admin Pusat) */
.info-board { padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.info-board-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.info-board-header h2 { font-size: 1.15rem; margin: 0; }
.info-board-header h2 i { color: var(--primary); margin-right: 0.35rem; }
.info-board-source { font-size: 0.8rem; color: var(--text-muted); }
.info-board-empty { color: var(--text-muted); margin: 0.25rem 0; }
.info-board-list, .sa-info-list { display: flex; flex-direction: column; gap: 0.75rem; max-height: 640px; overflow-y: auto; }
.info-item {
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.info-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.info-item-head h3 { font-size: 1rem; margin: 0; color: var(--text-main); }
.info-item-date { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.info-item-body {
  white-space: pre-line;
  line-height: 1.55;
  margin-top: 0.5rem;
  color: var(--text-main);
  overflow-wrap: anywhere;
}
.info-item-image { display: block; margin-top: 0.75rem; }
.info-item-image img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  margin: 0 auto;
  border-radius: 8px;
  object-fit: contain;
}
.sa-info-card { margin-top: 1.5rem; }
.sa-section-title { font-size: 1.15rem; margin: 0; }
.sa-section-title i { color: var(--primary); margin-right: 0.35rem; }
.sa-section-sub { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--text-muted); }
.sa-info-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.5rem; }
.sa-info-meta .sa-actions { margin-left: auto; }
.info-form-image-preview { margin-top: 0.5rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.info-form-image-preview img { max-width: 100%; max-height: 200px; border-radius: 8px; border: 1px solid var(--border-color); }
.info-form-check { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }

/* Bank Soal Pusat */
.sa-subject-area { display: flex; flex-direction: column; gap: 0.6rem; }
.sa-subject-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.sa-subject-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sa-subject-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.4rem 0.3rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-main);
}
.sa-subject-chip small { color: var(--text-muted); }
.sa-subject-chip button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}
.sa-subject-chip button:hover { color: #dc2626; background: rgba(220, 38, 38, 0.1); }
.sa-subject-form { display: flex; gap: 0.5rem; max-width: 460px; }
.sa-subject-form .form-control { flex: 1; }
.blast-packet-intro { margin: 0 0 1rem; line-height: 1.5; color: var(--text-main); }
.blast-school-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 240px;
  overflow-y: auto;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
#modal-blast-packet { z-index: 10000; }
.blast-target-options { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-bottom: 0.75rem; }
.blast-target-options .info-form-check, .blast-school-list .info-form-check { margin: 0; }

/* Menu samping Admin Pusat (Kelola Sekolah / Kelola Soal) */
.sa-sidebar-nav { display: flex; flex-direction: column; gap: 0.5rem; }
#teacher-pusat-nav { margin-bottom: 0.5rem; }
.content-area > .superadmin-content { padding: 0; max-width: 1200px; margin: 0 auto; }
@media (max-width: 768px) {
  .sa-sidebar-nav { flex-direction: row; gap: 0.25rem; }
  #teacher-pusat-nav { margin-bottom: 0.25rem; }
}
.filter-card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.form-grid-3.pusat-no-class { grid-template-columns: 1fr 1fr; }
@media (max-width: 768px) { .form-grid-3.pusat-no-class { grid-template-columns: 1fr; } }
.math-fallback { font-family: "Times New Roman", serif; font-style: italic; white-space: nowrap; }

/* Modal Buat Soal: tab Tulis Soal / Import JSON */
.question-modal-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.3rem;
  margin-bottom: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}
.question-modal-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.question-modal-tab:hover:not(.active) {
  color: var(--text-main);
  background: rgba(99, 102, 241, 0.08);
}
.question-modal-tab.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}
.question-modal-tab[data-qtab="json"].active {
  background: linear-gradient(135deg, #ea580c, #f97316);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
}
.json-import-target {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.08);
  font-size: 0.85rem;
  color: var(--text-main);
}
.json-import-target i { color: var(--primary); margin-right: 0.3rem; }

/* Deretan tombol aksi di kepala halaman (mis. Manajemen Siswa): ringkas & seragam */
.tab-header-action .toolbar-uniform {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  max-width: 75%;
}
.toolbar-uniform .btn {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  gap: 0.45rem;
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: none;
}
.toolbar-uniform .btn i {
  color: var(--primary);
  font-size: 0.85rem;
}
.toolbar-uniform .btn:hover {
  background: var(--bg-card);
  color: var(--primary);
  border-color: var(--primary);
  transform: none;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}
.toolbar-uniform .btn.toolbar-danger:hover,
.toolbar-uniform .btn.toolbar-danger:hover i {
  color: var(--danger);
  border-color: var(--danger);
}
@media (max-width: 900px) {
  .tab-header-action .toolbar-uniform { max-width: 100%; justify-content: flex-start; }
}
.tab-header-action:has(.toolbar-uniform) { gap: 1.5rem; }
.tab-header-action:has(.toolbar-uniform) > div:first-child { flex: 1 1 260px; min-width: 0; }
.tab-header-action .toolbar-uniform { flex: 0 1 auto; }

/* Analisis Hasil Ulangan */
.badge-secondary { background-color: var(--bg-hover, rgba(100,116,139,0.12)); color: var(--text-muted); }
.analysis-filter { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.analysis-filter .form-group { margin-bottom: 0; flex: 1 1 320px; min-width: 0; }
.analysis-filter .form-group label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 5px; }
.analysis-filter .analysis-kktp { flex: 0 0 110px; }
.analysis-filter .btn { height: 42px; }
.analysis-notes { display: flex; flex-direction: column; gap: 6px; margin: 0 0 1rem; }
.analysis-note { font-size: 0.85rem; padding: 8px 12px; border-radius: 8px; background: var(--warning-light); color: var(--text-main); }
.analysis-note i { margin-right: 6px; color: var(--warning); }
.analysis-card-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 0.75rem; }
.analysis-chips { font-size: 0.85rem; }
.analysis-table td { vertical-align: top; }
.analysis-table td.analysis-q, .analysis-table td.analysis-q * { white-space: normal !important; }
.analysis-table td.analysis-q { min-width: 260px; max-width: 420px; overflow-wrap: anywhere; }
.analysis-q-text { margin-top: 4px; font-size: 0.88rem; line-height: 1.4; }
.analysis-indikator { margin-top: 6px; font-size: 0.78rem; color: var(--primary); }
.analysis-indikator.is-missing { color: var(--text-muted); font-style: italic; }
.analysis-num { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.analysis-dist { display: flex; flex-direction: column; gap: 3px; min-width: 170px; }
.analysis-dist-row { display: grid; grid-template-columns: 34px 1fr 38px; align-items: center; gap: 6px; font-size: 0.78rem; }
.analysis-dist-label { font-weight: 600; }
.analysis-dist-label i { color: var(--success); font-size: 0.7rem; }
.analysis-dist-bar { height: 8px; border-radius: 4px; background: var(--border-color); overflow: hidden; }
.analysis-dist-bar span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.analysis-dist-row.is-key .analysis-dist-bar span { background: var(--success); }
.analysis-dist-row.is-dead .analysis-dist-label, .analysis-dist-row.is-dead .analysis-dist-pct { color: var(--danger); }
.analysis-dist-pct { text-align: right; color: var(--text-muted); }
.analysis-dist-blank, .analysis-dist-warn { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.analysis-dist-warn { color: var(--danger); }
.analysis-legend summary { cursor: pointer; font-weight: 600; }
.analysis-legend ul { margin: 0.75rem 0 0; padding-left: 1.2rem; font-size: 0.85rem; line-height: 1.55; }
@media (max-width: 640px) { .analysis-filter .analysis-kktp { flex: 1 1 100px; } }
.analysis-group-select { width: auto; min-width: 210px; }
.analysis-sw { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 1rem; }
.analysis-sw .analysis-note { grid-column: 1 / -1; }
.analysis-sw-box { border: 1px solid var(--border-color); border-left-width: 4px; border-radius: 10px; padding: 10px 14px; }
.analysis-sw-box.is-strong { border-left-color: var(--success); }
.analysis-sw-box.is-weak { border-left-color: var(--danger); }
.analysis-sw-box h4 { margin: 0 0 6px; font-size: 0.92rem; }
.analysis-sw-box.is-strong h4 i { color: var(--success); }
.analysis-sw-box.is-weak h4 i { color: var(--danger); }
.analysis-sw-box ul { margin: 0; padding-left: 1.1rem; font-size: 0.84rem; line-height: 1.5; }
.analysis-sw-box p { margin: 0; font-size: 0.84rem; }
.analysis-sw-pct { font-weight: 700; }
.analysis-ach { display: grid; grid-template-columns: 1fr 42px; gap: 8px; align-items: center; min-width: 150px; }
.analysis-ach b { text-align: right; font-size: 0.85rem; }
.analysis-dist-bar span.lvl-kuat { background: var(--success); }
.analysis-dist-bar span.lvl-cukup { background: var(--warning); }
.analysis-dist-bar span.lvl-lemah { background: var(--danger); }
.analysis-row-missing td { color: var(--text-muted); font-style: italic; }
.analysis-foot { margin: 0.75rem 0 0; font-size: 0.78rem; color: var(--text-muted); }
@media (max-width: 768px) { .analysis-sw { grid-template-columns: 1fr; } .analysis-group-select { width: 100%; } }
.analysis-ai-card { border-top: 3px solid #6366f1; }
.analysis-ai-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.analysis-ai-key { border: 1px dashed var(--border-color); border-radius: 10px; padding: 10px 12px; margin-bottom: 1rem; display: flex; flex-direction: column; gap: 6px; }
.analysis-ai-key label { font-weight: 600; font-size: 0.85rem; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.analysis-ai-key label a { font-weight: 500; color: #6366f1; text-decoration: none; }
.analysis-ai-key-row { display: flex; gap: 8px; }
.analysis-ai-key-row .form-control { flex: 1; min-width: 0; }
.analysis-ai-empty { margin: 0.25rem 0; font-size: 0.88rem; }
.analysis-ai-summary { background: var(--primary-light); border-radius: 10px; padding: 12px 14px; font-size: 0.92rem; line-height: 1.6; margin-bottom: 1rem; }
.analysis-ai-sec { margin-bottom: 1rem; }
.analysis-ai-sec h3 { font-size: 0.98rem; margin: 0 0 8px; }
.analysis-ai-sec h3 i { color: #6366f1; margin-right: 4px; }
.analysis-sw-box.analysis-ai-sec { margin-bottom: 0; }
.analysis-sw-box.is-strong h3 i { color: var(--success); }
.analysis-sw-box.is-weak h3 i { color: var(--danger); }
.analysis-sw-box ul li + li, .analysis-ai-list li + li { margin-top: 6px; }
.analysis-ai-misc { margin-top: 4px; font-size: 0.8rem; color: var(--danger); }
.analysis-ai-list { margin: 0; padding-left: 1.1rem; font-size: 0.86rem; line-height: 1.5; }
.analysis-ai-saran { color: var(--text-muted); font-size: 0.82rem; }
.analysis-ai-saran i { color: var(--warning); }
.analysis-ai-reks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.analysis-ai-rek { border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 12px; }
.analysis-ai-rek h4 { margin: 0 0 6px; font-size: 0.88rem; }
.analysis-ai-rek ul { margin: 0; padding-left: 1.1rem; font-size: 0.84rem; line-height: 1.5; }

/* Analisis Hasil Ulangan — tampilan ringkas */
.an-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.an-kpi { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.an-kpi-label { font-size: 0.76rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.an-kpi-value { font-size: 1.7rem; font-weight: 700; color: var(--text-main); line-height: 1.2; }
.an-kpi-sub { font-size: 0.78rem; color: var(--text-muted); }
.an-kpi.is-good .an-kpi-value { color: var(--success); }
.an-kpi.is-mid .an-kpi-value { color: var(--warning); }
.an-kpi.is-low .an-kpi-value { color: var(--danger); }
@media (max-width: 900px) { .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.analysis-notes { margin-bottom: 12px; }
.analysis-note { background: transparent; padding: 2px 2px; font-size: 0.8rem; color: var(--text-muted); }

.an-ai { padding: 20px 22px; border-radius: 16px; }
.an-ai-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.an-ai-title { display: flex; align-items: center; gap: 12px; }
.an-ai-title h2 { margin: 0; font-size: 1.15rem; }
.an-ai-title p { margin: 2px 0 0; font-size: 0.8rem; color: var(--text-muted); }
.an-ai-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; flex-shrink: 0; }
.an-ai-actions { display: flex; gap: 8px; align-items: center; }
.btn-icon-soft { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border-color); background: transparent; color: var(--text-muted); cursor: pointer; }
.btn-icon-soft:hover { color: var(--primary); border-color: var(--primary); }
.an-stale { color: var(--warning); font-weight: 600; }
.an-ai-empty { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px dashed var(--border-color); border-radius: 12px; color: var(--text-muted); }
.an-ai-empty i { font-size: 1.4rem; color: #8b5cf6; }
.an-ai-empty p { margin: 0; font-size: 0.9rem; line-height: 1.5; }
.an-label { display: block; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.an-ai-overview { background: var(--primary-light); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.an-ai-overview .an-label { color: var(--primary); }
.an-ai-overview p { margin: 0; font-size: 0.98rem; line-height: 1.65; color: var(--text-main); }
.an-ai-strengths { margin-bottom: 18px; }
.an-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.an-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--success-light); color: var(--success); font-size: 0.84rem; font-weight: 600; }
.an-weak-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.an-weak { border: 1px solid var(--border-color); border-radius: 14px; padding: 14px 16px; background: var(--bg-card); }
.an-weak-head { display: flex; align-items: center; gap: 10px; }
.an-weak-no { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--danger-light); color: var(--danger); font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
.an-weak-head h3 { margin: 0; font-size: 0.98rem; flex: 1; line-height: 1.35; }
.an-weak-pct { font-weight: 700; color: var(--danger); font-size: 0.95rem; }
.an-weak-soal { margin: 6px 0 0 36px; font-size: 0.76rem; color: var(--text-muted); }
.an-weak-why, .an-weak-fix { margin: 10px 0 0; font-size: 0.88rem; line-height: 1.55; display: flex; gap: 8px; }
.an-weak-why i { color: var(--text-muted); margin-top: 4px; }
.an-weak-fix { background: var(--warning-light); border-radius: 10px; padding: 8px 10px; }
.an-weak-fix i { color: var(--warning); margin-top: 4px; }
.an-ai-foot { margin: 14px 0 0; font-size: 0.75rem; color: var(--text-muted); }

.an-section { padding: 0; border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.an-section > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; font-weight: 600; }
.an-section > summary::-webkit-details-marker { display: none; }
.an-section > summary i:first-child { color: var(--primary); margin-right: 6px; }
.an-summary-right { display: inline-flex; align-items: center; gap: 12px; font-weight: 400; }
.an-chevron { color: var(--text-muted); transition: transform 0.2s; }
.an-section[open] .an-chevron { transform: rotate(180deg); }
.an-section-body { padding: 0 18px 16px; border-top: 1px solid var(--border-color); padding-top: 14px; }
.an-section-tools { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.an-legend { margin: 12px 0 0; padding-left: 1.1rem; font-size: 0.78rem; color: var(--text-muted); line-height: 1.6; }
@media (max-width: 640px) { .an-summary-right .analysis-chips { display: none; } .an-ai { padding: 16px; } }

/* Saklar bagikan analisis ke murid */
.an-share { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.an-share-text { display: flex; flex-direction: column; gap: 2px; font-size: 0.86rem; }
.an-share-text span { color: var(--text-muted); font-size: 0.78rem; line-height: 1.4; }
.an-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; cursor: pointer; }
.an-switch input { opacity: 0; width: 0; height: 0; }
.an-switch-slider { position: absolute; inset: 0; background: var(--border-color); border-radius: 999px; transition: background 0.2s; }
.an-switch-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.an-switch input:checked + .an-switch-slider { background: var(--success); }
.an-switch input:checked + .an-switch-slider::before { transform: translateX(20px); }
.an-switch input:disabled + .an-switch-slider { opacity: 0.6; }

/* Analisis Hasilku (murid) */
.student-analysis-modal { max-width: 560px; width: calc(100% - 24px); }
.student-analysis-body { max-height: 72vh; overflow-y: auto; background: #fff; border-radius: 12px; padding: 14px; }
.btn-student-analysis-action { background: var(--primary) !important; margin-bottom: 8px; }

/* ==========================================================
   Format paragraf teks soal (rata & menjorok dari editor Quill)
   Berlaku di pratinjau guru, Kelola Soal, ujian murid, laporan & cetak
   ========================================================== */
.q-rich p, .q-rich div:not(.katex):not([class*="katex"]),
.question-body p, .doc-question-body p, .report-q-text p,
.essay-question-text p, #preview-question-text p {
  margin: 0;
}
.q-rich p:empty, .question-body p:empty, .doc-question-body p:empty, .report-q-text p:empty { min-height: 1em; }
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }
.ql-indent-1:not(li) { padding-left: 3em; }
.ql-indent-2:not(li) { padding-left: 6em; }
.ql-indent-3:not(li) { padding-left: 9em; }
.ql-indent-4:not(li) { padding-left: 12em; }
.ql-indent-5:not(li) { padding-left: 15em; }
.ql-indent-6:not(li) { padding-left: 18em; }
.ql-indent-7:not(li) { padding-left: 21em; }
.ql-indent-8:not(li) { padding-left: 24em; }
.ql-firstline-1 { text-indent: 2.5em; }
.ql-align-center img, .ql-align-right img { display: inline-block; }
.ql-toolbar .ql-firstline { width: 28px; }

/* Pesan galat login */
.login-error { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger); font-size: 0.88rem; font-weight: 600; line-height: 1.4; }
.login-error i { margin-top: 2px; }
.login-error.hidden { display: none; }
.input-error, .input-error:focus { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-light) !important; }
@keyframes loginShake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.login-shake { animation: loginShake 0.35s ease; }
@media (prefers-reduced-motion: reduce) { .login-shake { animation: none; } }

/* Animasi loading: skeleton shimmer */
@keyframes skeletonShimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skeleton-line {
  display: block; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(148,163,184,0.28) 0%, rgba(148,163,184,0.12) 50%, rgba(148,163,184,0.28) 100%);
  background-size: 800px 100%;
  animation: skeletonShimmer 1.3s linear infinite;
  opacity: 1;
}
.skeleton-row td { padding-top: 14px !important; padding-bottom: 14px !important; }
.skeleton-row:hover { background: transparent !important; }
.skeleton-caption td { padding: 10px 12px !important; color: var(--text-muted); font-size: 0.85rem; }
.skeleton-caption i, .skeleton-doc-caption i { color: var(--primary); margin-right: 6px; }
.skeleton-doc { padding: 8px 4px; }
.skeleton-doc-caption { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 18px; }
.skeleton-doc-item { display: flex; gap: 14px; margin-bottom: 26px; }
.skeleton-num { width: 22px !important; height: 22px; flex-shrink: 0; border-radius: 6px; }
.skeleton-doc-lines { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.skeleton-opt { height: 10px; margin-left: 12px; }
@media (prefers-reduced-motion: reduce) { .skeleton-line { animation: none; } }

/* ===== Ukuran kotak login tetap saat berpindah peran =====
   Form Murid / Guru / Proktor ditumpuk di satu sel grid, begitu juga langkah login sekolah
   dan Admin Pusat. Yang tidak aktif hanya disembunyikan (tetap memakan tempat), sehingga
   tinggi kotak selalu mengikuti form yang paling tinggi dan tidak "melompat". */
#login-view .login-card {
  display: grid;
}
#login-view .login-card > #login-step-role,
#login-view .login-card > #login-step-superadmin,
.login-forms-stack > .login-form {
  grid-area: 1 / 1;
  min-width: 0;
}
.login-forms-stack {
  display: grid;
}
#login-view .login-card > #login-step-role.hidden,
#login-view .login-card > #login-step-superadmin.hidden,
.login-forms-stack > .login-form.hidden {
  display: block !important;
  visibility: hidden;
  pointer-events: none;
}
/* Cegah "bayangan" sesaat: .btn memakai transition: all, sehingga visibility ikut beranimasi */
#login-view .login-card > #login-step-role.hidden *,
#login-view .login-card > #login-step-superadmin.hidden *,
.login-forms-stack > .login-form.hidden * {
  transition: none !important;
}

/* ====================================================
   MONITORING LIVE (Admin Pusat)
   ==================================================== */
.live-nav-count {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: var(--success); color: #fff; font-size: 0.72rem; font-weight: 700; text-align: center;
}
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 0 0 hsla(145, 65%, 42%, 0.6);
  animation: livePulse 1.8s ease-out infinite; vertical-align: middle;
}
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 hsla(145, 65%, 42%, 0.55); } 70% { box-shadow: 0 0 0 8px hsla(145, 65%, 42%, 0); } 100% { box-shadow: 0 0 0 0 hsla(145, 65%, 42%, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.live-refresh-note { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }

.live-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 1.25rem; }
.live-stat {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--bg-sidebar); border: 1px solid var(--border-color); border-radius: var(--border-radius-md);
}
.live-stat > i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1rem; flex-shrink: 0; }
.live-stat strong { display: block; font-size: 1.45rem; line-height: 1.1; color: var(--text-main); }
.live-stat strong small { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.live-stat span { font-size: 0.8rem; color: var(--text-muted); }
.live-stat-purple > i { background: var(--primary-light); color: var(--primary); }
.live-stat-green > i { background: var(--success-light); color: var(--success); }
.live-stat-blue > i { background: hsl(210, 90%, 94%); color: hsl(210, 80%, 48%); }
.live-stat-orange > i { background: var(--warning-light); color: hsl(30, 90%, 42%); }
.live-stat-red > i { background: var(--danger-light); color: var(--danger); }
.dark-theme .live-stat-blue > i { background: hsla(210, 80%, 50%, 0.18); }

.live-school-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.live-school-card {
  display: flex; flex-direction: column; gap: 12px; text-align: left; font: inherit; color: inherit;
  padding: 16px; border-radius: var(--border-radius-md); border: 1px solid var(--border-color);
  background: var(--bg-sidebar); cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.live-school-card.is-live { border-color: hsla(145, 65%, 42%, 0.45); box-shadow: 0 6px 18px hsla(145, 65%, 30%, 0.08); }
.live-school-card.is-live:hover { transform: translateY(-2px); box-shadow: 0 10px 26px hsla(145, 65%, 30%, 0.16); }
.live-school-card.is-live:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.live-school-card.is-idle { cursor: default; opacity: 0.72; }
.live-school-card.is-skeleton { cursor: default; gap: 14px; }
.lsc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.lsc-name { font-weight: 700; font-size: 1rem; color: var(--text-main); }
.lsc-badge {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 3px 9px; border-radius: 999px;
  background: var(--success-light); color: var(--success); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em;
}
.lsc-badge.idle { background: var(--bg-app); color: var(--text-muted); font-weight: 600; letter-spacing: 0; }
.lsc-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lsc-nums > div { background: var(--bg-app); border-radius: 10px; padding: 8px; text-align: center; }
.lsc-nums strong { display: block; font-size: 1.25rem; color: var(--text-main); }
.lsc-nums span { font-size: 0.72rem; color: var(--text-muted); }
.lsc-nums .warn strong { color: hsl(30, 90%, 45%); }
.lsc-exams { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; }
.lsc-exams li { display: flex; align-items: center; gap: 6px; color: var(--text-muted); min-width: 0; }
.lsc-exams li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-main); }
.lsc-exams li b { color: var(--success); font-weight: 700; }
.lsc-cta { margin-top: auto; font-size: 0.82rem; font-weight: 600; color: var(--primary); }

.live-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; font-weight: 600; }
.live-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 1rem; }
.live-filter .input-wrapper { flex: 1 1 240px; }
.live-filter select { flex: 0 1 200px; width: auto; }

.live-student-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.live-student {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--border-radius-md);
  background: var(--bg-sidebar); border: 1px solid var(--border-color); border-left: 4px solid var(--success);
}
.live-student.is-offline { border-left-color: var(--border-color); }
.live-student.is-locked { border-left-color: var(--danger); }
.ls-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ls-id { min-width: 0; }
.ls-id strong { display: block; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; }
.ls-id span { font-size: 0.78rem; color: var(--text-muted); }
.ls-exam { font-size: 0.82rem; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-exam i { color: var(--primary); margin-right: 4px; }
.ls-progress { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; }
.ls-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--bg-app); overflow: hidden; }
.ls-bar span { display: block; height: 100%; border-radius: inherit; background: var(--grad-primary); transition: width 0.4s ease; }
.ls-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-muted); }
.ls-meta .warn, .live-spec-bar .warn { color: hsl(30, 90%, 42%); font-weight: 600; }
.ls-watch { margin-left: auto; }

.lst { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.lst-online { background: var(--success-light); color: var(--success); }
.lst-offline { background: var(--bg-app); color: var(--text-muted); font-weight: 600; }
.lst-locked { background: var(--danger-light); color: var(--danger); }
.lst-done { background: var(--primary-light); color: var(--primary); }

.live-empty { grid-column: 1 / -1; padding: 2.5rem 1rem; text-align: center; color: var(--text-muted); border: 1px dashed var(--border-color); border-radius: var(--border-radius-md); }
.live-empty i { margin-right: 6px; }

/* Jendela tonton */
#modal-live-spectate .live-spectate { max-width: 1100px; width: 95%; max-height: 92vh; display: flex; flex-direction: column; padding: 1.25rem 1.5rem; }
.live-spec-header { align-items: flex-start; }
.live-spec-title h2 { margin: 0; }
.live-spec-title p { margin: 4px 0 0; font-size: 0.85rem; }
.live-spec-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 14px; margin: 0.5rem 0 1rem; background: var(--bg-app); border-radius: 12px; font-size: 0.85rem; color: var(--text-main); }
.live-spec-bar i { color: var(--text-muted); margin-right: 4px; }
.live-spec-bar .spec-note { margin-left: auto; font-size: 0.78rem; }
.live-spec-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; min-height: 0; flex: 1; overflow: hidden; }
.live-spec-nav { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; overflow: auto; padding: 4px; }
.live-spec-nav-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; font-weight: 600; color: var(--text-main); }
.live-follow { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--text-muted); cursor: pointer; }
.live-spec-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.live-spec-grid .sg {
  width: 100%; height: 36px; min-width: 0; padding: 0; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-sidebar);
  font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--text-main); cursor: pointer; position: relative;
}
.live-spec-grid .sg.ans { background: var(--success); border-color: var(--success); color: #fff; }
.live-spec-grid .sg.doubt { background: var(--warning); border-color: var(--warning); color: #3a2a00; }
.live-spec-grid .sg.cur { box-shadow: 0 0 0 2px var(--bg-sidebar), 0 0 0 4px var(--primary); }
.live-spec-grid .sg.viewing { outline: 2px dashed var(--primary); outline-offset: 3px; }
.live-spec-grid .sg.cur::after { content: ""; position: absolute; top: -5px; right: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid var(--bg-sidebar); }
.live-spec-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 0.74rem; color: var(--text-muted); }
.live-spec-legend .lg { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; border: 1px solid var(--border-color); }
.live-spec-legend .lg-cur { background: var(--bg-sidebar); box-shadow: 0 0 0 2px var(--primary); border-color: transparent; }
.live-spec-legend .lg-ans { background: var(--success); border-color: var(--success); }
.live-spec-legend .lg-doubt { background: var(--warning); border-color: var(--warning); }
.live-spec-legend .lg-empty { background: var(--bg-sidebar); }
.live-spec-question { overflow: auto; min-height: 0; padding: 4px 6px 12px 2px; }
.live-spec-loading { color: var(--text-muted); padding: 2rem 0; text-align: center; }
.sq-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.sq-num { font-weight: 800; font-size: 1.05rem; color: var(--text-main); }
.sq-num small { color: var(--text-muted); font-weight: 600; }
.sq-flag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; }
.sq-cur { background: var(--primary-light); color: var(--primary); }
.sq-doubt { background: var(--warning-light); color: hsl(30, 90%, 38%); }
.sq-text { line-height: 1.6; color: var(--text-main); }
.sq-text img, .sq-opt-text img { max-width: 100%; height: auto; }
.sq-img { margin: 10px 0; }
.sq-img img { max-width: 100%; border-radius: 8px; }
.sq-answer-label { margin: 16px 0 8px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.sq-opts { display: flex; flex-direction: column; gap: 8px; }
.sq-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-sidebar); }
.sq-opt.picked { border-color: var(--primary); background: var(--primary-light); }
.sq-opt-badge { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.82rem; background: var(--bg-app); color: var(--text-main); }
.sq-opt-badge.sq { border-radius: 7px; }
.sq-opt.picked .sq-opt-badge { background: var(--primary); color: #fff; }
.sq-opt-text { flex: 1; min-width: 0; padding-top: 3px; color: var(--text-main); }
.sq-opt-img { max-height: 110px; margin-top: 6px; border-radius: 6px; }
.sq-pick { flex-shrink: 0; font-size: 0.75rem; font-weight: 700; color: var(--primary); padding-top: 5px; }
.sq-empty { margin-top: 8px; color: var(--text-muted); font-size: 0.85rem; }
.sq-text-answer { padding: 12px 14px; border-radius: 10px; background: var(--primary-light); border: 1px solid var(--primary); color: var(--text-main); white-space: pre-wrap; word-break: break-word; }
.sq-text-answer.essay { min-height: 80px; }
.sq-bs th, .sq-bs td { vertical-align: middle; }
.sq-match { display: flex; flex-direction: column; gap: 8px; }
.sq-match-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 10px; }
.sq-match-row > i { color: var(--text-muted); }
.sq-match-row .picked { color: var(--primary); font-weight: 600; }

@media (max-width: 768px) {
  .live-spec-body { display: block; overflow: visible; }
  .live-spec-nav { overflow: visible; width: 100%; margin-bottom: 16px; }
  .live-spec-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .live-spec-question { overflow: visible; }
  #modal-live-spectate .live-spectate { padding: 1rem; overflow: auto; }
  .live-spec-bar .spec-note { margin-left: 0; }
  .live-filter select { flex: 1 1 140px; }
  .live-refresh-note { white-space: normal; }
}

/* ====================================================
   BACKUP DATABASE (Admin Pusat)
   ==================================================== */
.backup-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 1rem; }
.backup-top .superadmin-card { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.backup-top .sa-section-title { margin: 0; }
.backup-help { margin: 0; font-size: 0.85rem; line-height: 1.5; }
.backup-check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--text-main); cursor: pointer; }
.backup-check input, .backup-switch input { width: 16px; height: 16px; accent-color: var(--primary); }
.backup-switch { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text-main); cursor: pointer; }
.backup-auto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.backup-auto-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--text-muted); }
.backup-warning {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 1rem;
  border-radius: 12px; background: var(--warning-light); color: hsl(30, 70%, 28%); font-size: 0.86rem; line-height: 1.5;
}
.dark-theme .backup-warning { background: hsla(42, 95%, 50%, 0.12); color: hsl(42, 90%, 70%); }
.backup-warning i { margin-top: 3px; }
.backup-table td { vertical-align: middle; }
/* kolom waktu & catatan boleh turun baris agar tombol aksi tidak terpotong */
.backup-table td:first-child, .backup-table td:first-child * { white-space: normal !important; }
.backup-table td:first-child { min-width: 170px; }
#sa-page-backup .tab-header-action > div:last-child { flex-wrap: nowrap !important; flex-shrink: 0; }
@media (max-width: 768px) { #sa-page-backup .tab-header-action > div:last-child { flex-wrap: wrap !important; } }
.backup-actions { white-space: nowrap; }
.backup-actions .btn { margin-left: 4px; }
.btn-outline-warning { background: transparent; border: 1px solid hsl(35, 90%, 45%); color: hsl(30, 90%, 38%); }
.btn-outline-warning:hover:not(:disabled) { background: var(--warning-light); }
.dark-theme .btn-outline-warning { color: hsl(42, 90%, 65%); }
.backup-restore-warn {
  display: flex; gap: 10px; padding: 12px 14px; margin-bottom: 1rem; border-radius: 12px;
  background: var(--danger-light); color: hsl(355, 60%, 35%); font-size: 0.86rem; line-height: 1.5;
}
.dark-theme .backup-restore-warn { background: hsla(355, 75%, 55%, 0.14); color: hsl(355, 80%, 78%); }
.backup-restore-warn i { margin-top: 3px; }
.restore-school-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.restore-school-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; padding: 4px; border: 1px solid var(--border-color); border-radius: 10px; }
.restore-school { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text-main); }
.restore-school:hover { background: var(--bg-app); }
.restore-school input { width: 16px; height: 16px; accent-color: var(--danger); flex-shrink: 0; }
.restore-school.is-disabled { opacity: 0.55; cursor: not-allowed; }
@media (max-width: 768px) {
  .backup-actions .btn span { display: none; }
  .backup-auto-grid { grid-template-columns: 1fr; }
}

/* Header: tombol Akun & Keluar cukup ikon di HP agar tidak terdorong keluar layar */
.btn-header-icon { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 768px) {
  .app-header .header-user .btn-header-icon { padding: 6px 10px; }
  .app-header .header-user .btn-header-icon .btn-label { display: none; }
}

/* Sebelum sekolah dipilih: langkah Admin Pusat tidak ikut memakan tempat, kotak mengikuti isinya */
#login-view .login-card.no-school > #login-step-superadmin.hidden { display: none !important; }
#login-view .login-card.no-school .login-school-group { margin-bottom: 0; }

/* ====================================================
   MATA PELAJARAN: daftar pusat (Admin Pusat) & pilihan sekolah (proktor)
   ==================================================== */
.subject-info-note {
  display: flex; gap: 8px; align-items: flex-start; margin-bottom: 1rem; padding: 10px 14px;
  border-radius: 12px; background: var(--primary-light); color: var(--text-main); font-size: 0.86rem; line-height: 1.5;
}
.subject-info-note > i:first-child { color: var(--primary); margin-top: 3px; }
.subject-pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: auto; padding: 4px; border: 1px solid var(--border-color); border-radius: 10px; }
.subject-pick { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--text-main); }
.subject-pick:hover { background: var(--bg-app); }
.subject-pick input { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }
.subject-pick span { flex: 1; }
.subject-pick small { color: var(--success); font-weight: 600; }
.subject-pick.is-used { cursor: default; opacity: 0.7; }
.master-subject-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 1rem; }
.master-subject-form .form-control { flex: 1 1 260px; }

/* ====================================================
   PAKET SOAL: pilihan tujuan kirim (Admin Pusat) & kotak masuk proktor
   ==================================================== */
.blast-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0.75rem 0 1rem; }
.blast-mode-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border-color); border-radius: 12px; cursor: pointer; }
.blast-mode-option:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.blast-mode-option input { margin-top: 3px; accent-color: var(--primary); }
.blast-mode-option b { display: block; color: var(--text-main); font-size: 0.9rem; }
.blast-mode-option b i { color: var(--primary); margin-right: 4px; }
.blast-mode-option small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 0.78rem; line-height: 1.4; }
.paket-preview-body { overflow: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; }
.paket-preview-item { padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 10px; }
.paket-preview-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.paket-preview-opts { margin: 8px 0 0 1.2rem; padding: 0; }
.paket-preview-opts li { margin: 3px 0; }
@media (max-width: 600px) { .blast-mode { grid-template-columns: 1fr; } }

/* Mapel nonaktif di tabel proktor */
tr.subject-inactive td:nth-child(2) { opacity: 0.55; }
.btn-outline-secondary { background: transparent; border: 1px solid var(--border-color); color: var(--text-muted); }
.btn-outline-secondary:hover:not(:disabled) { background: var(--bg-app); color: var(--text-main); }
.btn-outline-success { background: transparent; border: 1px solid var(--success); color: var(--success); }
.btn-outline-success:hover:not(:disabled) { background: var(--success-light); }

/* ====================================================
   ANTI-SCREENSHOT (ruang ujian murid, hanya saat anti-curang aktif)
   ==================================================== */
#exam-main-interface { position: relative; }
.exam-watermark { position: fixed; inset: 0; z-index: 900; pointer-events: none; background-repeat: repeat; }
body.exam-protected #exam-main-interface { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.exam-protected #exam-main-interface :is(input, textarea, select) { -webkit-user-select: text; user-select: text; }
body.exam-protected #exam-main-interface img { -webkit-user-drag: none; pointer-events: none; }
/* Layar ditutup saat terdeteksi screenshot / aplikasi tidak aktif */
body.exam-shield #exam-main-interface { visibility: hidden !important; }
body.exam-shield { background: #0b1020 !important; }
/* Soal diburamkan selama ujian terkunci */
body:has(#cheat-overlay:not(.hidden)) #exam-main-interface { filter: blur(18px); }
/* Cetak halaman ujian tidak menampilkan soal */
@media print {
  body.exam-protected * { visibility: hidden !important; }
  body.exam-protected::before { content: "Mencetak halaman ujian tidak diizinkan."; visibility: visible !important; display: block; padding: 3rem; font: 600 18px Inter, Arial, sans-serif; text-align: center; }
}
