/* ==========================================================================
   Centery Platform - Student & Parent Portal
   Theme: Executive Obsidian & Cyber-Glass (#080b12 / #0f172a)
   Typography: Alexandria (Arabic) + Plus Jakarta Sans (Numbers & Codes)
   Version: 20260914.CompactAndResponsive
   ========================================================================== */

:root {
  /* Core Backgrounds */
  --std-bg-base: #080b12;
  --std-bg-surface: #0d1322;
  --std-card-glass: rgba(15, 23, 42, 0.75);
  --std-card-glass-hover: rgba(22, 34, 61, 0.85);
  --std-card-subtle: rgba(255, 255, 255, 0.03);
  --std-card-elevated: #111a2e;

  /* Glass Borders */
  --std-border: rgba(255, 255, 255, 0.08);
  --std-border-light: rgba(255, 255, 255, 0.14);
  --std-border-glow: rgba(99, 102, 241, 0.35);
  --std-border-focus: #6366f1;

  /* Vibrant Accent Palette */
  --std-primary: #6366f1;
  --std-primary-rgb: 99, 102, 241;
  --std-primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --std-primary-light: rgba(99, 102, 241, 0.14);
  --std-primary-hover: #4f46e5;

  --std-secondary: #0ea5e9;
  --std-secondary-gradient: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  --std-cyan-light: rgba(14, 165, 233, 0.14);

  --std-success: #10b981;
  --std-success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --std-success-light: rgba(16, 185, 129, 0.14);

  --std-warning: #f59e0b;
  --std-warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --std-warning-light: rgba(245, 158, 11, 0.14);

  --std-danger: #ef4444;
  --std-danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --std-danger-light: rgba(239, 68, 68, 0.14);

  --std-purple: #a855f7;
  --std-purple-light: rgba(168, 85, 247, 0.14);

  /* Typography Colors */
  --std-text-primary: #f8fafc;
  --std-text-secondary: #94a3b8;
  --std-text-muted: #64748b;
  --std-text-dim: #475569;

  /* Geometry & Shadows */
  --std-radius-xs: 6px;
  --std-radius-sm: 8px;
  --std-radius-md: 12px;
  --std-radius-lg: 18px;
  --std-radius-xl: 24px;
  --std-radius-full: 9999px;

  --std-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --std-shadow-md: 0 6px 18px -4px rgba(0, 0, 0, 0.4);
  --std-shadow-lg: 0 12px 28px -6px rgba(0, 0, 0, 0.5);
  --std-shadow-glow: 0 0 25px rgba(99, 102, 241, 0.2);
}

/* ==========================================================================
   Base Layout & Atmosphere
   ========================================================================== */
html {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

body.student-portal-body {
  font-family: 'Cairo', 'Alexandria', system-ui, -apple-system, sans-serif !important;
  font-size: 0.8rem;
  line-height: 1.5;
  background-color: var(--std-bg-base) !important;
  color: var(--std-text-primary);
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  direction: rtl;
  position: relative;
  overflow-x: hidden !important;
  box-sizing: border-box;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(14, 165, 233, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
    #080b12 !important;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Subtle Animated Background Grain */
body.student-portal-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   SCREEN 1: SMART ACCESS GATEWAY (QR SCANNER & CODE INPUT)
   ========================================================================== */
#studentQrGate {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 14px;
}

.qr-login-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: auto;
  position: relative;
  animation: modalScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.qr-login-card {
  background: var(--std-card-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--std-border-light);
  border-radius: var(--std-radius-xl);
  padding: 22px 18px;
  box-shadow: var(--std-shadow-lg), var(--std-shadow-glow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.qr-login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #0ea5e9, #a855f7);
}

/* Brand Header */
.login-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.login-logo {
  width: 52px;
  height: 52px;
  border-radius: var(--std-radius-md);
  background: linear-gradient(135deg, #6366f1 0%, #0ea5e9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.login-logo svg {
  width: 28px;
  height: 28px;
}

.login-brand-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.login-brand-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: var(--std-text-secondary);
}

/* Auth Mode Tabs (Camera vs Manual Code) */
.auth-mode-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--std-border);
  border-radius: var(--std-radius-full);
  padding: 3px;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--std-text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: var(--std-radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: var(--std-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* Scanner Viewport */
.qr-scanner-viewport {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 230px;
  background: #020617;
  border-radius: var(--std-radius-md);
  border: 1.5px solid rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.qr-scanner-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Cyber Viewfinder */
.qr-viewfinder-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 45%, rgba(2, 6, 23, 0.6) 80%);
}

.qr-target-box {
  width: 160px;
  height: 160px;
  position: relative;
  box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.4);
}

.qr-target-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border-top: 3px solid #38bdf8;
  border-left: 3px solid #38bdf8;
  border-top-left-radius: 6px;
}

.qr-target-box::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-bottom: 3px solid #38bdf8;
  border-right: 3px solid #38bdf8;
  border-bottom-right-radius: 6px;
}

