/* ==============================================================================
   LMS EDU PRO V2 — ULTIMATE LIQUID GLASS 3D DESIGN SYSTEM (GLASSMORPHISM 3.0)
   Typography Engine: Outfit (Headings) + Be Vietnam Pro (Body) + JetBrains Mono (Code)
   Hardware-accelerated 120 FPS, Specular Border Reflection & Deep Theme Harmony
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600&family=JetBrains+Mono:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Premium Typography Tokens */
  --font-primary: 'Be Vietnam Pro', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Plus Jakarta Sans', 'Be Vietnam Pro', sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Core Deep Space Theme */
  --bg-core: #070b14;
  --bg-deep: #03060c;
  --bg-surface: rgba(14, 22, 40, 0.7);
  --bg-glass-card: rgba(20, 31, 56, 0.45);
  --bg-glass-card-hover: rgba(30, 47, 85, 0.65);
  --bg-glass-modal: rgba(10, 16, 30, 0.88);
  --bg-input: rgba(12, 19, 36, 0.65);

  /* Neon Gradients & Dynamic Accents */
  --primary-glow: #00f2fe;
  --primary-accent: #4facfe;
  --secondary-glow: #ff0844;
  --secondary-accent: #ffb199;
  --accent-purple: #7f00ff;
  --accent-magenta: #e100ff;
  --accent-emerald: #00f5a0;
  --accent-amber: #ffb300;
  --accent-blue: #0984e3;

  /* Typography Colors */
  --text-pure: #f8fafc;
  --text-sub: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Specular Highlights & Glassmorphism 3.0 */
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-hover: rgba(0, 242, 254, 0.45);
  --glass-border-focus: rgba(79, 172, 254, 0.85);
  --glass-shine: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.02) 100%);
  --glass-blur: blur(20px);
  --glass-blur-heavy: blur(35px);

  /* Shadows */
  --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 242, 254, 0.1);
  --shadow-lg: 0 20px 50px -10px rgba(0, 0, 0, 0.7), 0 0 35px rgba(79, 172, 254, 0.2);
  --shadow-neon-cyan: 0 0 25px rgba(0, 242, 254, 0.45);
  --shadow-neon-purple: 0 0 25px rgba(225, 0, 255, 0.45);
  --shadow-neon-green: 0 0 25px rgba(0, 245, 160, 0.45);
  --shadow-neon-red: 0 0 25px rgba(255, 8, 68, 0.45);

  /* Radii & Transitions */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-pill: 9999px;
  
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Fluid Responsive Dimension Tokens */
  --sidebar-w: 260px;
  --navbar-h: 72px;
  --fluid-pad: clamp(14px, 2.2vw, 36px);
  --fluid-gap: clamp(12px, 1.8vw, 24px);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-core: #f1f5f9;
  --bg-deep: #e2e8f0;
  --bg-surface: rgba(255, 255, 255, 0.85);
  --bg-glass-card: rgba(255, 255, 255, 0.75);
  --bg-glass-card-hover: rgba(255, 255, 255, 0.95);
  --bg-input: rgba(241, 245, 249, 0.9);
  --text-pure: #0f172a;
  --text-sub: #334155;
  --text-muted: #64748b;
  --glass-border: rgba(15, 23, 42, 0.1);
  --glass-border-hover: rgba(0, 180, 216, 0.5);
  --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.08);
}

/* Base Body & Fluid Typography */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ==============================================================================
   INVISIBLE SMOOTH SCROLLBAR (Cuộn mượt mà 100% nhưng ẩn thanh cuộn thô cứng)
   ============================================================================== */
html, body, * {
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE and Edge */
}

::-webkit-scrollbar {
  display: none !important;
  width: 0px !important;
  height: 0px !important;
  background: transparent !important;
}

