/* =========================================================
   EduExam Online - Modern Design System & Styles
   ========================================================= */

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-dark: #3730a3;

  --secondary: #0ea5e9;
  --secondary-hover: #0284c7;
  --secondary-light: #f0f9ff;

  --success: #10b981;
  --success-light: #ecfdf5;
  --success-dark: #047857;

  --warning: #f59e0b;
  --warning-light: #fffbeb;

  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-dark: #b91c1c;

  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border-color: #e2e8f0;
  --border-focus: #818cf8;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Utilities */
.hidden { display: none !important; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; gap: 0.5rem; }
.flex-gap { display: flex; align-items: center; gap: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-xl { font-size: 1.25rem; }
.font-bold { font-weight: 700; }
.block { display: block; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.px-0 { padding-left: 0; padding-right: 0; }
.pb-0 { padding-bottom: 0; }
.text-center { text-align: center; }

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.brand-logo {
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: white;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-subtle);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.role-pill {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: white;
  color: var(--text-main);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideIn 0.3s ease-out;
  min-width: 300px;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary-dark));
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}
.btn-secondary:hover { background: var(--secondary-hover); }

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.btn-success:hover { background: var(--success-dark); }

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover { background: var(--danger-dark); }

.btn-outline {
  background: white;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}

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

.btn-subtle {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-subtle:hover { background: #e2e8f0; }

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-block { width: 100%; }

/* Form Controls */
.form-group {
  margin-bottom: 1.15rem;
}

label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-label-inline {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
}

.form-control {
  width: 100%;
  font-family: var(--font-main);
  font-size: 0.875rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: white;
  color: var(--text-main);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap > svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
}

.input-icon-wrap .form-control {
  padding-left: 2.5rem;
}

.input-icon-wrap .form-control.has-toggle-btn {
  padding-right: 2.85rem;
}

/* Password Visibility Toggle Button */
.btn-toggle-password {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.45rem;
  color: var(--text-muted, #64748b);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm, 6px);
  transition: all 0.2s ease;
  z-index: 5;
  user-select: none;
}

.btn-toggle-password:hover {
  color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
}

.btn-toggle-password.active {
  color: var(--color-primary, #2563eb);
}

.btn-toggle-password svg {
  position: static !important;
  transform: none !important;
  display: block;
}

/* Input Error Highlight & Subtle Shake */
.form-control.input-error {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18) !important;
  animation: inputShake 0.35s ease-in-out;
}

@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Dynamic Login Feedback Alert Banners */
.login-feedback-alert {
  margin-bottom: 1.35rem;
  border-radius: var(--radius-md, 8px);
  padding: 1rem 1.15rem;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  border-width: 1.5px;
  border-style: solid;
  animation: alertSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.login-feedback-alert.hidden {
  display: none !important;
}

@keyframes alertSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-feedback-alert .login-alert-content {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  flex: 1;
}

.login-feedback-alert .login-alert-icon-wrap {
  flex-shrink: 0;
  margin-top: 1px;
}

.login-feedback-alert .login-alert-text {
  flex: 1;
}

.login-feedback-alert .login-alert-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.login-feedback-alert .login-alert-msg {
  font-size: 0.865rem;
  line-height: 1.5;
}

.login-feedback-alert .login-alert-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
  opacity: 0.55;
  transition: opacity 0.15s ease;
  color: inherit;
}

.login-feedback-alert .login-alert-close:hover {
  opacity: 1;
}

/* Danger / Salah NISN atau Sandi */
.login-feedback-alert.alert-danger {
  background: #fef2f2;
  border-color: #f87171;
  color: #991b1b;
}

.login-feedback-alert.alert-danger .login-alert-title {
  color: #b91c1c;
}

/* Warning / Akun Belum Diaktifkan untuk Ujian */
.login-feedback-alert.alert-warning {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.login-feedback-alert.alert-warning .login-alert-title {
  color: #b45309;
}

/* Callout Box inside Alert */
.login-alert-callout {
  margin-top: 0.75rem;
  background: rgba(245, 158, 11, 0.12);
  border-left: 3.5px solid #f59e0b;
  border-radius: 4px;
  padding: 0.65rem 0.85rem;
  font-size: 0.835rem;
}

.login-alert-callout .callout-step {
  margin-bottom: 0.45rem;
  line-height: 1.45;
  color: #78350f;
}

.login-alert-callout .callout-badge {
  display: inline-block;
  background: #d97706;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.login-alert-callout .callout-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #78350f;
}

.badge-tag-warning {
  display: inline-block;
  background: #fde68a;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Cards & Layout */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-body {
  padding: 1.5rem;
}

.grid-2-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .grid-2-cols { grid-template-columns: 1fr; }
}

/* 1. REAL CBT LOGIN SCREEN */
.cbt-login-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: radial-gradient(circle at top, #eef2ff 0%, #f1f5f9 60%, #e2e8f0 100%);
}

.cbt-brand-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: left;
  max-width: 580px;
  width: 100%;
}

.cbt-logo-badge {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  color: white;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 10px 20px rgba(30, 58, 138, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.cbt-inst-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #2563eb;
  text-transform: uppercase;
  display: block;
}

.cbt-main-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0.15rem 0;
}

.cbt-sub-title {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
  font-weight: 500;
}

.server-status-strip {
  max-width: 580px;
  width: 100%;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.server-status-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: #334155;
}

.status-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.cbt-login-card {
  background: white;
  width: 100%;
  max-width: 580px;
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: 0 20px 35px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  border: 1px solid #e2e8f0;
}

/* CBT Role Navigation Tabs */
.cbt-role-tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 0.35rem;
  gap: 0.35rem;
  margin-bottom: 1.75rem;
  border: 1px solid #e2e8f0;
}

.cbt-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cbt-tab-btn:hover {
  color: #1e293b;
}

.cbt-tab-btn.active {
  background: white;
  color: #1e40af;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.cbt-form-view {
  display: block;
}

.cbt-form-view.hidden {
  display: none !important;
}

.cbt-card-header {
  margin-bottom: 1.5rem;
}

.cbt-card-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.cbt-card-header p {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.45;
  margin: 0;
}

.cbt-login-btn {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 0.85rem 1.5rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.cbt-login-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.4);
}