.qr-target-corner-tr {
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-top: 3px solid #38bdf8;
  border-right: 3px solid #38bdf8;
  border-top-right-radius: 6px;
}

.qr-target-corner-bl {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border-bottom: 3px solid #38bdf8;
  border-left: 3px solid #38bdf8;
  border-bottom-left-radius: 6px;
}

.qr-laser-line {
  position: absolute;
  left: 5%;
  right: 5%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8 50%, transparent);
  box-shadow: 0 0 10px 2px #38bdf8;
  animation: laserSweep 2s ease-in-out infinite alternate;
}

@keyframes laserSweep {
  0% { top: 8%; opacity: 0.8; }
  100% { top: 92%; opacity: 0.8; }
}

#studentScannerStatus {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.08);
  padding: 7px 12px;
  border-radius: var(--std-radius-sm);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.camera-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseEmerald 1.8s infinite;
}

@keyframes pulseEmerald {
  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); }
}

.qr-scanner-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-qr-action {
  flex: 1;
  min-width: 100px;
  background: var(--std-card-subtle);
  border: 1px solid var(--std-border);
  color: var(--std-text-primary);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: var(--std-radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-qr-action:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--std-border-light);
}

/* Manual Code View */
.manual-code-form-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.manual-code-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.manual-code-input {
  width: 100%;
  background: #060911;
  border: 1.5px solid var(--std-border-light);
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
  padding: 12px 14px;
  border-radius: var(--std-radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.manual-code-input:focus {
  border-color: var(--std-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.manual-code-input::placeholder {
  font-family: 'Alexandria', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0;
  color: var(--std-text-dim);
  font-weight: 500;
}

.btn-manual-submit {
  width: 100%;
  background: var(--std-primary-gradient);
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 12px 16px;
  border-radius: var(--std-radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: all 0.2s ease;
}

.btn-manual-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}

#studentLoginError {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 9px 12px;
  border-radius: var(--std-radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.qr-gate-footer-hint {
  font-size: 0.74rem;
  color: var(--std-text-muted);
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 14px;
  border-radius: var(--std-radius-sm);
  border: 1px solid var(--std-border);
  text-align: right;
}

.qr-gate-footer-link {
  text-align: center;
  font-size: 0.78rem;
  color: var(--std-text-muted);
  border-top: 1px solid var(--std-border);
  padding-top: 14px;
}

.qr-gate-footer-link a {
  color: #818cf8;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s ease;
}

.qr-gate-footer-link a:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

/* ----------------------------------------------------
   PIN Verification & Security Elements
   ---------------------------------------------------- */
.btn-pin-eye {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.btn-pin-eye:hover {
  opacity: 1;
}

.pin-student-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--std-radius-md);
  padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.pin-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
  flex-shrink: 0;
}

.pin-badge-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
  flex: 1;
}

/* Student Modal Generic (For First-time PIN setup & Change PIN) */
/* Card Self-Activation Modal (Fix for black screen visibility) */
#cardActivationModal {
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
#cardActivationModal.open,
#cardActivationModal.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
#cardActivationModal.open .modal-card,
#cardActivationModal.active .modal-card {
  opacity: 1 !important;
  visibility: visible !important;
  transform: scale(1) translateY(0) !important;
  pointer-events: auto !important;
}

/* =========================================================
   Smart Card Onboarding & Celebratory Welcome Styles
   ========================================================= */
.onboarding-welcome-wrap {
  padding: 36px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: stdWelcomeFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes stdWelcomeFadeIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.onboarding-hero-icon-box {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 18px auto;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
  border: 2px solid rgba(168, 85, 247, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 35px rgba(168, 85, 247, 0.35), inset 0 0 20px rgba(99, 102, 241, 0.2);
  animation: welcomeBadgePulse 3s ease-in-out infinite alternate;
}

@keyframes welcomeBadgePulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
  }
  100% {
    transform: translateY(-6px) scale(1.04);
    box-shadow: 0 0 50px rgba(99, 102, 241, 0.55), 0 0 20px rgba(56, 189, 248, 0.4);
  }
}

.onboarding-welcome-title {
  font-size: 1.65rem;
  font-weight: 900;
  margin: 0 0 8px 0;
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.onboarding-welcome-sub {
  font-size: 0.95rem;
  color: #94a3b8;
  max-width: 480px;
  line-height: 1.6;
  margin: 0 0 22px 0;
}

.onboarding-welcome-card-preview {
  width: 100%;
  max-width: 490px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.7));
  border: 1.5px solid rgba(99, 102, 241, 0.35);
  border-radius: 20px;
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.onboarding-welcome-card-preview::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 60%
  );
  transform: rotate(35deg);
  animation: cardShimmer 6s infinite linear;
  pointer-events: none;
}