html {
  overflow-x: hidden;
  max-width: 100vw;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--navbar-h, 72px) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-core);
  color: var(--text-pure);
  font-family: var(--font-primary);
  font-size: 15px;
  line-height: 1.68;
  letter-spacing: -0.011em;
  overflow-x: hidden;
  max-width: 100vw;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* Headings Typography */
h1, h2, h3, h4, h5, h6, .brand-logo, .display-4, .display-5, .display-6 {
  font-family: var(--font-heading);
  letter-spacing: -0.03em;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.28;
}

p, .lead, .text-sub {
  letter-spacing: -0.01em;
}

code, kbd, samp, pre, .timer-countdown-digits, .kbd-badge {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

/* 3D Canvas Background Layer */
#canvas-3d-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -10;
  pointer-events: none;
  opacity: 0.85;
}

/* Glassmorphism 3D Panel Core */
.glass-panel {
  background: var(--bg-glass-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: var(--glass-shine);
  pointer-events: none;
  opacity: 0.25;
}

.glass-panel:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg);
}

/* ==============================================================================
   UNIFIED FORM CONTROLS & SELECTION (LIQUIDGLASS HARMONY)
   ============================================================================== */
.form-control, .form-select {
  background: var(--bg-input) !important;
  color: var(--text-pure) !important;
  font-family: var(--font-primary) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 12px 16px !important;
  font-size: 14px !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: var(--transition-fast) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-glow) !important;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.35), inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  outline: none !important;
  background: rgba(18, 28, 52, 0.85) !important;
}

.form-control::placeholder {
  color: var(--text-muted) !important;
  opacity: 0.8;
}

.form-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2300f2fe' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  background-size: 14px 10px !important;
  padding-right: 44px !important;
  cursor: pointer !important;
  color-scheme: dark !important;
}

.form-select option {
  background-color: #080d1a !important;
  color: #ffffff !important;
  padding: 14px 18px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

.form-select option:hover,
.form-select option:checked {
  background-color: #122244 !important;
  color: #00f2fe !important;
}

/* Role Selector Interactive Cards */
.role-select-card {
  background: var(--bg-input);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-bounce);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.role-select-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 242, 254, 0.4);
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}

.role-select-card.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.18) 0%, rgba(127, 0, 255, 0.1) 100%) !important;
  border: 2px solid var(--primary-glow) !important;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4) !important;
  transform: scale(1.02);
}

.role-select-card.active::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 11px;
  font-weight: 900;
  color: #030812;
  background: var(--primary-glow);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px var(--primary-glow);
}

.input-group {
  display: flex !important;
  align-items: stretch !important;
  gap: 8px !important;
}

.input-group-text {
  background: var(--bg-input) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--primary-glow) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 12px 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  transition: var(--transition-fast) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.input-group:focus-within .input-group-text {
  border-color: var(--primary-glow) !important;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.35), inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  color: #fff !important;
}

.input-group .form-control {
  border-radius: var(--radius-sm) !important;
}

/* Range Slider */
.form-range::-webkit-slider-thumb {
  background: var(--primary-glow);
  box-shadow: 0 0 12px var(--primary-glow);
}

.form-check-input {
  background-color: var(--bg-input);
  border-color: var(--glass-border);
}

.form-check-input:checked {
  background-color: var(--primary-accent);
  border-color: var(--primary-glow);
  box-shadow: 0 0 10px var(--primary-glow);
}

/* ==============================================================================
   UNIFIED HIGH-CONTRAST GLASS TABLE STYLES (ANTI-WHITE-GLARE & CRISP TEXT)
   ============================================================================== */
:root, [data-theme="dark"], body {
  --bs-table-bg: transparent !important;
  --bs-table-accent-bg: transparent !important;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02) !important;
  --bs-table-striped-color: #f1f5f9 !important;
  --bs-table-active-bg: rgba(0, 242, 254, 0.08) !important;
  --bs-table-active-color: #ffffff !important;
  --bs-table-hover-bg: rgba(0, 242, 254, 0.06) !important;
  --bs-table-hover-color: #ffffff !important;
  --bs-table-color: #f1f5f9 !important;
  --bs-table-border-color: rgba(255, 255, 255, 0.08) !important;
}