/* Exam Notice Callout */
.cbt-exam-notice {
  margin-top: 1.75rem;
  background: #f8fafc;
  border-left: 4px solid #3b82f6;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.85rem 1.15rem;
  border: 1px solid #e2e8f0;
  border-left-width: 4px;
}

.cbt-notice-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 0.4rem;
}

.cbt-rules-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.5;
}

.cbt-rules-list li {
  margin-bottom: 0.2rem;
}

/* Copyright Footer */
.cbt-copyright-footer {
  margin-top: 1.75rem;
  text-align: center;
}

.cbt-copyright-footer p {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
  font-weight: 600;
}

.cbt-copyright-sub {
  font-size: 0.72rem !important;
  font-weight: 500 !important;
  color: #94a3b8 !important;
  margin-top: 0.2rem !important;
}

/* Discreet Proktor Link */
.cbt-proktor-link {
  margin-top: 1rem;
  text-align: center;
}

.cbt-proktor-link a {
  font-size: 0.72rem;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}

.cbt-proktor-link a:hover {
  color: #475569;
  text-decoration: underline;
}

.role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.35rem;
}
.dot-teacher { background: var(--primary); }
.dot-student { background: var(--success); }

/* 2. TEACHER DASHBOARD LAYOUT (eVote Style Dark-Navy Theme) */
.dashboard-layout {
  display: flex;
  min-height: calc(100vh - 65px);
  background: #0B1120;
}

.sidebar {
  width: 270px;
  background: #0D1527;
  border-right: 1px solid #1E293B;
  padding: 1.5rem 1rem 1rem 1rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding-bottom: 0.5rem;
}

.nav-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748B;
  letter-spacing: 0.08em;
  padding-left: 0.75rem;
  margin-bottom: 0.75rem;
  display: block;
  text-transform: uppercase;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: #94A3B8;
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}

.nav-bullet {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid #64748B;
  background: #1E293B;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.nav-icon {
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #F8FAFC;
}

.nav-item:hover .nav-bullet {
  border-color: #94A3B8;
  background: #475569;
}

.nav-item.active {
  background: rgba(14, 165, 233, 0.12);
  color: #38BDF8;
  font-weight: 700;
}