@keyframes cardShimmer {
  0% { transform: translateY(-100%) rotate(35deg); }
  100% { transform: translateY(100%) rotate(35deg); }
}

.onboarding-cta-btn {
  width: 100%;
  max-width: 490px;
  padding: 16px 24px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #10b981, #059669, #0284c7);
  background-size: 200% 200%;
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4), 0 0 20px rgba(14, 165, 233, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s ease;
  animation: ctaGradientPulse 4s ease infinite;
}

.onboarding-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(16, 185, 129, 0.55), 0 0 30px rgba(14, 165, 233, 0.45);
}

@keyframes ctaGradientPulse {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes waveHand {
  0% { transform: rotate(0deg); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-10deg); }
  45% { transform: rotate(14deg); }
  60% { transform: rotate(-4deg); }
  75% { transform: rotate(10deg); }
  100% { transform: rotate(0deg); }
}

.student-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4, 7, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: stdFadeIn 0.25s ease-out;
}

.student-modal-dialog {
  background: #0f172a;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--std-radius-xl);
  width: 100%;
  max-width: 440px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  animation: stdScaleUp 0.25s ease-out;
}

@keyframes stdFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes stdScaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   SCREEN 2: MAIN DASHBOARD & NAVBAR
   ========================================================================== */
#studentDashboardWrap {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  overflow-x: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Floating Glass Top Navbar (Ultra-Clean Minimalist Header) */
.student-navbar {
  background: rgba(8, 11, 18, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--std-border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

.student-navbar-inner {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portal-brand:hover {
  transform: scale(1.02);
}

.portal-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(14, 165, 233, 0.2));
  border: 1.5px solid rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.brand-cap-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
  transition: transform 0.3s ease;
}

.portal-brand:hover .brand-cap-img {
  transform: rotate(-8deg) scale(1.1);
}

.portal-brand-text h1 {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 900;
  letter-spacing: -0.3px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.portal-brand-en {
  font-weight: 600;
  font-size: 0.76rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

.student-user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.student-badge-code {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818cf8;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: var(--std-radius-full);
  letter-spacing: 0.5px;
  font-family: 'Plus Jakarta Sans', monospace;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.student-badge-code:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: #6366f1;
}

.student-profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--std-card-glass);
  border: 1px solid var(--std-border);
  padding: 4px 10px 4px 6px;
  border-radius: var(--std-radius-full);
}

.student-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.student-meta-info {
  display: flex;
  flex-direction: column;
}

.student-name-text {
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--std-text-primary);
  line-height: 1.2;
}

.student-sub-text {
  font-size: 0.68rem;
  color: var(--std-text-secondary);
}

.btn-portal-logout {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--std-radius-sm);
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-portal-logout:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: #ef4444;
  color: #ffffff;
}

/* Notification Bell & Alerts */
.btn-portal-notif {
  position: relative;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--std-radius-sm);
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-portal-notif:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #ffffff;
}

.notif-ping-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #0b1120;
  animation: notifPulse 1.8s infinite;
}

@keyframes notifPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.notif-count-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--std-radius-full);
}

.homework-ping-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: var(--std-radius-full);
  background: #f59e0b;
  border: 2px solid #0b1120;
  animation: hwPulse 1.8s infinite;
}

@keyframes hwPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.75); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 7px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.tab-badge-homework {
  background: #f59e0b !important;
  color: #1e1b4b !important;
  font-weight: 800 !important;
}