.table, table, .data-table {
  --bs-table-bg: transparent !important;
  --bs-table-accent-bg: transparent !important;
  --bs-table-color: #f1f5f9 !important;
  color: #f1f5f9 !important;
  background: transparent !important;
  border-collapse: separate !important;
  border-spacing: 0 8px !important;
  margin-bottom: 0 !important;
}

.table > :not(caption) > * > *,
.data-table > :not(caption) > * > *,
table > :not(caption) > * > * {
  background-color: transparent !important;
  color: inherit !important;
  box-shadow: none !important;
}

.table thead th,
.data-table thead th,
.table-dark thead th,
table thead th {
  font-family: var(--font-heading) !important;
  background: rgba(15, 23, 42, 0.85) !important;
  color: #00F2FE !important; /* Radiant Cyan Header Text */
  font-weight: 700 !important;
  font-size: 0.82rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  border: none !important;
  border-top: 1px solid rgba(0, 242, 254, 0.2) !important;
  border-bottom: 1px solid rgba(0, 242, 254, 0.2) !important;
  padding: 14px 18px !important;
  vertical-align: middle !important;
}

.table thead th:first-child,
.data-table thead th:first-child {
  border-left: 1px solid rgba(0, 242, 254, 0.2) !important;
  border-top-left-radius: 12px !important;
  border-bottom-left-radius: 12px !important;
}

.table thead th:last-child,
.data-table thead th:last-child {
  border-right: 1px solid rgba(0, 242, 254, 0.2) !important;
  border-top-right-radius: 12px !important;
  border-bottom-right-radius: 12px !important;
}

.table tbody tr,
.data-table tbody tr {
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: var(--glass-blur) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border-radius: 12px !important;
}

.table tbody tr:hover,
.data-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.9) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 242, 254, 0.2) !important;
}

.table tbody td,
.data-table tbody td {
  padding: 16px 18px !important;
  border: none !important;
  border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  vertical-align: middle !important;
  background: transparent !important;
  color: #f1f5f9 !important;
}

.table tbody td:first-child,
.data-table tbody td:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-top-left-radius: 12px !important;
  border-bottom-left-radius: 12px !important;
}

.table tbody td:last-child,
.data-table tbody td:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-top-right-radius: 12px !important;
  border-bottom-right-radius: 12px !important;
}

/* Đảm bảo các text con, badge, code trong bảng luôn tương phản cao */
.table td strong, .table td b, .table td .fw-bold {
  color: #ffffff !important;
}

.table td .text-muted, .table td .text-sub, .table td small {
  color: #94a3b8 !important; /* Rõ nét Slate-400 */
}

.table td code {
  color: #00F2FE !important;
  background: rgba(0, 242, 254, 0.1) !important;
  border: 1px solid rgba(0, 242, 254, 0.25) !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
}

/* ==============================================================================
   FUTURISTIC LIQUID GLASS BUTTONS
   ============================================================================== */
.btn-liquid {
  font-family: var(--font-heading);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.2) 0%, rgba(0, 242, 254, 0.05) 100%);
  color: #fff !important;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: var(--glass-blur);
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.btn-liquid::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.35) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.btn-liquid:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--primary-glow);
  box-shadow: var(--shadow-neon-cyan);
}

.btn-liquid:hover::after {
  opacity: 1;
}

.btn-liquid:active {
  transform: translateY(0) scale(0.98);
}

.btn-liquid-primary {
  background: linear-gradient(135deg, var(--primary-accent) 0%, var(--primary-glow) 100%);
  color: #030812 !important;
  font-weight: 800;
  border: none;
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.35);
}

.btn-liquid-primary:hover {
  color: #030812 !important;
  box-shadow: 0 6px 28px rgba(0, 242, 254, 0.65);
}