.nav-item.active .nav-bullet {
  background: #0284C7;
  border-color: #38BDF8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

.sidebar-mysql-btn-wrap {
  margin-top: 1.25rem;
  padding: 0 0.25rem;
}

.btn-outline-mysql {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: #131E33;
  border: 1px solid #233352;
  color: #E2E8F0;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-main);
}

.btn-outline-mysql:hover {
  background: #1A2844;
  border-color: #38BDF8;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.25rem;
}

.sidebar-cr-box {
  background: #11192C;
  border: 1px solid #1E293B;
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  text-align: left;
}

.sidebar-cr-box .cr-title {
  display: block;
  font-size: 0.75rem;
  color: #94A3B8;
  font-weight: 600;
}

.sidebar-cr-box .cr-author {
  display: block;
  font-size: 0.78rem;
  color: #E2E8F0;
  font-weight: 600;
  margin-top: 0.15rem;
}

.sidebar-cr-box .cr-link {
  display: block;
  font-size: 0.72rem;
  color: #38BDF8;
  text-decoration: none;
  margin-top: 0.15rem;
  font-family: var(--font-mono);
}

.content-area {
  flex: 1;
  padding: 1.75rem 2rem;
  background: #0B1120;
  color: #F1F5F9;
  overflow-y: auto;
}

.tab-pane {
  display: none !important;
}

.tab-pane.active {
  display: block !important;
  animation: fadeInPane 0.2s ease-out;
}

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

.page-title-bar {
  margin-bottom: 1.75rem;
}

.page-title-bar h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-blue { background: #e0e7ff; color: #4338ca; }
.icon-purple { background: #f3e8ff; color: #7e22ce; }
.icon-emerald { background: #d1fae5; color: #065f46; }
.icon-amber { background: #fef3c7; color: #92400e; }

.stat-label {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

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

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

.table th {
  background: var(--bg-subtle);
  padding: 0.875rem 1.25rem;
  font-weight: 700;
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: rgba(248, 250, 252, 0.8);
}

/* Badges & Pills */
.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-primary { background: rgba(255,255,255,0.25); color: white; border: 1px solid rgba(255,255,255,0.4); }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef9c3; color: #a16207; }
.badge-danger { background: #fee2e2; color: #b91c1c; }

/* CSV Dropzone */
.upload-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--bg-subtle);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.upload-dropzone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-dropzone svg {
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.upload-dropzone input[type="file"] {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-name-label {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

.csv-format-guide {
  background: var(--bg-subtle);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  border: 1px solid var(--border-color);
}

.csv-format-guide code {
  font-family: var(--font-mono);
  background: white;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--primary);
}

/* Item List */
.item-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.item-list li {
  padding: 0.75rem 1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 3. STUDENT PORTAL */
.student-portal {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.student-profile-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 12px 24px -4px rgba(30, 58, 138, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .student-profile-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

.student-profile-main {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.student-avatar-box {
  width: 58px;
  height: 58px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.student-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.student-display-name {
  font-size: 1.65rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}

.student-inst-sub {
  font-size: 0.85rem;
  color: #bfdbfe;
  margin: 0.25rem 0 0;
}

.student-notice-box {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  max-width: 340px;
}

.student-notice-box p {
  color: #eff6ff;
  line-height: 1.45;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.student-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.exam-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.exam-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-focus);
}

.exam-card-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}

.badge-active { background: #dcfce7; color: #166534; }
.badge-upcoming { background: #fef9c3; color: #854d0e; }
.badge-done { background: #f1f5f9; color: #475569; }

.exam-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.exam-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

/* 4. STUDENT EXAM EXECUTION SCREEN */
.exam-room-container {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}

.exam-header-bar {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1rem 1.75rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  position: sticky;
  top: 1rem;
  z-index: 40;
}

.exam-title-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.timer-box {
  background: #1e1b4b;
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: 0 4px 12px rgba(30, 27, 75, 0.3);
}

.timer-box.timer-warning {
  background: #991b1b;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.timer-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  opacity: 0.8;
  display: block;
}

.timer-countdown {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #38bdf8;
}

.timer-warning .timer-countdown {
  color: #fecaca;
}

.exam-body-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
}

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

.exam-question-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 480px;
}

.q-badge {
  background: var(--primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}

.type-pill {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  margin-left: 0.5rem;
}

.autosave-status {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.save-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text-main);
  margin-top: 1.25rem;
}

.q-media-box {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
}

.q-media-box img {
  max-width: 100%;
  max-height: 350px;
  border-radius: var(--radius-sm);
  display: block;
}

/* Answers Layout */
.option-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: white;
  border: 2px solid var(--border-color);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

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

.option-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.option-radio {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

.option-text-span {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  flex: 1;
}

.essay-textarea {
  width: 100%;
  font-family: var(--font-main);
  font-size: 0.95rem;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  min-height: 160px;
  resize: vertical;
}

.essay-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.exam-nav-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Question Palette Grid */
.palette-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.palette-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-top: 1rem;
}

.palette-btn {
  height: 42px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

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

.palette-btn.answered {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.palette-btn.current {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.palette-legend {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.legend-item { display: flex; align-items: center; gap: 0.5rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-dot.answered { background: #86efac; }
.legend-dot.current { border: 2px solid var(--primary); }
.legend-dot.unanswered { background: #e2e8f0; }

/* 5. RESULT SCREEN */
.result-wrapper {
  min-height: calc(100vh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.result-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  text-align: center;
  border: 1px solid var(--border-color);
}

.result-icon {
  width: 72px;
  height: 72px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.score-display-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
}

.score-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin: 0.5rem 0;
}

.status-pill {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
}
.status-pass { background: #dcfce7; color: #15803d; }
.status-fail { background: #fee2e2; color: #b91c1c; }

.result-details-box {
  text-align: left;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
}

.result-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--bg-subtle);
}
.result-stat-row:last-child { border-bottom: none; }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-dialog {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.modal-lg { max-width: 800px; }
.modal-sm { max-width: 400px; }

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

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.checkbox-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
  max-height: 150px;
  overflow-y: auto;
  padding: 0.5rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

/* Analytics Chart Visualization */
.chart-bars-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
}

.bar-label {
  width: 80px;
  font-weight: 600;
  color: var(--text-muted);
}

.bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  border-radius: var(--radius-md);
  transition: width 0.6s ease;
}

.bar-count {
  width: 40px;
  font-weight: 700;
  text-align: right;
  color: var(--text-main);
}

/* ==========================================================================
   REAL-TIME PROCTOR MONITORING & TIMELINE STYLES
   ========================================================================== */

.live-dot-badge {
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
  margin-left: auto;
  animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.badge-pulse {
  animation: pulse-live 2s infinite;
}

/* Monitoring Table & Elements */
.monitoring-table td {
  padding: 0.85rem 1rem;
}

.student-mon-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.student-mon-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #334155;
  font-size: 0.85rem;
  flex-shrink: 0;
  position: relative;
}

.student-mon-avatar.online::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid white;
  border-radius: 50%;
}

.student-mon-avatar.offline::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #cbd5e1;
  border: 2px solid white;
  border-radius: 50%;
}

.mon-progress-bar-wrap {
  width: 100%;
  max-width: 170px;
}

.mon-progress-track {
  height: 7px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 4px;
}

.mon-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  transition: width 0.4s ease;
}

.mon-progress-fill.completed {
  background: #10b981;
}

.time-pill-active {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.775rem;
  padding: 0.2rem 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: #0f172a;
}

/* Activity Logs Timeline */
.logs-timeline {
  position: relative;
  padding-left: 1.75rem;
}

.logs-timeline::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 8px;
  width: 2px;
  background: #e2e8f0;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -1.75rem;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 3px solid #64748b;
}

.timeline-dot.login { border-color: #10b981; background: #ecfdf5; }
.timeline-dot.start_exam { border-color: #3b82f6; background: #eff6ff; }
.timeline-dot.answer_question { border-color: #6366f1; background: #eef2ff; }
.timeline-dot.submit_exam { border-color: #8b5cf6; background: #f5f3ff; }
.timeline-dot.unlock_session { border-color: #f59e0b; background: #fffbeb; }
.timeline-dot.force_submit { border-color: #ef4444; background: #fef2f2; }
.timeline-dot.logout { border-color: #94a3b8; background: #f8fafc; }

.timeline-content {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.timeline-title {
  font-weight: 700;
  font-size: 0.8rem;
  color: #1e293b;
}

.timeline-time {
  font-size: 0.725rem;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
}

.timeline-desc {
  font-size: 0.8rem;
  color: #475569;
  margin: 0;
}

.timeline-ip {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.25rem;
  display: block;
}

/* ==========================================================================
   GLOBAL COPYRIGHT STYLES (Across all views)
   ========================================================================== */

.nav-copyright-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: #475569;
}

.nav-copyright-pill strong {
  color: #1e3a8a;
  font-weight: 700;
}

@media (max-width: 860px) {
  .nav-copyright-pill {
    display: none;
  }
}

.portal-page-footer {
  margin-top: 3.5rem;
  padding: 1.5rem 0 1rem 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.portal-page-footer strong {
  color: var(--text-main);
  font-weight: 700;
}

.exam-header-copyright {
  display: flex;
  align-items: center;
}

.exam-cr-pill {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  background: white;
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.exam-cr-pill strong {
  color: #1e3a8a;
  font-weight: 700;
}

.exam-room-footer {
  margin-top: 2rem;
  padding: 1.25rem 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
}

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

.result-copyright-footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.result-copyright-footer strong {
  color: var(--text-main);
  font-weight: 700;
}

/* ==========================================================================
   INTERNET BLOCKING & STATUS STYLES
   ========================================================================== */

.internet-status-card {
  border-radius: var(--radius-lg, 12px);
  padding: 1.1rem 1.4rem;
  border: 1.5px solid var(--border-color);
  background: var(--card-bg, #ffffff);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.internet-status-card.internet-open {
  background: rgba(16, 185, 129, 0.06);
  border-color: #10b981;
}

.internet-status-card.internet-blocked {
  background: rgba(239, 68, 68, 0.07);
  border-color: #ef4444;
}

.inet-status-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.inet-status-info {
  flex: 1;
  min-width: 250px;
}

.inet-header-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.inet-dot {
  font-size: 0.9rem;
  line-height: 1;
}

.inet-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.02em;
}

.internet-open .inet-title {
  color: #059669;
}

.internet-blocked .inet-title {
  color: #dc2626;
}

.inet-desc {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  margin: 0.25rem 0 0 0;
}

.inet-warning {
  display: block;
  font-size: 0.78rem;
  color: #d97706;
  font-weight: 600;
  margin-top: 0.25rem;
}

.inet-status-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Student Internet Blocked Floating Notification Banner */
.internet-block-banner {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #991b1b, #dc2626);
  color: white;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.inet-banner-content {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.inet-banner-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.inet-banner-content strong {
  font-size: 0.92rem;
  font-weight: 700;
  display: block;
  letter-spacing: 0.01em;
}

.inet-banner-content p {
  font-size: 0.8rem;
  margin: 0.15rem 0 0 0;
  opacity: 0.95;
  line-height: 1.35;
}

.inet-banner-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.inet-banner-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* =========================================================
   eVote & CBT Admin/Teacher Dashboard Custom Styles
   ========================================================= */

/* Top 4 Stat Cards Matching Reference Screenshot */
.dark-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
  .dark-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.dark-stat-card {
  background: #111B2E;
  border: 1px solid #1E2D4A;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.dark-stat-card:hover {
  transform: translateY(-2px);
  border-color: #2D4268;
}

.stat-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #94A3B8;
  margin-bottom: 0.4rem;
  display: block;
}

.stat-card-number {
  font-size: 2.25rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.stat-card-sub {
  font-size: 0.78rem;
  font-weight: 600;
  display: block;
}

.text-emerald { color: #10B981 !important; }
.text-slate { color: #64748B !important; }
.text-indigo { color: #818CF8 !important; }
.text-teal { color: #06B6D4 !important; }

/* Dark Main Card & Table */
.dark-main-card {
  background: #111B2E;
  border: 1px solid #1E2D4A;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  margin-bottom: 1.5rem;
}

.dark-card-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid #1E2D4A;
  background: #0E1729;
}

.card-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card-header-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.card-header-icon {
  font-size: 1.15rem;
}

.card-header-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: #F1F5F9;
  margin: 0;
}

.badge-dark-pill {
  background: #182236;
  color: #94A3B8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid #283754;
}

.card-header-sub {
  font-size: 0.8rem;
  color: #64748B;
  margin: 0;
}

/* Custom Action Buttons */
.btn-teal {
  background: #0D9488;
  color: #FFFFFF !important;
  border: none;
  font-weight: 600;
  font-size: 0.84rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.btn-teal:hover {
  background: #0F766E;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.btn-dark-outline {
  background: #0B1220;
  color: #E2E8F0 !important;
  border: 1px solid #233352;
  font-weight: 600;
  font-size: 0.84rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-dark-outline:hover {
  background: #141F36;
  border-color: #38BDF8;
  color: #FFFFFF !important;
}

/* Dark Table Styles */
.dark-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

.dark-table thead th {
  background: #0B1220;
  color: #94A3B8;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid #1E2D4A;
  text-align: left;
}

.dark-table tbody td {
  padding: 0.95rem 1.25rem;
  color: #E2E8F0;
  border-bottom: 1px solid #16223A;
  font-size: 0.875rem;
  vertical-align: middle;
}

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

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

/* Badges for Roles */
.badge-teal {
  background: rgba(13, 148, 136, 0.18);
  color: #2DD4BF;
  border: 1px solid rgba(45, 212, 191, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-role-admin {
  background: rgba(239, 68, 68, 0.18);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
}

.badge-role-teacher {
  background: rgba(56, 189, 248, 0.18);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
}

/* Server API Status Box */
.server-api-status-box {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.status-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background: #0B1220;
  border-radius: 8px;
  border: 1px solid #1E2D4A;
}

.status-row-item .status-label {
  font-size: 0.84rem;
  color: #94A3B8;
  font-weight: 600;
}

.status-row-item code {
  font-family: var(--font-mono);
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.82rem;
}

/* MySQL Info Grid in Modal */
.mysql-info-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mysql-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.85rem;
  background: var(--bg-subtle);
  border-radius: 8px;
  font-size: 0.85rem;
}

.mysql-info-row .label {
  color: var(--text-muted);
  font-weight: 600;
}

.mysql-info-row code {
  font-family: var(--font-mono);
  color: var(--primary);
  font-weight: 600;
}

/* ==========================================================================
   PAGINATION BAR — Questions Table & Similar Tables
   ========================================================================== */

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.pagination-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.pagination-controls .btn {
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  font-size: 0.85rem;
}

.pagination-controls .btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-ellipsis {
  padding: 0 0.3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  user-select: none;
}

/* ==========================================================================
   TOGGLE LABEL ROW (for checkbox + label in form)
   ========================================================================== */

.toggle-label-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  user-select: none;
}

.toggle-label-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-label-text {
  flex: 1;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  margin-bottom: 0;
  padding-left: 0.15rem;
  line-height: 1.4;
}

/* ==========================================================================
   ANTI-CHEAT MONITORING & VIOLATION NOTIFICATIONS
   ========================================================================== */

@keyframes pulseRed {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

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

.badge-pulse {
  animation: pulseRed 1.8s infinite;
}

.badge-anti-cheat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-anti-cheat .pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
  animation: pulseRed 2s infinite;
}

.badge-count-alert {
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  margin-left: auto;
  animation: pulseRed 1.5s infinite;
}

.btn-viol-badge {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-viol-badge:hover {
  background: #fee2e2;
  border-color: #ef4444;
  transform: translateY(-1px);
}

.stat-card-danger {
  border-color: #fca5a5 !important;
  background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%) !important;
}

.icon-rose-pulse {
  background: #fee2e2;
  color: #e11d48;
  animation: pulseRed 2s infinite;
}

/* Floating Proctor Notification Container */
.proctor-alert-container {
  position: fixed;
  top: 75px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  pointer-events: none;
}

.proctor-alert-card {
  pointer-events: auto;
  background: #ffffff;
  border: 2px solid #ef4444;
  border-left: 6px solid #dc2626;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 10px 25px -5px rgba(220, 38, 38, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.proctor-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.proctor-alert-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #b91c1c;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.proctor-alert-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 0 4px;
}

.proctor-alert-close:hover {
  color: #1f2937;
}

.proctor-alert-body {
  font-size: 0.85rem;
  color: #1f2937;
  line-height: 1.4;
}

.proctor-alert-student {
  font-weight: 700;
  color: #111827;
}

.proctor-alert-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.75rem;
  color: #6b7280;
}

/* Student Cheating Warning Modal Styling */
.cheat-warning-card {
  text-align: center;
  padding: 2rem 1.5rem 1rem;
}

.cheat-warning-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulseRed 1.8s infinite;
}

.violation-advice-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.violation-advice-box.warning {
  background: #fefce8;
  border-color: #fef08a;
  color: #854d0e;
}

.violation-advice-box.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.violation-table th {
  background: #f8fafc;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  padding: 8px 12px;
}

.violation-table td {
  padding: 9px 12px;
  font-size: 0.83rem;
  vertical-align: middle;
}

/* ==========================================================================
   RESPONSIVE DESIGN FOR SMARTPHONES & MOBILE DEVICES (HP / TABLET)
   Khusus Akses Siswa via Perangkat Handphone / Smartphone
   ========================================================================== */

@media (max-width: 768px) {
  /* Prevent horizontal scroll & viewport jumping */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Prevent automatic zoom-in on input focus on iOS & Android */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* --- 1. NAVBAR RESPONSIVE FOR MOBILE --- */
  .navbar {
    padding: 0.55rem 0.85rem;
  }

  .nav-brand {
    gap: 0.5rem;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
  }

  .brand-logo svg {
    width: 18px;
    height: 18px;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .brand-subtitle {
    display: none !important;
  }

  #header-academic-year-pill {
    display: none !important;
  }

  .nav-user {
    gap: 0.4rem;
  }

  .user-badge {
    padding: 0.2rem 0.5rem;
  }

  .user-name {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
  }

  .role-pill {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
  }

  #btn-logout {
    padding: 0.4rem 0.6rem;
  }

  #btn-logout span {
    display: none;
  }

  /* --- 2. HALAMAN LOGIN SISWA DI HP --- */
  .cbt-login-wrapper {
    padding: 1.25rem 0.85rem 2rem;
    min-height: 100vh;
    justify-content: flex-start;
  }

  .cbt-brand-header {
    flex-direction: column;
    text-align: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
  }

  .cbt-logo-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    margin: 0 auto;
  }

  .cbt-logo-badge svg {
    width: 28px;
    height: 28px;
  }

  .cbt-inst-label {
    font-size: 0.62rem;
    letter-spacing: 0.04em;
  }

  .cbt-main-title {
    font-size: 1.15rem;
    line-height: 1.3;
    margin: 0.2rem 0;
  }

  .cbt-sub-title {
    font-size: 0.74rem;
  }

  .server-status-strip {
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.75rem;
    text-align: center;
    font-size: 0.76rem;
    border-radius: 10px;
  }

  .server-status-info {
    justify-content: center;
  }

  .cbt-login-card {
    padding: 1.25rem 1rem;
    border-radius: 16px;
    width: 100%;
    box-shadow: var(--shadow-md);
  }

  .cbt-card-header h3 {
    font-size: 1.15rem;
  }

  .cbt-card-header p {
    font-size: 0.82rem;
  }

  .auth-form .form-group label {
    font-size: 0.82rem;
  }

  .form-control {
    padding: 0.75rem 0.85rem;
    min-height: 46px;
  }

  .cbt-login-btn {
    min-height: 50px;
    font-size: 0.95rem;
    border-radius: 12px;
  }

  .cbt-exam-notice {
    padding: 0.75rem 0.85rem;
    margin-top: 1rem;
  }

  .cbt-rules-list {
    padding-left: 1.2rem;
    font-size: 0.78rem;
    gap: 0.35rem;
  }

  .cbt-copyright-footer {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    text-align: center;
  }

  /* --- 3. DASHBOARD PORTAL SISWA DI HP --- */
  .student-portal {
    padding: 0 0.85rem;
    margin: 1rem auto 2rem auto;
  }

  .student-profile-banner {
    padding: 1.25rem 1rem;
    border-radius: 16px;
    gap: 1rem;
  }

  .student-profile-main {
    gap: 0.85rem;
  }

  .student-avatar-box {
    width: 48px;
    height: 48px;
  }

  .student-display-name {
    font-size: 1.25rem;
  }

  .student-inst-sub {
    font-size: 0.78rem;
  }

  .student-notice-box {
    max-width: 100%;
    width: 100%;
    padding: 0.75rem 0.85rem;
    font-size: 0.78rem;
    border-radius: 10px;
  }

  .section-title {
    font-size: 1.15rem;
    margin-bottom: 0.85rem;
  }

  .student-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .exam-card {
    padding: 1.25rem 1rem;
    border-radius: 16px;
  }

  .exam-card h3 {
    font-size: 1.1rem;
  }

  .exam-card .btn {
    min-height: 46px;
    font-size: 0.9rem;
  }

  /* --- 4. RUANG UJIAN SISWA (EXAM ROOM) DI HP --- */
  .exam-room-container {
    padding: 0 0.65rem;
    margin: 0.5rem auto 1.5rem auto;
  }

  /* Sticky Top Bar yang Rapi & Kompak (Struktur Grid 2 Baris yang Kokoh) */
  .exam-header-bar {
    position: sticky;
    top: 0;
    z-index: 60;
    padding: 0.55rem 0.75rem;
    border-radius: 14px;
    margin-bottom: 0.85rem;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    row-gap: 0.35rem;
    column-gap: 0.5rem;
    align-items: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border-color);
  }

  /* Baris 1: Judul Ujian (Kiri) & Timer Hitung Mundur (Kanan) */
  .exam-info-pill {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    min-width: 0;
  }

  .exam-title-text {
    font-size: 0.92rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.25;
  }

  #exam-live-user {
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .timer-box {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    justify-self: end;
    padding: 0.32rem 0.65rem;
    border-radius: 8px;
    gap: 0.4rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
  }

  .timer-box svg {
    width: 16px;
    height: 16px;
  }

  .timer-label {
    display: none;
  }

  .timer-countdown {
    font-size: 1.12rem;
  }

  /* Baris 2: Badge Anti-Cheat (Kiri) & Tombol Kirim Ujian (Kanan) */
  .badge-anti-cheat {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    justify-self: start;
    font-size: 0.68rem;
    padding: 3px 8px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
  }

  .exam-header-copyright {
    display: none !important;
  }

  .exam-header-bar button[onclick="app.promptSubmitExam()"] {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    justify-self: end;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 8px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
  }

  .exam-header-bar button[onclick="app.promptSubmitExam()"] svg {
    width: 15px;
    height: 15px;
  }

  /* Layout Konten Soal & Palet Nomor */
  .exam-body-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .exam-question-card {
    padding: 1.15rem 0.85rem;
    min-height: auto;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: visible !important;
  }

  .question-header {
    margin-bottom: 0.75rem;
  }

  .q-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
  }

  .type-pill {
    font-size: 0.7rem;
    padding: 0.25rem 0.55rem;
    margin-left: 0.35rem;
  }

  .autosave-status {
    font-size: 0.72rem;
  }

  .question-text {
    font-size: 1rem;
    line-height: 1.55;
    margin-top: 0.75rem;
    word-break: break-word;
  }

  .q-media-box {
    padding: 0.6rem;
    margin-top: 0.75rem;
  }

  .q-media-box img {
    max-height: 220px;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    object-fit: contain;
  }

  /* Pilihan Jawaban: Ergonomis & Nyaman untuk Sentuhan Jempol */
  .option-item {
    min-height: 50px;
    padding: 0.85rem 0.85rem;
    border-radius: 12px;
    margin-bottom: 0.65rem;
    gap: 0.75rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(79, 70, 229, 0.1);
    transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
  }

  .option-item:active {
    transform: scale(0.985);
    background: var(--primary-light);
    border-color: var(--primary);
  }

  .option-radio {
    width: 22px;
    height: 22px;
    margin: 0;
    flex-shrink: 0;
  }

  .option-text-span {
    font-size: 0.95rem;
    line-height: 1.42;
    word-break: break-word;
  }

  .essay-textarea {
    min-height: 130px;
    padding: 0.85rem;
    font-size: 16px !important;
    border-radius: 10px;
  }

  /* Navigasi Soal Bawah - Layout 2 Baris Grid (Terbaca Utuh, Seimbang & Bebas Terpotong) */
  .exam-nav-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto !important;
    column-gap: 0.65rem !important;
    row-gap: 0.65rem !important;
    width: 100% !important;
  }

  /* Baris 1: Status Terjawab (Lebar Penuh, Rapi di Tengah) */
  .exam-nav-footer .progress-wrap {
    grid-column: 1 / 3 !important;
    grid-row: 1 / 2 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0.45rem 0.75rem !important;
    background: #f1f5f9 !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
  }

  #answered-count-label {
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: #334155 !important;
    letter-spacing: 0.02em !important;
    white-space: nowrap !important;
    text-align: center !important;
  }

  /* Baris 2 Kiri: Tombol Sebelumnya (50% Lebar Kartu) */
  #btn-prev-q {
    grid-column: 1 / 2 !important;
    grid-row: 2 / 3 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 48px !important;
    padding: 0.65rem 0.5rem !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    white-space: nowrap !important;
    border: 1.5px solid var(--border-color) !important;
    background: white !important;
    color: var(--text-main) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  }

  /* Baris 2 Kanan: Tombol Selanjutnya (50% Lebar Kartu, Teks Terbaca Penuh) */
  #btn-next-q {
    grid-column: 2 / 3 !important;
    grid-row: 2 / 3 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 48px !important;
    padding: 0.65rem 0.5rem !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    white-space: nowrap !important;
    background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25) !important;
  }

  #btn-prev-q span,
  #btn-next-q span {
    white-space: nowrap !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
  }

  #btn-prev-q svg,
  #btn-next-q svg {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
  }

  #btn-prev-q:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    background: #f8fafc !important;
  }

  /* Palet Nomor Soal di Layar HP (5 Kolom Touch-Friendly) */
  .palette-card {
    padding: 1rem 0.85rem;
    border-radius: 16px;
  }

  .palette-card h4 {
    font-size: 0.95rem;
  }

  .palette-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.45rem;
    margin-top: 0.75rem;
  }

  .palette-btn {
    height: 44px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 8px;
    touch-action: manipulation;
  }

  .palette-btn:active {
    transform: scale(0.95);
  }

  .palette-legend {
    font-size: 0.72rem;
    gap: 0.35rem;
  }

  .portal-page-footer,
  .exam-room-footer {
    font-size: 0.72rem;
    text-align: center;
    padding: 1rem 0.5rem;
    opacity: 0.85;
    line-height: 1.4;
  }

  /* --- 5. HALAMAN HASIL UJIAN SISWA DI HP --- */
  .result-wrapper {
    padding: 1rem 0.65rem 2rem;
    min-height: calc(100vh - 55px);
  }

  .result-card {
    padding: 1.5rem 1rem;
    border-radius: 18px;
    width: 100%;
    max-width: 100%;
  }

  .result-icon {
    width: 58px;
    height: 58px;
    margin-bottom: 0.85rem;
  }

  .result-header h2 {
    font-size: 1.35rem;
  }

  .result-header p {
    font-size: 0.82rem;
  }

  .score-display-box {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 12px;
  }

  .score-number {
    font-size: 2.5rem;
    margin: 0.35rem 0;
  }

  .result-details-box {
    padding: 0.85rem;
    font-size: 0.8rem;
    border-radius: 10px;
  }

  .result-stat-row {
    padding: 0.35rem 0;
    font-size: 0.78rem;
  }

  .result-card .btn {
    min-height: 46px;
    width: 100%;
    font-size: 0.92rem;
    border-radius: 12px;
  }

  /* --- 6. MODAL & DIALOG PADA LAYAR HP --- */
  .modal-overlay {
    padding: 0.65rem;
  }

  .modal-dialog {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 16px;
  }

  .modal-header {
    padding: 1rem 1.15rem;
  }

  .modal-header h3 {
    font-size: 1.1rem;
  }

  .modal-body {
    padding: 1.15rem;
  }

  .modal-footer {
    padding: 0.85rem 1.15rem;
    flex-direction: column-reverse;
    gap: 0.5rem;
  }

  .modal-footer .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .cheat-warning-card {
    padding: 1.5rem 1rem 1.15rem;
  }

  .cheat-warning-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 0.75rem;
  }
}

@media (max-width: 480px) {
  /* Extra compact optimizations for small screens (360px - 480px) */
  .exam-room-container {
    padding: 0 0.4rem;
  }

  .exam-question-card {
    padding: 1rem 0.75rem;
  }

  .exam-title-text {
    font-size: 0.86rem;
  }

  .timer-countdown {
    font-size: 1.05rem;
  }

  .badge-anti-cheat {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  #btn-prev-q, #btn-next-q {
    font-size: 0.84rem !important;
    padding: 0.65rem 0.35rem !important;
    gap: 0.25rem !important;
  }

  #btn-prev-q span, #btn-next-q span {
    font-size: 0.84rem !important;
  }

  .palette-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35rem;
  }

  .palette-btn {
    height: 40px;
    font-size: 0.88rem;
  }

  .cbt-main-title {
    font-size: 1.05rem;
  }
}

/* ==========================================================================
   STUDENT INTEGRITY & ANTI-CHEAT ENFORCEMENT STYLES
   ========================================================================== */
#screen-exam-taking, #screen-student {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#screen-exam-taking input,
#screen-exam-taking textarea,
#screen-student input,
#screen-student textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.fullscreen-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fullscreen-status-badge:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

/* ==========================================================================
   DESKTOP CONTROL PANEL REPLICA STYLES (EXACT PIXEL & COLOR MATCHING)
   ========================================================================== */

/* Dark Control Panel Root Colors */
.dashboard-layout {
  background-color: #080D1A;
  color: #F8FAFC;
  min-height: calc(100vh - 60px);
  display: flex;
}

/* Sidebar Auto-Hide / Collapsed State */
.sidebar {
  width: 315px;
  background-color: #0C1427;
  border-right: 1px solid #1E2D4A;
  padding: 14px 12px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed {
  width: 68px;
}

.sidebar.collapsed .nav-item span:not(.nav-bullet):not(.nav-icon),
.sidebar.collapsed .sidebar-header span,
.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .sidebar-mysql-btn-wrap span,
.sidebar.collapsed .live-dot-badge,
.sidebar.collapsed .top10-badge,
.sidebar.collapsed .new-badge,
.sidebar.collapsed .badge-count-info {
  display: none !important;
}

.btn-sidebar-collapse {
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  padding: 4px;
}

.btn-sidebar-collapse:hover {
  color: #38BDF8;
}

.btn-toggle-sidebar-nav {
  background: #111B2E;
  border: 1px solid #1E2D4A;
  color: #38BDF8;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.btn-toggle-sidebar-nav:hover {
  background: #1E2D4A;
}

/* Top Academic Year Pill & Grade Promotion */
.header-center-pill-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.academic-year-box {
  background: #111B2E;
  border: 1px solid #1E2D4A;
  border-radius: 8px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #94A3B8;
  font-weight: 600;
}

.academic-year-select {
  background: #0F172A;
  color: #F8FAFC;
  border: 1px solid #2A3854;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  outline: none;
}

.btn-promote-grades {
  background: #1E293B;
  border: 1px solid #334155;
  color: #38BDF8;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-promote-grades:hover {
  background: #0F172A;
  border-color: #38BDF8;
}

/* Sidebar Nav Pills */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 10px;
  flex: 1;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.sidebar-nav .nav-item:hover {
  background: #152037;
  color: #F8FAFC;
}

.sidebar-nav .nav-item.active {
  background: #152037;
  color: #F8FAFC;
  font-weight: 700;
  border-left: 3px solid #38BDF8;
}

.sidebar-nav .nav-bullet {
  font-size: 10px;
  color: #64748B;
}

.sidebar-nav .nav-item.active .nav-bullet {
  color: #38BDF8;
}

.top10-badge {
  background: #F59E0B;
  color: #0F172A;
  font-size: 9px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
}

.new-badge {
  background: #0D9488;
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
}

.badge-count-info {
  background: #0D9488;
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
}

/* 4 Top Stat Cards Grid */
.dark-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.dark-stat-card {
  background: #111B2E;
  border: 1px solid #1E2D4A;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.stat-card-title {
  font-size: 0.8rem;
  color: #94A3B8;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.stat-card-number {
  font-size: 2rem;
  font-weight: 800;
  color: #F8FAFC;
  line-height: 1.1;
  margin-bottom: 6px;
}

.stat-card-sub {
  font-size: 0.76rem;
  font-weight: 600;
}

.text-teal { color: #0D9488 !important; }
.text-cyan { color: #38BDF8 !important; }
.text-rose { color: #F43F5E !important; }
.text-amber { color: #F59E0B !important; }
.text-blue { color: #3B82F6 !important; }
.text-slate { color: #94A3B8 !important; }

/* Internet Control Card */
.internet-status-card {
  background: #111B2E;
  border: 1px solid #1E2D4A;
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
}

.internet-open {
  background: linear-gradient(90deg, rgba(6,78,59,0.35) 0%, #111B2E 100%);
  border-color: #059669;
}

.internet-blocked {
  background: linear-gradient(90deg, rgba(127,29,29,0.35) 0%, #111B2E 100%);
  border-color: #DC2626;
}

.inet-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #F8FAFC;
  margin: 0;
}

.inet-desc {
  font-size: 0.8rem;
  color: #94A3B8;
  margin: 4px 0 0 0;
}

.btn-danger-dark {
  background: #DC2626;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-danger-dark:hover { background: #B91C1C; }

.btn-success-dark {
  background: #10B981;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-success-dark:hover { background: #059669; }

/* Grade Analytics Distribution Card */
.dark-main-card {
  background: #111B2E;
  border: 1px solid #1E2D4A;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.card-header-icon {
  font-size: 1.2rem;
}

.card-header-heading {
  font-size: 1.1rem;
  font-weight: 800;
  color: #F8FAFC;
  margin: 0;
}

.card-header-sub {
  font-size: 0.8rem;
  color: #94A3B8;
  margin-top: 4px;
}

.form-control-dark {
  background: #0F172A;
  color: #F8FAFC;
  border: 1px solid #2A3854;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
}

.btn-teal {
  background: #0D9488;
  color: white;
  border: 1px solid #14B8A6;
  border-radius: 8px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-teal:hover { background: #0F766E; }

/* Grade Metrics Row */
.grade-metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.metric-box {
  background: #0C1427;
  border: 1px solid #1E2D4A;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: center;
}

.metric-label {
  font-size: 0.74rem;
  color: #94A3B8;
  font-weight: 600;
  display: block;
}

.metric-value {
  font-size: 1.4rem;
  font-weight: 800;
  margin-top: 4px;
}

.radio-label {
  font-size: 0.82rem;
  color: #CBD5E1;
  font-weight: 600;
  cursor: pointer;
  margin-right: 12px;
}

/* Horizontal Score Bar Distribution Items */
.overview-chart-wrap {
  background: #0C1427;
  border: 1px solid #1E2D4A;
  border-radius: 10px;
  padding: 16px 20px;
}

.bar-row-item {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.bar-row-item:last-child { margin-bottom: 0; }

.bar-row-label {
  width: 190px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #CBD5E1;
  flex-shrink: 0;
}

.bar-row-track {
  flex: 1;
  height: 22px;
  background: #111B2E;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.bar-fill-horizontal {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-row-value {
  width: 120px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #F8FAFC;
  text-align: right;
  flex-shrink: 0;
}

/* Live Score Top 10 Leaderboard Podiums */
.leaderboard-podiums-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.podium-card {
  background: #111B2E;
  border: 1px solid #1E2D4A;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  position: relative;
}

.gold-podium {
  border-color: #F59E0B;
  background: linear-gradient(180deg, rgba(245,158,11,0.12) 0%, #111B2E 100%);
}

.silver-podium {
  border-color: #94A3B8;
  background: linear-gradient(180deg, rgba(148,163,184,0.12) 0%, #111B2E 100%);
}

.bronze-podium {
  border-color: #D97706;
  background: linear-gradient(180deg, rgba(217,119,6,0.12) 0%, #111B2E 100%);
}

.podium-rank-badge {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.podium-student-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #F8FAFC;
}

.podium-student-class {
  font-size: 0.8rem;
  color: #94A3B8;
  font-weight: 600;
}

.podium-score {
  font-size: 2.2rem;
  font-weight: 900;
  margin-top: 8px;
}

/* Grade Promotion Box */
.promote-info-box {
  background: #0C1427;
  border: 1px solid #1E2D4A;
  border-radius: 10px;
  padding: 16px;
}

.promote-steps-list {
  margin: 10px 0 0 20px;
  font-size: 0.86rem;
  line-height: 1.8;
  color: #CBD5E1;
}

/* CBT Login Role Switcher Tabs */
.cbt-login-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid #1E2D4A;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  overflow: hidden;
}

.cbt-tab-btn {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: #94A3B8;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom: 3px solid transparent;
}

.cbt-tab-btn:hover {
  color: #F8FAFC;
  background: rgba(255, 255, 255, 0.04);
}

.cbt-tab-btn.active {
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.08);
  border-bottom-color: #38BDF8;
}