/* Active Announcement Alert Banner on Overview */
.active-announcement-alert {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(99, 102, 241, 0.14) 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--std-radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  animation: bannerFadeIn 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

@keyframes bannerFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.active-announcement-alert .ann-alert-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.active-announcement-alert .ann-alert-content {
  flex: 1;
  min-width: 0;
}

.active-announcement-alert .ann-alert-content strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 2px;
}

.active-announcement-alert .ann-alert-content p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--std-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-view-ann {
  background: var(--std-primary);
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--std-radius-sm);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-view-ann:hover {
  background: var(--std-primary-hover);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* ==========================================================================
   CONTAINER & TABS
   ========================================================================== */
.student-main-container {
  max-width: 1280px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 16px 12px 50px 12px;
  overflow-x: hidden;
}

.student-tabs-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-x pan-y !important;
  overscroll-behavior-x: contain;
  padding: 4px 2px 12px 2px;
  margin-bottom: 16px;
  scrollbar-width: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.student-tabs-wrapper::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: var(--std-card-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--std-border);
  color: var(--std-text-secondary);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--std-radius-full);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--std-text-primary);
  border-color: var(--std-border-light);
}

.tab-btn.active {
  background: var(--std-primary);
  color: #ffffff;
  border-color: var(--std-primary);
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.35);
}

.tab-badge-counter {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--std-radius-full);
  line-height: 1;
}

.tab-btn.active .tab-badge-counter {
  background: #ffffff;
  color: var(--std-primary);
}

.tab-badge-homework {
  background: rgba(234, 179, 8, 0.2) !important;
  color: #facc15 !important;
  border: 1px solid rgba(234, 179, 8, 0.4);
}
.tab-btn.active .tab-badge-homework {
  background: #facc15 !important;
  color: #713f12 !important;
  border-color: #facc15 !important;
}

.homework-ping-dot {
  position: absolute;
  top: 0px;
  right: -2px;
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--std-card-glass);
  animation: ping-pulse 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping-pulse {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.tab-pane {
  display: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  animation: tabFadeIn 0.25s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   TAB 1: DIGITAL SMART ID CARD & BENTO METRICS
   ========================================================================== */
.id-card-hero-grid {
  display: grid;
  grid-template-columns: 370px 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 980px) {
  .id-card-hero-grid {
    grid-template-columns: 1fr;
  }
}

.student-smart-card {
  background: linear-gradient(135deg, #101728 0%, #0d121f 50%, #0a0e17 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--std-radius-lg);
  padding: 20px;
  box-shadow: var(--std-shadow-md), 0 0 25px rgba(99, 102, 241, 0.12);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.student-smart-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 40% 40%, rgba(99, 102, 241, 0.12) 0%, rgba(14, 165, 233, 0.08) 30%, transparent 65%);
  pointer-events: none;
}

.student-smart-card::after {
  content: '';
  position: absolute;
  top: 18px;
  right: 18px;
  width: 26px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(135deg, #d97706 0%, #fbbf24 100%);
  opacity: 0.35;
  pointer-events: none;
}

.id-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--std-border);
  padding-bottom: 10px;
  position: relative;
  z-index: 2;
}

.id-card-center-logo {
  font-size: 0.86rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--std-text-primary);
}

.id-card-type-tag {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--std-radius-full);
}