.btn-liquid-danger {
  background: linear-gradient(135deg, var(--secondary-glow) 0%, #d63031 100%);
  color: #fff !important;
  border: none;
  box-shadow: 0 4px 20px rgba(255, 8, 68, 0.35);
}

.btn-liquid-danger:hover {
  box-shadow: var(--shadow-neon-red);
}

.btn-liquid-success {
  background: linear-gradient(135deg, var(--accent-emerald) 0%, #00b894 100%);
  color: #030812 !important;
  border: none;
  font-weight: 800;
  box-shadow: 0 4px 20px rgba(0, 245, 160, 0.35);
}

.btn-liquid-success:hover {
  box-shadow: var(--shadow-neon-green);
}

/* Secondary & Outline Buttons */
.btn-outline-info, .btn-outline-secondary, .btn-outline-primary, .btn-outline-danger {
  font-family: var(--font-heading) !important;
  border-radius: var(--radius-pill) !important;
  backdrop-filter: var(--glass-blur);
  transition: var(--transition-fast) !important;
  padding: 8px 18px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
}

.btn-outline-info {
  border-color: rgba(0, 242, 254, 0.4) !important;
  color: var(--primary-glow) !important;
}

.btn-outline-info:hover {
  background: rgba(0, 242, 254, 0.2) !important;
  border-color: var(--primary-glow) !important;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.4) !important;
  color: #fff !important;
}

.btn-outline-secondary {
  border-color: var(--glass-border) !important;
  color: var(--text-sub) !important;
}

.btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #fff !important;
}

/* ==============================================================================
   GLOWING LIQUID BADGES & PILLS
   ============================================================================== */
.badge {
  font-family: var(--font-heading);
  padding: 6px 12px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  letter-spacing: 0.3px;
}

.badge-liquid-cyan {
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: var(--primary-glow);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}

.badge-liquid-emerald {
  background: rgba(0, 245, 160, 0.15);
  border: 1px solid rgba(0, 245, 160, 0.4);
  color: var(--accent-emerald);
  box-shadow: 0 0 12px rgba(0, 245, 160, 0.2);
}

.badge-liquid-purple {
  background: rgba(127, 0, 255, 0.15);
  border: 1px solid rgba(127, 0, 255, 0.4);
  color: #d1a4ff;
  box-shadow: 0 0 12px rgba(127, 0, 255, 0.2);
}

.badge-liquid-amber {
  background: rgba(255, 179, 0, 0.15);
  border: 1px solid rgba(255, 179, 0, 0.4);
  color: var(--accent-amber);
  box-shadow: 0 0 12px rgba(255, 179, 0, 0.2);
}

.badge-liquid-danger {
  background: rgba(255, 8, 68, 0.15);
  border: 1px solid rgba(255, 8, 68, 0.4);
  color: #ff6b81;
  box-shadow: 0 0 12px rgba(255, 8, 68, 0.2);
}

/* Modals & Stacking Fix */
.modal-backdrop {
  z-index: 1050 !important;
  background-color: rgba(3, 6, 12, 0.78) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

.modal {
  z-index: 1055 !important;
  position: fixed !important;
}

.modal-dialog {
  z-index: 1060 !important;
  position: relative !important;
}

.modal-content {
  background: rgba(10, 16, 30, 0.95) !important;
  backdrop-filter: var(--glass-blur-heavy) !important;
  -webkit-backdrop-filter: var(--glass-blur-heavy) !important;
  border: 1px solid var(--glass-border-hover) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(0, 242, 254, 0.25) !important;
  position: relative !important;
  z-index: 1065 !important;
  pointer-events: auto !important;
}

.modal-header, .modal-footer {
  border-color: var(--glass-border) !important;
  padding: 20px 24px !important;
}

.modal-body {
  padding: 24px !important;
}

/* Neon Text Gradients */
.gradient-text-glow {
  font-family: var(--font-heading);
  background: linear-gradient(135deg, var(--primary-glow) 0%, var(--accent-magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  filter: drop-shadow(0 0 15px rgba(0, 242, 254, 0.4));
}

.gradient-text-gold {
  font-family: var(--font-heading);
  background: linear-gradient(135deg, #ffe259 0%, #ffa751 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Custom Futuristic Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: rgba(79, 172, 254, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-glow);
}

/* Universal 1:1 Perfectly Circular Avatars */
.avatar,
.avatar-img,
.user-avatar,
.chat-avatar-img,
.author-avatar,
.student-avatar,
.table-avatar,
img[src*="avatar"],
img.rounded-circle {
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
}

/* Responsive Fluid Typography & Layout Utilities */
h1, .h1 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h2, .h2 { font-size: clamp(1.35rem, 2.8vw, 2rem); }
h3, .h3 { font-size: clamp(1.15rem, 2.2vw, 1.6rem); }
h4, .h4 { font-size: clamp(1.05rem, 1.8vw, 1.35rem); }
h5, .h5 { font-size: clamp(0.95rem, 1.5vw, 1.15rem); }

@media (max-width: 767.98px) {
  .display-1 { font-size: 2.5rem !important; }
  .display-2 { font-size: 2.2rem !important; }
  .display-3 { font-size: 1.9rem !important; }
  .display-4 { font-size: 1.65rem !important; }
  .display-5 { font-size: 1.45rem !important; }
  .display-6 { font-size: 1.3rem !important; }
}

/* Touch Friendly Tap Targets */
button, .btn, a.btn, select, .form-control {
  touch-action: manipulation;
}

/* Responsive Table Wrapper */
.table-responsive {
  border-radius: var(--radius-sm);
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
  height: 5px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.3);
  border-radius: 3px;
}

/* ==============================================================================
   UNIVERSAL FLUID GRIDS & FLEX ENGINE (CO DÃN TỰ ĐỘNG KHÔNG BÓ HẸP)
   ============================================================================== */
.fluid-metrics-grid,
.row-metrics {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)) !important;
  gap: var(--fluid-gap) !important;
}

.fluid-cards-grid,
.row-cards {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)) !important;
  gap: var(--fluid-gap) !important;
}

.fluid-badges-grid,
.row-badges {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)) !important;
  gap: var(--fluid-gap) !important;
}

/* ==============================================================================
   TIER 1: COMPACT DESKTOPS & TABLETS (VIEWPORT <= 1199.98px — RESOLVES 1037px)
   ============================================================================== */
@media (max-width: 1199.98px) {
  :root {
    --navbar-h: 68px;
    --fluid-pad: 20px;
    --fluid-gap: 16px;
  }

  .app-navbar {
    padding: 0 16px !important;
  }

  .brand-logo img {
    height: 30px !important;
    max-width: 150px !important;
  }

  /* Typography adjustments for 1000px - 1199px */
  h1, .display-4, .display-5 {
    font-size: clamp(28px, 4vw, 38px) !important;
    line-height: 1.25 !important;
  }

  h2, .display-6 {
    font-size: clamp(22px, 3.2vw, 28px) !important;
  }

  /* Omnibar trigger on compact desktop */
  .omnibar-trigger-btn {
    min-width: 180px !important;
    max-width: 280px !important;
  }

  /* Public nav links compact sizing */
  .nav-public-link {
    font-size: 13px !important;
    padding: 5px 10px !important;
    gap: 5px !important;
  }

  .glass-panel.p-5 {
    padding: 32px 24px !important;
  }
}

/* ==============================================================================
   TIER 2: TABLETS & IPADS (VIEWPORT <= 999.98px)
   ============================================================================== */