.id-card-body {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.id-card-qr-box {
  background: #ffffff;
  padding: 6px;
  border-radius: var(--std-radius-sm);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
}

.id-card-qr-box canvas,
.id-card-qr-box img {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.id-card-info-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.id-student-name {
  font-size: 0.96rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.id-student-code {
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 0.82rem;
  font-weight: 800;
  color: #818cf8;
  letter-spacing: 0.8px;
}

.id-card-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--std-border);
  padding: 10px 12px;
  border-radius: var(--std-radius-sm);
  font-size: 0.74rem;
  position: relative;
  z-index: 2;
}

.id-detail-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.id-detail-label {
  color: var(--std-text-muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.id-detail-val {
  color: var(--std-text-primary);
  font-weight: 700;
}

.id-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--std-border);
  padding-top: 12px;
  position: relative;
  z-index: 2;
}

.btn-card-action {
  flex: 1;
  background: var(--std-primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818cf8;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 9px 12px;
  border-radius: var(--std-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-card-action:hover {
  background: var(--std-primary);
  color: #ffffff;
}

/* Bento Grid KPIs */
.overview-kpis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 600px) {
  .overview-kpis-grid {
    grid-template-columns: 1fr;
  }
}

.std-kpi-card {
  background: var(--std-card-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--std-border);
  border-radius: var(--std-radius-md);
  padding: 16px 14px;
  box-shadow: var(--std-shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.std-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--std-border-glow);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--std-text-secondary);
  font-weight: 700;
}

.kpi-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--std-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-wrap.indigo { background: var(--std-primary-light); color: #818cf8; }
.kpi-icon-wrap.emerald { background: var(--std-success-light); color: #34d399; }
.kpi-icon-wrap.amber { background: var(--std-warning-light); color: #fbbf24; }
.kpi-icon-wrap.sky { background: var(--std-cyan-light); color: #38bdf8; }

.kpi-value {
  font-size: 1.3rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', system-ui;
  color: var(--std-text-primary);
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.kpi-value span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--std-text-secondary);
}

.kpi-subtext {
  font-size: 0.72rem;
  color: var(--std-text-muted);
  font-weight: 600;
}

/* Next Session Banner */
#nextSessionBox {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(14, 165, 233, 0.06) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--std-radius-md);
  padding: 16px 18px;
  margin-top: 16px;
}

/* ==========================================================================
   COMMON PANELS & DATA TABLES (ROBUST MOBILE SCROLLING & TOUCH DRAG)
   ========================================================================== */
.section-panel {
  background: var(--std-card-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--std-border);
  border-radius: var(--std-radius-lg);
  padding: 18px 16px;
  box-shadow: var(--std-shadow-sm);
  margin-bottom: 20px;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 7px;
}

.panel-title-desc {
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--std-text-secondary);
}

/* Interactive Mobile Table Navigation Bar */
.table-scroll-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--std-border);
  border-radius: var(--std-radius-sm);
  padding: 6px 10px;
  margin-bottom: 10px;
  user-select: none;
}

.table-scroll-hint-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #818cf8;
}

.table-scroll-hint-pill .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6366f1;
  box-shadow: 0 0 8px #6366f1;
  animation: cameraPulse 1.8s infinite;
}

.table-scroll-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-table-scroll {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--std-radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-table-scroll:hover {
  background: var(--std-primary);
  color: #ffffff;
  border-color: var(--std-primary);
}

.btn-table-view-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--std-border);
  color: var(--std-text-secondary);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--std-radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-table-view-toggle:hover {
  color: #ffffff;
  border-color: var(--std-border-light);
}

/* Table Wrapper with Guaranteed Mobile Touch-Scrolling & Grab Hand */
.std-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-x pan-y !important;
  overscroll-behavior-x: auto !important;
  display: block;
  position: relative;
  border-radius: var(--std-radius-sm);
  border: 1px solid var(--std-border);
  background: rgba(0, 0, 0, 0.25);
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.35) transparent;
  cursor: grab;
  user-select: none;
}

.std-table-wrap:active {
  cursor: grabbing;
}

.std-table-wrap::-webkit-scrollbar {
  height: 6px;
}

.std-table-wrap::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.std-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: var(--std-radius-full);
}

.std-table {
  width: 100%;
  min-width: 580px !important; /* CRITICAL: guarantees columns are never crushed or invisible */
  border-collapse: collapse;
  text-align: right;
  font-size: 0.76rem;
}

.std-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--std-text-secondary);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 8px 10px;
  border-bottom: 1px solid var(--std-border);
  white-space: nowrap;
}

.std-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--std-text-primary);
  vertical-align: middle;
  font-size: 0.76rem;
  white-space: nowrap;
}

.std-table tbody tr {
  transition: background 0.15s ease;
}

.std-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.std-table tbody tr:last-child td {
  border-bottom: none;
}

/* Mobile Responsive Cards Alternative View */
.std-mobile-cards-list {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.std-record-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--std-border);
  border-radius: var(--std-radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.std-record-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--std-border-glow);
}

.std-record-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 7px;
}

.std-record-card-title {
  font-weight: 700;
  font-size: 0.8rem;
  color: #ffffff;
}

.std-record-card-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 12px;
  font-size: 0.72rem;
}