@media (max-width: 999.98px) {
  :root {
    --navbar-h: 66px;
    --fluid-pad: 16px;
    --fluid-gap: 14px;
    --glass-blur: blur(14px);
  }

  /* 1. App Layout & Spacing */
  .app-main-layout {
    padding: 16px 12px !important;
    width: 100% !important;
    overflow-x: hidden !important;
  }

  .container, .container-fluid {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* 2. Glass Panels & Cards */
  .glass-panel {
    padding: 20px 16px !important;
    border-radius: 16px !important;
    margin-bottom: 18px !important;
  }

  .glass-panel.p-5 {
    padding: 24px 18px !important;
  }

  .glass-panel.p-4 {
    padding: 18px 14px !important;
  }

  /* 3. Typography Scaling */
  h1, .display-4, .display-5 {
    font-size: clamp(24px, 5.5vw, 34px) !important;
    line-height: 1.25 !important;
    letter-spacing: -0.02em !important;
  }

  h2, .display-6 {
    font-size: clamp(20px, 4.5vw, 26px) !important;
    line-height: 1.3 !important;
  }

  h3 {
    font-size: clamp(18px, 4vw, 22px) !important;
  }

  h4 {
    font-size: clamp(16px, 3.5vw, 19px) !important;
  }

  h5 {
    font-size: clamp(14.5px, 3vw, 17px) !important;
  }

  p.lead {
    font-size: 15px !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
  }

  /* 4. Navbar & Navigation */
  .app-navbar {
    height: var(--navbar-h) !important;
    padding: 0 12px !important;
  }

  .brand-logo img {
    height: 28px !important;
    max-width: 130px !important;
  }

  /* 5. Buttons & Action Links */
  .btn-liquid, .btn-liquid-primary, .btn-liquid-cyan {
    padding: 8px 16px !important;
    font-size: 13.5px !important;
  }

  /* 6. Disable 3D tilt jitters on touch/tablets */
  .tilt-card-3d {
    transform: none !important;
    perspective: none !important;
  }

  /* 7. Maps & Media Embeds */
  .ratio-21x9, .ratio-16x9 {
    --bs-aspect-ratio: 56.25% !important; /* Force 16:9 on tablets so maps don't collapse */
    min-height: 280px !important;
  }

  /* 8. Table Responsiveness */
  .table-responsive {
    -webkit-overflow-scrolling: touch !important;
    border-radius: 12px !important;
  }

  /* 9. Flex & Header Toolbar Wrapping */
  .header-actions {
    gap: 6px !important;
  }
}

@media (max-width: 767.98px) {
  .app-main-layout .row > [class*="col-sm-6"],
  .app-main-layout .row > [class*="col-md-6"],
  .app-main-layout .row > [class*="col-lg-6"] {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* Universal Header & Toolbar Fluid Wrapping Engine */
.glass-panel .d-flex.justify-content-between,
.glass-panel .d-flex.align-items-center.justify-content-between,
.page-header-actions,
.filter-toolbar {
  flex-wrap: wrap !important;
  gap: 12px !important;
}

.glass-panel .d-flex.gap-2,
.glass-panel .d-flex.gap-3 {
  flex-wrap: wrap !important;
}

.glass-panel .form-select,
.glass-panel input.form-control {
  max-width: 100% !important;
}

/* ==============================================================================
   FUTURISTIC LIQUID GLASS TOAST & CYBER HUD NOTIFICATION SYSTEM
   ============================================================================== */
.toast-container-v2 {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100vw - 48px);
}

@media (max-width: 767.98px) {
  .toast-container-v2 {
    top: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: 100%;
  }
}

.toast-v2 {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(14, 20, 40, 0.92) 0%, rgba(8, 12, 28, 0.96) 100%);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 20px rgba(0, 242, 254, 0.15);
  animation: toast-spring-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-v2.toast-success {
  border-color: rgba(0, 242, 254, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 25px rgba(0, 242, 254, 0.25);
}

.toast-v2.toast-danger {
  border-color: rgba(255, 59, 48, 0.5);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 59, 48, 0.35);
}

.toast-v2.toast-warning {
  border-color: rgba(255, 179, 0, 0.5);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 25px rgba(255, 179, 0, 0.3);
}

.toast-v2.toast-info {
  border-color: rgba(79, 172, 254, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 25px rgba(79, 172, 254, 0.25);
}

.toast-deplete-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #00f2fe, #4facfe);
  border-radius: 3px;
  width: 100%;
  animation: toast-deplete var(--toast-duration, 3500ms) linear forwards;
}

.toast-v2.toast-danger .toast-deplete-bar {
  background: linear-gradient(90deg, #ff3b30, #ff7675);
}
.toast-v2.toast-warning .toast-deplete-bar {
  background: linear-gradient(90deg, #ffb300, #ffeaa7);
}
.toast-v2.toast-success .toast-deplete-bar {
  background: linear-gradient(90deg, #00b894, #55efc4);
}

@keyframes toast-spring-in {
  0% {
    opacity: 0;
    transform: translateY(-24px) scale(0.88);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-deplete {
  from { width: 100%; }
  to { width: 0%; }
}

/* ==============================================================================
   HOLOGRAPHIC EXAM VIOLATION HUD & SCREEN PULSE
   ============================================================================== */
.hud-violation-overlay {
  position: fixed;
  inset: 0;
  z-index: 10500;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 35px;
  animation: screen-vignette-pulse 0.8s ease-in-out infinite alternate;
}

.hud-violation-card {
  pointer-events: auto;
  background: linear-gradient(135deg, rgba(28, 8, 12, 0.95) 0%, rgba(14, 5, 8, 0.98) 100%);
  backdrop-filter: blur(35px) saturate(200%);
  -webkit-backdrop-filter: blur(35px) saturate(200%);
  border: 1.5px solid rgba(255, 59, 48, 0.8);
  border-radius: 24px;
  padding: 18px 26px;
  box-shadow: 0 0 50px rgba(255, 59, 48, 0.5), 0 25px 60px rgba(0,0,0,0.85);
  max-width: 520px;
  width: 92%;
  animation: hud-bounce-down 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.violation-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 59, 48, 0.4);
  transition: all 0.3s ease;
}

.violation-dot.active {
  background: #ff3b30;
  box-shadow: 0 0 15px #ff3b30, 0 0 30px #ff3b30;
  border-color: #fff;
  transform: scale(1.2);
}

@keyframes screen-vignette-pulse {
  0% {
    box-shadow: inset 0 0 40px rgba(255, 59, 48, 0.25);
  }
  100% {
    box-shadow: inset 0 0 100px rgba(255, 59, 48, 0.65);
  }
}

@keyframes hud-bounce-down {
  0% {
    opacity: 0;
    transform: translateY(-50px) scale(0.85);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==============================================================================
   DYNAMIC ISLAND UPLOAD PROGRESS HUD
   ============================================================================== */
.hud-upload-island {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10200;
  background: linear-gradient(135deg, rgba(10, 15, 30, 0.95) 0%, rgba(5, 8, 18, 0.98) 100%);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1.5px solid rgba(0, 242, 254, 0.5);
  border-radius: 30px;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 242, 254, 0.35);
  animation: hud-bounce-down 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  min-width: 300px;
  max-width: 480px;
}

/* ==============================================================================
   HIGH CONTRAST & ACCESSIBILITY TYPOGRAPHY ENGINE (CHỐNG CHÌM CHỮ TỐI ĐA)
   ============================================================================== */
.text-muted {
  color: #94a3b8 !important; /* Crisp Slate-400 thay thế xám tối của Bootstrap */
}

.text-secondary {
  color: #94a3b8 !important;
}

.text-sub {
  color: #cbd5e1 !important; /* Rõ nét Slate-300 */
}

.text-dim {
  color: #94a3b8 !important;
}

small, .small {
  color: #cbd5e1;
}

/* Table Header & Cell Contrast */
.table thead th,
.table-dark thead th,
table th {
  color: #00F2FE !important;
  font-weight: 700 !important;
  letter-spacing: 0.8px;
  background: rgba(15, 23, 42, 0.85) !important;
}

.table tbody td,
.table-dark tbody td,
table td {
  color: #f8fafc !important;
  background: transparent !important;
}

/* Form Input & Placeholder Contrast */
::placeholder,
.form-control::placeholder,
textarea::placeholder {
  color: #94a3b8 !important;
  opacity: 0.9 !important;
}

input:disabled,
textarea:disabled,
select:disabled {
  color: #cbd5e1 !important;
  background: rgba(15, 23, 42, 0.7) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  opacity: 1 !important;
}

/* High Contrast Alert Boxes */
.alert-info {
  color: #e0f2fe !important;
  background: rgba(0, 242, 254, 0.1) !important;
  border: 1px solid rgba(0, 242, 254, 0.4) !important;
}

.alert-warning {
  color: #fef3c7 !important;
  background: rgba(255, 179, 0, 0.12) !important;
  border: 1px solid rgba(255, 179, 0, 0.45) !important;
}

.alert-danger {
  color: #ffe4e6 !important;
  background: rgba(255, 59, 48, 0.12) !important;
  border: 1px solid rgba(255, 59, 48, 0.45) !important;
}

.alert-success {
  color: #dcfce7 !important;
  background: rgba(0, 245, 160, 0.12) !important;
  border: 1px solid rgba(0, 245, 160, 0.45) !important;
}

/* Badges Readability */
.badge.bg-warning {
  color: #0b0f19 !important; /* Đen đậm trên nền vàng hổ phách */
  font-weight: 800 !important;
}

.badge.bg-secondary {
  color: #f8fafc !important;
  background-color: #334155 !important; /* Slate-700 nền rõ chữ trắng */
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.badge.bg-dark {
  color: #e2e8f0 !important;
  background-color: rgba(10, 15, 30, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* ==============================================================================
   LIVE NETWORK SIGNAL GLOW (XANH - VÀNG - ĐỎ CHỐNG LAG)
   ============================================================================== */
.net-icon-pulse {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.net-icon-pulse.text-success {
  filter: drop-shadow(0 0 8px rgba(0, 245, 160, 0.7)) !important;
}
.net-icon-pulse.text-warning {
  filter: drop-shadow(0 0 8px rgba(255, 179, 0, 0.7)) !important;
}
.net-icon-pulse.text-danger {
  filter: drop-shadow(0 0 10px rgba(255, 59, 48, 0.85)) !important;
  animation: net-danger-blink 1s ease-in-out infinite alternate;
}

@keyframes net-danger-blink {
  0% { opacity: 0.5; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* ==============================================================================
   DRM ANTI-SCREENSHOT & ANTI-RECORDING PROTECTION STYLES
   ============================================================================== */
.watermark-overlay-secure {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 99999;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(6, 1fr);
  opacity: 0.12;
  user-select: none;
  overflow: hidden;
}

.watermark-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #dc3545;
  transform: rotate(-30deg);
  white-space: nowrap;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Khi người dùng chuyển tab / mở Snipping Tool chụp lén -> Làm mờ & đen màn hình */
body.drm-protected-blur .app-main-layout,
body.drm-protected-blur #pdfViewerWrapper,
body.drm-protected-blur #examActiveLayout {
  filter: blur(35px) brightness(0.1) !important;
  transition: filter 0.15s ease-out !important;
  pointer-events: none !important;
  user-select: none !important;
}

body.drm-protected-blur::after {
  content: "🔒 NỘI DUNG ĐƯỢC BẢO VỆ BẢN QUYỀN DRM — ĐANG CHẶN GHI HÌNH HOẶC CHỤP ẢNH";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.95);
  color: #00f0ff;
  font-weight: 800;
  font-size: 16px;
  padding: 18px 32px;
  border-radius: 16px;
  border: 2px solid #00f0ff;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.35);
  z-index: 999999;
  pointer-events: none;
  text-align: center;
  letter-spacing: 0.8px;
}