.std-card-prop {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.std-card-prop-label {
  color: var(--std-text-muted);
  font-size: 0.65rem;
  font-weight: 600;
}

.std-card-prop-val {
  color: var(--std-text-primary);
  font-weight: 700;
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--std-radius-full);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge-status.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-status.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-status.info {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.badge-status.neutral {
  background: rgba(255, 255, 255, 0.08);
  color: var(--std-text-secondary);
  border: 1px solid var(--std-border);
}

/* ==========================================================================
   TAB 4: QUIZZES STUDIO & CARDS
   ========================================================================== */
.quizzes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.quiz-card {
  background: var(--std-card-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--std-border);
  border-radius: var(--std-radius-md);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--std-shadow-sm);
  position: relative;
  overflow: hidden;
}

.quiz-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #0ea5e9);
}

.quiz-card.is-completed::before {
  background: linear-gradient(90deg, #10b981, #06b6d4);
}

.quiz-card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.35;
}

.quiz-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--std-border);
  border-radius: var(--std-radius-xs);
  padding: 8px 10px;
  font-size: 0.74rem;
  color: var(--std-text-secondary);
}

.quiz-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.btn-start-quiz {
  width: 100%;
  background: var(--std-primary-gradient);
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: var(--std-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
}

.btn-review-quiz {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--std-border-light);
  color: #38bdf8;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 9px 12px;
  border-radius: var(--std-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Studio Modal */
.quiz-studio-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #060911;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}

.quiz-studio-modal.active {
  display: flex;
}

.quiz-studio-header {
  background: rgba(13, 19, 34, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--std-border);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.studio-exam-info h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
}

.studio-exam-info p {
  margin: 1px 0 0 0;
  font-size: 0.74rem;
  color: var(--std-text-muted);
}

.studio-timer-pill {
  background: rgba(245, 158, 11, 0.12);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  padding: 6px 12px;
  border-radius: var(--std-radius-full);
  font-family: 'Plus Jakarta Sans', monospace;
  font-weight: 900;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-timer-pill.ticking {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #f87171;
}

.studio-body {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 50px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.question-tracker-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.q-dot {
  width: 34px;
  height: 34px;
  border-radius: var(--std-radius-xs);
  background: var(--std-card-glass);
  border: 1px solid var(--std-border);
  color: var(--std-text-secondary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.q-dot.active {
  background: var(--std-primary);
  border-color: var(--std-primary);
  color: #ffffff;
}

.q-dot.answered {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.active-question-card {
  background: var(--std-card-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--std-border-light);
  border-radius: var(--std-radius-lg);
  padding: 24px 20px;
  box-shadow: var(--std-shadow-md);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.question-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.q-number-badge {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--std-radius-full);
}

.q-points-badge {
  color: var(--std-text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.question-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.55;
}

.mcq-options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mcq-option-label {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid var(--std-border);
  border-radius: var(--std-radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.mcq-option-label.selected {
  background: rgba(99, 102, 241, 0.12);
  border-color: #6366f1;
}


.mcq-letter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--std-text-secondary);
  font-weight: 800;
  font-size: 0.82rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.mcq-option-label.selected .mcq-letter-badge {
  background: #6366f1;
  color: #ffffff;
}

.mcq-radio-custom {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--std-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mcq-option-label.selected 
.mcq-letter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--std-text-secondary);
  font-weight: 800;
  font-size: 0.82rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.mcq-option-label.selected .mcq-letter-badge {
  background: #6366f1;
  color: #ffffff;
}

.mcq-radio-custom {
  border-color: #6366f1;
  background: #6366f1;
}

.mcq-option-label.selected .mcq-radio-custom::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}

.mcq-option-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--std-text-primary);
}

.studio-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--std-border);
  padding-top: 16px;
  gap: 10px;
}

.btn-studio-nav {
  background: var(--std-card-subtle);
  border: 1px solid var(--std-border);
  color: var(--std-text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: var(--std-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-studio-submit {
  background: var(--std-success-gradient);
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 10px 22px;
  border-radius: var(--std-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.4);
}

/* Celebration Modal */
.result-celebration-card {
  background: #0b1120;
  border: 1px solid var(--std-border-light);
  border-radius: var(--std-radius-lg);
  padding: 28px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.result-badge-icon {
  font-size: 2.8rem;
}

.result-score-big {
  font-size: 2.6rem;
  font-weight: 900;
  font-family: 'Plus Jakarta Sans', system-ui;
  color: #ffffff;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 6px 0;
}

.result-score-big span {
  font-size: 1.2rem;
  color: var(--std-text-muted);
}

.result-percentage-tag {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 1.05rem;
  font-weight: 900;
  padding: 4px 14px;
  border-radius: var(--std-radius-full);
}

.review-question-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--std-border);
  border-radius: var(--std-radius-sm);
  padding: 12px;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
}

.review-question-item.correct {
  border-right: 3px solid #10b981;
}

.review-question-item.wrong {
  border-right: 3px solid #ef4444;
}

/* Toast */
.portal-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e293b;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--std-radius-full);
  padding: 10px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.portal-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   PRINT STYLESHEET
   ========================================================================== */
@media print {
  body.student-portal-body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  body.student-portal-body::before,
  .student-navbar,
  .student-tabs-wrapper,
  .overview-kpis-grid,
  #nextSessionBox,
  .btn-card-action,
  .table-scroll-hint,
  .quiz-studio-modal,
  #studentQrGate {
    display: none !important;
  }

  #studentDashboardWrap,
  .student-main-container,
  .tab-pane.active,
  .id-card-hero-grid {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .student-smart-card {
    background: #ffffff !important;
    border: 2px solid #0f172a !important;
    box-shadow: none !important;
    color: #000000 !important;
    max-width: 440px !important;
    margin: 30px auto !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .student-smart-card * {
    color: #000000 !important;
  }

  .id-card-qr-box {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
  }
}

/* ==========================================================================
   MOBILE & RESPONSIVE REFINEMENTS
   ========================================================================== */
@media (max-width: 768px) {
  .student-navbar {
    padding: 7px 12px;
  }

  .portal-brand-text p {
    display: none;
  }

  .student-main-container {
    padding: 12px 10px 95px 10px !important;
  }

  .desktop-only-nav-actions {
    display: none !important;
  }

  .student-tabs-wrapper {
    padding-bottom: 10px;
    gap: 4px;
    margin-bottom: 14px;
  }

  .tab-btn {
    padding: 6px 10px;
    font-size: 0.72rem;
  }

  .section-panel {
    padding: 14px 12px;
    border-radius: var(--std-radius-md);
    margin-bottom: 14px;
  }

  .id-card-body {
    gap: 12px;
  }

  .id-card-qr-box {
    width: 80px;
    height: 80px;
  }

  .id-student-name {
    font-size: 0.94rem;
  }

  .student-smart-card {
    padding: 14px 12px;
  }

  .overview-kpis-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .std-kpi-card {
    padding: 12px 10px;
  }

  .kpi-value {
    font-size: 1.25rem;
  }

  .active-question-card {
    padding: 16px 12px;
  }

  .question-text {
    font-size: 0.95rem;
  }
}

@media (max-width: 640px) {
  .portal-brand-text h1 {
    font-size: 0.88rem;
  }

  /* Compact navbar buttons - hide text and show icon only */
  .btn-text-label {
    display: none !important;
  }

  .btn-portal-notif {
    padding: 6px 9px;
    gap: 0;
  }

  .btn-portal-logout {
    padding: 6px 9px;
    font-size: 0.72rem;
    gap: 0;
  }

  .student-user-bar {
    gap: 6px;
  }

  /* Mobile navbar profile: Ensure student name and grade are fully visible and readable */
  .student-meta-info {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center;
    min-width: 0;
    max-width: 140px;
  }

  .student-name-text {
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    line-height: 1.25 !important;
  }

  .student-sub-text {
    font-size: 0.66rem !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
  }

  .student-profile-chip {
    padding: 3px 8px 3px 5px !important;
    gap: 6px !important;
    max-width: 180px;
  }

  .student-badge-code {
    font-size: 0.72rem;
    padding: 3px 7px;
  }

  .id-card-details-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .id-card-footer {
    flex-direction: column !important;
    gap: 6px !important;
    width: 100%;
  }

  .btn-card-action {
    font-size: 0.74rem;
    padding: 8px 12px;
    width: 100% !important;
    justify-content: center;
    flex: none !important;
  }

  /* Gate Card & Scanner Controls on mobile */
  #studentQrGate {
    padding: 16px 10px;
  }

  .qr-login-container {
    width: 100%;
    max-width: 100%;
  }

  .qr-login-card {
    padding: 18px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .qr-scanner-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    width: 100%;
  }

  .btn-qr-action {
    min-width: 0;
    width: 100%;
    padding: 8px 3px;
    font-size: 0.68rem;
    gap: 3px;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .student-navbar-inner {
    gap: 4px;
  }

  .portal-logo-icon {
    width: 28px;
    height: 28px;
  }

  .portal-logo-icon svg {
    width: 18px;
    height: 18px;
  }

  .overview-kpis-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .std-kpi-card {
    padding: 10px 8px;
    gap: 4px;
  }

  .kpi-label {
    font-size: 0.68rem;
  }

  .kpi-value {
    font-size: 1.15rem;
  }

  .kpi-subtext {
    display: none;
  }

  .kpi-icon-wrap {
    width: 28px;
    height: 28px;
  }

  .kpi-icon-wrap svg {
    width: 15px;
    height: 15px;
  }

  .id-card-qr-box {
    width: 70px;
    height: 70px;
    padding: 4px;
  }

  .id-student-name {
    font-size: 0.9rem;
  }

  .id-student-code {
    font-size: 0.76rem;
  }

  .table-scroll-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .table-scroll-actions {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  .btn-table-scroll {
    flex: 1;
    justify-content: center;
    padding: 5px 6px;
    font-size: 0.7rem;
  }

  .btn-table-view-toggle {
    flex: 1;
    justify-content: center;
    padding: 5px 6px;
    font-size: 0.7rem;
  }
}

/* Modern 2026 SaaS Button Improvements */
.btn-manual-submit svg,
.btn-qr-action svg,
.btn-card-action svg,
.tab-btn svg,
.auth-tab-btn svg {
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.btn-manual-submit:hover svg {
  transform: translateX(-2px);
}

.btn-qr-action:hover svg {
  transform: scale(1.08);
}

/* ==========================================================================
   LECTURE QR SCANNER ANIMATIONS
   ========================================================================== */
@keyframes scanLaser {
  0% { top: 10%; opacity: 0.3; }
  50% { top: 85%; opacity: 1; }
  100% { top: 10%; opacity: 0.3; }
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.08); opacity: 1; }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   STUDENT MOBILE BOTTOM ACTION DOCK (FLOATING BAR)
   ========================================================================== */
.student-bottom-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(8, 12, 22, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.65), 0 -1px 0 rgba(255, 255, 255, 0.05);
  padding: 6px 16px;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
}

.bottom-dock-inner {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.bottom-dock-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
  max-width: 110px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.bottom-dock-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.07);
}

.bottom-dock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #cbd5e1;
  transition: all 0.2s ease;
}

.bottom-dock-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.bottom-dock-btn:hover .bottom-dock-icon,
.bottom-dock-btn:hover .bottom-dock-label {
  color: #38bdf8;
}

.bottom-dock-btn.logout:hover .bottom-dock-icon,
.bottom-dock-btn.logout:hover .bottom-dock-label,
.bottom-dock-btn.logout:active .bottom-dock-icon,
.bottom-dock-btn.logout:active .bottom-dock-label {
  color: #f87171;
}

/* Center Elevated Hero FAB */
.bottom-dock-center-fab {
  position: relative;
  top: -16px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 3.5px solid #080c16;
  border-radius: 9999px;
  padding: 9px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5), 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: inherit;
  z-index: 10;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.bottom-dock-center-fab:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.65);
}

.bottom-dock-center-fab:active {
  transform: translateY(1px) scale(0.95);
}

.bottom-dock-center-fab .fab-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-dock-center-fab .fab-label {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.fab-pulse-ring {
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  border: 2px solid #10b981;
  opacity: 0.6;
  animation: fabPulse 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  pointer-events: none;
}

@keyframes fabPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.12); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

/* Exam Scheduling Buttons & Card Locks */
.btn-start-quiz.btn-upcoming {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #f59e0b !important;
  border: 1px dashed rgba(245, 158, 11, 0.4) !important;
  cursor: pointer !important;
}
.btn-start-quiz.btn-upcoming:hover {
  background: rgba(245, 158, 11, 0.22) !important;
  transform: none !important;
}

.btn-start-quiz.btn-expired {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  border: 1px dashed rgba(239, 68, 68, 0.35) !important;
  cursor: not-allowed !important;
}
.btn-start-quiz.btn-expired:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  transform: none !important;
}

.quiz-card.is-locked {
  border-color: rgba(255, 255, 255, 0.08);
  opacity: 0.95;
}
