﻿/* =====================================================
   1. FONT CHỮ
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap');


/* =====================================================
   2. PASTEL LIQUID GLASS THEME - ENHANCED
   ===================================================== */

:root {
  --glass-text: #28366B;
  --glass-muted: #7184B4;
  --glass-border: rgba(255, 255, 255, 0.2);

  --glass-shadow:
    0 8px 32px 0 rgba(91, 104, 175, 0.37),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 4px 0 rgba(91, 104, 175, 0.2);

  --glass-shadow-hover:
    0 12px 40px 0 rgba(91, 104, 175, 0.45),
    inset 0 1px 2px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 4px 0 rgba(91, 104, 175, 0.3);

  --glass-blur: 12px;

  /* Accent colors */
  --accent-primary: #796AFF;
  --accent-secondary: #E982B6;
  --accent-success: #38C995;
  --accent-warning: #F4B740;

  /* Border radius */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 50px;

  /* Transitions */
  --transition-fast: 150ms;
  --transition-normal: 200ms;
  --transition-slow: 300ms;
  --transition-liquid: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}


/* =====================================================
   3. BASE STYLES
   ===================================================== */

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px 24px 48px;

  background:
    radial-gradient(ellipse at 15% 10%,
      #E8E2FF 0%, transparent 38%),
    radial-gradient(ellipse at 90% 25%,
      #DDF3FF 0%, transparent 35%),
    radial-gradient(ellipse at 60% 90%,
      #FFE5EF 0%, transparent 35%),
    #FFF9F0;

  color: var(--glass-text);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Staggered Animation */
.staggered-animate {
  opacity: 0;
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.staggered-animate:nth-child(1) { animation-delay: 0ms; }
.staggered-animate:nth-child(2) { animation-delay: 50ms; }
.staggered-animate:nth-child(3) { animation-delay: 100ms; }
.staggered-animate:nth-child(4) { animation-delay: 150ms; }
.staggered-animate:nth-child(5) { animation-delay: 200ms; }
.staggered-animate:nth-child(6) { animation-delay: 250ms; }
.staggered-animate:nth-child(7) { animation-delay: 300ms; }
.staggered-animate:nth-child(8) { animation-delay: 350ms; }
.staggered-animate:nth-child(9) { animation-delay: 400ms; }
.staggered-animate:nth-child(10) { animation-delay: 450ms; }

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--glass-text);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  line-height: 1.3;
}

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page.active .clay-card,
.page.active .glass-panel {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.page .clay-card.slide-out-left,
.page .glass-panel.slide-out-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.page .clay-card.slide-out-right,
.page .glass-panel.slide-out-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.page .clay-card.slide-in-left,
.page .glass-panel.slide-in-left {
  opacity: 0;
  transform: translateX(50px);
}

.page .clay-card.slide-in-right,
.page .glass-panel.slide-in-right {
  opacity: 0;
  transform: translateX(-50px);
}

.page.active .container > * {
  opacity: 0;
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.page.active .container > *:nth-child(1) { animation-delay: 0ms !important; }
.page.active .container > *:nth-child(2) { animation-delay: 50ms !important; }
.page.active .container > *:nth-child(3) { animation-delay: 100ms !important; }
.page.active .container > *:nth-child(4) { animation-delay: 150ms !important; }
.page.active .container > *:nth-child(5) { animation-delay: 200ms !important; }
.page.active .container > *:nth-child(6) { animation-delay: 250ms !important; }
.page.active .container > *:nth-child(7) { animation-delay: 300ms !important; }
.page.active .container > *:nth-child(8) { animation-delay: 350ms !important; }
.page.active .container > *:nth-child(9) { animation-delay: 400ms !important; }
.page.active .container > *:nth-child(10) { animation-delay: 450ms !important; }

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}


/* =====================================================
   4. HEADER
   ===================================================== */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;

  max-width: 1200px;
  margin: 0 auto 34px;
}

.header-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
}

.page-title {
  margin: 0;
  font-size: clamp(23px, 3vw, 32px);
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--glass-text);
}


/* =====================================================
   5. GLASS PANEL / CARD - ENHANCED LIQUID GLASS
   ===================================================== */

.clay-card,
.glass-panel,
.glass-card,
.glass-modal {
  position: relative;
  overflow: hidden;

  max-width: 1200px;
  margin: 0 auto 26px;
  padding: 28px 30px;

  border-radius: var(--radius-xl);

  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  border: 1px solid var(--glass-border);

  box-shadow: var(--glass-shadow);

  transition: all var(--transition-liquid);
}

/* Hiệu ứng lớp sáng bóng lướt qua */
.clay-card::before,
.glass-panel::before,
.glass-card::before,
.glass-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
  pointer-events: none;
}

.clay-card:hover,
.glass-panel:hover,
.glass-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

.clay-card:hover::before,
.glass-panel:hover::before,
.glass-card:hover::before {
  left: 100%;
}

.clay-card h2 {
  margin: 0 0 20px;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.3px;
  color: var(--glass-text);
  position: relative;
  z-index: 1;
}

/* Card phân biệt bằng màu nhẹ */
.clay-card.lavender,
.glass-card--lavender {
  background: linear-gradient(
    135deg,
    rgba(232, 235, 255, 0.15),
    rgba(220, 217, 255, 0.08)
  );
}

.clay-card.blue,
.glass-card--blue {
  background: linear-gradient(
    135deg,
    rgba(237, 247, 255, 0.15),
    rgba(190, 222, 255, 0.08)
  );
}

.clay-card.green,
.glass-card--green {
  background: linear-gradient(
    135deg,
    rgba(221, 248, 236, 0.15),
    rgba(167, 235, 203, 0.08)
  );
}

.clay-card.yellow,
.glass-card--yellow {
  background: linear-gradient(
    135deg,
    rgba(255, 249, 226, 0.15),
    rgba(255, 228, 176, 0.08)
  );
}

.clay-card.pink,
.glass-card--pink {
  background: linear-gradient(
    135deg,
    rgba(255, 240, 248, 0.15),
    rgba(247, 211, 255, 0.08)
  );
}


/* =====================================================
   6. INPUT AND TEXTAREA - LIQUID GLASS
   ===================================================== */

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 8px;

  color: var(--glass-text);
  font-size: 1.1rem;
  font-weight: 800;
  text-align: left;
}

.clay-input,
.clay-select,
.clay-textarea {
  position: relative;
  color: var(--glass-text);
  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  outline: none;

  width: 100%;
  padding: 14px 20px;
  min-height: 58px;

  font-family: 'Nunito', sans-serif;
  font-size: 1rem;

  transition: all var(--transition-liquid);
}

.clay-input::placeholder,
.clay-textarea::placeholder {
  color: var(--glass-muted);
  opacity: 1;
}

.clay-input:hover,
.clay-textarea:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-hover);
}

.clay-input:focus,
.clay-textarea:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-primary);
  box-shadow:
    0 0 0 4px rgba(121, 106, 255, 0.2),
    var(--glass-shadow-hover);
}

.clay-textarea {
  min-height: 120px;
  resize: vertical;
  font-size: 1.1rem;
}

.toggle-password-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 5px;
  z-index: 10;
}

/* Fix: password dài không đè lên icon mắt */
#password {
    padding-right: 48px !important;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =====================================================
   7. STUDENT SELECT BUTTONS - LIQUID GLASS
   ===================================================== */

.student-select-btn {
  position: relative;
  overflow: hidden;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-height: 48px;
  padding: 12px 24px;

  color: var(--glass-text);
  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  font-weight: 900;
  cursor: pointer;

  transition: all var(--transition-liquid);

  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
}

.student-select-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
  pointer-events: none;
}

.student-select-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

.student-select-btn:hover::before {
  left: 100%;
}

.student-select-btn.selected {
  background: linear-gradient(135deg, #62DCC2, #50BEEB);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 3px rgba(98, 220, 194, 0.2),
    var(--glass-shadow-hover);
}

.student-select-btn.selected span {
  position: relative;
  z-index: 1;
}

.student-select-btn:nth-child(even) {
  background: rgba(255, 255, 255, 0.05);
}

.student-select-btn:nth-child(even).selected {
  background: linear-gradient(135deg, #62DCC2, #50BEEB);
  color: #FFFFFF;
}


/* =====================================================
   8. BUTTONS - ENHANCED LIQUID GLASS
   ===================================================== */

.clay-button {
  position: relative;
  overflow: hidden;

  color: var(--glass-text);

  background: rgba(255, 255, 255, 0.02);

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  transition: all var(--transition-liquid);

  padding: 16px 36px;
  min-height: 46px;

  font-weight: 800;
  line-height: 1.35;
  text-align: center;

  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
}

/* Hiệu ứng lớp sáng bóng lướt qua */
.clay-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
  pointer-events: none;
}

.clay-button span {
  position: relative;
  z-index: 1;
}

.clay-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

.clay-button:hover::before {
  left: 100%;
}

.clay-button:active {
  transform: translateY(1px);
  box-shadow:
    0 4px 16px 0 rgba(91, 104, 175, 0.4),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
}

.clay-button:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 3px;
}

.clay-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.clay-button.primary {
  color: #FFFFFF;
  background: linear-gradient(135deg, rgba(98, 220, 194, 0.7), rgba(80, 190, 235, 0.7));
  border-color: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.clay-button.secondary {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}


/* =====================================================
   9. ACTION BUTTONS
   ===================================================== */

.action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;

  margin-top: 30px;
}


/* =====================================================
   10. ASSIGNMENT/STUDENT ITEMS - LIQUID GLASS
   ===================================================== */

.assignment-item,
.student-item {
  position: relative;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;

  width: 100%;
  max-width: 1200px;
  min-height: 100px;

  margin: 0 auto 22px;
  padding: 22px 28px;

  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  transition: all var(--transition-liquid);
}

.assignment-item::before,
.student-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
  pointer-events: none;
}

.assignment-item:hover,
.student-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-3px);
}

.assignment-item:hover::before,
.student-item:hover::before {
  left: 100%;
}

.assignment-info,
.student-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.assignment-info h3,
.student-info h3 {
  margin: 0 0 8px;

  color: var(--glass-text);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.4;
}

.assignment-info p,
.student-info p {
  margin: 0;

  color: var(--glass-muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.assignment-actions,
.student-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.assignment-actions .clay-button,
.student-actions .clay-button {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  min-width: 80px;
}

/* Mobile responsive for assignment items */
@media (max-width: 768px) {
  .assignment-item,
  .student-item {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .assignment-info,
  .student-info {
    width: 100%;
    min-width: 0;
  }

  .assignment-actions,
  .student-actions {
    width: 100%;
    justify-content: flex-start;
    margin-top: 1rem;
  }

  .assignment-actions .clay-button,
  .student-actions .clay-button {
    flex: 1;
    min-width: 100px;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }
}


/* =====================================================
   11. LOGIN CARD
   ===================================================== */

.login-card {
  max-width: 440px;
  width: 100%;
  margin: 2rem auto;
  padding: 0;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255,255,255,.98), rgba(255,255,255,.88));
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: 0 25px 55px rgba(74,70,120,.12), 0 8px 20px rgba(90,100,150,.08), inset 0 1px 1px rgba(255,255,255,.85);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  overflow: hidden;
}

.login-card .uf-body {
  gap: 14px;
  padding: 18px 22px 8px;
}

.login-card .login-actions {
  display: flex;
  justify-content: center;
  padding: 0 22px 10px;
}

.login-card .login-submit-btn {
  width: 100%;
  max-width: 320px;
  height: 46px;
}

.login-card .error-message {
  margin-top: 0;
}

@media (max-width: 480px) {
  .login-card { margin: 1rem auto; border-radius: 20px; }
}

.error-message {
  color: var(--accent-secondary);
  font-weight: 600;
  min-height: 1.5rem;
  text-align: center;
  margin-top: 1rem;
}


/* =====================================================
   12. PROGRESS BAR - LIQUID GLASS
   ===================================================== */


/* =====================================================
   13. QUESTION CARD - LIQUID GLASS
   ===================================================== */

.question-card {
  position: relative;
  overflow: hidden;

  max-width: 1200px;
  margin: 0 auto 26px;
  padding: 28px 30px;

  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  transition: all var(--transition-liquid);
}

.question-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
  pointer-events: none;
}

.question-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

.question-card:hover::before {
  left: 100%;
}

.question-number {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--glass-muted);
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.question-header .question-number {
  margin-bottom: 0;
}

.question-text {
  font-size: 1.3rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  color: var(--glass-text);
  position: relative;
  z-index: 1;
}

/* Scroll to part button */
.scroll-to-part-container {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
}

.scroll-to-part-btn {
  position: relative;
  overflow: hidden;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  padding: 0.4rem 1rem;
  min-height: 32px;

  color: var(--glass-text);
  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;

  transition: all var(--transition-liquid);

  font-family: 'Nunito', sans-serif;
}

.scroll-to-part-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
  pointer-events: none;
}

.scroll-to-part-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

.scroll-to-part-btn:hover::before {
  left: 100%;
}

.scroll-to-part-btn:active {
  transform: translateY(1px);
}

@media (max-width: 768px) {
  .scroll-to-part-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    min-height: 36px;
  }
}


/* =====================================================
   14. MULTIPLE CHOICE - LIQUID GLASS
   ===================================================== */

.multiple-choice-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.option-card {
  position: relative;
  overflow: hidden;

  color: var(--glass-text);
  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition-liquid);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.option-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
  pointer-events: none;
}

.option-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

.option-card:hover::before {
  left: 100%;
}

.option-card.selected {
  background: linear-gradient(135deg, #62DCC2, #50BEEB);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 3px rgba(98, 220, 194, 0.2),
    var(--glass-shadow-hover);
}

.option-card.selected span {
  position: relative;
  z-index: 1;
}

.option-letter {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--glass-border);
  border-radius: 50%;

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}


/* =====================================================
   15. FILL IN THE BLANK
   ===================================================== */

.blank-input {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0.3rem;
  color: var(--glass-text);
  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  font-family: 'Nunito', sans-serif;
  font-size: 1.1rem;
  width: 130px;
  min-width: 90px;
  max-width: 200px;
  height: 45px;

  transition: all var(--transition-liquid);
}

.blank-input:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-hover);
}

.blank-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-primary);
  box-shadow:
    0 0 0 4px rgba(121, 106, 255, 0.2),
    var(--glass-shadow-hover);
}


/* =====================================================
   16. TRUE FALSE
   ===================================================== */

.true-false-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.tf-option {
  position: relative;
  overflow: hidden;

  flex: 1;
  min-width: 150px;
  padding: 1.25rem;
  color: var(--glass-text);
  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  cursor: pointer;
  transition: all var(--transition-liquid);
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.tf-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
  pointer-events: none;
}

.tf-option:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

.tf-option:hover::before {
  left: 100%;
}

.tf-option.selected {
  background: linear-gradient(135deg, #62DCC2, #50BEEB);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(2px);
  box-shadow:
    0 0 0 3px rgba(98, 220, 194, 0.2),
    var(--glass-shadow-hover);
}

.tf-option.selected span {
  position: relative;
  z-index: 1;
}


/* =====================================================
   17. SHORT ANSWER
   ===================================================== */

.short-answer-input {
  width: 100%;
  padding: 0.875rem 1rem;
  color: var(--glass-text);
  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  font-family: 'Nunito', sans-serif;
  font-size: 1rem;

  transition: all var(--transition-liquid);
}

.short-answer-input:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-hover);
}

.short-answer-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-primary);
  box-shadow:
    0 0 0 4px rgba(121, 106, 255, 0.2),
    var(--glass-shadow-hover);
}


/* =====================================================
   18. SENTENCE ORDERING
   ===================================================== */

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  min-height: 80px;
  padding: 1.5rem;
  color: var(--glass-text);
  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.sentence-area {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  min-height: 80px;
  padding: 1.5rem;
  background: linear-gradient(
    135deg,
    rgba(221, 248, 236, 0.15),
    rgba(167, 235, 203, 0.08)
  );

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  margin-bottom: 1.5rem;
}

.word-chip {
  position: relative;
  overflow: hidden;

  padding: 0.75rem 1.25rem;
  color: var(--glass-text);
  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  cursor: pointer;
  transition: all var(--transition-liquid);
  font-weight: 700;
  font-size: 1.1rem;
  display: inline-block;
}

.word-chip::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
  pointer-events: none;
}

.word-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

.word-chip:hover::before {
  left: 100%;
}

.word-chip:active {
  transform: translateY(2px);
}

.reset-btn {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}


/* =====================================================
   19. FIND THE MISTAKE
   ===================================================== */

.mistake-text {
  font-size: 1.1rem;
  line-height: 2;
  padding: 1rem;
}

.mistake-word {
  display: inline;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-liquid);
  border: 2px solid transparent;
}

.mistake-word:hover {
  background: rgba(255, 255, 255, 0.3);
}

.mistake-word.selected {
  background: rgba(255, 234, 242, 0.5);
  color: var(--accent-secondary);
  border-color: var(--accent-secondary);
  box-shadow:
    0 4px 8px rgba(233, 130, 182, 0.3),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
}


/* =====================================================
   20. SUBMIT SECTION
   ===================================================== */

.submit-section {
  text-align: center;
  margin-top: 2rem;
  padding: 2rem;
}


/* =====================================================
   21. GRADING SECTION
   ===================================================== */

.grading-section {
  margin-top: 3rem;
  padding: 2rem;
}


/* =====================================================
   22. PART CARD
   ===================================================== */

.part-card {
  position: relative;
  overflow: hidden;

  max-width: 1200px;
  margin: 0 auto 26px;
  padding: 28px 30px;

  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  transition: all var(--transition-liquid);
}

.part-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
  pointer-events: none;
}

.part-card.expanded {
  padding: 32px;
}

.part-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

.part-card:hover::before {
  left: 100%;
}

.part-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.part-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.part-controls {
  display: flex;
  gap: 0.5rem;
}

.part-content {
  display: none;
  margin-top: 1rem;
  position: relative;
  z-index: 1;
}

.part-card.expanded .part-content {
  display: block;
  animation: fadeIn var(--transition-normal) ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* =====================================================
   23. TYPE SELECTOR
   ===================================================== */

.type-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.type-option {
  position: relative;
  overflow: hidden;

  padding: 1rem;
  color: var(--glass-text);
  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);

  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  cursor: pointer;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: all var(--transition-liquid);
}

.type-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
  pointer-events: none;
}

.type-option:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

.type-option:hover::before {
  left: 100%;
}

.type-option.selected {
  background: linear-gradient(135deg, #62DCC2, #50BEEB);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 3px rgba(98, 220, 194, 0.2),
    var(--glass-shadow-hover);
}

.type-option.selected span {
  position: relative;
  z-index: 1;
}

/* Mỗi dạng câu hỏi một tông màu riêng — gradient, không trắng */
#teacher-dashboard .type-option[data-type="multiple-choice"] { background: linear-gradient(135deg, #dcebff, #b8d7ff); border: 1.5px solid rgba(91, 141, 239, 0.45); color: #2c4a94; }
#teacher-dashboard .type-option[data-type="fill-blank"] { background: linear-gradient(135deg, #ffe9d2, #ffd3ae); border: 1.5px solid rgba(244, 162, 97, 0.5); color: #8a4d0e; }
#teacher-dashboard .type-option[data-type="true-false"] { background: linear-gradient(135deg, #d0f4ee, #b0eae0); border: 1.5px solid rgba(42, 157, 143, 0.45); color: #0b5f58; }
#teacher-dashboard .type-option[data-type="short-answer"] { background: linear-gradient(135deg, #e9dfff, #d5c2ff); border: 1.5px solid rgba(155, 93, 229, 0.5); color: #5b2ea8; }
#teacher-dashboard .type-option[data-type="sentence-ordering"] { background: linear-gradient(135deg, #d2f8e7, #b2f0d6); border: 1.5px solid rgba(6, 214, 160, 0.5); color: #065f46; }
#teacher-dashboard .type-option[data-type="find-mistake"] { background: linear-gradient(135deg, #ffded5, #ffc7b8); border: 1.5px solid rgba(231, 111, 81, 0.5); color: #8f2f1d; }
#teacher-dashboard .type-option.selected[data-type="multiple-choice"] { background: linear-gradient(135deg, #5B8DEF, #3f6fe0); border-color: rgba(255, 255, 255, 0.65); color: #fff; box-shadow: 0 8px 18px rgba(91, 141, 239, 0.4); }
#teacher-dashboard .type-option.selected[data-type="fill-blank"] { background: linear-gradient(135deg, #F4A261, #e07f2e); border-color: rgba(255, 255, 255, 0.65); color: #fff; box-shadow: 0 8px 18px rgba(244, 162, 97, 0.4); }
#teacher-dashboard .type-option.selected[data-type="true-false"] { background: linear-gradient(135deg, #2A9D8F, #1d7a6d); border-color: rgba(255, 255, 255, 0.65); color: #fff; box-shadow: 0 8px 18px rgba(42, 157, 143, 0.4); }
#teacher-dashboard .type-option.selected[data-type="short-answer"] { background: linear-gradient(135deg, #9B5DE5, #7c3fd4); border-color: rgba(255, 255, 255, 0.65); color: #fff; box-shadow: 0 8px 18px rgba(155, 93, 229, 0.4); }
#teacher-dashboard .type-option.selected[data-type="sentence-ordering"] { background: linear-gradient(135deg, #07b98d, #039e76); border-color: rgba(255, 255, 255, 0.65); color: #fff; box-shadow: 0 8px 18px rgba(6, 214, 160, 0.4); }
#teacher-dashboard .type-option.selected[data-type="find-mistake"] { background: linear-gradient(135deg, #E76F51, #cf4f33); border-color: rgba(255, 255, 255, 0.65); color: #fff; box-shadow: 0 8px 18px rgba(231, 111, 81, 0.4); }


/* Ô nhập nội dung câu hỏi: cho phép xuống dòng, cao tối thiểu */
.part-card .content-input {
  min-height: 140px;
  resize: vertical;
}

/* =====================================================
   24. SCATTER LETTERS EFFECT (GIỮ NGUYÊN)
   ===================================================== */

.scatter-container {
  position: relative;
  display: inline-block;
}

.scatter-letter {
  display: inline-block;
  position: relative;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s ease;
}

@media (prefers-reduced-motion: reduce) {
  .scatter-letter {
    transition: none !important;
  }
}


/* =====================================================
   25. RESULT SUMMARY
   ===================================================== */

.result-summary {
  text-align: center;
  margin-bottom: 2rem;
}

.score-display {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.score-label {
  color: var(--glass-muted);
}

.score-value {
  color: var(--accent-success);
  font-size: 2.5rem;
}

.feedback-text {
  color: var(--glass-muted);
  font-style: italic;
  font-size: 1.3rem;
  font-weight: 600;
}


/* =====================================================
   26. CORRECT/INCORRECT STYLES
   ===================================================== */

.correct-answer {
  background: linear-gradient(135deg, #62DCC2, #50BEEB) !important;
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.9) !important;
}

.incorrect-answer {
  background: rgba(255, 234, 242, 0.5) !important;
  color: var(--accent-secondary) !important;
  border-color: var(--accent-secondary) !important;
}


/* =====================================================
   27. MODAL - LIQUID GLASS
   ===================================================== */

.modal-overlay {
  position: fixed;
  z-index: 9999;
  inset: 0;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgba(255, 255, 255, 0.4);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-overlay:not(.hidden) {
  display: flex;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  position: relative;
  overflow: hidden;

  width: min(100%, 560px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;

  padding: 32px;

  background: rgba(255, 255, 255, 0.25);

  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-xl);

  box-shadow: 
    0 8px 32px 0 rgba(91, 104, 175, 0.37),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 4px 0 rgba(91, 104, 175, 0.2),
    0 0 40px rgba(121, 106, 255, 0.15);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  text-align: center;
}

.modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(121, 106, 255, 0.1),
    transparent
  );
  transition: 0.5s;
  pointer-events: none;
}

.modal-card:hover::before {
  left: 100%;
}

/* Liquid glass inputs inside modal */
.modal-card .clay-input {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid var(--accent-primary);
  box-shadow: 
    0 0 0 3px rgba(121, 106, 255, 0.2),
    inset 0 1px 2px 0 rgba(0, 0, 0, 0.1);
}

.modal-card .clay-input:focus {
  background: rgba(255, 255, 255, 0.25);
  border-color: var(--accent-primary);
  box-shadow: 
    0 0 0 4px rgba(121, 106, 255, 0.3),
    inset 0 1px 2px 0 rgba(0, 0, 0, 0.1);
}

/* Liquid glass buttons inside modal */
.modal-card .clay-button {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 4px 16px 0 rgba(91, 104, 175, 0.2),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.modal-card .clay-button:hover {
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 6px 24px 0 rgba(91, 104, 175, 0.3),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.4),
    0 0 20px rgba(121, 106, 255, 0.2);
}

.modal-card .clay-button:active {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 
    inset 0 2px 8px 0 rgba(91, 104, 175, 0.3),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
}

.modal-card .clay-button.primary {
  background: linear-gradient(135deg, rgba(121, 106, 255, 0.3), rgba(233, 130, 182, 0.3));
  border-color: rgba(121, 106, 255, 0.4);
  color: #796AFF;
  font-weight: 700;
}

.modal-title {
  margin: 0 0 18px;
  color: var(--glass-text);
  font-size: 24px;
  font-weight: 900;
  position: relative;
  z-index: 1;
}

.modal-message {
  color: var(--glass-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
  white-space: pre-line;
}

.modal-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;

  margin-top: 26px;
  position: relative;
  z-index: 1;
}

.modal-actions .clay-button {
  min-width: 120px;
}


/* =====================================================
   28. LOADING OVERLAY
   ===================================================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 249, 240, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.loading-overlay.hidden {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.loading-text {
  margin-top: 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--glass-text);
}


/* =====================================================
   29. LOADER - CYBER PLASMA VIAL (Uiverse by Yaseen549)
   ===================================================== */

.cyber-loader-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 0 35px rgba(0, 255, 204, 0.15));
}

.plasma-vial {
  --neon-cyan: #00ffcc;
  --neon-blue: #0066ff;
  position: relative;
  width: 80px;
  height: 200px;
  border-radius: 40px;
  background: linear-gradient(180deg, #050b14 0%, #020408 100%);
  border: 2px solid rgba(0, 255, 204, 0.15);
  box-shadow:
    0 0 20px 0 rgba(0, 255, 204, 0.1),
    inset 0 0 25px rgba(0, 102, 255, 0.4),
    inset 0 -15px 30px rgba(0, 255, 204, 0.2);
  overflow: hidden;
  animation: vial-pulse 4s ease-in-out infinite;
}

.plasma-vial::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 40px;
  box-shadow:
    inset -6px -6px 15px rgba(0, 0, 0, 0.8),
    inset 6px 6px 15px rgba(255, 255, 255, 0.15);
  pointer-events: none;
  z-index: 10;
}

.plasma-vial::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 12px;
  width: 12px;
  height: 170px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0) 80%
  );
  border-radius: 10px;
  filter: blur(1px);
  pointer-events: none;
  z-index: 10;
}

.vial-base {
  width: 100px;
  height: 20px;
  background: linear-gradient(90deg, #1a1c23, #2a2d38, #1a1c23);
  border-radius: 10px;
  margin-top: -10px;
  z-index: 20;
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.8),
    inset 0 2px 2px rgba(255, 255, 255, 0.1),
    0 -2px 10px rgba(0, 255, 204, 0.3);
  border: 1px solid #333;
}

.fluid-chamber {
  position: absolute;
  inset: -10px;
  filter: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><filter id="g"><feGaussianBlur in="SourceGraphic" stdDeviation="7"/><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 22 -9"/></filter></svg>#g');
  -webkit-filter: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><filter id="g"><feGaussianBlur in="SourceGraphic" stdDeviation="7"/><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 22 -9"/></filter></svg>#g');
  animation: fluid-colors 6s ease-in-out infinite;
  z-index: 1;
}

.plasma-pool, .droplet {
  position: absolute;
  background: linear-gradient(
    180deg,
    var(--neon-cyan) 10%,
    var(--neon-blue) 90%
  );
  border-radius: 50%;
}

.bottom-pool {
  width: 100px;
  height: 60px;
  bottom: 0;
  left: 0;
  border-radius: 40% 60% 50% 50%;
  animation: pool-shift 4s ease-in-out infinite alternate;
}

.top-pool {
  width: 100px;
  height: 40px;
  top: 0;
  left: 0;
  border-radius: 50% 50% 60% 40%;
  opacity: 0.8;
  animation: pool-shift 3s ease-in-out infinite alternate-reverse;
}

.droplet {
  bottom: 20px;
}

.d-1 {
  width: 35px;
  height: 35px;
  left: 15px;
  animation: antigrav-flow 4s cubic-bezier(0.4, 0.1, 0.3, 1) infinite;
}

.d-2 {
  width: 45px;
  height: 45px;
  left: 35px;
  animation: antigrav-flow 5.5s cubic-bezier(0.5, 0.1, 0.2, 1) infinite 1.2s;
}

.d-3 {
  width: 24px;
  height: 24px;
  left: 55px;
  animation: antigrav-flow 3.8s cubic-bezier(0.4, 0.2, 0.4, 1) infinite 0.7s;
}

.d-4 {
  width: 28px;
  height: 28px;
  left: 25px;
  animation: antigrav-flow 4.5s cubic-bezier(0.3, 0.1, 0.4, 1) infinite 2.5s;
}

.d-5 {
  width: 20px;
  height: 20px;
  left: 45px;
  animation: antigrav-flow 3s cubic-bezier(0.4, 0.1, 0.2, 1) infinite 3s;
}

@keyframes antigrav-flow {
  0% {
    transform: translateY(20px) scale(0.8) rotate(0deg);
  }
  50% {
    transform: translateY(-170px) scale(1.15) rotate(180deg);
  }
  100% {
    transform: translateY(20px) scale(0.8) rotate(360deg);
  }
}

@keyframes pool-shift {
  0% {
    transform: scaleX(1) translateX(-5px);
  }
  100% {
    transform: scaleX(1.1) translateX(5px);
  }
}

@keyframes fluid-colors {
  0%,
  100% {
    filter: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><filter id="g"><feGaussianBlur in="SourceGraphic" stdDeviation="7"/><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 22 -9"/></filter></svg>#g')
      hue-rotate(0deg);
  }
  50% {
    filter: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><filter id="g"><feGaussianBlur in="SourceGraphic" stdDeviation="7"/><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 22 -9"/></filter></svg>#g')
      hue-rotate(40deg);
  }
}

@keyframes vial-pulse {
  0%,
  100% {
    box-shadow:
      0 0 20px 0 rgba(0, 255, 204, 0.1),
      inset 0 0 25px rgba(0, 102, 255, 0.4),
      inset 0 -15px 30px rgba(0, 255, 204, 0.2);
  }
  50% {
    box-shadow:
      0 0 35px 5px rgba(0, 255, 204, 0.25),
      inset 0 0 40px rgba(0, 102, 255, 0.6),
      inset 0 -20px 45px rgba(0, 255, 204, 0.4);
  }
}

/* =====================================================
   30. DOCK MENU (GIỮ NGUYÊN - ORIGINAL)
   ===================================================== */

.dock {
  --s: 50px;
  --max: 1.6;
  --gap: max(2px, calc(var(--s) * 0.03));
  --pad: max(4px, calc(var(--s) * 0.06));

  display: inline-flex;

  margin: 10px auto 24px; /* Giảm margin-top xuống 10px để gần dashboard hơn */

  padding: var(--pad) calc(var(--pad) - var(--gap) / 2);

  /* Liquid Glass Effect */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border: 1px solid rgba(255, 255, 255, 0.2);

  border-radius: 50px;

  box-shadow:
    0 8px 32px 0 rgba(91, 104, 175, 0.15),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px 0 rgba(91, 104, 175, 0.1);

  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);

  isolation: isolate;
}

.dock::before {
  display: none; /* Tắt :before để không ảnh hưởng vùng màu */
}

.dock__row {
  position: relative;
  display: flex;
  align-items: flex-end;

  height: var(--s);
  width: 100%;
}

.dock__blob {
  position: absolute; left: 0; top: 50%;
  width: calc(var(--s) - 4px); height: calc(var(--s) - 4px);
  border-radius: 50%; pointer-events: none; z-index: 1; opacity: 0;
  transform: translate3d(var(--bx, 0px), -50%, 0);
  background: radial-gradient(circle at 30% 22%, rgba(255,255,255,.95), rgba(255,255,255,.35) 45%, rgba(121,106,255,.16) 100%);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: 0 6px 18px rgba(91,104,175,.25), inset 0 1px 2px rgba(255,255,255,.95),
              inset 0 -3px 6px rgba(121,106,255,.2), 0 0 0 1px rgba(121,106,255,.12);
}

.dock__item {
  --k: 1;

  --shadow-y: max(1px, calc(var(--s) * 0.03));

  --shadow-b: max(2px, calc(var(--s) * 0.06));

  position: relative;

  flex: none;

  display: flex;
  align-items: center;
  justify-content: center;

  width: calc(var(--s) + var(--gap));

  height: var(--s);

  padding: 0 calc(var(--gap) / 2);

  cursor: pointer;

  z-index: 10;

  transform-origin: bottom center;

  transition: all 0.3s ease;

  border: none;
  background: transparent;
  font-family: 'Nunito', sans-serif;
}

.dock__item .dock-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;

  font-size: calc(var(--s) * 0.5);

  filter: drop-shadow(
    0 var(--shadow-y) var(--shadow-b)
      rgba(91, 104, 175, 0.2)
  ) grayscale(100%) brightness(0);

  transition: font-size 0.3s ease;

  border-radius: 4px;
}

.dock__item[data-page="classes"] .dock-icon svg {
  width: 28px;
  height: 28px;
  fill: #000000;
  stroke: #000000;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}


.dock__item .dock-label {
  display: none;
}

.dock__item:hover {
  z-index: 18;
}

.dock__item:hover .dock-icon {
  font-size: calc(var(--s) * 0.7);
  filter: drop-shadow(
    0 2px 4px
      rgba(91, 104, 175, 0.3)
  ) grayscale(100%) brightness(0);
}

/* Liquid glass background for individual items on hover */
.dock__item::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: calc(var(--s) - 8px);
  height: calc(var(--s) - 8px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 4px 16px 0 rgba(91, 104, 175, 0.12),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 4px 0 rgba(91, 104, 175, 0.08);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
  z-index: -1;
}

.dock__item:hover::before {
  transform: translate(-50%, -50%) scale(1);
}

.dock__item.active .dock__dot{display:none}

/* CSS ICONS - Đồng bộ màu đen như icon logout */
.css-icon.home::before {
  border-bottom-color: #000000 !important;
}

.css-icon.home::after {
  background: #000000 !important;
}

.css-icon.students::before {
  background: #000000 !important;
}

.css-icon.students::after {
  background: #000000 !important;
}

/* Đảm bảo icon luôn màu đen */
.css-icon.home,
.css-icon.students {
  color: #000000 !important;
}

.dock__item .css-icon.home,
.dock__item .css-icon.students {
  color: #000000 !important;
}

.dock__item .css-icon.home::before,
.dock__item .css-icon.home::after,
.dock__item .css-icon.students::before,
.dock__item .css-icon.students::after {
  color: #000000 !important;
}

.dock__item:active {
  transform: translateY(max(-8px, calc(var(--s) * -0.15)));

  transition-duration: 0.2s;
}

.dock__dot {
  display: none;

  position: absolute;

  bottom: max(-2px, calc(var(--s) * -0.05));

  left: 50%;

  transform: translateX(-50%);

  width: max(3px, calc(var(--s) * 0.06));

  height: max(3px, calc(var(--s) * 0.06));

  border-radius: 50%;

  background-color: rgba(121, 106, 255, 0.8);

  box-shadow:
    0 0 5px rgba(121, 106, 255, 0.55),
    0 1px 3px rgba(91, 104, 175, 0.3);
}

.dock__item.active .dock__dot {
  display: none;
}

.dock__item.active .dock-icon {
  filter: drop-shadow(0 2px 3px rgba(91, 104, 175, 0.2))
    drop-shadow(0 8px 12px rgba(91, 104, 175, 0.12))
    grayscale(100%) brightness(0);
}

.dock__tooltip {
  position: absolute;

  left: 50%;
  bottom: calc(100% + 14px);

  min-width: max-content;

  transform: translateX(-50%) translateY(6px) scale(0.92);

  transform-origin: bottom center;

  padding: 8px 11px;

  border: 1px solid rgba(255, 255, 255, 0.18);

  border-radius: 9px;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.04)
  ),
  rgba(91, 104, 175, 0.88);

  color: rgba(255, 255, 255, 0.97);

  font-family: 'Nunito', sans-serif;

  font-size: 12px;
  font-weight: 600;

  letter-spacing: 0.01em;
  line-height: 1;

  white-space: nowrap;

  opacity: 0;

  visibility: hidden;

  pointer-events: none;

  box-shadow:
    0 10px 25px rgba(91, 104, 175, 0.2),
    0 2px 8px rgba(91, 104, 175, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);

  -webkit-backdrop-filter: blur(18px) saturate(160%);

  backdrop-filter: blur(18px) saturate(160%);

  transition:
    opacity 160ms ease,
    visibility 160ms ease,
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);

  z-index: 100;
}

.dock__item:hover .dock__tooltip {
  opacity: 1;

  visibility: visible;

  transform: translateX(-50%) translateY(0) scale(1);
}

@media (max-width: 1023px), (max-height: 1023px) {
  .dock {
    --s: 56px;
    --max: 1.6;
  }
}

@media (max-width: 767px), (max-height: 767px) {
  .dock {
    --s: 48px;
    --max: 1.5;
  }
}

@media (max-width: 479px), (max-height: 479px) {
  .dock {
    --s: 40px;
    --max: 1.4;
  }
}

@media (max-width: 767px), (hover: none) {
  .dock__item:hover {
    --k: 1;
  }

  .dock__item:hover + .dock__item,
  .dock__item:has(+ .dock__item:hover) {
    --k: 1;
  }

  .dock__item:hover + .dock__item + .dock__item,
  .dock__item:has(+ .dock__item + .dock__item:hover) {
    --k: 1;
  }

  .dock__tooltip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dock,
  .dock__item,
  .dock__item .dock-icon,
  .dock__tooltip {
    transition: none !important;
  }
}


/* =====================================================
   31. RESPONSIVE — TABLET VÀ ĐIỆN THOẠI
   ===================================================== */

@media (max-width: 768px) {
  body {
    padding: 20px 16px 32px;
  }

  .header {
    gap: 12px;
    margin-bottom: 24px;
    flex-direction: column;
    align-items: flex-start;
  }

  .page-title {
    font-size: 32px;
    order: 1;
  }

  .header-buttons {
    order: 2;
    width: 100%;
    justify-content: flex-start;
  }

  .dock {
    justify-content: center;
    --s: 38px;
    --gap: max(2px, calc(var(--s) * 0.03));
    --pad: max(4px, calc(var(--s) * 0.06));
  }

  .clay-card,
  .glass-panel,
  .glass-card,
  .glass-modal {
    margin-bottom: 20px;
    padding: 22px 18px;
    border-radius: 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .clay-card h2 {
    font-size: 22px;
  }

  .clay-input,
  .clay-textarea {
    min-height: 52px;
    padding: 12px 15px;
    border-radius: 14px;
  }

  .action-buttons {
    gap: 10px;
    margin-top: 24px;
  }

  .clay-button {
    min-height: 44px;
    padding: 10px 15px;
    border-radius: 13px;
  }

  .assignment-item,
  .student-item {
    gap: 14px;
    min-height: 112px;
    margin-bottom: 16px;
    padding: 16px;

    border-radius: 20px;
  }

  .assignment-item h3,
  .student-item h3 {
    font-size: 16px;
    margin-bottom: 5px;
  }

  .assignment-item p,
  .student-item p {
    font-size: 13px;
  }

  .modal-card {
    padding: 22px 18px;
    border-radius: 20px;
  }
}


/* =====================================================
   32. RESPONSIVE — IPHONE MÀN HÌNH NHỎ
   ===================================================== */

@media (max-width: 420px) {
  body {
    padding: 16px 12px 26px;
  }

  .header {
    align-items: flex-start;
    gap: 8px;
    flex-direction: column;
  }

  .page-title {
    font-size: 28px;
    letter-spacing: -0.3px;
    order: 1;
  }

  .header-buttons {
    order: 2;
    width: 100%;
    justify-content: flex-start;
  }

  .dock {
    justify-content: center;
    --s: 34px;
    --gap: max(2px, calc(var(--s) * 0.03));
    --pad: max(4px, calc(var(--s) * 0.06));
  }

  .clay-card,
  .glass-panel,
  .glass-card,
  .glass-modal {
    padding: 19px 14px;
    border-radius: 18px;
  }

  .clay-card h2 {
    font-size: 20px;
  }

  .student-select-btn {
    gap: 8px;
  }

  .student-select-btn {
    min-height: 40px;
    padding: 8px 13px;
    font-size: 13px;
  }

  .action-buttons {
    justify-content: stretch;
  }

  .action-buttons .clay-button {
    flex: 1;
  }

  .assignment-item,
  .student-item {
    gap: 10px;
    min-height: 100px;
    padding: 13px 11px;
    border-radius: 18px;
  }

  .assignment-item h3,
  .student-item h3 {
    font-size: 14px;
    line-height: 1.4;
  }

  .assignment-item p,
  .student-item p {
    font-size: 11px;
    line-height: 1.4;
  }
}


/* =====================================================
   33. TÔN TRỌNG THIẾT LẬP GIẢM CHUYỂN ĐỘNG
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .td-track {
    transition: none !important;
  }

  .td-tab-indicator {
    transition: none !important;
  }
}


/* =====================================================
   34. ACCESSIBILITY
   ===================================================== */

.clay-button:focus-visible,
.clay-input:focus-visible,
.clay-textarea:focus-visible,
.option-card:focus-visible,
.tf-option:focus-visible,
.word-chip:focus-visible,
.mistake-word:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
}

/* =====================================================
   35. QUESTION COUNT
   ===================================================== */

.question-count {
  font-size: 1rem;
  color: var(--glass-muted);
  margin-top: 0.5rem;
  font-weight: 700;
}


/* =====================================================
   36. SMOOTH SCROLL OPTIMIZATION
   ===================================================== */

html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

* {
  -webkit-tap-highlight-color: transparent;
}

:root {
  --sb-w: 6px;
  --sb-thumb: rgba(121, 106, 255, 0.28);
  --sb-thumb-hover: rgba(121, 106, 255, 0.5);
  --sb-track: transparent;
}
* { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) var(--sb-track); }
*::-webkit-scrollbar { width: var(--sb-w); height: var(--sb-w); }
*::-webkit-scrollbar-track { background: var(--sb-track); }
*::-webkit-scrollbar-thumb {
  background: var(--sb-thumb);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--sb-thumb-hover);
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner { background: transparent; }
*::-webkit-scrollbar-button { display: none; }


/* =====================================================
   37. TOTAL SCORE BADGE
   ===================================================== */

#total-score-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, rgba(98, 220, 194, 0.95), rgba(80, 190, 235, 0.95));
  border-radius: var(--radius-pill);
  border: 2px solid rgba(255, 255, 255, 0.4);
}

#total-score-badge.hidden {
  display: none;
}

#total-score-badge .score-label {
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 700;
}

#total-score-badge .score-value {
  color: #FFFFFF;
  font-size: 1.4rem;
  font-weight: 900;
  min-width: 80px;
  text-align: right;
}

#total-score-badge .score-value.over {
  color: #FF6B6B;
  animation: pulse 1s ease-in-out infinite;
}

#total-score-badge .score-value.under {
  color: #FFE66D;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@media (max-width: 768px) {
  #total-score-badge {
    padding: 0.75rem 1.25rem;
  }

  #total-score-badge .score-label {
    font-size: 0.9rem;
  }

  #total-score-badge .score-value {
    font-size: 1.2rem;
  }
}


/* =====================================================
   38. BACK BUTTON
   ===================================================== */

.back-button {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);

  padding: 0.5rem 1rem;
  margin-left: 1rem;

  background: linear-gradient(135deg, rgba(121, 106, 255, 0.8), rgba(98, 220, 194, 0.8));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-pill);

  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;

  transition: all var(--transition-liquid);
  z-index: 10;
}

.back-button:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 8px 32px 0 rgba(91, 104, 175, 0.45);
}

@media (max-width: 768px) {
  .back-button {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
}

.total-score-badge {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-pill);

  box-shadow:
    0 8px 32px 0 rgba(91, 104, 175, 0.37),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 4px 0 rgba(91, 104, 175, 0.2);

  transition: all var(--transition-liquid);
}

.total-score-badge.hidden {
  display: none;
}

.total-score-badge:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 40px 0 rgba(91, 104, 175, 0.45),
    inset 0 1px 2px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 4px 0 rgba(91, 104, 175, 0.3);
}

.total-score-badge #badge-score-value {
  color: #FFFFFF;
  font-size: 1.2rem;
  font-weight: 900;
  text-align: center;
  line-height: 1.2;
}

.total-score-badge #badge-score-value.over {
  color: #FF6B6B;
  animation: pulse 1s ease-in-out infinite;
}

.total-score-badge #badge-score-value.under {
  color: #FFE66D;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@media (max-width: 768px) {
  .total-score-badge {
    min-width: 80px;
    padding: 0.6rem 1.2rem;
  }

  .total-score-badge #badge-score-value {
    font-size: 1rem;
  }
}


.hidden {
  display: none !important;
}

/* Loading Wave Loader */
.loading-wave {
  width: 300px;
  height: 50px; /* Giảm từ 100px xuống 50px */
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.loading-bar {
  width: 20px;
  height: 10px;
  margin: 0 5px;
  background-color: #3498db;
  border-radius: 5px;
  animation: loading-wave-animation 1s ease-in-out infinite;
}

.loading-bar:nth-child(2) {
  animation-delay: 0.1s;
}

.loading-bar:nth-child(3) {
  animation-delay: 0.2s;
}

.loading-bar:nth-child(4) {
  animation-delay: 0.3s;
}

@keyframes loading-wave-animation {
  0% {
    height: 10px;
  }

  50% {
    height: 30px; /* Giảm từ 50px xuống 30px */
  }

  100% {
    height: 10px;
  }
}

/* Dots Container Loader */
.dots-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px !important; /* Cố định height quan trọng để không thay đổi chiều dài giao diện */
  width: 100%;
  min-height: 30px !important;
}

.dot {
  height: 20px;
  width: 20px;
  margin-right: 10px;
  border-radius: 10px;
  background-color: #b3d4fc;
  animation: pulse 1.5s infinite ease-in-out;
}

.dot:last-child {
  margin-right: 0;
}

.dot:nth-child(1) {
  animation-delay: -0.3s;
}

.dot:nth-child(2) {
  animation-delay: -0.1s;
}

.dot:nth-child(3) {
  animation-delay: 0.1s;
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    background-color: #b3d4fc;
    box-shadow: 0 0 0 0 rgba(178, 212, 252, 0.7);
  }

  50% {
    transform: scale(1.2);
    background-color: #6793fb;
    box-shadow: 0 0 0 10px rgba(178, 212, 252, 0);
  }

  100% {
    transform: scale(0.8);
    background-color: #b3d4fc;
    box-shadow: 0 0 0 0 rgba(178, 212, 252, 0.7);
  }
}

/* ===== Morphing History Menu ===== */
.history-menu {
  position: relative;
  width: 100%;
}

.history-nav {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(121, 106, 255, 0.12);
  box-shadow: 0 0 0 1px var(--glass-border);
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.history-tab-btn {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 13.5px;
  font-weight: 750;
  color: var(--glass-muted);
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
  font-family: 'Nunito', sans-serif;
  white-space: nowrap;
}

.history-tab-btn.active {
  color: var(--glass-text);
  background: rgba(255, 255, 255, 0.12);
}

.history-caret {
  position: absolute;
  top: 44px;
  left: 0;
  width: 14px;
  height: 14px;
  background: rgba(121, 106, 255, 0.08);
  box-shadow: -1px -1px 0 var(--glass-border);
  transform: translateX(var(--caret-x, 100px)) rotate(45deg);
  border-radius: 3px 0 0 0;
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.3, 1.1, 0.4, 1), opacity 0.25s;
  z-index: 2;
  pointer-events: none;
}

.history-menu.is-open .history-caret {
  opacity: 1;
}

.history-panel {
  position: relative;
  margin: 8px auto 0;
  width: 100%;
  max-width: 460px;
  height: var(--panel-h, auto);
  min-height: 144px;
  border-radius: 18px;
  background: rgba(121, 106, 255, 0.08);
  box-shadow: 0 0 0 1px var(--glass-border), 0 24px 40px -18px rgba(40, 30, 80, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: max-width 0.45s cubic-bezier(0.3, 1.1, 0.4, 1), opacity 0.25s;
  overflow: hidden;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.history-menu.is-open .history-panel {
  opacity: 1;
  pointer-events: auto;
}

.history-panel-inner {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  min-height: 120px;
}

.history-page {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: none;
  transition: transform 0.45s cubic-bezier(0.3, 1.1, 0.4, 1), opacity 0.3s;
}

.history-page::-webkit-scrollbar {
  display: none;
}

.history-page.slide-left {
  transform: translateX(-40px);
  opacity: 0;
  pointer-events: none;
}

.history-page.slide-right {
  transform: translateX(40px);
  opacity: 0;
  pointer-events: none;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  transition: background 0.2s;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.history-item-icon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.history-item-body b {
  display: block;
  font-size: 13.5px;
  font-weight: 780;
  color: var(--glass-text);
}

.history-item-body span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--glass-muted);
}

/* ===== User Action Dropdown Menu ===== */
.action-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
}

#user-action-dropdown {
    position: absolute;
    display: block !important;
    background: var(--card-bg, #fff);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    z-index: 10000;
    min-width: 200px;
    padding: 0.5rem;
    border: 1px solid var(--border-color, rgba(0,0,0,0.1));
    opacity: 0;
    transform: translateY(-14px) scale(0.9);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0.28s;
    will-change: transform, opacity;
}

#user-action-dropdown:not(.hidden) {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s;
}

.action-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    text-align: left;
    font-size: 0.95rem;
    color: inherit;
    opacity: 0;
    transform: translateX(-10px);
    transition: background 0.15s, opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#user-action-dropdown:not(.hidden) .action-menu-item {
    opacity: 1;
    transform: translateX(0);
}

#user-action-dropdown:not(.hidden) .action-menu-item:nth-child(1) { transition-delay: 0.04s; }
#user-action-dropdown:not(.hidden) .action-menu-item:nth-child(2) { transition-delay: 0.07s; }
#user-action-dropdown:not(.hidden) .action-menu-item:nth-child(3) { transition-delay: 0.10s; }
#user-action-dropdown:not(.hidden) .action-menu-item:nth-child(4) { transition-delay: 0.13s; }
#user-action-dropdown:not(.hidden) .action-menu-item:nth-child(5) { transition-delay: 0.16s; }
#user-action-dropdown:not(.hidden) .action-menu-item:nth-child(6) { transition-delay: 0.19s; }
#user-action-dropdown:not(.hidden) .action-menu-item:nth-child(7) { transition-delay: 0.22s; }

.action-menu-item:hover {
    background: var(--cream, #f5f5f5);
}

.action-menu-item.action-danger {
    color: #e53935;
}

.action-menu-item.action-danger:hover {
    background: #ffebee;
}

.user-card {
    overflow: visible !important;
    position: relative;                
}

#admin-users-list {
    overflow: visible;
}
/* ===== Admin Stats Dashboard ===== */
#admin-dashboard {
    background:
        radial-gradient(circle at 5% 10%, rgba(210, 195, 255, 0.45), transparent 28%),
        radial-gradient(circle at 95% 5%, rgba(190, 235, 255, 0.55), transparent 32%),
        radial-gradient(circle at 55% 100%, rgba(255, 195, 220, 0.35), transparent 35%),
        linear-gradient(135deg, #f4f0ff 0%, #fffaf5 50%, #eef9ff 100%);
}

.dashboard-panel {
    position: relative;
    overflow: hidden;
    margin: 18px 0;
    padding: 40px 45px;
    min-height: 500px;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    background:
        radial-gradient(circle at 0% 0%, rgba(220, 210, 255, 0.28), transparent 35%),
        radial-gradient(circle at 100% 0%, rgba(190, 235, 255, 0.32), transparent 38%),
        radial-gradient(circle at 55% 100%, rgba(255, 210, 225, 0.20), transparent 42%),
        rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: 0 25px 55px rgba(74, 70, 120, 0.12), 0 8px 20px rgba(90, 100, 150, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.85);
}

.dashboard-panel::before {
    content: "";
    position: absolute;
    width: 400px; height: 400px;
    top: -220px; right: -120px;
    border-radius: 50%;
    background: rgba(190, 185, 255, 0.22);
    pointer-events: none;
}

.dashboard-panel::after {
    content: "";
    position: absolute;
    width: 600px; height: 300px;
    bottom: -200px; right: -80px;
    border-radius: 50%;
    background: rgba(210, 220, 255, 0.22);
    pointer-events: none;
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
    color: #293b70;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.6px;
    position: relative;
    z-index: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .stat-card { padding: 10px 6px; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
    .stat-icon { margin-bottom: 4px; }
    .stat-icon svg { width: 20px !important; height: 20px !important; }
    .stat-number { font-size: 1.3rem; }
    .stat-label { font-size: 0.68rem; white-space: nowrap; margin-top: 2px; }
    .stat-line { width: 24px; margin-top: 4px; }
    .dashboard-title { font-size: 1.2rem !important; }
    .dashboard-title svg { width: 22px !important; height: 22px !important; }
}

@media (max-width: 360px) {
    .stats-grid { gap: 6px; }
    .stat-card { padding: 8px 4px; }
    .stat-icon svg { width: 18px !important; height: 18px !important; }
    .stat-number { font-size: 1.1rem; }
    .stat-label { font-size: 0.62rem; }
    .stat-line { width: 20px; }
}

/* ===== TEACHER DETAIL MODAL ===== */
.modal-card.teacher-detail-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    height: min(calc(100dvh - 48px), 760px);
    max-width: 520px;
    text-align: left;
    background: linear-gradient(160deg, rgba(255,255,255,0.98), rgba(255,255,255,0.88));
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 28px;
    box-shadow: 0 25px 55px rgba(74, 70, 120, 0.12), 0 8px 20px rgba(90, 100, 150, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.modal-card.teacher-detail-card::before {
    content: none;
}

/* ===== GLASS MODAL SHARED STYLES ===== */
.glass-modal-card {
    --gm-text: #293b70;
    --gm-muted: #596995;
    --gm-accent: #796AFF;
    
    background: linear-gradient(160deg, rgba(255,255,255,0.98), rgba(255,255,255,0.88));
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 28px;
    box-shadow: 0 25px 55px rgba(74, 70, 120, 0.12), 0 8px 20px rgba(90, 100, 150, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.glass-modal-card::before {
    content: none;
}

.glass-modal-header {
    flex: none;
    padding: 20px 20px 12px;
    background:
        radial-gradient(circle at 10% 0%, rgba(255,255,255,.6), transparent 42%),
        radial-gradient(circle at 100% 100%, rgba(255,205,225,.5), transparent 45%),
        linear-gradient(135deg, #d4cafe 0%, #c0dcff 55%, #cdf1ff 100%);
    border-bottom: 1px solid rgba(255,255,255,.7);
    box-shadow: 0 6px 16px rgba(91, 104, 175, 0.08);
}

.glass-modal-footer {
    flex: none;
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 14px 20px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(121,106,255,.15);
    background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,.6));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 -6px 16px rgba(91,104,175,.08);
}

.glass-modal-footer .clay-button {
    flex: 1;
    max-width: 190px;
    height: 46px;
    border-radius: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== GLASS MODAL OPEN ANIMATION ===== */
.modal-overlay:not(.hidden) .glass-modal-card {
    animation: glassModalOpen 0.3s cubic-bezier(.3,1.1,.4,1) forwards;
}

@keyframes glassModalOpen {
    from {
        opacity: 0;
        transform: scale(.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal-overlay:not(.hidden) .glass-modal-card {
        animation: none;
    }
}

.glass-modal-footer .clay-button.secondary {
    background: rgba(255,255,255,.7);
    border: 1px solid rgba(121,106,255,.25);
    color: #596995;
}

.glass-modal-footer .clay-button.secondary:hover {
    background: linear-gradient(135deg, #796AFF, #5B6EF0);
    color: white;
    border-color: transparent;
}

.glass-modal-footer .clay-button.primary {
    background: linear-gradient(135deg, #796AFF, #5B6EF0);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

/* ===== GLASS MODAL PRIMARY BUTTON ===== */
.glass-modal-primary-btn {
    background: linear-gradient(135deg, #796AFF 0%, #5B8DEF 100%);
    color: #fff;
    font-weight: 800;
    letter-spacing: .3px;
    height: 46px;
    min-width: 200px;
    padding: 0 28px;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(121,106,255,.35), inset 0 1px 1px rgba(255,255,255,.45);
    cursor: pointer;
    transition: all 0.2s;
}

.glass-modal-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(121,106,255,.45);
}

.glass-modal-primary-btn:active {
    transform: translateY(0) scale(.98);
}

.glass-modal-primary-btn:focus-visible {
    outline: 2px solid #796AFF;
    outline-offset: 2px;
}

/* ===== GLASS MODAL SECONDARY BUTTON ===== */
.glass-modal-secondary-btn {
    background: rgba(255,255,255,.8);
    border: 1.5px solid rgba(121,106,255,.35);
    color: #5B6EF0;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}

.glass-modal-secondary-btn:hover {
    background: rgba(121,106,255,.08);
}

/* ===== LIMIT CARD ===== */
.modal-card.limit-card {
    max-width: 460px;
    width: 100%;
    padding: 0;
    height: auto;
    max-height: calc(100dvh - 48px);
}

.limit-body {
    flex: 0 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 24px 22px 22px;
    background: linear-gradient(180deg, rgba(244,236,255,.25), rgba(238,249,255,.2));
}

.limit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 24px;
}

.limit-field {
    padding: 14px 16px;
    background: #fff8e6;
    border-radius: 20px;
    border: 1px solid rgba(255,195,90,.45);
    box-shadow: 0 6px 16px rgba(75,80,130,.08);
    position: relative;
    overflow: hidden;
}

.limit-field::before {
    display: none;
}

.limit-field.limit-field-students {
    background: #fff0f5;
    border-color: rgba(255,140,180,.45);
}

.limit-field.limit-field-per-class {
    background: #eef6ff;
    border-color: rgba(110,175,255,.45);
}

.limit-field.limit-field-daily {
    background: #eefaf3;
    border-color: rgba(110,215,165,.45);
}

.limit-input {
    width: 100%;
    height: 48px;
    padding: 0 12px;
    font-size: 22px;
    font-weight: 800;
    color: #293b70;
    text-align: center;
    background: rgba(255,255,255,.92);
    border: 1.5px solid rgba(255,195,90,.5);
    border-radius: 12px;
    outline: none;
    transition: all 0.2s;
}

.limit-input:focus {
    border-color: #d98c0f;
    box-shadow: 0 0 0 3px rgba(217,140,15,.2);
}

.limit-field.limit-field-students .limit-input {
    border-color: rgba(255,140,180,.5);
}

.limit-field.limit-field-students .limit-input:focus {
    border-color: #e0457a;
    box-shadow: 0 0 0 3px rgba(224,69,122,.2);
}

.limit-field.limit-field-per-class .limit-input {
    border-color: rgba(110,175,255,.5);
}

.limit-field.limit-field-per-class .limit-input:focus {
    border-color: #2f7fe8;
    box-shadow: 0 0 0 3px rgba(47,127,232,.2);
}

.limit-field.limit-field-daily .limit-input {
    border-color: rgba(110,215,165,.5);
}

.limit-field.limit-field-daily .limit-input:focus {
    border-color: #249553;
    box-shadow: 0 0 0 3px rgba(36,149,83,.2);
}

/* Hide number input spinners */
.limit-input::-webkit-inner-spin-button,
.limit-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.limit-input[type=number] {
    -moz-appearance: textfield;
}

@media (max-width: 360px) {
    .limit-grid {
        gap: 14px;
    }

    .limit-field {
        padding: 10px 12px;
    }

    .limit-input {
        height: 44px;
        font-size: 20px;
    }
}

.td-header {
    flex: none;
    padding: 20px 20px 12px;
    background:
        radial-gradient(circle at 10% 0%, rgba(255,255,255,.6), transparent 42%),
        radial-gradient(circle at 100% 100%, rgba(255,205,225,.5), transparent 45%),
        linear-gradient(135deg, #d4cafe 0%, #c0dcff 55%, #cdf1ff 100%);
    border-bottom: 1px solid rgba(255,255,255,.7);
    box-shadow: 0 6px 16px rgba(91, 104, 175, 0.08);
}

#teacher-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.td-modal-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #293b70;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.2px;
}

.td-modal-title svg {
    width: 22px;
    height: 22px;
    color: #7550ee;
    flex-shrink: 0;
}

.td-mini-card {
    padding: 10px 12px;
    background: linear-gradient(135deg, #ffffff, #e9dcff);
    border-radius: 18px;
    border: 1px solid rgba(180,145,255,.75);
    box-shadow: 0 8px 18px rgba(75,80,130,.14), inset 0 1px 1px rgba(255,255,255,.95);
    display: flex;
    align-items: center;
    gap: 10px;
}

.td-mini-card.td-name {
    background: linear-gradient(135deg, #ffffff, #e9dcff);
    border-color: rgba(180,145,255,.75);
}

.td-mini-card.td-name .td-icon-chip {
    color: #7550ee;
}

.td-mini-card.td-username {
    background: linear-gradient(135deg, #ffffff, #d9ebff);
    border-color: rgba(110,175,255,.75);
}

.td-mini-card.td-username .td-icon-chip {
    color: #2f7fe8;
}

.td-mini-card.td-classes {
    background: linear-gradient(135deg, #fffdf5, #ffe9b8);
    border-color: rgba(255,195,90,.8);
}

.td-mini-card.td-classes .td-icon-chip {
    color: #d98c0f;
}

.td-mini-card.td-students {
    background: linear-gradient(135deg, #ffffff, #ffe3ec);
    border-color: rgba(255,140,180,.8);
}

.td-mini-card.td-students .td-icon-chip {
    color: #e0457a;
}

.td-icon-chip {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.td-icon-chip svg {
    width: 22px;
    height: 22px;
}

.td-mini-card .td-label {
    color: #596995;
    font-size: 0.85rem;
}

.td-mini-card .td-value {
    color: #293b70;
    font-size: 1.1rem;
    font-weight: 700;
    position: relative;
}

.td-mini-card.td-name .td-value::after {
    content: '';
    display: block;
    width: 24px;
    height: 4px;
    margin-top: 4px;
    border-radius: 2px;
    background: #b08cff;
}

.td-mini-card.td-username .td-value::after {
    content: '';
    display: block;
    width: 24px;
    height: 4px;
    margin-top: 4px;
    border-radius: 2px;
    background: #6fa8ff;
}

.td-mini-card.td-classes .td-value::after {
    content: '';
    display: block;
    width: 24px;
    height: 4px;
    margin-top: 4px;
    border-radius: 2px;
    background: #ffc04d;
}

.td-mini-card.td-students .td-value::after {
    content: '';
    display: block;
    width: 24px;
    height: 4px;
    margin-top: 4px;
    border-radius: 2px;
    background: #ff86ad;
}

#teacher-detail-content {
    margin-bottom: 12px;
}

.td-history-section {
    margin-top: 8px;
}

.td-tabs {
    position: relative;
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.td-tab {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #596995;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.td-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

.td-tab.active {
    color: white;
}

.td-tab-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    border-radius: 999px;
    z-index: 0;
    background-color: #3f8ff5;
    background-image: linear-gradient(135deg, rgba(255,255,255,.25), transparent);
    box-shadow: 0 4px 12px rgba(63,143,245,.35);
    transform: translateX(var(--x, 0));
    width: var(--w, 0);
    transition: transform .4s cubic-bezier(.3,1.1,.4,1), width .4s, background-color .3s, box-shadow .3s;
}

.td-tab-indicator[data-index="1"] {
    background-color: #38C995;
    box-shadow: 0 4px 12px rgba(56,201,149,.35);
}

.td-tab-indicator[data-index="2"] {
    background-color: #f4a93a;
    box-shadow: 0 4px 12px rgba(233,167,44,.35);
}

/* Touch swipe for mobile tabs */
@media (max-width: 768px) {
    .td-track {
        touch-action: pan-y;
    }
}

.td-body {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: hidden;
    padding: 16px 20px;
    background: linear-gradient(180deg, rgba(244,236,255,0.18), rgba(238,249,255,0.15));
}

.td-track {
    display: flex;
    width: 300%;
    height: 100%;
    transform: translateX(calc(var(--i) * -33.3333%));
    transition: transform .45s cubic-bezier(.3,1.1,.4,1);
}

.td-track.no-anim {
    transition: none;
}

.td-pane {
    flex: 0 0 33.3333%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    min-width: 0;
    box-sizing: border-box;
}

.td-pane[aria-hidden="true"] {
    visibility: hidden;
}

.td-history-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(121,106,255,.10), rgba(63,143,245,.08));
    border-radius: 16px;
    border: 1px solid rgba(121, 106, 255, 0.18);
    transition: all 0.2s;
}

.td-history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(121, 106, 255, 0.15);
}

.td-history-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.td-history-icon svg {
    width: 20px;
    height: 20px;
}

.td-history-content {
    flex: 1;
    min-width: 0;
}

.td-history-text {
    font-size: 0.9rem;
    color: #293b70;
    margin-bottom: 4px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.td-history-time {
    font-size: 0.75rem;
    color: #596995;
}

.td-history-icon.add {
    color: #249553;
}

.td-history-item.add {
    background: linear-gradient(135deg, rgba(36,149,83,.12), rgba(36,149,83,.06));
    border-color: rgba(36,149,83,.25);
}

.td-history-icon.delete {
    color: #e0457a;
}

.td-history-item.delete {
    background: linear-gradient(135deg, rgba(224,69,122,.12), rgba(240,100,145,.06));
    border-color: rgba(224,69,122,.25);
}

.td-history-icon.edit {
    color: #d98c0f;
}

.td-history-item.edit {
    background: linear-gradient(135deg, rgba(217,140,15,.14), rgba(244,169,58,.07));
    border-color: rgba(217,140,15,.28);
}

.td-history-icon.neutral {
    color: #2f7fe8;
}

.td-history-item.neutral {
    background: linear-gradient(135deg, rgba(47,127,232,.12), rgba(63,143,245,.06));
    border-color: rgba(47,127,232,.25);
}

.td-empty {
    text-align: center;
    color: #596995;
    padding: 24px;
    font-size: 0.9rem;
}

/* ===== TD EYE BUTTON ===== */
.td-eye-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: none;
    border: none;
    color: #796AFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: auto;
    padding: 0;
}

.td-eye-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.td-eye-btn:not(:disabled):hover {
    background: rgba(121, 106, 255, 0.12);
}

.td-eye-btn:focus-visible {
    outline: 2px solid #796AFF;
    outline-offset: 2px;
}

.td-mini-card.td-classes .td-eye-btn {
    color: #d98c0f;
}

.td-mini-card.td-classes .td-eye-btn:not(:disabled):hover {
    background: rgba(217, 140, 15, 0.12);
}

.td-mini-card.td-classes .td-eye-btn:focus-visible {
    outline-color: #d98c0f;
}

.td-mini-card.td-students .td-eye-btn {
    color: #e0457a;
}

.td-mini-card.td-students .td-eye-btn:not(:disabled):hover {
    background: rgba(224, 69, 122, 0.12);
}

.td-mini-card.td-students .td-eye-btn:focus-visible {
    outline-color: #e0457a;
}

/* ===== TD POPUP MINI ===== */
#td-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(41, 59, 112, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

#td-popup-overlay.active {
    display: flex;
}

.td-popup-card {
    max-width: 360px;
    max-height: 70dvh;
    width: 90%;
    background: linear-gradient(160deg, rgba(255,255,255,0.98), rgba(255,255,255,0.88));
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 24px;
    box-shadow: 0 25px 55px rgba(74, 70, 120, 0.12), 0 8px 20px rgba(90, 100, 150, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.td-popup-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(238,231,255,0.75), rgba(234,244,255,0.55));
    border-bottom: 1px solid rgba(121, 106, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.td-popup-title {
    font-size: 1rem;
    font-weight: 700;
    color: #293b70;
}

.td-popup-header[data-type="classes"] .td-popup-title {
    color: #d98c0f;
}

.td-popup-header[data-type="students"] .td-popup-title {
    color: #e0457a;
}

.td-popup-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(121, 106, 255, 0.2);
    color: #796AFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.td-popup-close:hover {
    background: linear-gradient(135deg, #796AFF, #5B6EF0);
    color: white;
    border-color: #796AFF;
}

.td-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    background: linear-gradient(180deg, rgba(244,236,255,0.18), rgba(238,249,255,0.15));
}

.td-popup-item {
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.85), rgba(244,236,255,0.15));
    border-radius: 12px;
    border: 1px solid rgba(121, 106, 255, 0.12);
    margin-bottom: 8px;
}

.td-popup-item:last-child {
    margin-bottom: 0;
}

.td-popup-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #293b70;
    margin-bottom: 4px;
}

.td-popup-item-detail {
    font-size: 0.8rem;
    color: #596995;
}

.td-popup-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.td-popup-chip {
    padding: 2px 8px;
    background: rgba(121, 106, 255, 0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    color: #796AFF;
}

.td-popup-search {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(121, 106, 255, 0.2);
    border-radius: 10px;
    font-size: 0.85rem;
    color: #293b70;
    margin-bottom: 12px;
}

.td-popup-search:focus {
    outline: none;
    border-color: rgba(90, 100, 140, .45);
}

/* Responsive <= 420px */
@media (max-width: 420px) {
    .modal-card.teacher-detail-card {
        height: min(calc(100dvh - 32px), 80vh);
        max-width: 100%;
        border-radius: 20px;
    }
    .modal-card.limit-card {
        height: auto;
        max-height: calc(100dvh - 32px);
        max-width: 100%;
        border-radius: 20px;
    }

    .glass-modal-header {
        padding: 16px 16px 10px;
    }

    .glass-modal-footer {
        padding: 12px 16px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .glass-modal-footer .clay-button {
        width: 100%;
        min-width: auto;
    }

    .td-header {
        padding: 16px 16px 10px;
    }

    .td-mini-card {
        padding: 8px 10px;
        gap: 8px;
    }

    .td-icon-chip {
        width: 20px;
        height: 20px;
    }

    .td-icon-chip svg {
        width: 20px;
        height: 20px;
    }

    .td-mini-card .td-label {
        font-size: 0.8rem;
    }

    .td-mini-card .td-value {
        font-size: 1rem;
    }

    .td-mini-card .td-value::after {
        width: 20px;
        height: 3px;
        margin-top: 3px;
    }

    .td-tab {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .td-body {
        padding: 12px 16px;
    }
    .limit-body {
        padding: 18px 16px;
    }

    .td-history-item {
        padding: 10px;
    }

    .td-history-text {
        font-size: 0.85rem;
    }

    .td-history-icon {
        width: 18px;
        height: 18px;
    }

    .td-history-icon svg {
        width: 18px;
        height: 18px;
    }

    .td-popup-card {
        max-width: 320px;
        max-height: 75dvh;
    }

    .limit-grid {
        gap: 18px 14px;
    }

    .limit-field {
        padding: 10px 12px;
    }

    .limit-input {
        height: 44px;
        font-size: 20px;
    }
}

.stat-card {
    position: relative;
    overflow: hidden;
    min-height: 215px;
    padding: 28px 32px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.35));
    box-shadow: 0 18px 32px rgba(75, 80, 130, 0.12), 0 5px 12px rgba(70, 70, 120, 0.07), inset 0 1px 1px rgba(255, 255, 255, 0.95);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 40px rgba(75, 80, 130, 0.16), 0 8px 18px rgba(70, 70, 120, 0.08);
}

.stat-card::before {
    content: "";
    position: absolute;
    width: 250px; height: 180px;
    right: -100px; bottom: -70px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.30);
    transform: rotate(-25deg);
    pointer-events: none;
}

.stat-card.users { background: linear-gradient(135deg, #ffffff, #f4ecff); border-color: rgba(210, 180, 255, 0.65); }
.stat-card.admin { background: linear-gradient(135deg, #ffffff, #eaf4ff); border-color: rgba(150, 200, 255, 0.60); }
.stat-card.teacher { background: linear-gradient(135deg, #fffefa, #fff6e4); border-color: rgba(255, 210, 130, 0.60); }
.stat-card.student { background: linear-gradient(135deg, #ffffff, #e9fff5); border-color: rgba(130, 235, 190, 0.60); }
.stat-card.classes { background: linear-gradient(135deg, #ffffff, #f0efff); border-color: rgba(190, 175, 255, 0.60); }
.stat-card.enrolled { background: linear-gradient(135deg, #ffffff, #fff0f4); border-color: rgba(255, 170, 200, 0.65); }
.stat-card.security { background: linear-gradient(135deg, #ffffff, #ffe9ec); border-color: rgba(255, 140, 160, 0.65); }
.stat-card.mail     { background: linear-gradient(135deg, #ffffff, #e6fbfa); border-color: rgba(14,165,164,.45); }
.stat-card.noclass  { background: linear-gradient(135deg, #ffffff, #fff3e6); border-color: rgba(255,170,90,.55); }
.stat-card.feedback { background: linear-gradient(135deg, #ffffff, #fff3ee); border-color: rgba(255,170,140,.6); }
.stat-card.adviews  { background: linear-gradient(135deg, #ffffff, #eef4ff); border-color: rgba(120,160,255,.55); }
.stat-card.adclicks { background: linear-gradient(135deg, #ffffff, #f3ecff); border-color: rgba(170,140,255,.55); }

.stat-icon {
    display: flex; align-items: center; justify-content: center;
    width: 56px; height: 56px;
    margin-bottom: 22px;
    border-radius: 50%;
    position: relative; z-index: 1;
}

.users .stat-icon { color: #8465f4; background: #eee7ff; }
.admin .stat-icon { color: #3f8ff5; background: #e0efff; }
.teacher .stat-icon { color: #e9a72c; background: #fff0d2; }
.student .stat-icon { color: #249553; background: #d9f9e8; }
.classes .stat-icon { color: #8065e8; background: #eeeaff; }
.enrolled .stat-icon { color: #f06491; background: #ffe5ee; }
.security .stat-icon { color: #e0485f; background: #ffe1e6; }
.mail .stat-icon     { color:#0ea5a4; background:#d5f5f4; }
.noclass .stat-icon  { color:#e07a1f; background:#ffe9d2; }
.feedback .stat-icon { color:#e8603c; background:#ffe6dd; }

.stat-number {
    margin: 0;
    color: #293b70;
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
    position: relative; z-index: 1;
}

.stat-label {
    margin-top: 12px;
    margin-bottom: 18px;
    color: #596995;
    font-size: 16px;
    font-weight: 600;
    position: relative; z-index: 1;
}

.stat-line {
    width: 48px; height: 7px;
    margin-top: auto;
    border-radius: 999px;
    position: relative; z-index: 1;
    flex: none;
}

.users .stat-line { background: #c4a2ff; }
.admin .stat-line { background: #8abaff; }
.teacher .stat-line { background: #ffd27b; }
.student .stat-line { background: #91dfbd; }
.classes .stat-line { background: #c8b0ff; }
.enrolled .stat-line { background: #ff9fc0; }
.security .stat-line { background: #ff9fb2; }
.mail .stat-line     { background:#7fe0dd; }
.noclass .stat-line  { background:#ffc48a; }
.feedback .stat-line { background:#ffb59d; }
.stat-card.broadcast { grid-column: 1 / -1; display:flex; flex-direction:row; align-items:center; gap:20px; min-height:0; padding:18px 28px;
  background: linear-gradient(135deg,#ffffff,#efe9ff); border-color: rgba(150,115,255,.5); }
.broadcast .stat-icon { color:#8465f4; background:#eee7ff; width:48px; height:48px; margin-bottom:0; flex:none; }
.broadcast .stat-icon svg { width:24px; height:24px; }
.broadcast .stat-number { font-size:26px; letter-spacing:-1px; }
.broadcast .stat-label { margin-top:0; font-size:15px; }
.broadcast .stat-line { display:none; }

/* Dropdown Menu Styles */
.action-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    margin-top: 2px;
}

.dropdown-content {
    padding: 0.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    text-align: left;
    font-size: 0.95rem;
    color: inherit;
}

.dropdown-item:hover {
    background: var(--cream, #f5f5f5);
}

.dropdown-item.delete-history-btn {
    color: #e53935;
}

.dropdown-item.delete-history-btn:hover {
    background: #ffebee;
}

/* ===== ADMIN SEARCH - STATS PAGE STYLE ===== */

/* Search wrapper */
.admin-search-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

/* Search bar - glassmorphism like stat cards */
.admin-search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(244, 236, 255, 0.6));
    box-shadow: 0 8px 20px rgba(75, 80, 130, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.95);
    transition: all 0.25s ease;
}

.admin-search-bar:focus-within {
    border-color: rgba(90, 100, 140, .45);
    box-shadow: 0 8px 20px rgba(75, 80, 130, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.admin-search-bar svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: #8465f4;
}

.admin-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-family: inherit;
    color: #293b70;
    outline: none;
}

.admin-search-input::placeholder {
    color: #8e9ab8;
}

.admin-search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(132, 101, 244, 0.1);
    cursor: pointer;
    border-radius: 50%;
    color: #8465f4;
    transition: all 0.15s;
    flex-shrink: 0;
}

.admin-search-clear:hover {
    background: rgba(132, 101, 244, 0.2);
}

.admin-search-clear.hidden {
    display: none;
}

/* Suggestions dropdown - glassmorphism */
.admin-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.85));
    box-shadow: 0 12px 32px rgba(75, 80, 130, 0.15);
    max-height: 280px;
    overflow-y: auto;
    z-index: 200;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.admin-suggestions.hidden {
    display: none;
}

.suggestion-item {
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #293b70;
    border-bottom: 1px solid rgba(132, 101, 244, 0.08);
    transition: background 0.12s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: linear-gradient(135deg, rgba(238, 231, 255, 0.6), rgba(244, 236, 255, 0.3));
}

.suggestion-type {
    font-size: 0.72rem;
    color: #8465f4;
    padding: 0.2rem 0.6rem;
    background: rgba(132, 101, 244, 0.1);
    border-radius: 999px;
    white-space: nowrap;
    font-weight: 600;
}

/* Filter chips - glassmorphism pills */
.admin-filter-chips {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(244, 236, 255, 0.4));
    box-shadow: 0 4px 10px rgba(75, 80, 130, 0.06);
    cursor: pointer;
    font-size: 0.88rem;
    font-family: inherit;
    color: #596995;
    transition: all 0.2s;
}

.filter-chip:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(238, 231, 255, 0.5));
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(75, 80, 130, 0.1);
}

.filter-chip.active {
    background: linear-gradient(135deg, #8465f4, #9d7eff);
    color: white;
    border-color: rgba(132, 101, 244, 0.3);
    box-shadow: 0 6px 16px rgba(132, 101, 244, 0.3);
}

.filter-chip svg {
    width: 14px;
    height: 14px;
}

/* Result count */
.admin-result-count {
    font-size: 0.85rem;
    color: #596995;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* Table container - glassmorphism card */
.admin-table-container {
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.65));
    box-shadow: 0 12px 28px rgba(75, 80, 130, 0.1), 0 4px 10px rgba(70, 70, 120, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.95);
    overflow: hidden;
    overflow-x: auto;
}

/* Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.admin-table th {
    text-align: left;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(238, 231, 255, 0.5), rgba(244, 236, 255, 0.25));
    border-bottom: 1px solid rgba(132, 101, 244, 0.15);
    font-weight: 700;
    color: #293b70;
    white-space: nowrap;
}

.admin-table td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid rgba(132, 101, 244, 0.06);
    color: #293b70;
}

.admin-table tbody tr {
    transition: background 0.15s;
}

.admin-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(238, 231, 255, 0.15), rgba(244, 236, 255, 0.08));
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge svg {
    width: 14px;
    height: 14px;
}

.status-graded {
    background: linear-gradient(135deg, rgba(36, 149, 83, 0.15), rgba(36, 149, 83, 0.08));
    color: #249553;
    border: 1px solid rgba(36, 149, 83, 0.2);
}

.status-pending {
    background: linear-gradient(135deg, rgba(233, 167, 44, 0.15), rgba(233, 167, 44, 0.08));
    color: #e9a72c;
    border: 1px solid rgba(233, 167, 44, 0.2);
}

/* Action buttons */
.admin-table-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(244, 236, 255, 0.4));
    box-shadow: 0 3px 8px rgba(75, 80, 130, 0.08);
    cursor: pointer;
    color: #596995;
    transition: all 0.2s;
}

.admin-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(75, 80, 130, 0.12);
}

.admin-action-btn.view-btn:hover {
    color: #3f8ff5;
    border-color: rgba(63, 143, 245, 0.4);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(224, 239, 255, 0.5));
}

.admin-action-btn.delete-btn:hover {
    color: #f06491;
    border-color: rgba(240, 100, 145, 0.4);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 229, 238, 0.5));
}

.admin-action-btn svg {
    width: 16px;
    height: 16px;
}

/* ===== ADMIN SECTIONS + MODAL REVIEW — STAT CARD STYLE ===== */
/* Match glassmorphism + màu của stats page */

/* Fallback nếu CSS vars chưa load */
:root {
    --review-primary: #796AFF;
    --review-text: #28366B;
    --review-muted: #7184B4;
    --review-border: rgba(255, 255, 255, 0.2);
}

/* ================================================================
   1. SECTION HEADERS — stat card style (icon + title + line)
   ================================================================ */

/* --- Bài Tập Trên Hệ Thống --- */
#admin-assignments-section .clay-card > h2 {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(121, 106, 255, 0.12);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--glass-text, var(--review-text));
    position: relative;
    z-index: 1;
}
#admin-assignments-section .clay-card > h2::before {
    content: '';
    width: 48px; height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M8 13h8M8 17h8M8 9h2'/%3E%3C/svg%3E") center / 26px no-repeat,
        linear-gradient(135deg, var(--accent-primary, var(--review-primary)), #5B6EF0);
    box-shadow: 0 4px 12px rgba(121, 106, 255, 0.3);
}

/* --- Bài Nộp & Điểm --- */
#admin-submissions-section .clay-card > h2 {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(121, 106, 255, 0.12);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--glass-text, var(--review-text));
    position: relative;
    z-index: 1;
}
#admin-submissions-section .clay-card > h2::before {
    content: '';
    width: 48px; height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Crect x='8' y='2' width='8' height='4' rx='1' ry='1'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E") center / 26px no-repeat,
        linear-gradient(135deg, var(--accent-primary, var(--review-primary)), #5B6EF0);
    box-shadow: 0 4px 12px rgba(121, 106, 255, 0.3);
}

/* ===== ADMIN DASHBOARD FULL WIDTH ===== */
#admin-dashboard.page.active {
    margin: -28px -24px -48px;
    min-height: 100vh;
}
#admin-dashboard.page.active .container {
    max-width: 100% !important;
    padding: 28px 24px 48px;
}
#admin-dashboard.page.active .header {
    max-width: 100% !important;
}
#admin-dashboard.page.active .clay-card {
    max-width: 100% !important;
}
/* ===== ADMIN STATS — MOBILE OPTIMIZED ===== */

/* Tablet nhỏ + mobile lớn (481-768px) */
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 28px !important; }
    .stat-card { padding: 10px 6px !important; min-width: 0 !important; min-height: 0 !important; aspect-ratio: 1 !important; display: flex; flex-direction: column; align-items: center; justify-content: center; }
    .stat-icon { margin-bottom: 2px; }
    .stat-icon svg { width: 20px !important; height: 20px !important; }
    .stat-number { font-size: 1.3rem !important; }
    .stat-label { font-size: 0.7rem !important; white-space: nowrap !important; margin-top: 1px !important; }
    .stat-line { width: 24px !important; margin-top: 3px !important; }
    .dashboard-title { font-size: 1.2rem !important; }
    .dashboard-title svg { width: 22px !important; height: 22px !important; }
}

/* Mobile (≤480px) */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .stat-card { padding: 12px 8px !important; min-width: 0 !important; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
    .stat-icon { margin-bottom: 4px; }
    .stat-icon svg { width: 22px !important; height: 22px !important; }
    .stat-number { font-size: 1.5rem !important; }
    .stat-label { font-size: 0.72rem !important; white-space: nowrap !important; margin-top: 2px !important; }
    .stat-line { width: 28px !important; margin-top: 4px !important; }
    .dashboard-title { font-size: 1.2rem !important; }
    .dashboard-title svg { width: 22px !important; height: 22px !important; }
}

/* Mobile nhỏ (≤360px) */
@media (max-width: 360px) {
    .stats-grid {
        gap: 8px;
    }
    .stat-card {
        padding: 12px 8px;
    }
    .stat-number {
        font-size: 1.2rem;
    }
    .stat-label {
        font-size: 0.7rem;
    }
    .stat-icon svg {
        width: 20px !important;
        height: 20px !important;
    }
}

/* ===== LIMIT MODAL: HEADER CĂN GIỮA ===== */
.limit-card .glass-modal-header {
    text-align: center;
    padding: 22px 20px 16px;
}
.limit-card .glass-modal-header > div:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.limit-card .glass-modal-header h2 {
    text-align: center;
}

/* ===== LIMIT MODAL: 2 NÚT BẰNG NHAU (Lưu trái - Hủy phải) ===== */
.limit-card .glass-modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px 22px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
}
.limit-card .glass-modal-footer .glass-modal-primary-btn,
.limit-card .glass-modal-footer .glass-modal-secondary-btn {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 46px;
    padding: 0 16px;
    border-radius: 14px;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* =====================================================
   STUDENT DETAIL MODAL (ADMIN) — GLASS STYLE
   ===================================================== */

.modal-card.student-detail-card {
    max-width: 460px;
    width: 100%;
    padding: 0;
    height: auto;
    max-height: calc(100dvh - 48px);
    text-align: left;
}

/* ----- Header ----- */
.student-detail-card .sd-header {
    text-align: center;
    padding: 22px 20px 20px;
}

.sd-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sd-title h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    color: #293b70;
    text-align: center;
}

#student-detail-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: left;
}

.sd-mini-text {
    min-width: 0;
    flex: 1;
}

#student-detail-content .td-value {
    overflow-wrap: anywhere;
    line-height: 1.3;
}

/* ----- Body ----- */
.sd-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: linear-gradient(180deg, rgba(244,236,255,.25), rgba(238,249,255,.2));
}

/* ----- Section head ----- */
.sd-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #293b70;
}

.sd-section-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.sd-section-icon svg {
    width: 16px;
    height: 16px;
}

.sd-count {
    margin-left: auto;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.sd-section.classes .sd-section-icon { background: #fff0d2; color: #d98c0f; }
.sd-section.classes .sd-count        { background: rgba(217,140,15,.12); color: #d98c0f; }

.sd-section.teachers .sd-section-icon { background: #ffe5ee; color: #e0457a; }
.sd-section.teachers .sd-count        { background: rgba(224,69,122,.12); color: #e0457a; }

/* ----- Item card ----- */
.sd-item {
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 16px;
    border: 1px solid rgba(121, 106, 255, 0.16);
    background: linear-gradient(135deg, rgba(244,236,255,.55), rgba(238,249,255,.4));
    box-shadow: 0 4px 12px rgba(75, 80, 130, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.sd-item:last-child { margin-bottom: 0; }

.sd-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(121, 106, 255, 0.15);
}

.sd-section.classes .sd-item {
    background: linear-gradient(135deg, rgba(255,233,184,.45), rgba(255,240,210,.3));
    border-color: rgba(217,140,15,.25);
}

.sd-section.teachers .sd-item {
    background: linear-gradient(135deg, rgba(255,229,238,.5), rgba(255,200,220,.3));
    border-color: rgba(224,69,122,.22);
}

.sd-item-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #293b70;
    overflow-wrap: anywhere;
}

.sd-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.sd-chip {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(121, 106, 255, 0.1);
    color: #796AFF;
    overflow-wrap: anywhere;
}

/* ----- Mobile ----- */
@media (max-width: 420px) {
    .modal-card.student-detail-card {
        max-height: calc(100dvh - 32px);
        border-radius: 20px;
    }
    .student-detail-card .sd-header { padding: 18px 16px 16px; }
    .sd-body { padding: 16px; gap: 20px; }
}

/* =====================================================
   ADMIN: TRANG CỐ ĐỊNH (Bài tập + Bài nộp) – CHỈ CUỘN BẢNG
   ===================================================== */

#admin-dashboard.page.active.admin-fixed > .container {
    display: flex;
    flex-direction: column;
}

#admin-dashboard.admin-fixed .header { flex: none; margin-bottom: 12px; }
#admin-dashboard.admin-fixed .dock   { flex: none; align-self: center; margin: 0 auto 14px; }

/* Section chiếm phần còn lại, xếp dọc */
#admin-dashboard.admin-fixed #admin-assignments-section:not(.hidden),
#admin-dashboard.admin-fixed #admin-submissions-section:not(.hidden) {
    flex: none;
    display: flex;
    flex-direction: column;
}

/* Thứ tự: tiêu đề → tìm kiếm/lọc → số lượng → bảng */
#admin-dashboard.admin-fixed .admin-section > .clay-card {
    order: 0; flex: none;
    max-width: 100%;
    margin: 0 0 12px;
    padding: 14px 20px;
}
#admin-dashboard.admin-fixed .admin-section > .clay-card > h2 {
    margin: 0;
    padding-bottom: 0;
    border-bottom: none;
}
#admin-dashboard.admin-fixed .admin-search-wrapper { order: 1; flex: none; margin-bottom: 12px; }
#admin-dashboard.admin-fixed .admin-filter-chips   { margin-bottom: 10px; }
#admin-dashboard.admin-fixed .admin-result-count   { order: 2; flex: none; margin-bottom: 8px; }

/* Vùng bảng: chỉ vùng này cuộn */
#admin-dashboard.admin-fixed .admin-table-container {
    order: 3;
    flex: none;
    overflow: auto;
}
#admin-dashboard.admin-fixed .admin-table { min-width: 900px; }

/* Hàng tiêu đề bảng cố định (đặt nền đặc để dòng cuộn không lộ ra phía sau) */
.admin-table { border-collapse: separate; border-spacing: 0; }
.admin-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f1ecff;
    box-shadow: 0 1px 0 rgba(132, 101, 244, 0.18);
}

/* ----- Trạng thái bài tập ----- */
.status-notdone {
    background: linear-gradient(135deg, rgba(63,143,245,.15), rgba(63,143,245,.08));
    color: #3f8ff5;
    border: 1px solid rgba(63,143,245,.2);
}
.status-deleted {
    background: linear-gradient(135deg, rgba(240,100,145,.15), rgba(240,100,145,.08));
    color: #f06491;
    border: 1px solid rgba(240,100,145,.2);
}

.status-counts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.status-count {
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.status-count.notdone { background: rgba(63,143,245,.12);  color: #3f8ff5; }
.status-count.pending { background: rgba(233,167,44,.14);  color: #d98c0f; }
.status-count.done    { background: rgba(36,149,83,.12);   color: #249553; }

/* ----- Dòng bài đã xoá ----- */
.admin-table tr.row-deleted td { opacity: 0.78; background: rgba(255, 229, 238, 0.25); }
.admin-table tr.row-deleted .row-title { text-decoration: line-through; }
.deleted-meta {
    margin-top: 6px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #596995;
}

/* =====================================================
   ADMIN (Bài tập + Bài nộp) – CHỈNH LẠI HEADER/DOCK, TIÊU ĐỀ KHÔNG KHUNG, HEADER BẢNG GLASS
   ===================================================== */

/* ----- 1. Header + dock giữ vị trí như trang chủ (sát trái, không tự căn giữa) ----- */
#admin-dashboard.page.active.admin-fixed > .container {
    padding: 28px 24px 0 !important;
}

#admin-dashboard.admin-fixed .header {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
}

#admin-dashboard.admin-fixed .dock {
    align-self: flex-start;
    margin: 10px 0 24px;
}

@media (max-width: 768px) {
    #admin-dashboard.admin-fixed .header { margin-bottom: 24px; }
}

/* ----- 2. Bỏ khung của tiêu đề "Bài Tập Trên Hệ Thống" / "Bài Nộp & Điểm" ----- */
#admin-dashboard #admin-assignments-section > .clay-card,
#admin-dashboard #admin-submissions-section > .clay-card {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
    transition: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    padding: 0 4px !important;
    margin: 0 0 14px !important;
}

#admin-dashboard #admin-assignments-section > .clay-card::before,
#admin-dashboard #admin-submissions-section > .clay-card::before {
    display: none !important;
}

#admin-dashboard #admin-assignments-section > .clay-card > h2,
#admin-dashboard #admin-submissions-section > .clay-card > h2 {
    margin: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

#admin-assignments-list,
#admin-submissions-list {
    display: none;
}

/* ----- 3. Hàng tiêu đề bảng: liquid glass, nổi bật vừa phải ----- */
.admin-table thead th {
    color: #293b70;
    font-weight: 800;
    letter-spacing: 0.2px;
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.70) 0%,
            rgba(255, 255, 255, 0.18) 48%,
            rgba(255, 255, 255, 0) 52%),
        linear-gradient(135deg, #d6ccff 0%, #c4dcff 55%, #cdeeff 100%);
    border-bottom: 1px solid rgba(121, 106, 255, 0.28);
    border-right: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 0 rgba(121, 106, 255, 0.18),
        0 6px 12px -6px rgba(91, 104, 175, 0.30);
}

.admin-table thead th:last-child {
    border-right: none;
}

/* =====================================================
   ADMIN – TRANG QUẢN LÝ NGƯỜI DÙNG (giao diện mới)
   ===================================================== */

/* ----- Layout cố định: chỉ bảng cuộn ----- */
#admin-dashboard.admin-fixed #admin-users-section:not(.hidden) {
    flex: none;
    display: flex;
    flex-direction: column;
}

#admin-users-section .um-toolbar        { order: 1; flex: none; }
#admin-users-section .admin-filter-chips { order: 1; flex: none; margin-bottom: 10px; }
#admin-users-section .admin-result-count { order: 2; flex: none; margin-bottom: 8px; }
#admin-dashboard.admin-fixed #admin-users-section .admin-table-container { order: 3; }

/* ----- Tiêu đề không khung, có icon ----- */
#admin-dashboard #admin-users-section > .clay-card {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
    transition: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    padding: 0 4px !important;
    margin: 0 0 14px !important;
}
#admin-dashboard #admin-users-section > .clay-card::before { display: none !important; }

#admin-users-section .clay-card > h2 {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--glass-text);
    position: relative;
    z-index: 1;
}
#admin-users-section .clay-card > h2::before {
    content: '';
    width: 48px; height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E") center / 26px no-repeat,
        linear-gradient(135deg, var(--accent-primary), #5B6EF0);
    box-shadow: 0 4px 12px rgba(121, 106, 255, 0.3);
}

/* ----- Thanh công cụ: tìm kiếm + 2 nút ----- */
.um-toolbar {
    display: flex;
    align-items: stretch;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.um-toolbar .admin-search-bar { flex: 1 1 260px; min-width: 0; }

.um-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 22px;
    min-height: 52px;
    border-radius: 20px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.um-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.um-btn:hover { transform: translateY(-2px); }
.um-btn:active { transform: translateY(0) scale(.98); }
.um-btn:focus-visible { outline: 2px solid #796AFF; outline-offset: 2px; }

.um-btn.primary {
    color: #fff;
    border: 0;
    background: linear-gradient(135deg, #796AFF 0%, #5B8DEF 100%);
    box-shadow: 0 8px 18px rgba(121,106,255,.35), inset 0 1px 1px rgba(255,255,255,.45);
}
.um-btn.primary:hover { box-shadow: 0 12px 24px rgba(121,106,255,.45); }

.um-btn.secondary {
    color: #5B6EF0;
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(244,236,255,.6));
    box-shadow: 0 8px 20px rgba(75,80,130,.10), inset 0 1px 1px rgba(255,255,255,.95);
}
.um-btn.secondary:hover { box-shadow: 0 12px 24px rgba(75,80,130,.16); }

@media (max-width: 768px) {
    .um-toolbar .admin-search-bar { flex-basis: 100%; }
    .um-btn { flex: 1; min-height: 46px; }
}

/* ----- Badge vai trò ----- */
.status-badge.role-admin {
    background: linear-gradient(135deg, rgba(121,106,255,.15), rgba(121,106,255,.08));
    color: #796AFF;
    border: 1px solid rgba(121,106,255,.22);
}
.status-badge.role-teacher {
    background: linear-gradient(135deg, rgba(63,143,245,.15), rgba(63,143,245,.08));
    color: #3f8ff5;
    border: 1px solid rgba(63,143,245,.22);
}
.status-badge.role-student {
    background: linear-gradient(135deg, rgba(233,167,44,.16), rgba(233,167,44,.08));
    color: #d98c0f;
    border: 1px solid rgba(233,167,44,.25);
}

.admin-table tr.row-locked td { opacity: 0.72; background: rgba(255, 229, 238, 0.22); }
.admin-table tr.row-locked .admin-table-actions { opacity: 1; }

/* ----- Các lớp phủ phải nằm trên modal tạo/sửa người dùng ----- */
#modal-overlay   { z-index: 10050 !important; }
.loading-overlay { z-index: 10040; }

/* =====================================================
   MODAL TẠO / SỬA NGƯỜI DÙNG – GLASS
   ===================================================== */
.modal-card.user-form-card {
    max-width: 460px;
    width: 100%;
    padding: 0;
    height: auto;
    max-height: calc(100dvh - 48px);
    text-align: left;
}

.user-form-card .glass-modal-header {
    text-align: center;
    padding: 22px 20px 18px;
}
.uf-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.uf-title h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    color: #293b70;
    text-align: center;
}
.uf-sub {
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: #7184B4;
}

.uf-body {
    flex: 0 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(180deg, rgba(244,236,255,.25), rgba(238,249,255,.2));
}
.uf-body .input-group { margin: 0; gap: 6px; }
.uf-body .input-group label {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 800;
    color: #596995;
}

.user-form-card .clay-input {
    min-height: 48px;
    padding: 10px 16px;
    background: rgba(255,255,255,.92);
    border: 1.5px solid rgba(121,106,255,.22);
    border-radius: 14px;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: #293b70;
    font-weight: 600;
}
.user-form-card .clay-input:hover { background: #fff; box-shadow: none; }
.user-form-card .clay-input:focus {
    background: #fff;
    border-color: #796AFF;
    box-shadow: 0 0 0 3px rgba(121,106,255,.18);
}
.user-form-card #new-user-password { padding-right: 48px !important; }

/* Footer: 2 nút bằng nhau (trái = chính, phải = Hủy) */
.user-form-card .glass-modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px 22px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
}
.user-form-card .glass-modal-footer .glass-modal-primary-btn,
.user-form-card .glass-modal-footer .glass-modal-secondary-btn {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 46px;
    padding: 0 16px;
    border-radius: 14px;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

@media (max-width: 420px) {
    .modal-card.user-form-card { max-height: calc(100dvh - 32px); border-radius: 20px; }
    .uf-body { padding: 16px; }
}

/* =====================================================
   1. TIÊU ĐỀ BẢNG – GRADIENT #43CBFF -> #9708CC (cả 4 trang bảng)
   ===================================================== */
.admin-table thead th {
    color: #fff;
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.62) 0%,
            rgba(255, 255, 255, 0.14) 50%,
            rgba(255, 255, 255, 0) 52%),
        linear-gradient(135deg, #43CBFF 0%, #9708CC 100%);
    border-right: none;
    border-bottom: 1px solid rgba(151, 8, 204, 0.4);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 0 rgba(151, 8, 204, 0.2),
        0 6px 12px -6px rgba(151, 8, 204, 0.3);
}

/* =====================================================
   2. THANH TÌM KIẾM – GỌN HƠN (Lớp, Người dùng, Bài tập, Bài nộp)
   ===================================================== */
.admin-search-bar {
    padding: 0.45rem 0.9rem;
    gap: 0.55rem;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(75, 80, 130, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
.admin-search-bar svg { width: 18px; height: 18px; }
.admin-search-input   { font-size: 0.9rem; min-height: 28px; }
.admin-search-clear   { width: 24px; height: 24px; }
.admin-search-clear svg { width: 14px; height: 14px; }

.admin-search-wrapper { margin-bottom: 1rem; }
.admin-search-wrapper .admin-search-bar { max-width: 380px; }       /* Bài tập, Bài nộp */
.um-toolbar .admin-search-bar { flex: 0 1 380px; max-width: 380px; } /* Lớp, Người dùng */

.admin-suggestions {
    right: auto;
    width: min(380px, 100%);
    top: calc(100% + 6px);
    border-radius: 14px;
}
.suggestion-item { padding: 0.55rem 1rem; font-size: 0.88rem; }

/* 2 nút trên thanh công cụ trang Người dùng: nhỏ lại cho cân với thanh tìm kiếm */
.um-toolbar { gap: 10px; margin-bottom: 10px; }
.um-btn {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 14px;
    font-size: 0.88rem;
    gap: 6px;
}
.um-btn svg { width: 16px; height: 16px; }

@media (max-width: 768px) {
    .um-toolbar .admin-search-bar { flex: 1 1 100%; max-width: none; }
    .admin-search-wrapper .admin-search-bar { max-width: none; }
    .admin-suggestions { width: 100%; }
    .um-btn { flex: 1; min-height: 40px; }
}

/* =====================================================
   3. TRANG QUẢN LÝ LỚP HỌC (admin)
   ===================================================== */
#admin-dashboard.admin-fixed #admin-classes-section:not(.hidden) {
    flex: none;
    display: flex;
    flex-direction: column;
}

#admin-classes-section .um-toolbar        { order: 1; flex: none; }
#admin-classes-section .admin-result-count { order: 2; flex: none; margin-bottom: 8px; }
#admin-dashboard.admin-fixed #admin-classes-section .admin-table-container { order: 3; }
#admin-dashboard.admin-fixed #admin-classes-section .admin-table { min-width: 640px; }

/* Tiêu đề không khung, có icon */
#admin-dashboard #admin-classes-section > .clay-card {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
    transition: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    padding: 0 4px !important;
    margin: 0 0 14px !important;
}
#admin-dashboard #admin-classes-section > .clay-card::before { display: none !important; }

#admin-classes-section .clay-card > h2 {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--glass-text);
    position: relative;
    z-index: 1;
}
#admin-classes-section .clay-card > h2::before {
    content: '';
    width: 48px; height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18'/%3E%3Cpath d='M5 21V7l7-4 7 4v14'/%3E%3Cpath d='M9 21V13h6v8'/%3E%3C/svg%3E") center / 26px no-repeat,
        linear-gradient(135deg, var(--accent-primary), #5B6EF0);
    box-shadow: 0 4px 12px rgba(121, 106, 255, 0.3);
}

/* =====================================================
   4. MODAL CHI TIẾT LỚP (dùng lại khung student-detail-card)
   ===================================================== */
.sd-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    text-align: left;
}
.sd-mini-grid .td-value {
    overflow-wrap: anywhere;
    line-height: 1.3;
}

.sd-section.students .sd-section-icon { background: #ffe5ee; color: #e0457a; }
.sd-section.students .sd-count        { background: rgba(224,69,122,.12); color: #e0457a; }
.sd-section.students .sd-item {
    background: linear-gradient(135deg, rgba(255,229,238,.5), rgba(255,200,220,.3));
    border-color: rgba(224,69,122,.22);
}

.sd-section.assigns .sd-section-icon  { background: #d9f9e8; color: #249553; }
.sd-section.assigns .sd-count         { background: rgba(36,149,83,.12); color: #249553; }
.sd-section.assigns .sd-item {
    background: linear-gradient(135deg, rgba(217,249,232,.5), rgba(190,240,215,.3));
    border-color: rgba(36,149,83,.22);
}

@media (max-width: 420px) {
    .sd-mini-grid { grid-template-columns: 1fr; }
}

/* Ô mã lớp chỉ đọc trong modal Sửa lớp */
.user-form-card .clay-input[readonly] {
    background: rgba(241, 236, 255, 0.7);
    color: #7184B4;
    cursor: not-allowed;
}

/* =====================================================
   ADMIN TABLE HEADER – GRADIENT XANH → TÍM CHẠY LIỀN CẢ DÒNG
   Áp dụng cho cả 4 trang: Lớp học, Người dùng, Bài tập, Bài nộp
   ===================================================== */

/* Gradient đặt trên cả dòng tiêu đề, đồng thời giữ cố định khi cuộn */
.admin-table thead {
    position: sticky;
    top: 0;
    z-index: 3;
    background: linear-gradient(90deg, #43CBFF 0%, #9708CC 100%);
}

/* Các ô tiêu đề trong suốt để lộ gradient của cả dòng */
.admin-table thead th {
    position: static;
    background: transparent;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.2px;
    border-right: none;
    border-bottom: none;
    box-shadow: none;
}

/* =====================================================
   ADMIN: KÉO THANH DOCK LÊN SÁT TIÊU ĐỀ, TĂNG DIỆN TÍCH NỘI DUNG
   ===================================================== */
#admin-dashboard .header,
#admin-dashboard.admin-fixed .header {
    margin: 0 0 6px;
}

#admin-dashboard .dock,
#admin-dashboard.admin-fixed .dock {
    margin: 0 0 12px;
}

/* Trên điện thoại: giữ khoảng cách gọn giống bản desktop */
@media (max-width: 768px) {
    #admin-dashboard .header,
    #admin-dashboard.admin-fixed .header {
        margin-bottom: 6px;
    }
}

/* =====================================================
   TEACHER UI – PHONG CÁCH MÀU TRANG THỐNG KÊ ADMIN
   Áp dụng: Dashboard GV, Quản lý lớp, Người dùng (students-page), Chấm bài
   ===================================================== */

/* ----- Biến màu dùng chung (cũng sửa luôn các var(--cream), --mint... đang bị trống) ----- */
:is(#teacher-dashboard, #students-page, #grading-view) {
    --cream: #f4ecff;
    --mint: #249553;
    --coral: #f06491;
    --text-muted: #7184B4;
    --text-secondary: #596995;
    --text-primary: #293b70;

    /* tông mặc định = tím */
    --tone: #8465f4;
    --tone2: #5B6EF0;
    --tone-soft: #f4ecff;
    --tone-border: rgba(210, 180, 255, 0.65);
}

/* ----- Nền trang giống trang thống kê admin ----- */
:is(#teacher-dashboard, #students-page, #grading-view).page.active {
    margin: -28px -24px -48px;
    padding: 28px 24px 48px;
    min-height: calc(100vh - 76px);
    min-height: calc(100dvh - 76px);
    background:
        radial-gradient(circle at 5% 10%, rgba(210, 195, 255, 0.45), transparent 28%),
        radial-gradient(circle at 95% 5%, rgba(190, 235, 255, 0.55), transparent 32%),
        radial-gradient(circle at 55% 100%, rgba(255, 195, 220, 0.35), transparent 35%),
        linear-gradient(135deg, #f4f0ff 0%, #fffaf5 50%, #eef9ff 100%);
}
@media (max-width: 768px) {
    :is(#teacher-dashboard, #students-page, #grading-view).page.active {
        margin: -20px -16px -32px;
        padding: 20px 16px 32px;
        min-height: calc(100vh - 52px);
        min-height: calc(100dvh - 52px);
    }
}
@media (max-width: 420px) {
    :is(#teacher-dashboard, #students-page, #grading-view).page.active {
        margin: -16px -12px -26px;
        padding: 16px 12px 26px;
        min-height: calc(100vh - 42px);
        min-height: calc(100dvh - 42px);
    }
}

/* ----- Mỗi khối một tông màu (giống stat-card) ----- */
#teacher-dashboard .create-assignment-card { /* tím mặc định */ }

#teacher-dashboard .assignments-card {
    --tone: #3f8ff5; --tone2: #5B8DEF;
    --tone-soft: #eaf4ff; --tone-border: rgba(150, 200, 255, 0.6);
}
#teacher-dashboard .submissions-pending-card {
    --tone: #e9a72c; --tone2: #f4b740;
    --tone-soft: #fff6e4; --tone-border: rgba(255, 210, 130, 0.6);
}
#teacher-dashboard .assignments-history-card {
    --tone: #38C995; --tone2: #249553;
    --tone-soft: #e9fff5; --tone-border: rgba(130, 235, 190, 0.6);
}
#students-page .content-area > .clay-card:nth-child(2) {
    --tone: #e09a14; --tone2: #f4b740;
    --tone-soft: #fff6e4; --tone-border: rgba(255, 210, 130, 0.6);
}
#students-page .content-area > .clay-card:nth-child(3) {
    --tone: #f06491; --tone2: #E982B6;
    --tone-soft: #fff0f4; --tone-border: rgba(255, 170, 200, 0.65);
}
#students-page .content-area > .clay-card:nth-child(4),
#teacher-classes-section .clay-card > .clay-card {
    --tone: #3f8ff5; --tone2: #5B8DEF;
    --tone-soft: #eaf4ff; --tone-border: rgba(150, 200, 255, 0.6);
}
#grading-view { --tone: #8465f4; }

/* ----- Card lớn ----- */
:is(#teacher-dashboard, #students-page) .content-area > .clay-card,
#teacher-classes-section .clay-card,
#teacher-settings-section .clay-card {
    background: linear-gradient(135deg, #ffffff, var(--tone-soft));
    border: 1px solid var(--tone-border);
    border-radius: 30px;
    box-shadow:
        0 18px 32px rgba(75, 80, 130, 0.12),
        0 5px 12px rgba(70, 70, 120, 0.07),
        inset 0 1px 1px rgba(255, 255, 255, 0.95);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
:is(#teacher-dashboard, #students-page) .content-area > .clay-card:hover,
#teacher-classes-section .clay-card:hover,
#teacher-settings-section .clay-card:hover {
    transform: none;
    background: linear-gradient(135deg, #ffffff, var(--tone-soft));
    border-color: var(--tone-border);
    box-shadow:
        0 22px 38px rgba(75, 80, 130, 0.15),
        0 6px 14px rgba(70, 70, 120, 0.08),
        inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

/* Khung form tạo lớp (đang dùng inline var không tồn tại) */
#teacher-classes-section .clay-card > div[style*="padding: 1.5rem"] {
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid var(--tone-border) !important;
    border-radius: 22px !important;
}

/* ----- Tiêu đề card: icon ô vuông gradient + gạch chân nhạt ----- */
:is(#teacher-dashboard, #students-page, #teacher-classes-section, #teacher-settings-section) .clay-card > h2 {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(121, 106, 255, 0.12);
    font-size: 1.4rem;
    font-weight: 900;
    color: #293b70;
}
:is(#teacher-dashboard, #students-page) .clay-card > h2 > svg {
    width: 48px !important;
    height: 48px !important;
    padding: 12px;
    margin: 0 !important;
    flex-shrink: 0;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--tone), var(--tone2));
    box-shadow: 0 4px 12px rgba(75, 80, 130, 0.25);
}
/* Tiêu đề không có icon: thêm thanh màu nhỏ phía trước */
:is(#teacher-dashboard, #students-page, #teacher-classes-section, #teacher-settings-section) .clay-card > h2:not(:has(> svg))::before {
    content: '';
    width: 8px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--tone), var(--tone2));
}

/* ----- Tiêu đề lớp (class-header) ----- */
:is(#teacher-dashboard) .class-header {
    background: #ffffff !important;
    color: #293b70;
    border: 1px solid var(--tone-border);
    border-left: 5px solid var(--tone);
    border-radius: 16px !important;
    box-shadow: 0 4px 12px rgba(75, 80, 130, 0.06);
}
:is(#teacher-dashboard) .class-header svg { color: var(--tone); }

/* ----- Thẻ con: bài tập, học sinh/lớp, phần bài, câu hỏi chấm ----- */
:is(#teacher-dashboard, #students-page, #grading-view) :is(.assignment-item, .user-card, .part-card, .question-card) {
    background: linear-gradient(135deg, #ffffff, var(--tone-soft));
    border: 1px solid var(--tone-border);
    border-left: 4px solid var(--tone);
    border-radius: 22px;
    box-shadow: 0 8px 18px rgba(75, 80, 130, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.95);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
:is(#teacher-dashboard, #students-page, #grading-view) :is(.assignment-item, .user-card, .part-card, .question-card):hover {
    background: linear-gradient(135deg, #ffffff, var(--tone-soft));
    border-color: var(--tone-border);
    border-left-color: var(--tone);
    box-shadow: 0 14px 26px rgba(75, 80, 130, 0.14), inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
:is(#teacher-dashboard, #students-page) :is(.assignment-info, .student-info) h3 { color: #293b70; }
:is(#teacher-dashboard, #students-page) :is(.assignment-info, .student-info) p { color: #596995; }

/* ----- Ô nhập liệu ----- */
:is(#teacher-dashboard, #students-page, #grading-view) :is(.clay-input, .clay-textarea) {
    background: rgba(255, 255, 255, 0.92);
    border: 1.5px solid rgba(121, 106, 255, 0.22);
    border-radius: 14px;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: #293b70;
    font-weight: 600;
}
:is(#teacher-dashboard, #students-page, #grading-view) :is(.clay-input, .clay-textarea):hover {
    background: #ffffff;
    box-shadow: none;
}
:is(#teacher-dashboard, #students-page, #grading-view) :is(.clay-input, .clay-textarea):focus {
    background: #ffffff;
    border-color: #796AFF;
    box-shadow: 0 0 0 3px rgba(121, 106, 255, 0.18);
}
:is(#teacher-dashboard, #students-page, #grading-view) .input-group label { color: #596995; }

/* ----- Nút ----- */
:is(#teacher-dashboard, #students-page, #grading-view) .clay-button.primary:not(#total-score-badge) {
    color: #fff;
    border: 0;
    background: linear-gradient(135deg, #796AFF 0%, #5B8DEF 100%);
    box-shadow: 0 8px 18px rgba(121, 106, 255, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.45);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
:is(#teacher-dashboard, #students-page, #grading-view) .clay-button.primary:not(#total-score-badge):hover {
    background: linear-gradient(135deg, #796AFF 0%, #5B8DEF 100%);
    box-shadow: 0 12px 24px rgba(121, 106, 255, 0.45);
}
:is(#teacher-dashboard, #students-page, #grading-view) .clay-button.secondary:not(#total-score-badge) {
    color: #5B6EF0;
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(244, 236, 255, 0.6));
    box-shadow: 0 8px 20px rgba(75, 80, 130, 0.10), inset 0 1px 1px rgba(255, 255, 255, 0.95);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
:is(#teacher-dashboard, #students-page, #grading-view) .clay-button.secondary:not(#total-score-badge):hover {
    background: linear-gradient(135deg, #ffffff, rgba(238, 231, 255, 0.8));
    box-shadow: 0 12px 24px rgba(75, 80, 130, 0.16);
}

/* Badge tổng điểm */
#teacher-dashboard #total-score-badge {
    background: linear-gradient(135deg, #796AFF, #5B8DEF);
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 18px rgba(121, 106, 255, 0.35);
}

/* ----- Chọn loại câu hỏi ----- */
#teacher-dashboard .type-option {
    background: rgba(255, 255, 255, 0.9);
    border: 1.5px solid rgba(121, 106, 255, 0.22);
    color: #596995;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
#teacher-dashboard .type-option:hover {
    background: #fff;
    border-color: #796AFF;
    box-shadow: 0 6px 14px rgba(121, 106, 255, 0.15);
}
#teacher-dashboard .type-option.selected {
    background: linear-gradient(135deg, #796AFF, #5B8DEF);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(121, 106, 255, 0.35);
}

/* ----- Trang chấm bài ----- */
#grading-view .grading-score-display,
#grading-view #grading-score-display {
    background: linear-gradient(135deg, #ffffff, #f4ecff) !important;
    border: 1px solid rgba(210, 180, 255, 0.65);
    border-radius: 20px !important;
    color: #293b70 !important;
    box-shadow: 0 8px 18px rgba(75, 80, 130, 0.08);
}
#grading-view .part-header {
    background: linear-gradient(135deg, #ffffff, #f4ecff) !important;
    border: 1px solid rgba(210, 180, 255, 0.65);
    border-radius: 20px !important;
}

/* =====================================================
   TEACHER UI – TĂNG ĐỘ ĐẬM MÀU + KHOẢNG CÁCH
   ===================================================== */

/* ----- Bộ màu đậm hơn cho từng khối ----- */
:is(#teacher-dashboard, #students-page, #grading-view) {
    --tone: #7a5cf5;
    --tone2: #5B6EF0;
    --tone-soft: #e6dbff;
    --tone-soft2: #d3c2ff;
    --tone-border: rgba(150, 115, 255, 0.55);
}
#teacher-dashboard .assignments-card {
    --tone: #2f7fe8; --tone2: #4f9bff;
    --tone-soft: #d6e9ff; --tone-soft2: #b8d6ff;
    --tone-border: rgba(80, 150, 245, 0.55);
}
#teacher-dashboard .submissions-pending-card {
    --tone: #e09a14; --tone2: #f5b52e;
    --tone-soft: #ffeec7; --tone-soft2: #ffe09a;
    --tone-border: rgba(240, 175, 50, 0.6);
}
#teacher-dashboard .assignments-history-card {
    --tone: #1fae7c; --tone2: #2fcf98;
    --tone-soft: #cff5e3; --tone-soft2: #a8ebcd;
    --tone-border: rgba(50, 190, 140, 0.55);
}
#students-page .content-area > .clay-card:nth-child(2) {
    --tone: #d98a1f; --tone2: #f0a83c;
    --tone-soft: #ffeccb; --tone-soft2: #ffdca8;
    --tone-border: rgba(240, 170, 60, 0.55);
}
#students-page .content-area > .clay-card:nth-child(3) {
    --tone: #e0457a; --tone2: #f27aa6;
    --tone-soft: #ffdce8; --tone-soft2: #ffc2d6;
    --tone-border: rgba(240, 110, 155, 0.55);
}
#students-page .content-area > .clay-card:nth-child(4),
#teacher-classes-section .clay-card > .clay-card {
    --tone: #2f7fe8; --tone2: #4f9bff;
    --tone-soft: #d6e9ff; --tone-soft2: #b8d6ff;
    --tone-border: rgba(80, 150, 245, 0.55);
}

/* ----- Card lớn: nền đậm hơn, viền rõ hơn ----- */
:is(#teacher-dashboard, #students-page) .content-area > .clay-card,
#teacher-classes-section .clay-card,
#teacher-settings-section .clay-card,
:is(#teacher-dashboard, #students-page) .content-area > .clay-card:hover,
#teacher-classes-section .clay-card:hover,
#teacher-settings-section .clay-card:hover {
    background: linear-gradient(135deg, #ffffff 0%, var(--tone-soft) 100%);
    border: 1.5px solid var(--tone-border);
    box-shadow:
        0 18px 34px rgba(75, 80, 130, 0.16),
        0 5px 12px rgba(70, 70, 120, 0.08),
        inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

/* Đường gạch chân dưới tiêu đề card theo màu tông */
:is(#teacher-dashboard, #students-page, #teacher-classes-section, #teacher-settings-section) .clay-card > h2 {
    border-bottom: 2px solid var(--tone-border);
}

/* ----- Tiêu đề lớp: nền màu đặc, chữ trắng, nổi bật ----- */
#teacher-dashboard .class-header {
    background: linear-gradient(135deg, var(--tone), var(--tone2)) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 18px rgba(75, 80, 130, 0.22);
    margin-top: 2rem !important;
    margin-bottom: 1.25rem !important;
    padding: 0.9rem 1.2rem !important;
    font-size: 1.1rem !important;
}
#teacher-dashboard .class-header:first-child { margin-top: 0.5rem !important; }
#teacher-dashboard .class-header svg { color: #ffffff; }

/* ----- Thẻ con: nền đậm hơn, viền trái dày hơn ----- */
:is(#teacher-dashboard, #students-page, #grading-view) :is(.assignment-item, .user-card, .part-card, .question-card) {
    background: linear-gradient(135deg, #ffffff 0%, var(--tone-soft) 100%);
    border: 1.5px solid var(--tone-border);
    border-left: 6px solid var(--tone);
    box-shadow: 0 10px 22px rgba(75, 80, 130, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
:is(#teacher-dashboard, #students-page, #grading-view) :is(.assignment-item, .user-card, .part-card, .question-card):hover {
    background: linear-gradient(135deg, #ffffff 0%, var(--tone-soft2) 100%);
    border-color: var(--tone-border);
    border-left-color: var(--tone);
    box-shadow: 0 16px 30px rgba(75, 80, 130, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

/* Khoảng cách giữa các bài tập trong cùng lớp */
#teacher-dashboard .assignment-item {
    margin-bottom: 16px;
}

/* ----- Chữ trong thẻ rõ hơn ----- */
:is(#teacher-dashboard, #students-page) :is(.assignment-info, .student-info) h3 {
    color: #1f2d5c;
}
:is(#teacher-dashboard, #students-page) :is(.assignment-info, .student-info) p {
    color: #4a5a8a;
}

/* ----- Nút phụ rõ hơn ----- */
:is(#teacher-dashboard, #students-page, #grading-view) .clay-button.secondary:not(#total-score-badge) {
    color: #4b3fd6;
    background: #ffffff;
    border: 1.5px solid rgba(121, 106, 255, 0.35);
    box-shadow: 0 6px 14px rgba(75, 80, 130, 0.12);
}
:is(#teacher-dashboard, #students-page, #grading-view) .clay-button.secondary:not(#total-score-badge):hover {
    background: #f0eaff;
    border-color: #796AFF;
}

/* ----- Ô nhập liệu viền rõ hơn ----- */
:is(#teacher-dashboard, #students-page, #grading-view) :is(.clay-input, .clay-textarea) {
    border: 1.5px solid rgba(121, 106, 255, 0.4);
}

/* ----- Nền trang đậm hơn một chút ----- */
:is(#teacher-dashboard, #students-page, #grading-view).page.active {
    background:
        radial-gradient(circle at 5% 10%, rgba(190, 170, 255, 0.6), transparent 30%),
        radial-gradient(circle at 95% 5%, rgba(160, 220, 255, 0.7), transparent 34%),
        radial-gradient(circle at 55% 100%, rgba(255, 175, 205, 0.5), transparent 38%),
        linear-gradient(135deg, #ece5ff 0%, #fff4ea 50%, #e3f4ff 100%);
}

/* ===== TẠO BÀI TẬP: TÔNG TÍM RÕ HƠN ===== */
#teacher-dashboard .create-assignment-card,
#teacher-dashboard .create-assignment-card:hover {
    --tone: #7a5cf5;
    --tone2: #5B6EF0;
    --tone-border: rgba(130, 95, 255, 0.6);
    background: linear-gradient(135deg, #efe6ff 0%, #d8c6ff 100%);
    border: 1.5px solid rgba(130, 95, 255, 0.6);
}

/* Các phần bài tập bên trong: nền trắng-tím để nổi trên nền tím */
#teacher-dashboard .create-assignment-card .part-card {
    --tone: #7a5cf5;
    --tone-soft: #f6f1ff;
    --tone-soft2: #ece2ff;
    background: linear-gradient(135deg, #ffffff 0%, #f3ecff 100%);
}

/* ===== SELECT TÙY BIẾN (chọn lớp...) ===== */
@supports (appearance: base-select) {
    select.clay-input,
    select.clay-input::picker(select) {
        appearance: base-select;
    }

    select.clay-input {
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    select.clay-input::picker-icon {
        content: '';
        width: 10px; height: 10px;
        border-right: 2.5px solid #7a5cf5;
        border-bottom: 2.5px solid #7a5cf5;
        transform: rotate(45deg) translateY(-2px);
        transition: transform 0.25s ease;
    }
    select.clay-input:open::picker-icon {
        transform: rotate(225deg) translateY(-2px);
    }

    /* Khung menu */
    select.clay-input::picker(select) {
        margin-top: 8px;
        padding: 8px;
        border: 1.5px solid rgba(130, 95, 255, 0.35);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 18px 40px rgba(75, 80, 130, 0.25);
        max-height: 280px;
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
        transition: opacity 0.2s ease, transform 0.2s ease, display 0.2s allow-discrete, overlay 0.2s allow-discrete;
    }
    select.clay-input:open::picker(select) {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    @starting-style {
        select.clay-input:open::picker(select) {
            opacity: 0;
            transform: translateY(-8px) scale(0.98);
        }
    }

    /* Từng lựa chọn */
    select.clay-input option {
        padding: 12px 14px;
        margin-bottom: 4px;
        border-radius: 12px;
        color: #293b70;
        font-weight: 700;
        cursor: pointer;
        transition: background 0.15s, color 0.15s;
    }
    select.clay-input option::checkmark { display: none; }
    select.clay-input option:hover,
    select.clay-input option:focus {
        background: #ece2ff;
    }
    select.clay-input option:checked {
        background: linear-gradient(135deg, #796AFF, #5B8DEF);
        color: #fff;
    }
    select.clay-input option:disabled { opacity: 0.5; }
}

/* CSS đi kèm cho bản JS fallback */
.cs-wrap { position: relative; width: 100%; }
.cs-native { position: absolute; opacity: 0; pointer-events: none; height: 0; width: 0; }
.cs-btn { display: flex; align-items: center; justify-content: space-between; text-align: left; cursor: pointer; }
.cs-arrow {
    width: 10px; height: 10px; flex-shrink: 0;
    border-right: 2.5px solid #7a5cf5; border-bottom: 2.5px solid #7a5cf5;
    transform: rotate(45deg) translateY(-2px); transition: transform .25s ease;
}
.cs-wrap.open .cs-arrow { transform: rotate(225deg) translateY(-2px); }
.cs-list {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 500;
    max-height: 280px; overflow-y: auto; padding: 8px;
    background: rgba(255,255,255,.97);
    border: 1.5px solid rgba(130,95,255,.35); border-radius: 18px;
    box-shadow: 0 18px 40px rgba(75,80,130,.25);
    animation: csPop .2s ease;
}
@keyframes csPop { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.cs-opt { padding: 12px 14px; margin-bottom: 4px; border-radius: 12px; font-weight: 700; color: #293b70; cursor: pointer; transition: background .15s; }
.cs-opt:hover { background: #ece2ff; }
.cs-opt.selected { background: linear-gradient(135deg, #796AFF, #5B8DEF); color: #fff; }

/* ===== GIÁO VIÊN: BỎ KHOẢNG CÁCH DƯỚI HEADER ===== */
#teacher-dashboard .header,
#students-page .header {
    margin-bottom: 0 !important;
}
#teacher-dashboard .dock,
#students-page .dock {
    margin-top: 6px;   /* muốn sát hơn thì đặt 0 */
}

/* =====================================================
   BẢNG GIÁO VIÊN (Quản lý lớp + Người dùng) – giống admin
   ===================================================== */
#teacher-classes-list,
#students-list {
    overflow: auto;
}
#teacher-classes-list .admin-table { min-width: 480px; }
#students-list .admin-table { min-width: 560px; }

/* Thanh tìm kiếm + số lượng nằm gọn trong card */
:is(#teacher-classes-section, #students-page) .um-toolbar { margin-bottom: 10px; }
:is(#teacher-classes-section, #students-page) .admin-result-count { margin-bottom: 8px; }

/* Nút thao tác không bị theme giáo viên ghi đè */
:is(#teacher-classes-list, #students-list) .admin-action-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(244, 236, 255, 0.4));
    border: 1px solid rgba(255, 255, 255, 0.9);
    color: #596995;
}
:is(#teacher-classes-list, #students-list) .admin-action-btn:hover {
    color: #796AFF;
    border-color: rgba(121, 106, 255, 0.4);
}

/* ===== TRANG KẾT QUẢ: NGẮN THÌ KHÔNG CUỘN ===== */
html { overflow-x: hidden; }

/* Chỉ khi đang ở trang kết quả: bỏ ép chiều cao 100vh, để nội dung tự quyết định */
html:has(#result-view.active) { min-height: 100%; }   /* giữ nền gradient phủ kín màn hình */
body:has(#result-view.active) { min-height: 0; }

/* =====================================================
   HỌC SINH – ĐỒNG BỘ PHONG CÁCH GIÁO VIÊN
   ===================================================== */
#student-dashboard {
    --cream: #f4ecff;
    --mint: #249553;
    --coral: #f06491;
    --text-muted: #7184B4;
    --text-secondary: #596995;
    --text-primary: #293b70;

    --tone: #7a5cf5;
    --tone2: #5B6EF0;
    --tone-soft: #e6dbff;
    --tone-soft2: #d3c2ff;
    --tone-border: rgba(150, 115, 255, 0.55);
}
/* Bài đã nộp: xanh lá */
#student-dashboard .completed-assignments-card {
    --tone: #1fae7c; --tone2: #2fcf98;
    --tone-soft: #cff5e3; --tone-soft2: #a8ebcd;
    --tone-border: rgba(50, 190, 140, 0.55);
}

/* ----- Nền trang ----- */
#student-dashboard.page.active {
    margin: -28px -24px -48px;
    padding: 28px 24px 48px;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 5% 10%, rgba(190, 170, 255, 0.6), transparent 30%),
        radial-gradient(circle at 95% 5%, rgba(160, 220, 255, 0.7), transparent 34%),
        radial-gradient(circle at 55% 100%, rgba(255, 175, 205, 0.5), transparent 38%),
        linear-gradient(135deg, #ece5ff 0%, #fff4ea 50%, #e3f4ff 100%);
}
@media (max-width: 768px) {
    #student-dashboard.page.active { margin: -20px -16px -32px; padding: 20px 16px 32px; }
}
@media (max-width: 420px) {
    #student-dashboard.page.active { margin: -16px -12px -26px; padding: 16px 12px 26px; }
}

/* ----- Header + dock: sát nhau như giáo viên ----- */
#student-dashboard .header { margin-bottom: 0 !important; }
#student-dashboard .dock { margin-top: 6px; }

/* ----- Card lớn ----- */
#student-dashboard .content-area > .clay-card,
#student-dashboard .content-area > .clay-card:hover {
    background: linear-gradient(135deg, #ffffff 0%, var(--tone-soft) 100%);
    border: 1.5px solid var(--tone-border);
    border-radius: 30px;
    transform: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow:
        0 18px 34px rgba(75, 80, 130, 0.16),
        0 5px 12px rgba(70, 70, 120, 0.08),
        inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

/* ----- Tiêu đề card: icon ô vuông gradient ----- */
#student-dashboard .clay-card > h2 {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--tone-border);
    font-size: 1.4rem;
    font-weight: 900;
    color: #293b70;
}
#student-dashboard .clay-card > h2 > svg {
    width: 48px !important;
    height: 48px !important;
    padding: 12px;
    margin: 0 !important;
    flex-shrink: 0;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--tone), var(--tone2));
    box-shadow: 0 4px 12px rgba(75, 80, 130, 0.25);
}

/* ----- Thẻ bài tập ----- */
#student-dashboard .assignment-item {
    background: linear-gradient(135deg, #ffffff 0%, var(--tone-soft) 100%);
    border: 1.5px solid var(--tone-border);
    border-left: 6px solid var(--tone);
    border-radius: 22px;
    margin-bottom: 16px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 10px 22px rgba(75, 80, 130, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
#student-dashboard .assignment-item:hover {
    background: linear-gradient(135deg, #ffffff 0%, var(--tone-soft2) 100%);
    border-color: var(--tone-border);
    border-left-color: var(--tone);
    box-shadow: 0 16px 30px rgba(75, 80, 130, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
#student-dashboard .assignment-info h3 { color: #1f2d5c; }
#student-dashboard .assignment-info p  { color: #4a5a8a; }

/* ----- Nút ----- */
#student-dashboard .clay-button.primary {
    color: #fff;
    border: 0;
    background: linear-gradient(135deg, #796AFF 0%, #5B8DEF 100%);
    box-shadow: 0 8px 18px rgba(121, 106, 255, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.45);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
#student-dashboard .clay-button.primary:hover {
    background: linear-gradient(135deg, #796AFF 0%, #5B8DEF 100%);
    box-shadow: 0 12px 24px rgba(121, 106, 255, 0.45);
}
#student-dashboard .clay-button.secondary {
    color: #4b3fd6;
    background: #ffffff;
    border: 1.5px solid rgba(121, 106, 255, 0.35);
    box-shadow: 0 6px 14px rgba(75, 80, 130, 0.12);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
#student-dashboard .clay-button.secondary:hover {
    background: #f0eaff;
    border-color: #796AFF;
}

/* =====================================================
   MODAL THÔNG BÁO / XÁC NHẬN – phong cách trang Thống kê
   ===================================================== */
.modal-card.notice-card {
    --nt-bg: linear-gradient(135deg, #d4cafe 0%, #c0dcff 55%, #cdf1ff 100%);
    --nt-icon: #8465f4;
    max-width: 400px;
    width: 100%;
    padding: 0;
    text-align: center;
}
.notice-card[data-type="success"] { --nt-bg: linear-gradient(135deg, #d9f9e8 0%, #c8f2e0 50%, #cdf1ff 100%); --nt-icon: #249553; }
.notice-card[data-type="error"]   { --nt-bg: linear-gradient(135deg, #ffe5ee 0%, #ffd6e4 55%, #f4ecff 100%); --nt-icon: #f06491; }
.notice-card[data-type="confirm"] { --nt-bg: linear-gradient(135deg, #fff0d2 0%, #ffe5ee 60%, #f4ecff 100%); --nt-icon: #e9a72c; }
.notice-card[data-type="info"]    { --nt-icon: #3f8ff5; }

.notice-card .notice-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 24px 20px;
    background:
        radial-gradient(circle at 10% 0%, rgba(255,255,255,.6), transparent 42%),
        radial-gradient(circle at 100% 100%, rgba(255,255,255,.45), transparent 45%),
        var(--nt-bg);
}
.notice-icon {
    display: flex; align-items: center; justify-content: center;
    width: 60px; height: 60px;
    border-radius: 50%;
    color: var(--nt-icon);
    background: rgba(255,255,255,.92);
    box-shadow: 0 8px 18px rgba(75,80,130,.14), inset 0 1px 1px rgba(255,255,255,.95);
}
.notice-icon svg { width: 28px; height: 28px; }
.notice-title {
    margin: 0;
    color: #293b70;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.2px;
}
.notice-body {
    padding: 22px 24px;
    background: linear-gradient(180deg, rgba(244,236,255,.25), rgba(238,249,255,.2));
}
.notice-message {
    margin: 0;
    color: #596995;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.65;
    white-space: pre-line;
    word-break: break-word;
}
.notice-card .glass-modal-footer { gap: 12px; padding: 14px 22px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.notice-card .glass-modal-footer button {
    flex: 1; min-width: 0; max-width: none;
    height: 46px; padding: 0 16px;
    border-radius: 14px;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem; font-weight: 800;
}
.notice-card .glass-modal-footer button.hidden { display: none !important; }

/* Màu nút chính theo loại */
.notice-card[data-type="success"] .glass-modal-primary-btn {
    background: linear-gradient(135deg, #249553, #38C995);
    box-shadow: 0 8px 18px rgba(56,201,149,.35), inset 0 1px 1px rgba(255,255,255,.45);
}
.notice-card[data-type="error"] .glass-modal-primary-btn {
    background: linear-gradient(135deg, #f06491, #E982B6);
    box-shadow: 0 8px 18px rgba(240,100,145,.32), inset 0 1px 1px rgba(255,255,255,.45);
}

/* =====================================================
   MODAL ĐỔI / RESET MẬT KHẨU – CHỈ ĐỔI MÀU, GIỮ BỐ CỤC
   ===================================================== */
:is(#change-password-modal, #change-username-modal, #reset-password-modal, #password-reset-warning-modal) .modal-card {
    background: linear-gradient(160deg, rgba(255,255,255,.98), rgba(255,255,255,.88));
    border-color: rgba(255,255,255,.85);
    box-shadow: 0 25px 55px rgba(74,70,120,.12), 0 8px 20px rgba(90,100,150,.08), inset 0 1px 1px rgba(255,255,255,.85);
}
/* Dải màu mỏng phía trên (thay hiệu ứng quét sáng cũ) */
:is(#change-password-modal, #change-username-modal, #reset-password-modal, #password-reset-warning-modal) .modal-card::before,
:is(#change-password-modal, #change-username-modal, #reset-password-modal, #password-reset-warning-modal) .modal-card:hover::before {
    left: 0; top: 0; width: 100%; height: 6px;
    background: linear-gradient(90deg, #796AFF, #5B8DEF, #E982B6);
    transition: none;
}
#password-reset-warning-modal .modal-card::before,
#password-reset-warning-modal .modal-card:hover::before {
    background: linear-gradient(90deg, #ffd27b, #f06491);
}

:is(#change-password-modal, #change-username-modal, #reset-password-modal, #password-reset-warning-modal) .modal-title { color: #293b70; }
:is(#change-password-modal, #change-username-modal, #reset-password-modal, #password-reset-warning-modal) .input-group label { color: #596995; }
:is(#reset-password-modal, #password-reset-warning-modal) .modal-card > p:not([id$="-status"]) { color: #596995; }

:is(#change-password-modal, #change-username-modal, #reset-password-modal) .clay-input {
    background: rgba(255,255,255,.92);
    border-color: rgba(121,106,255,.22);
    color: #293b70;
    box-shadow: none;
}
:is(#change-password-modal, #change-username-modal, #reset-password-modal) .clay-input:focus {
    background: #fff;
    border-color: #796AFF;
    box-shadow: 0 0 0 3px rgba(121,106,255,.18);
}
:is(#change-password-modal, #reset-password-modal) .toggle-password-btn { color: #7184B4; }
:is(#change-password-modal, #reset-password-modal) .toggle-password-btn:hover { color: #796AFF; }

:is(#change-password-modal, #change-username-modal, #reset-password-modal, #password-reset-warning-modal) .modal-card .clay-button.primary {
    background: linear-gradient(135deg, #796AFF, #5B8DEF);
    border-color: rgba(255,255,255,.3);
    color: #fff;
    box-shadow: 0 8px 18px rgba(121,106,255,.35), inset 0 1px 1px rgba(255,255,255,.45);
}
:is(#change-password-modal, #change-username-modal, #reset-password-modal, #password-reset-warning-modal) .modal-card .clay-button.secondary {
    background: rgba(255,255,255,.8);
    border: 1.5px solid rgba(121,106,255,.35);
    color: #5B6EF0;
    box-shadow: none;
}
:is(#change-password-modal, #change-username-modal, #reset-password-modal, #password-reset-warning-modal) .modal-card .clay-button.secondary:hover {
    background: rgba(121,106,255,.08);
}

/* Thông báo nhiều dòng (danh sách mở khoá) */
.notice-message.is-list { text-align: left; }

/* ===== AI REPORT MODAL ===== */
.ai-report-card {
    max-width: 560px;
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.ai-report-card--wide {
    max-width: min(1150px, 96vw);
}

.ai-report-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 24px;
    border-bottom: 1px solid rgba(210,180,255,.25);
    flex-shrink: 0;
}

.ai-report-search {
    position: relative;
    flex: 0 1 380px;
    max-width: 380px;
    width: 100%;
}

.ai-report-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #8a94b8;
    pointer-events: none;
    z-index: 2;
}

.ai-report-search .clay-input {
    width: 100%;
    padding: 6px 14px 6px 36px;
    min-height: 36px;
    height: 36px;
    font-size: .85rem;
}

/* Ô tìm kiếm trong modal báo cáo: viền xám trung tính, bỏ khung/quầng tím của .modal-card .clay-input */
.modal-card .ai-report-search .clay-input,
.ai-report-search .clay-input {
    border: 1.5px solid rgba(90, 100, 140, .35);
    box-shadow: none;
    background: rgba(255, 255, 255, .92);
}

.ns-spark {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 26px;
    min-width: 120px;
}

.ns-spark i {
    display: block;
    width: 7px;
    border-radius: 2px;
    background: linear-gradient(180deg, #796aff, #b9a8ff);
    opacity: .75;
}

.ns-spark i.ns-today {
    background: linear-gradient(180deg, #0ea5a4, #5eead4);
    opacity: 1;
}

.ai-report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f4ecff, #e8f4ff);
    border-bottom: 1px solid rgba(210,180,255,.3);
    flex-shrink: 0;
}

.ai-report-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-report-title {
    margin: 0;
    color: #293b70;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.3px;
}

.ai-report-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.9);
    background: rgba(255,255,255,.7);
    color: #596995;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    flex-shrink: 0;
}

.ai-report-back:hover {
    background: rgba(255,255,255,.95);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(75,80,130,.15);
}

.ai-report-back svg {
    width: 18px;
    height: 18px;
}

.ai-report-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: linear-gradient(180deg, rgba(244,236,255,.15), rgba(238,249,255,.1));
}

.ai-report-section {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255,255,255,.7);
    border: 1px solid rgba(210,180,255,.4);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(75,80,130,.08);
}

.ai-report-section:last-child {
    margin-bottom: 0;
}

.ai-report-section-title {
    margin: 0 0 12px;
    color: #293b70;
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-report-section-title::before {
    content: "";
    width: 4px;
    height: 18px;
    border-radius: 99px;
    background: linear-gradient(#9a89ff, #5b8dff);
}

.ai-report-ok .ai-report-section-title { color: #249553; }
.ai-report-ok .ai-report-section-title::before { background: linear-gradient(#4cd4a0, #249553); }
.ai-report-warn .ai-report-section-title { color: #b7791f; }
.ai-report-warn .ai-report-section-title::before { background: linear-gradient(#ffd27b, #e9a72c); }
.ai-report-idea .ai-report-section-title { color: #8465f4; }
.ai-report-idea .ai-report-section-title::before { background: linear-gradient(#b9a6ff, #8465f4); }

.ai-report-ok { border-left: 3px solid #4cd4a0; }
.ai-report-warn { border-left: 3px solid #ffd27b; }
.ai-report-idea { border-left: 3px solid #b9a6ff; }

.ai-report-section-content {
    color: #596995;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.7;
    white-space: pre-line;
    word-break: break-word;
}

.ai-report-footer { display:flex; flex-direction:column; gap:10px; padding:14px 24px; padding-bottom:max(14px, env(safe-area-inset-bottom));
    background:rgba(255,255,255,.5); border-top:1px solid rgba(210,180,255,.3); flex-shrink:0; }
.ai-report-runs-left { margin:0; text-align:center; font-size:.82rem; font-weight:700; color:#7184B4; }
.ai-report-actions { display:grid; grid-auto-flow:column; grid-auto-columns:1fr; gap:12px; }
.ai-report-actions button { width:100%; min-width:0; height:44px; padding:0 12px; border-radius:14px;
    display:flex; align-items:center; justify-content:center; font-family:'Nunito',sans-serif; font-size:.95rem; font-weight:800;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ai-report-section-content { overflow-wrap:anywhere; }

/* Modal học sinh trong lớp */
#class-students-modal .modal-card.user-form-card { max-width: 600px; }
#class-students-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 2px;
}
.cs-student-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #ffffff, #f4ecff);
    border: 1px solid rgba(210,180,255,.55);
    border-radius: 16px;
    box-shadow: 0 6px 14px rgba(75,80,130,.07);
}
.cs-student-name { display: block; color: #293b70; font-size: 1.05rem; font-weight: 800; }
.cs-student-user { margin: 0; color: #7184B4; font-size: .88rem; font-weight: 600; }
.cs-remove-btn {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border: 0; border-radius: 50%;
    font-size: 1.4rem; line-height: 1;
    color: #f06491; background: #ffe5ee;
    cursor: pointer;
    transition: transform .2s, background .2s, color .2s;
}
.cs-remove-btn:hover {
    background: linear-gradient(135deg, #f06491, #E982B6);
    color: #fff;
    transform: scale(1.08);
}
.cs-empty {
    margin: 0;
    padding: 14px;
    text-align: center;
    color: #7184B4;
    font-weight: 600;
    background: rgba(255,255,255,.7);
    border: 1.5px dashed rgba(121,106,255,.3);
    border-radius: 14px;
}

#class-students-modal .cs-list { max-height: 200px; }

/* =====================================================
   MODAL THOÁT BÀI LÀM
   ===================================================== */
.notice-card[data-type="exit"] { --nt-bg: linear-gradient(135deg, #fff0d2 0%, #ffe5ee 60%, #f4ecff 100%); --nt-icon: #f06491; }
.notice-card[data-type="exit"] .glass-modal-primary-btn {
    background: linear-gradient(135deg, #f4b740, #f06491);
    box-shadow: 0 8px 18px rgba(240,100,145,.32), inset 0 1px 1px rgba(255,255,255,.45);
}

/* =====================================================
   TRANG LÀM BÀI (HỌC SINH) – PHONG CÁCH MỚI
   ===================================================== */
#assignment-view {
    --cream: #f4ecff;
    --mint: #249553;
    --coral: #f06491;
    --text-muted: #7184B4;
    --text-secondary: #596995;
    --text-primary: #293b70;
}
#assignment-view.page.active {
    margin: -28px -24px -48px;
    padding: 28px 24px 48px;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 5% 10%, rgba(190, 170, 255, 0.6), transparent 30%),
        radial-gradient(circle at 95% 5%, rgba(160, 220, 255, 0.7), transparent 34%),
        radial-gradient(circle at 55% 100%, rgba(255, 175, 205, 0.5), transparent 38%),
        linear-gradient(135deg, #ece5ff 0%, #fff4ea 50%, #e3f4ff 100%);
}
@media (max-width: 768px) { #assignment-view.page.active { margin: -20px -16px -32px; padding: 20px 16px 32px; } }
@media (max-width: 420px) { #assignment-view.page.active { margin: -16px -12px -26px; padding: 16px 12px 26px; } }

/* ----- Header + nút thoát ----- */
#assignment-view .header { position: relative; }
#assignment-view .page-title { color: #293b70; padding-right: 56px; }
.av-exit-btn {
    position: absolute; top: 0; right: 0; z-index: 5;
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1.5px solid rgba(121, 106, 255, 0.35);
    background: #fff;
    color: #5B6EF0;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(75, 80, 130, 0.14);
    transition: transform .2s, background .2s, color .2s, box-shadow .2s;
}
.av-exit-btn svg { width: 22px; height: 22px; }
.av-exit-btn:hover {
    background: linear-gradient(135deg, #f4b740, #f06491);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(240, 100, 145, 0.3);
}
.av-exit-btn:active { transform: translateY(1px); }

/* ----- Tiêu đề từng phần ----- */
#assignment-view .part-header {
    background: linear-gradient(135deg, #ffffff, #ece2ff) !important;
    border: 1.5px solid rgba(150, 115, 255, 0.45);
    border-left: 6px solid #7a5cf5;
    border-radius: 20px !important;
    box-shadow: 0 8px 18px rgba(75, 80, 130, 0.1);
}
#assignment-view .part-header h3 { color: #293b70; }

/* ----- Thẻ câu hỏi ----- */
#assignment-view .question-card,
#assignment-view .question-card:hover {
    background: linear-gradient(135deg, #ffffff, #f6f1ff);
    border: 1.5px solid rgba(150, 115, 255, 0.4);
    border-left: 6px solid #7a5cf5;
    border-radius: 26px;
    box-shadow: 0 12px 26px rgba(75, 80, 130, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.95);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
#assignment-view .question-card:hover { box-shadow: 0 16px 30px rgba(75, 80, 130, 0.17), inset 0 1px 1px rgba(255, 255, 255, 0.95); }
#assignment-view .question-card::before { display: none; }
#assignment-view .question-number {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #796AFF, #5B8DEF);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(121, 106, 255, 0.3);
}
#assignment-view .question-text { color: #293b70; }
#assignment-view .scroll-to-part-btn {
    color: #4b3fd6;
    background: #fff;
    border: 1.5px solid rgba(121, 106, 255, 0.35);
    box-shadow: 0 4px 10px rgba(75, 80, 130, 0.1);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
#assignment-view .scroll-to-part-btn:hover { background: #f0eaff; border-color: #796AFF; }
#assignment-view .scroll-to-part-btn::before { display: none; }

/* ----- Trắc nghiệm ----- */
#assignment-view .option-card {
    color: #293b70;
    background: #fff;
    border: 1.5px solid rgba(121, 106, 255, 0.25);
    border-radius: 16px;
    box-shadow: 0 4px 10px rgba(75, 80, 130, 0.07);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
#assignment-view .option-card::before { display: none; }
#assignment-view .option-card:hover {
    background: #f0eaff;
    border-color: #796AFF;
    box-shadow: 0 10px 20px rgba(121, 106, 255, 0.18);
}
#assignment-view .option-card.selected {
    background: linear-gradient(135deg, #796AFF, #5B8DEF);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(121, 106, 255, 0.2), 0 10px 22px rgba(121, 106, 255, 0.35);
}
#assignment-view .option-letter {
    background: #ece2ff;
    color: #5B6EF0;
    border: 0;
    box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
#assignment-view .option-card.selected .option-letter { background: rgba(255, 255, 255, 0.25); color: #fff; }

/* ----- Ô nhập: điền khuyết, trả lời ngắn, tìm lỗi sai ----- */
#assignment-view :is(.blank-input, .short-answer-input, .clay-input) {
    color: #293b70;
    background: #fff;
    border: 1.5px solid rgba(121, 106, 255, 0.3);
    box-shadow: none;
    font-weight: 600;
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
#assignment-view :is(.blank-input, .short-answer-input, .clay-input):hover {
    background: #fbf9ff;
    border-color: rgba(121, 106, 255, 0.55);
    box-shadow: none;
}
#assignment-view :is(.blank-input, .short-answer-input, .clay-input):focus {
    background: #fff;
    border-color: #796AFF;
    box-shadow: 0 0 0 3px rgba(121, 106, 255, 0.2);
    outline: none;
}
#assignment-view .input-group label { color: #596995; }

/* ----- Đúng / Sai ----- */
#assignment-view .tf-option {
    color: #293b70;
    background: #fff;
    border: 1.5px solid rgba(121, 106, 255, 0.25);
    border-radius: 18px;
    box-shadow: 0 4px 10px rgba(75, 80, 130, 0.07);
    letter-spacing: .5px;
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
#assignment-view .tf-option::before { display: none; }
#assignment-view .tf-option.true  { color: #1f7f48; background: linear-gradient(135deg, #fff, #e9fff5); border-color: rgba(56, 201, 149, 0.5); }
#assignment-view .tf-option.false { color: #c2415f; background: linear-gradient(135deg, #fff, #fff0f4); border-color: rgba(240, 100, 145, 0.5); }
#assignment-view .tf-option.true:hover  { background: linear-gradient(135deg, #fff, #d9f9e8); border-color: #38C995; box-shadow: 0 10px 20px rgba(56, 201, 149, 0.25); }
#assignment-view .tf-option.false:hover { background: linear-gradient(135deg, #fff, #ffe5ee); border-color: #f06491; box-shadow: 0 10px 20px rgba(240, 100, 145, 0.25); }
#assignment-view .tf-option.true.selected {
    color: #fff;
    background: linear-gradient(135deg, #249553, #38C995);
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(56, 201, 149, 0.22), 0 10px 22px rgba(56, 201, 149, 0.35);
}
#assignment-view .tf-option.false.selected {
    color: #fff;
    background: linear-gradient(135deg, #f06491, #E982B6);
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(240, 100, 145, 0.22), 0 10px 22px rgba(240, 100, 145, 0.35);
}

/* ----- Sắp xếp câu ----- */
#assignment-view .word-bank {
    background: #fff;
    border: 1.5px dashed rgba(121, 106, 255, 0.4);
    box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
#assignment-view .sentence-area {
    background: linear-gradient(135deg, #f3fffa, #e4fbf1);
    border: 1.5px dashed rgba(56, 201, 149, 0.55);
    box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
#assignment-view .word-chip {
    color: #293b70;
    background: #fff;
    border: 1.5px solid rgba(121, 106, 255, 0.3);
    box-shadow: 0 4px 10px rgba(75, 80, 130, 0.1);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
#assignment-view .word-chip::before { display: none; }
#assignment-view .word-chip:hover { background: #f0eaff; border-color: #796AFF; box-shadow: 0 8px 16px rgba(121, 106, 255, 0.2); }

/* ----- Nút nộp bài / làm lại ----- */
#assignment-view .clay-button.primary {
    color: #fff;
    border: 0;
    background: linear-gradient(135deg, #796AFF 0%, #5B8DEF 100%);
    box-shadow: 0 8px 18px rgba(121, 106, 255, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.45);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
#assignment-view .clay-button.primary:hover {
    background: linear-gradient(135deg, #796AFF 0%, #5B8DEF 100%);
    box-shadow: 0 12px 24px rgba(121, 106, 255, 0.45);
}
#assignment-view .clay-button.secondary {
    color: #4b3fd6;
    background: #fff;
    border: 1.5px solid rgba(121, 106, 255, 0.35);
    box-shadow: 0 6px 14px rgba(75, 80, 130, 0.12);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
#assignment-view .clay-button.secondary:hover { background: #f0eaff; border-color: #796AFF; }

/* ----- Dòng tổng số câu cuối bài ----- */
#assignment-view .assignment-footer {
    background: linear-gradient(135deg, #fff, #f4ecff) !important;
    border: 1.5px solid rgba(150, 115, 255, 0.4);
    border-radius: 20px !important;
    color: #596995 !important;
    box-shadow: 0 8px 18px rgba(75, 80, 130, 0.08);
}

/* ----- MOBILE: ĐÚNG / SAI nằm 1 hàng (laptop giữ nguyên) ----- */
@media (max-width: 768px) {
    #assignment-view .true-false-options { flex-wrap: nowrap; gap: .75rem; }
    #assignment-view .tf-option { min-width: 0; padding: 1rem .5rem; }
}

/* ----- Đếm nộp ----- */
#teacher-dashboard .assignment-info p.assign-progress {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: .85rem;
    font-weight: 800;
    color: #5B6EF0;
}
#teacher-dashboard .assign-progress strong {
    padding: 1px 10px;
    border-radius: 999px;
    background: #ece2ff;
    color: #5B6EF0;
}

/* ----- Dòng chào học sinh ----- */

/* ===== CLEAR DATA MODAL ===== */
.cd-list { display: flex; flex-direction: column; gap: 14px; }

.cd-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff8e6;
    border: 1.5px solid rgba(255,195,90,.45);
    border-radius: 20px;
    box-shadow: 0 6px 16px rgba(75,80,130,.08);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.cd-option:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(75,80,130,.12); }
.cd-option.cd-students { background: #fff0f5; border-color: rgba(255,140,180,.45); }
.cd-option.cd-classes  { background: #eef6ff; border-color: rgba(110,175,255,.45); }
.cd-option:has(.cd-check:checked) {
    border-color: #796AFF;
    box-shadow: 0 0 0 3px rgba(121,106,255,.18), 0 10px 20px rgba(75,80,130,.12);
}

.cd-check { position: absolute; opacity: 0; pointer-events: none; }

.cd-icon {
    flex: 0 0 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.85);
    border-radius: 14px;
}
.cd-icon svg { width: 20px; height: 20px; }

.cd-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cd-text strong { font-size: 14px; font-weight: 800; color: #293b70; }
.cd-text small { font-size: 12px; line-height: 1.35; color: #7184B4; }

.cd-tick {
    flex: 0 0 22px;
    height: 22px;
    position: relative;
    background: #fff;
    border: 2px solid rgba(121,106,255,.35);
    border-radius: 50%;
    transition: all .15s;
}
.cd-check:checked ~ .cd-tick {
    background: linear-gradient(135deg, #796AFF, #5B8DEF);
    border-color: transparent;
}
.cd-check:checked ~ .cd-tick::after {
    content: '';
    position: absolute;
    left: 6px; top: 2px;
    width: 5px; height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.cd-check:focus-visible ~ .cd-tick { outline: 2px solid #796AFF; outline-offset: 2px; }

.glass-modal-primary-btn.cd-danger-btn {
    background: linear-gradient(135deg, #ff6b8a 0%, #e0457a 100%);
    box-shadow: 0 8px 18px rgba(224,69,122,.35), inset 0 1px 1px rgba(255,255,255,.45);
}
.glass-modal-primary-btn.cd-danger-btn:hover { box-shadow: 0 12px 24px rgba(224,69,122,.45); }

.status-count.removed { background: rgba(240,100,145,.12); color: #f06491; }

/* ================================================================
   ADMIN DETAIL MODAL - PASTEL GRADIENT STYLE
   ================================================================ */

/* ----- Modal overlay ----- */
.adm-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(41, 59, 112, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    animation: admFadeIn 0.25s ease forwards;
}

@keyframes admFadeIn {
    to { opacity: 1; }
}

.adm-modal.hidden {
    display: none;
}

/* ----- Modal card ----- */
.adm-card {
    display: flex;
    flex-direction: column;
    max-width: 650px;
    width: 90%;
    max-height: 88vh;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255,248,240,0.98), rgba(255,240,245,0.92), rgba(248,240,255,0.88));
    box-shadow: 0 24px 48px rgba(75, 80, 130, 0.18), 0 4px 10px rgba(70, 70, 120, 0.05), inset 0 1px 1px rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    transform: scale(0.95);
    animation: admScaleIn 0.25s ease forwards;
}

@keyframes admScaleIn {
    to { transform: scale(1); }
}

@media (max-width: 768px) {
    .adm-card {
        width: 92vw;
        max-height: 88vh;
    }
}

/* ----- Header ----- */
.adm-header {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(135deg, rgba(255,248,240,0.7), rgba(255,240,245,0.5), rgba(248,240,255,0.4));
    border-bottom: 1px solid rgba(132, 101, 244, 0.12);
}

.adm-header-info {
    flex: 1;
}

.adm-header h3 {
    margin: 0 0 0.75rem 0;
    color: #293b70;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.3;
}

.adm-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.adm-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.adm-badge svg {
    width: 14px;
    height: 14px;
}

.adm-badge.purple {
    background: rgba(132, 101, 244, 0.15);
    color: #8465f4;
    border: 1px solid rgba(132, 101, 244, 0.25);
}

.adm-badge.blue {
    background: rgba(63, 143, 245, 0.15);
    color: #3f8ff5;
    border: 1px solid rgba(63, 143, 245, 0.25);
}

.adm-badge.green {
    background: rgba(36, 149, 83, 0.15);
    color: #249553;
    border: 1px solid rgba(36, 149, 83, 0.25);
}

.adm-badge.orange {
    background: rgba(233, 167, 44, 0.15);
    color: #e9a72c;
    border: 1px solid rgba(233, 167, 44, 0.25);
}

.adm-badge.pink {
    background: rgba(240, 100, 145, 0.15);
    color: #f06491;
    border: 1px solid rgba(240, 100, 145, 0.25);
}

/* Close button */
.adm-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(132, 101, 244, 0.25);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    color: #8465f4;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 1rem;
}

.adm-close-btn:hover {
    background: linear-gradient(135deg, #8465f4, #9d7eff);
    color: white;
    border-color: transparent;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(132, 101, 244, 0.35);
}

.adm-close-btn svg {
    width: 20px;
    height: 20px;
}

/* ----- Body ----- */
.adm-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(180deg, rgba(255,248,240,0.05), rgba(255,240,245,0.03));
}

/* ----- Part card ----- */
.adm-part-card {
    margin-bottom: 1.25rem;
    border-radius: 20px;
    border: 1px solid rgba(132, 101, 244, 0.12);
    background: linear-gradient(135deg, rgba(255,255,255,0.85), rgba(244,236,255,0.15));
    box-shadow: 0 4px 12px rgba(75, 80, 130, 0.06);
    overflow: hidden;
}

.adm-part-header {
    padding: 0.85rem 1.25rem;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(238, 231, 255, 0.5), rgba(244, 236, 255, 0.25));
    color: #293b70;
    border-bottom: 1px solid rgba(132, 101, 244, 0.1);
}

.adm-part-type-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.adm-part-body {
    padding: 0.75rem 1rem;
    background: transparent;
}

/* ----- Question card ----- */
.adm-q-card {
    padding: 0.85rem 1rem;
    margin: 0.5rem 0;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(244,236,255,0.08));
    border: 1px solid rgba(132, 101, 244, 0.08);
    box-shadow: 0 2px 8px rgba(75, 80, 130, 0.04);
    border-left: 3px solid transparent;
}

.adm-q-card.type-multiple-choice { border-left-color: #5B8DEF; }
.adm-q-card.type-fill-blank { border-left-color: #F4A261; }
.adm-q-card.type-true-false { border-left-color: #2A9D8F; }
.adm-q-card.type-short-answer { border-left-color: #9B5DE5; }
.adm-q-card.type-sentence-ordering { border-left-color: #06D6A0; }
.adm-q-card.type-find-mistake { border-left-color: #E76F51; }

.adm-q-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #8465f4, #9d7eff);
    color: white;
    border: none;
    box-shadow: 0 2px 6px rgba(132, 101, 244, 0.25);
}

.adm-q-text {
    font-size: 0.92rem;
    color: #293b70;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* ----- Correct answer ----- */
.adm-option {
    padding: 0.3rem 0.5rem;
    margin: 0.2rem 0;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #596995;
}

.adm-option.is-correct {
    background: rgba(56, 201, 149, 0.15);
    color: #38C995;
    font-weight: 700;
}

.adm-answer {
    padding: 0.35rem 0.5rem;
    margin: 0.25rem 0;
    border-radius: 8px;
    background: rgba(56, 201, 149, 0.12);
    color: #38C995;
    font-size: 0.88rem;
    font-weight: 600;
}

.adm-word-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.adm-word-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(6, 214, 160, 0.15);
    color: #06D6A0;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid rgba(6, 214, 160, 0.2);
}

/* ----- Submission detail ----- */
.adm-q-card.correct {
    background: linear-gradient(135deg, rgba(56, 201, 149, 0.12), rgba(56, 201, 149, 0.05));
    border-color: rgba(56, 201, 149, 0.2);
}

.adm-q-card.wrong {
    background: linear-gradient(135deg, rgba(233, 130, 182, 0.12), rgba(233, 130, 182, 0.05));
    border-color: rgba(233, 130, 182, 0.2);
}

.adm-result-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.adm-result-badge.correct {
    background: rgba(56, 201, 149, 0.15);
    color: #38C995;
    border: 1px solid rgba(56, 201, 149, 0.25);
}

.adm-result-badge.wrong {
    background: rgba(233, 130, 182, 0.15);
    color: #E982B6;
    border: 1px solid rgba(233, 130, 182, 0.25);
}

.adm-score {
    font-size: 0.85rem;
    font-weight: 700;
    color: #596995;
}

/* ----- Feedback section ----- */
.adm-feedback-card {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(238, 231, 255, 0.3), rgba(244, 236, 255, 0.15));
    border: 1px solid rgba(132, 101, 244, 0.15);
}

.adm-feedback-header {
    font-weight: 700;
    font-size: 0.95rem;
    color: #8465f4;
    margin-bottom: 0.5rem;
}

.adm-feedback-text {
    font-size: 0.9rem;
    color: #293b70;
    line-height: 1.5;
}


#student-dashboard-title { white-space: nowrap; max-width: 100%; }

.inline-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: -0.15em;
    margin-left: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: #796AFF;
    font-size: inherit;
    line-height: 1;
    cursor: pointer;
    transition: color .15s ease, transform .15s ease;
}
.inline-copy-btn svg { width: 1em; height: 1em; }
.inline-copy-btn:hover { transform: scale(1.1); }
.inline-copy-btn.copied { color: #2ecc71; }

/* ===== MODAL QUY TẮC + PROMPT AI ===== */
.modal-card.user-form-card.fg-card { max-width: 620px; }

.fg-section {
    background: rgba(255,255,255,.78);
    border: 1.5px solid rgba(121,106,255,.15);
    border-radius: 18px;
    padding: 16px;
}
.fg-heading {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 800;
    color: #293b70;
    display: flex;
    align-items: center;
    gap: 8px;
}
.fg-heading::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #796AFF, #5B8DEF);
}
.fg-rule {
    margin: 0 0 10px;
    color: #596995;
    font-weight: 600;
    line-height: 1.6;
}
.fg-example {
    margin: 0;
    padding: 12px 14px;
    background: rgba(121,106,255,.07);
    border: 1.5px dashed rgba(121,106,255,.35);
    border-radius: 14px;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 600;
    color: #293b70;
    white-space: pre-wrap;
    word-break: break-word;
}
.fg-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}
.fg-row3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}
.fg-prompt {
    width: 100%;
    min-height: 190px;
    padding: 12px 14px;
    background: linear-gradient(#ffffff,#ffffff) padding-box,
        linear-gradient(135deg,#d4cafe 0%,#c0dcff 55%,#cdf1ff 100%) border-box;
    border: 2px solid transparent;
    border-radius: 14px;
    color: #293b70;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.55;
    resize: vertical;
    box-sizing: border-box;
    box-shadow: none;
}
@media (max-width: 600px) {
    .fg-row3 { grid-template-columns: 1fr; }
}

/* =====================================================
   HIỆU ỨNG MỞ / ĐÓNG MƯỢT CHO TOÀN BỘ MODAL
   Chỉ animate opacity + transform (chạy trên GPU)
   ===================================================== */
:root {
    --modal-in: .22s;
    --modal-out: .16s;
    --modal-ease: cubic-bezier(.22, 1, .36, 1);
}

/* 1) Overlay luôn được render; trạng thái ẩn = trong suốt + không bấm được */
.modal-overlay,
.modal-overlay.hidden,
.adm-modal,
.adm-modal.hidden {
    display: flex !important;     /* thắng .hidden { display:none !important } */
}
.modal-overlay.hidden,
.modal-overlay.is-closing,
.adm-modal.hidden,
.adm-modal.is-closing {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--modal-out) ease, visibility 0s linear var(--modal-out);
}

/* 2) Hiệu ứng MỞ (animation chạy cả khi bỏ class hidden lẫn khi modal được chèn mới bằng JS) */
.modal-overlay:not(.hidden):not(.is-closing),
.adm-modal:not(.hidden):not(.is-closing) {
    opacity: 1;
    animation: mdOverlayIn var(--modal-in) ease both;
}
.modal-overlay:not(.hidden):not(.is-closing) .modal-card,
.modal-overlay:not(.hidden):not(.is-closing) .glass-modal-card,
.adm-modal:not(.hidden):not(.is-closing) .adm-card {
    animation: mdCardIn var(--modal-in) var(--modal-ease) both;
}

/* 3) Hiệu ứng ĐÓNG của card (thu nhỏ nhẹ + trượt xuống) */
.modal-overlay .modal-card,
.modal-overlay .glass-modal-card,
.adm-modal .adm-card {
    transition: transform var(--modal-out) ease, opacity var(--modal-out) ease;
}
.modal-overlay.hidden .modal-card,
.modal-overlay.hidden .glass-modal-card,
.modal-overlay.is-closing .modal-card,
.modal-overlay.is-closing .glass-modal-card,
.adm-modal.hidden .adm-card,
.adm-modal.is-closing .adm-card {
    opacity: 0;
    transform: scale(.96) translateY(8px);
}

/* 4) Ghi đè animation cũ của adm-modal (cũ: animation forwards khiến nó không đóng mượt được) */
.adm-modal { opacity: 1; animation: none; }
.adm-modal .adm-card { transform: none; animation: none; }

/* 5) Loading overlay: fade nhanh hơn và thật sự chạy (cũ bị display:none chặn) */
.loading-overlay,
.loading-overlay.hidden { display: flex !important; }
.loading-overlay { transition: opacity .2s ease, visibility 0s linear 0s; }
.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility 0s linear .2s;
}

@keyframes mdOverlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes mdCardIn {
    from { opacity: 0; transform: scale(.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .modal-overlay, .adm-modal, .loading-overlay,
    .modal-overlay .modal-card, .modal-overlay .glass-modal-card, .adm-card {
        animation: none !important;
        transition-duration: .01s !important;
    }
}

/* ===== Dï¿½NG " CHUA Cï¿½ D? LI?U\ TRONG B?NG ===== */
.admin-table tbody tr.admin-table-empty-row:hover { background: transparent; }
.admin-table-empty-row td {
 padding: 2.4rem 1.25rem;
 text-align: center;
 border-bottom: none;
}
.admin-table-empty {
 display: inline-flex;
 align-items: center;
 gap: 10px;
 color: #7184B4;
 font-weight: 700;
}
.admin-table-empty svg {
 width: 22px;
 height: 22px;
 flex-shrink: 0;
 opacity: .75;
}

/* ===== Nï¿½T AI + K?T QU? TRONG MODAL PROMPT ===== */
.user-form-card.fg-card .glass-modal-footer { grid-template-columns: 1fr; }

.fg-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}
.fg-action-btn {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 12px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    box-sizing: border-box;
}
.fg-action-btn svg { width: 1.1em; height: 1.1em; flex-shrink: 0; }

.fg-quota {
    margin: 10px 0 0;
    text-align: center;
    font-size: .85rem;
    font-weight: 700;
    color: #7184B4;
}
.fg-warn {
    margin: 8px 0 0;
    font-size: .85rem;
    font-weight: 700;
    color: #d98c0f;
}

.glass-modal-primary-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
/* Khi loading: icon AI đứng yên, chữ nhảy từng ký tự */
.fg-action-btn.is-loading:disabled { opacity: 1; cursor: progress; }
.fg-bounce-char {
    display: inline-block;
    animation: fgBounce .9s ease-in-out infinite;
}
@keyframes fgBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%           { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
    .fg-bounce-char { animation: none; }
}

@media (max-width: 420px) {
    .fg-actions { grid-template-columns: 1fr; }
}

/* ï¿½ " Lu?t AI/ngï¿½y\ trong modal gi?i h?n: chi?m tr?n 1 hï¿½ng */
.limit-field.limit-field-ai {
 grid-column: 1 / -1;
 background: #f4f0ff;
 border-color: rgba(121,106,255,.4);
}
.limit-field.limit-field-ai .limit-input { border-color: rgba(121,106,255,.45); }
.limit-field.limit-field-ai .limit-input:focus {
 border-color: #796AFF;
 box-shadow: 0 0 0 3px rgba(121,106,255,.2);
}

/* ===== Nï¿½T " AI T?O\ C?NH NHï¿½N N?I DUNG Cï¿½U H?I ===== */
.content-label-row {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 12px;
 margin-bottom: .5rem;
}
.content-label-row label { margin: 0; }

.ai-create-chip {
 display: inline-flex;
 align-items: center;
 gap: 6px;
 height: 34px;
 padding: 0 14px;
 border: 0;
 border-radius: 999px;
 cursor: pointer;
 font-family: 'Nunito', sans-serif;
 font-size: .85rem;
 font-weight: 800;
 color: #fff;
 background: linear-gradient(135deg, #9a89ff 0%, #796AFF 50%, #5b8dff 100%);
 box-shadow: 0 6px 14px rgba(121,106,255,.35), inset 0 1px 0 rgba(255,255,255,.4);
 transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.ai-create-chip svg { width: 16px; height: 16px; flex-shrink: 0; }
.ai-create-chip:hover {
 transform: translateY(-1px);
 filter: brightness(1.06);
 box-shadow: 0 9px 18px rgba(121,106,255,.45), inset 0 1px 0 rgba(255,255,255,.4);
}
.ai-create-chip:hover svg { animation: aiChipTwinkle .8s ease-in-out infinite; }
.ai-create-chip:active { transform: scale(.96); }
@keyframes aiChipTwinkle {
 0%, 100% { transform: scale(1) rotate(0); }
 50% { transform: scale(1.22) rotate(14deg); }
}

/* ===== THï¿½NG Bï¿½O: ch?m d? + danh sï¿½ch ===== */
.notif-dot {
  position: absolute; top: calc(50% - 15px); left: calc(50% + 5px);
  width: 10px; height: 10px; border-radius: 50%;
  background: #ff3b30; border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(255,59,48,.6);
  animation: notifPulse 1.8s infinite;
  pointer-events: none; z-index: 12;
}
.notif-dot.hidden { display: none; }
@keyframes notifPulse {
  70% { box-shadow: 0 0 0 7px rgba(255,59,48,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,59,48,0); }
}

/* ===== TRANG THÔNG BÁO (glass) ===== */
#notifications-page .header { position:relative; justify-content:flex-start; min-height:44px; margin-bottom:12px; }
#notifications-page .av-exit-btn { position:static; flex-shrink:0; }
.notif-panel { min-height: 0; padding: 32px 36px; }

.notif-head { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:20px; position:relative; z-index:1; }
.notif-head-title { display:flex; align-items:center; gap:16px; }
.notif-head-icon { width:56px; height:56px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#8465f4; background:#eee7ff; flex-shrink:0; }
.notif-head-icon svg { width:28px; height:28px; }
.notif-sub { margin:4px 0 0; color:#596995; font-weight:600; font-size:.95rem; }

.notif-tabs { position:relative; display:inline-flex; gap:4px; padding:4px; margin-bottom:6px; max-width:100%; overflow-x:auto;
    background:rgba(255,255,255,.6); border:1px solid rgba(255,255,255,.85); border-radius:999px;
    box-shadow:inset 0 1px 2px rgba(0,0,0,.03); z-index:1; scrollbar-width:none; }
.notif-tabs::-webkit-scrollbar { display:none; }
.notif-tab { position:relative; z-index:1; height:36px; padding:0 16px; border:0; border-radius:999px; background:transparent;
    color:#596995; font:800 .85rem 'Nunito',sans-serif; white-space:nowrap; cursor:pointer;
    display:inline-flex; align-items:center; gap:6px; transition:color .25s ease; }
.notif-tab.active { color:#fff; background:transparent; box-shadow:none; }
.notif-tab:hover:not(.active) { background:rgba(255,255,255,.5); transform:none; }
.notif-tab-count { font-style:normal; min-width:18px; padding:0 6px; border-radius:99px; font-size:.72rem; line-height:18px; background:rgba(0,0,0,.08); }
.notif-tab-count:empty { display:none; }
.notif-tab.active .notif-tab-count { background:rgba(255,255,255,.3); }

.notif-tab-indicator { position:absolute; top:4px; bottom:4px; left:0; z-index:0; border-radius:999px;
    width:var(--w,0); transform:translateX(var(--x,0));
    transition:transform .45s cubic-bezier(.3,1.1,.4,1), width .45s cubic-bezier(.3,1.1,.4,1), background-color .3s, box-shadow .3s;
    background-color:#796AFF; background-image:linear-gradient(135deg, rgba(255,255,255,.28), transparent);
    box-shadow:0 4px 12px rgba(121,106,255,.4); }
.notif-tab-indicator[data-tone="pink"]  { background-color:#f06491; box-shadow:0 4px 12px rgba(240,100,145,.4); }
.notif-tab-indicator[data-tone="green"] { background-color:#2fb577; box-shadow:0 4px 12px rgba(56,201,149,.4); }
.notif-tab-indicator[data-tone="amber"] { background-color:#e9a72c; box-shadow:0 4px 12px rgba(233,167,44,.4); }
.notif-tab-indicator[data-tone="blue"]  { background-color:#3f8ff5; box-shadow:0 4px 12px rgba(63,143,245,.4); }

#notif-list { will-change:transform, opacity; }
#notif-list.notif-out-left  { animation:notifOutL .18s ease forwards; }
#notif-list.notif-out-right { animation:notifOutR .18s ease forwards; }
#notif-list.notif-in-left   { animation:notifInL .35s cubic-bezier(.22,1,.36,1) both; }
#notif-list.notif-in-right  { animation:notifInR .35s cubic-bezier(.22,1,.36,1) both; }
#notif-list.notif-in-left .notif-item, #notif-list.notif-in-right .notif-item { animation:none; }
@keyframes notifOutL { to { opacity:0; transform:translateX(-40px); } }
@keyframes notifOutR { to { opacity:0; transform:translateX(40px); } }
@keyframes notifInL  { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:none; } }
@keyframes notifInR  { from { opacity:0; transform:translateX(-40px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce) { .notif-tab-indicator, #notif-list { transition:none !important; animation:none !important; } }

.notif-group { display:flex; align-items:center; gap:12px; margin:22px 4px 12px; color:#7184B4; font-weight:800; font-size:.8rem; letter-spacing:.08em; text-transform:uppercase; position:relative; z-index:1; }
.notif-group::after { content:""; flex:1; height:1px; background:linear-gradient(90deg,rgba(150,160,210,.35),transparent); }

/* Thẻ thông báo: mặc định là ĐÃ ĐỌC (chữ thường, nhạt) */
.notif-item {
  --c:#8465f4; --cbg:#eee7ff; --g1:#fff; --g2:#f4ecff; --bd:rgba(210,180,255,.65);
  position:relative; z-index:1; display:grid; grid-template-columns:52px 1fr auto; gap:16px; align-items:center;
  margin-bottom:12px; padding:16px 20px; border-radius:24px; cursor:pointer;
  border:1px solid rgba(255,255,255,.8); background:rgba(255,255,255,.5);
  box-shadow:0 8px 18px rgba(75,80,130,.07);
  transition:transform .2s ease, box-shadow .2s ease;
  animation:notifIn .35s ease backwards; animation-delay:calc(var(--i,0) * 35ms);
}
.notif-item:hover { transform:translateY(-3px); box-shadow:0 16px 28px rgba(75,80,130,.13); }
.notif-ico { width:52px; height:52px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:var(--c); background:var(--cbg); opacity:.7; }
.notif-ico svg { width:24px; height:24px; }
.notif-title { margin:0; font-size:1rem; font-weight:600; color:#7184B4; }
.notif-msg { margin:4px 0 0; font-size:.9rem; font-weight:500; color:#8a97bf; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.notif-meta { display:flex; flex-direction:column; align-items:flex-end; gap:8px; font-size:.8rem; font-weight:600; color:#9aa6c9; }
.notif-meta time { cursor:default; }
.notif-new { display:none; width:10px; height:10px; border-radius:50%; background:var(--c); box-shadow:0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }

/* CHƯA ĐỌC: nền màu theo loại, thanh màu bên trái, tiêu đề in đậm */
.notif-item.unread { background:linear-gradient(135deg,var(--g1),var(--g2)); border-color:var(--bd); box-shadow:0 12px 26px rgba(75,80,130,.12); }
.notif-item.unread::before { content:""; position:absolute; left:0; top:18px; bottom:18px; width:5px; border-radius:0 6px 6px 0; background:var(--c); }
.notif-item.unread .notif-ico { opacity:1; }
.notif-item.unread .notif-title { font-weight:800; color:#293b70; }
.notif-item.unread .notif-msg { font-weight:600; color:#596995; }
.notif-item.unread .notif-meta { color:#596995; }
.notif-item.unread .notif-new { display:block; }
.notif-leaving { opacity:0; max-height:0; padding-top:0; padding-bottom:0; margin:0; overflow:hidden; transition:opacity .25s, max-height .25s, padding .25s, margin .25s; }

/* Màu theo loại, lấy từ các thẻ thống kê */
.t-assignment { --c:#e9a72c; --cbg:#fff0d2; --g1:#fffefa; --g2:#fff6e4; --bd:rgba(255,210,130,.6); }
.t-account    { --c:#3f8ff5; --cbg:#e0efff; --g1:#fff;    --g2:#eaf4ff; --bd:rgba(150,200,255,.6); }
.t-report     { --c:#249553; --cbg:#d9f9e8; --g1:#fff;    --g2:#e9fff5; --bd:rgba(130,235,190,.6); }
.t-alert      { --c:#f06491; --cbg:#ffe5ee; --g1:#fff;    --g2:#fff0f4; --bd:rgba(255,170,200,.65); }
/* .t-general dùng màu tím mặc định ở trên */

@keyframes notifIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce) { .notif-item { animation:none; } }

/* Nút hành động thông báo */
.notif-actions { display:flex; gap:10px; flex-wrap:wrap; }
.notif-btn { display:inline-flex; align-items:center; gap:8px; height:44px; padding:0 18px; border-radius:999px; border:1px solid transparent; cursor:pointer; font:800 .9rem 'Nunito',sans-serif; transition:transform .15s ease, box-shadow .15s ease, background .2s ease, color .2s ease; }
.notif-btn svg { width:20px; height:20px; flex-shrink:0; }
.notif-btn:hover { transform:translateY(-2px); }
.notif-btn:active { transform:scale(.97); }
.notif-btn:disabled { opacity:.45; cursor:not-allowed; transform:none; box-shadow:none; }

/* Đã đọc: xanh lá đặc */
.notif-btn-read { color:#fff; background:linear-gradient(135deg,#4cd4a0,#249553); box-shadow:0 8px 18px rgba(36,149,83,.32), inset 0 1px 0 rgba(255,255,255,.4); }
.chk { stroke-dasharray:10; stroke-dashoffset:0; }
.notif-btn-read:hover:not(:disabled) .chk { animation:chkDraw .5s ease; }
@keyframes chkDraw { from { stroke-dashoffset:10; } to { stroke-dashoffset:0; } }

/* Xóa: viền hồng nhạt, hover đổ màu đặc */
.notif-btn-clear { color:#e0507f; background:linear-gradient(135deg,#fff,#fff0f4); border-color:rgba(255,170,200,.8); box-shadow:0 6px 14px rgba(240,100,145,.15); }
.notif-btn-clear:hover:not(:disabled) { color:#fff; border-color:transparent; background:linear-gradient(135deg,#ff8fb1,#f06491); }
.notif-btn-clear:hover:not(:disabled) svg { animation:trashShake .4s ease; }
@keyframes trashShake { 25% { transform:rotate(-10deg); } 75% { transform:rotate(10deg); } }

/* Trạng thái rỗng */
.notif-empty { text-align:center; padding:3.5rem 1rem; position:relative; z-index:1; }
.notif-empty-icon { width:96px; height:96px; margin:0 auto 1rem; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#8465f4; background:linear-gradient(135deg,#eee7ff,#f4ecff); box-shadow:0 10px 24px rgba(132,101,244,.18); }
.notif-empty-icon svg { width:44px; height:44px; }
.notif-empty p { margin:0; font-weight:800; color:#293b70; font-size:1.05rem; }
.notif-empty small { display:block; margin-top:6px; color:#8a97bf; font-weight:600; font-size:.88rem; }

@media (max-width:600px) {
  .notif-panel { padding:20px 16px; border-radius:26px; }
  .notif-head { flex-direction:column; align-items:stretch; }
  .notif-actions .notif-btn { flex:1; justify-content:center; padding:0 12px; }
  .notif-item { grid-template-columns:44px 1fr; padding:14px; }
  .notif-ico { width:44px; height:44px; }
  .notif-ico svg { width:20px; height:20px; }
  .notif-meta { grid-column:2; flex-direction:row; justify-content:space-between; align-items:center; }
}

/* ===== ADMIN OVERVIEW — thẻ stat-card ===== */
.ov-section { margin-top:36px; position:relative; z-index:1; }
.ov-head { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:22px; }
.ov-title { margin:0; display:flex; align-items:center; gap:12px; color:#293b70; font-size:24px; font-weight:800; letter-spacing:-.4px; }
.ov-title::before { content:""; width:6px; height:26px; border-radius:99px; background:linear-gradient(#9a89ff,#5b8dff); }
.ov-actions { display:flex; gap:10px; align-items:center; }

.ov-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; }
.ov-span2 { grid-column:span 2; }
.ov-full  { grid-column:1 / -1; }

/* Ghi đè chỉ trong thẻ tổng quan: không bị các media query của .stat-* làm số tí hon */
.ov-card { min-height:0; cursor:default; }
.ov-card .stat-number { font-size:44px; }
.ov-card .stat-number small { margin-left:6px; font-size:18px; font-weight:700; letter-spacing:0; color:#7184B4; }
.ov-card .stat-icon { margin-bottom:0; }
.ov-card-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; position:relative; z-index:1; }

.ov-chip { padding:5px 12px; border-radius:99px; font-size:13px; font-weight:800; }
.ov-chip.ok { background:#d9f9e8; color:#249553; }
.ov-chip.warn { background:#fff0d2; color:#b7791f; }
.ov-chip.danger { background:#ffe5ee; color:#d6336c; }

.ov-bar { position:relative; z-index:1; height:12px; margin-top:18px; border-radius:99px; background:rgba(255,255,255,.75); box-shadow:inset 0 1px 3px rgba(75,80,130,.15); overflow:hidden; }
.ov-bar > i { display:block; height:100%; width:var(--w); border-radius:inherit; background:linear-gradient(90deg,#8abaff,#3f8ff5); transition:width .8s cubic-bezier(.2,.8,.2,1); }
.users .ov-bar > i { background:linear-gradient(90deg,#c4a2ff,#8465f4); }
.ov-bar.warn > i   { background:linear-gradient(90deg,#ffd27b,#e9a72c); }
.ov-bar.danger > i { background:linear-gradient(90deg,#ff9fc0,#f06491); }
.ov-foot { position:relative; z-index:1; margin:12px 0 0; font-size:13px; font-weight:600; color:#7184B4; }
.ov-link { position:relative; z-index:1; display:inline-block; margin-top:10px; font-size:13px; font-weight:700; color:#8465f4; text-decoration:none; }
.ov-link:hover { text-decoration:underline; }

.ov-mini { position:relative; z-index:1; display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:16px; }
.ov-mini > div { padding:12px 14px; border-radius:18px; background:rgba(255,255,255,.7); border:1px solid rgba(255,255,255,.9); }
.ov-mini b { display:block; font-size:26px; font-weight:800; line-height:1; color:#293b70; }
.ov-mini span { font-size:12.5px; font-weight:700; color:#596995; }

.ov-chart { position:relative; z-index:1; display:flex; align-items:stretch; gap:14px; height:170px; margin-top:8px; }
.ov-col { flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; min-width:0; }
.ov-pair { flex:1; width:100%; display:flex; align-items:flex-end; justify-content:center; gap:4px; }
.ov-pair i { width:38%; max-width:18px; min-height:4px; height:var(--h); border-radius:8px 8px 4px 4px; }
.ov-pair i.a { background:linear-gradient(#b9a6ff,#8465f4); }
.ov-pair i.b { background:linear-gradient(#ffd27b,#e9a72c); }
.ov-col span { font-size:11.5px; font-weight:700; color:#7184B4; }
.ov-legend { display:flex; gap:14px; margin-top:10px; font-size:12px; font-weight:700; color:#596995; position:relative; z-index:1; }
.ov-legend i { display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:5px; vertical-align:-1px; }
.ov-legend .l-ai { background:linear-gradient(#b9a6ff,#8465f4); }
.ov-legend .l-asg { background:linear-gradient(#ffd27b,#e9a72c); }

.ov-top { position:relative; z-index:1; display:flex; flex-direction:column; gap:10px; margin-top:14px; }
.ov-top-row { display:grid; grid-template-columns:22px 1fr auto; align-items:center; gap:10px; font-size:.85rem; }
.ov-top-row .rank { width:22px; height:22px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:800; background:rgba(132,101,244,.12); color:#8465f4; }
.ov-top-row .uname { font-weight:700; color:#293b70; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ov-top-row .ucount { font-weight:800; color:#596995; }
.ov-top-bar { grid-column:2 / 4; height:6px; border-radius:99px; background:rgba(255,255,255,.7); overflow:hidden; }
.ov-top-bar i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#c4a2ff,#8465f4); }

.ov-cf-empty { display:flex; align-items:center; gap:14px; padding:16px 20px; border-radius:22px; border:2px dashed rgba(150,140,230,.5); background:rgba(255,255,255,.55); color:#596995; font-weight:700; }

@media (max-width:1100px) { .ov-grid { grid-template-columns:repeat(2,1fr); } .ov-span2 { grid-column:1 / -1; } }
@media (max-width:700px)  { .ov-grid { grid-template-columns:1fr; gap:14px; } .ov-span2 { grid-column:auto; } .ov-card .stat-number { font-size:34px; } }

/* ===== GIÁO VIÊN: PROFILE + HẠN MỨC ===== */
.tp-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:12px; }
.tp-limit { padding:14px 16px; border-radius:18px; background:rgba(255,255,255,.75); border:1px solid var(--tone-border, rgba(210,180,255,.5)); }
.tp-limit .td-label { color:#596995; font-size:.85rem; font-weight:700; }
.tp-limit-value { font-size:1.5rem; font-weight:900; color:#293b70; line-height:1.2; }
.tp-limit-value small { font-size:.9rem; font-weight:700; color:#7184B4; margin-left:4px; }
.tp-note { margin:10px 0 0; font-size:.85rem; font-weight:600; color:#7184B4; }
#teacher-edit-card .clay-input[readonly] { background:rgba(241,236,255,.7); color:#7184B4; cursor:not-allowed; }
@media (max-width:600px) { .tp-grid { grid-template-columns:1fr; } }

/* ===== USERNAME CHECKER HINT ===== */
.un-hint { min-height:0; margin-top:6px; font-size:.85rem; font-weight:700; display:flex; flex-direction:column; gap:6px; }
.un-hint.ok  { color:#249553; }
.un-hint.bad { color:#d6336c; }
.un-sugg { color:#596995; display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.un-chip { border:1px solid rgba(121,106,255,.35); background:#fff; color:#4b3fd6; border-radius:999px; padding:3px 12px;
    font:800 .82rem 'Nunito',sans-serif; cursor:pointer; transition:background .15s, transform .15s; }
.un-chip:hover { background:#f0eaff; transform:translateY(-1px); }

/* ===== ĐĂNG KÝ – giao diện mới ===== */
.reg-card { max-width: 480px; }
.reg-card .glass-modal-header { padding-bottom: 14px; }

/* Thanh bước có nhãn */
.reg-steps { display:flex; justify-content:center; gap:10px; padding:14px 20px 0; background:linear-gradient(180deg,rgba(244,236,255,.25),transparent); }
.reg-step { display:flex; align-items:center; gap:8px; padding:6px 12px; border-radius:999px; background:rgba(255,255,255,.7); border:1px solid rgba(121,106,255,.18); color:#7184B4; font-weight:800; font-size:.8rem; transition:all .3s; }
.reg-step i { width:22px; height:22px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-style:normal; font-size:.75rem; background:rgba(121,106,255,.12); color:#796AFF; }
.reg-step.active { background:linear-gradient(135deg,#796AFF,#5B8DEF); color:#fff; border-color:transparent; box-shadow:0 6px 14px rgba(121,106,255,.35); }
.reg-step.active i { background:rgba(255,255,255,.28); color:#fff; }
.reg-step.done { color:#249553; border-color:rgba(56,201,149,.4); }
.reg-step.done i { background:#d9f9e8; color:#249553; }
@media (max-width:420px){ .reg-step span{ display:none; } .reg-step.active span{ display:inline; } }

/* Dòng gợi ý dưới ô nhập */
.reg-hint { min-height:1.1em; margin:4px 0 0; font-size:.85rem; font-weight:700; color:#7184B4; }
.reg-hint.ok  { color:#249553; }
.reg-hint.bad { color:#d6336c; }

/* Thẻ vai trò */
.reg-role-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.reg-role-card { position:relative; padding:20px 14px; border-radius:20px; border:1.5px solid rgba(121,106,255,.22); background:#fff;
  box-shadow:0 6px 14px rgba(75,80,130,.08); transition:transform .2s, box-shadow .2s, border-color .2s, background .2s; display:flex; flex-direction:column; align-items:center; gap:8px; cursor:pointer; font-family:'Nunito',sans-serif; color:#293b70; }
.reg-role-card svg { padding:12px; width:56px !important; height:56px !important; border-radius:50%; }
.reg-role-card.student svg { color:#d98c0f; background:#fff0d2; }
.reg-role-card.teacher svg { color:#2f7fe8; background:#e0efff; }
.reg-role-card:hover { transform:translateY(-2px); box-shadow:0 12px 22px rgba(75,80,130,.14); }
.reg-role-card.selected { border-color:#796AFF; background:linear-gradient(135deg,#fff,#f0eaff); box-shadow:0 0 0 3px rgba(121,106,255,.2), 0 12px 22px rgba(121,106,255,.22); }
.reg-role-card.selected::after { content:'✓'; position:absolute; top:10px; right:12px; width:22px; height:22px; border-radius:50%; background:linear-gradient(135deg,#796AFF,#5B8DEF); color:#fff; font-size:.8rem; font-weight:900; display:flex; align-items:center; justify-content:center; }
.reg-role-card strong { font-size:1rem; }
.reg-role-card small { font-size:.75rem; color:#7184B4; text-align:center; line-height:1.3; }

.reg-turnstile { display:flex; justify-content:center; margin-top:14px; min-height:65px; }

/* Link đăng nhập */
.reg-login-link { flex:none; margin:0; padding:10px 20px calc(14px + env(safe-area-inset-bottom, 0px)); text-align:center; font-size:.9rem; font-weight:700; color:#596995; background:linear-gradient(180deg,rgba(255,255,255,.7),rgba(255,255,255,.6)); border-top:1px solid rgba(121,106,255,.15); }
.reg-login-link a { color:#4b3fd6; font-weight:800; text-decoration:none; }
.reg-login-link a:hover { text-decoration:underline; }

/* Footer: bỏ flex cũ, dùng lưới 2 nút như modal người dùng */
.reg-footer { display:grid !important; grid-template-columns:1fr 1fr; }
.reg-footer.single { grid-template-columns:1fr; }
.reg-footer button { flex:none; }
#reg-back-btn { display:flex; align-items:center; justify-content:center; gap:8px; }

/* Nút "Tiếp tục" bị vô hiệu */
.reg-footer .glass-modal-primary-btn:disabled { opacity:.5; cursor:not-allowed; filter:grayscale(.25); transform:none; box-shadow:none; }

/* Ô mã 6 số */
.reg-code-inputs { display:flex; gap:8px; justify-content:center; margin:12px 0; }
.reg-code-digit { width:44px; height:52px; text-align:center; font-size:1.4rem; font-weight:800; border-radius:14px; border:1.5px solid rgba(121,106,255,.3); color:#293b70; background:#fff; font-family:'Nunito',sans-serif; transition:border-color .2s, box-shadow .2s; }
.reg-code-digit:focus { outline:none; border-color:#796AFF; box-shadow:0 0 0 3px rgba(121,106,255,.2); }

.join-invite-banner { margin:0 0 16px; padding:14px 18px; border-radius:16px; background:linear-gradient(135deg,#f0eaff,#e6fbfa); border:1px solid rgba(121,106,255,.35); color:#293b70; font-size:.92rem; }

#reg-teacher-extra .tp-note { text-align: center; }

/* ===== MÃ THAM GIA LỚP ===== */
.jr-pending-chip { display:inline-block; margin-left:6px; padding:2px 10px; border-radius:999px; background:#fdf0d5; color:#b07a10; font-size:.75rem; font-weight:800; }
.join-code-card{position:relative;display:flex;align-items:center;justify-content:center;padding:18px 60px;border-radius:20px;
  background:linear-gradient(135deg,#efe9ff,#e3f1ff);border:1px solid rgba(255,255,255,.9);
  box-shadow:inset 0 1px 1px #fff,0 8px 20px rgba(121,106,255,.12)}
.join-code-display{font-family:'Courier New',monospace;font-size:1.9rem;font-weight:800;letter-spacing:6px;color:#293b70;text-align:center}
.join-code-copy{position:absolute;right:10px;top:50%;transform:translateY(-50%)}
.join-link-row{display:flex;gap:8px}
.join-link-row .clay-input{flex:1;min-width:0}
.join-link-row .gm-pill--icon{width:48px;height:48px;border-radius:14px}
.join-qr-wrap{display:flex;flex-direction:column;align-items:center;gap:12px;padding:16px;border-radius:20px;
  background:rgba(255,255,255,.85);border:1px solid rgba(121,106,255,.15);box-shadow:0 8px 20px rgba(91,104,175,.08)}
.join-qr-wrap canvas{width:180px;height:180px;border-radius:14px;background:#fff}
.join-mode-seg{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;border-radius:999px;
  background:rgba(255,255,255,.65);border:1px solid rgba(255,255,255,.9);box-shadow:inset 0 1px 2px rgba(0,0,0,.04)}
.join-mode-btn{height:38px;border:0;border-radius:999px;background:transparent;color:#596995;font:800 .85rem 'Nunito',sans-serif;cursor:pointer;transition:all .25s}
.join-mode-btn.active{background:linear-gradient(135deg,#796AFF,#5B8DEF);color:#fff;box-shadow:0 6px 14px rgba(121,106,255,.35)}
.join-code-copy.copied,.join-link-row .copied{background:#2fb577;color:#fff;border-color:transparent}
#join-class-modal .glass-modal-footer,#join-requests-modal .glass-modal-footer,#support-modal .glass-modal-footer{grid-template-columns:1fr}
@media (max-width:420px){.join-code-display{font-size:1.4rem;letter-spacing:3px}.join-code-card{padding:16px 54px}}

.jr-actions-top{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.jr-item{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:16px;background:rgba(255,255,255,.85);
  border:1px solid rgba(121,106,255,.15);box-shadow:0 4px 12px rgba(91,104,175,.06);margin-bottom:10px}
.jr-avatar{width:38px;height:38px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;
  font-weight:800;color:#fff;background:linear-gradient(135deg,#796AFF,#5B8DEF)}
.jr-info{flex:1;min-width:0}
.jr-info strong{color:#293b70;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.jr-user{font-size:.8rem;color:#7184B4;}
.jr-error{font-size:.78rem;color:#d6336c;font-weight:700;}
.jr-btns{display:flex;gap:8px;flex:none}
.jr-btns .gm-pill--icon{width:36px;height:36px;padding:0}
.join-class-card .join-input-row { display:flex; gap:10px; }
.join-class-card .join-input-row .clay-input { flex:1; text-transform:uppercase; }
.join-7day-banner { margin-bottom:12px; padding:10px 14px; border-radius:12px; background:#fdf0d5; color:#8a5a00; font-size:.85rem; font-weight:700; }
.jr-pending-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 14px; border-radius:12px; background:rgba(255,255,255,.75); border:1px dashed rgba(210,180,255,.5); margin-top:8px; font-size:.88rem; }
.jr-cancel-btn { border:none; background:#f06491; color:#fff; border-radius:8px; padding:6px 12px; font:800 .78rem 'Nunito',sans-serif; cursor:pointer; }

/* ===== ADMIN: hoạt động + sort ===== */
.th-sort { all:unset; cursor:pointer; display:inline-flex; gap:6px; align-items:center; color:inherit; font-weight:800; }
.th-sort:focus-visible { outline:2px solid #fff; outline-offset:2px; }
.th-arrow { display:inline-flex; opacity:.85; }
.th-arrow svg { width:14px; height:14px; }
.act-cell { font-size:.85rem; font-weight:700; color:#596995; }
.act-amber { color:#b07a10 !important; }
.act-red { color:#d6336c !important; }
.selfreg-chip { display:inline-block; margin-left:6px; padding:1px 8px; border-radius:999px; background:#e6fbfa; color:#0e7c74; font-size:.7rem; font-weight:800; }

/* ===== SECURITY ALERTS ===== */
.sec-flag-chip { display:inline-flex; align-items:center; gap:3px; margin-left:6px; padding:1px 8px; border-radius:999px; background:#ffe1e6; color:#d6336c; font-size:.7rem; font-weight:800; vertical-align:middle; }
.sec-empty { display:flex; flex-direction:column; align-items:center; gap:10px; padding:28px 12px; color:#7184B4; font-size:.9rem; text-align:center; }
.sec-empty svg { color:#2fb37f; }
.sec-alert-row { position:relative; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 14px; padding:12px 14px; margin-bottom:10px; border-radius:14px; background:rgba(255,255,255,.75); border:1px solid rgba(230,225,255,.9); }
.sec-alert-row.flagged { border-color:rgba(224,72,95,.45); background:linear-gradient(135deg,#fff5f6,#fff); }
.sec-alert-main { min-width:0; flex:1 1 200px; }
.sec-alert-user { display:flex; flex-wrap:wrap; align-items:center; gap:6px; font-size:.95rem; }
.sec-alert-meta { margin-top:3px; font-size:.78rem; color:#7184B4; }
.sec-alert-stats { display:flex; gap:14px; flex-shrink:0; }
.sec-stat { display:flex; flex-direction:column; align-items:center; min-width:44px; }
.sec-stat b { font-size:1.05rem; color:#3d4a6b; }
.sec-stat span { font-size:.68rem; color:#7184B4; font-weight:700; }
.sec-alert-reason { flex-basis:100%; font-size:.78rem; color:#d6336c; font-weight:600; }
.sec-tag { display:inline-flex; align-items:center; padding:1px 8px; border-radius:999px; font-size:.68rem; font-weight:800; }
.sec-tag-user { background:#e6fbfa; color:#0e7c74; }
.sec-tag-ghost { background:#f1f0ff; color:#7a6ff0; }
.sec-tag-flag { background:#ffe1e6; color:#d6336c; }
.t-join { --c:#0ea5a4; --cbg:#d5f5f4; --g1:#fff; --g2:#e6fbfa; --bd:rgba(14,165,164,.45); }
.t-signup   { --c:#2f7fe8; --cbg:#e0efff; --g1:#fff; --g2:#eaf4ff; --bd:rgba(150,200,255,.6); }
.t-feedback { --c:#e8603c; --cbg:#ffe6dd; --g1:#fff; --g2:#fff3ee; --bd:rgba(255,170,140,.6); }

@media (max-width:420px) {
    .reg-role-grid { grid-template-columns:1fr; }
    .join-code-display { font-size:1.5rem; letter-spacing:3px; }
    .reg-code-inputs { gap:6px; }
    .reg-code-digit { width:36px; height:42px; font-size:1.2rem; }
    .jr-item { flex-direction:column; align-items:flex-start; }
}

/* ===== GLASS PILL BUTTONS (dùng chung trong modal) ===== */
.gm-pill{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:42px;padding:0 18px;
  border-radius:999px;border:1.5px solid rgba(121,106,255,.3);background:rgba(255,255,255,.85);color:#5B6EF0;
  font:800 .9rem 'Nunito',sans-serif;cursor:pointer;box-shadow:0 4px 12px rgba(91,104,175,.08);
  transition:transform .2s,box-shadow .2s,background .2s,color .2s}
.gm-pill svg{width:18px;height:18px;flex:none}
.gm-pill:hover{background:linear-gradient(135deg,#796AFF,#5B8DEF);color:#fff;border-color:transparent;
  transform:translateY(-1px);box-shadow:0 8px 18px rgba(121,106,255,.3)}
.gm-pill:active{transform:scale(.97)}
.gm-pill:disabled{opacity:.55;cursor:not-allowed;transform:none;box-shadow:none;background:rgba(255,255,255,.6);color:#7184B4}
.gm-pill--sm{height:34px;padding:0 14px;font-size:.82rem}
.gm-pill--icon{width:42px;padding:0}
.gm-pill--danger{color:#d6336c;border-color:rgba(214,51,108,.35);background:rgba(214,51,108,.06)}
.gm-pill--danger:hover{background:linear-gradient(135deg,#f06491,#d6336c);color:#fff}
.gm-pill--success{color:#1f8f5f;border-color:rgba(47,181,119,.4);background:rgba(47,181,119,.08)}
.gm-pill--success:hover{background:linear-gradient(135deg,#38c995,#249553);color:#fff}

#join-reset-code-btn {
  height: 58px;
  padding: 0 24px;
  font-size: 1.05rem;
}
#join-reset-code-btn svg { width: 22px; height: 22px; }

/* Pending join requests: trượt mượt khi hiện/ẩn */
#join-pending-list {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .38s cubic-bezier(.4,0,.2,1), opacity .3s ease;
}
#join-pending-list.jr-open {
  opacity: 1;
}
.jr-pending-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px;
  border-top: 1px dashed rgba(91,104,175,.18);
}
.jr-cancel-btn {
  border: none;
  background: transparent;
  color: #e0447c;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  white-space: nowrap;
}
.jr-cancel-btn:hover { text-decoration: underline; }

/* Hồ sơ học sinh */
.student-profile-card .sp-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.sp-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg,#7b6cff,#4b3fd6);
  flex-shrink: 0;
}
.sp-name { font-size: 1.15rem; font-weight: 800; color: #293b70; }
.sp-user { font-size: .85rem; color: var(--text-muted, #7a86b8); }
.sp-rows { display: flex; flex-direction: column; gap: 8px; }
.sp-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(91,104,175,.12);
  border-radius: 14px;
}
.sp-row svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: #7b6cff; }
.sp-row .sp-label { font-size: .78rem; font-weight: 700; color: #7a86b8; text-transform: uppercase; letter-spacing: .04em; }
.sp-row .sp-value { font-size: .92rem; font-weight: 600; color: #293b70; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sp-chip {
  font-size: .78rem; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(123,108,255,.12); color: #4b3fd6;
}

/* ===== SECTION FADE ANIMATION ===== */
.admin-section:not(.hidden),.teacher-section:not(.hidden),.notif-section:not(.hidden){animation:secFade .28s ease both}
@keyframes secFade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.admin-section,.teacher-section,.notif-section{animation:none!important}}

/* Animation entrance chỉ chạy LẦN ĐẦU — các lần ẩn/hiện lại thì hiện thẳng, không trượt từ dưới lên */
.teacher-section.no-anim,.admin-section.no-anim,.notif-section.no-anim{animation:none!important}
.no-anim .create-panel,.no-anim .part-card{animation:none!important}
.no-anim .staggered-animate{animation:none!important;opacity:1!important}
.page.no-entrance .container > *{animation:none!important;opacity:1!important}

/* ===== ĐĂNG KÝ ===== */
.reg-resend-row{display:flex;justify-content:center;margin-top:4px}
.reg-card .uf-body{gap:14px;padding:18px 22px 16px}
.reg-card .uf-body .error-message{min-height:0;margin:0}
.reg-card .uf-body .error-message:empty{display:none}
.reg-hint{min-height:0;margin:2px 0 0}
.reg-hint:empty{display:none}

/* ===== LOGIN LOADER: bouncing balls (Uiverse by deax_9186) ===== */
.bounce-loader-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 80px;
  margin-top: 15px;
}

.bounce-loader {
  width: 200px;
  height: 60px;
  position: relative;
  display: flex;
  justify-content: center;
  z-index: 1;
}

.bounce-circle {
  width: 20px;
  height: 20px;
  position: absolute;
  border-radius: 50%;
  background-color: #fff;
  left: 15%;
  transform-origin: 50%;
  animation: circle7124 0.5s alternate infinite ease;
  border: solid 5px #000000;
}

.bounce-circle:nth-child(2) {
  left: 45%;
  animation-delay: 0.2s;
}

.bounce-circle:nth-child(3) {
  left: auto;
  right: 15%;
  animation-delay: 0.3s;
}

@keyframes circle7124 {
  0% {
    top: 60px;
    height: 5px;
    border-radius: 50px 50px 25px 25px;
    transform: scaleX(2.7);
    background-color: #808080;
  }
  40% {
    height: 20px;
    border-radius: 50%;
    transform: scaleX(1);
    background-color: rgb(44, 44, 44);
  }
  100% {
    top: 0%;
  }
}

.bounce-shadow {
  width: 20px;
  height: 4px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.5);
  position: absolute;
  top: 62px;
  z-index: -1;
  left: 15%;
  filter: blur(1px);
  animation: shadow0461 0.5s alternate infinite ease;
}

.bounce-shadow:nth-child(5) {
  left: 45%;
  animation-delay: 0.2s;
}

.bounce-shadow:nth-child(6) {
  left: auto;
  right: 15%;
  animation-delay: 0.3s;
}

@keyframes shadow0461 {
  0% { transform: scaleX(1.5); }
  40% { transform: scaleX(1); opacity: 0.7; }
  100% { transform: scaleX(0.2); opacity: 0.4; }
}

/* ===== Cï¿½I ï¿½?T CHUNG (GIï¿½O VIï¿½N) ===== */
#teacher-settings-section .clay-card {
  --tone: #8465f4; --tone2: #5B8DEF;
  --tone-soft: #f4ecff; --tone-border: rgba(150,115,255,.35);
}
.st-list { display:flex; flex-direction:column; gap:12px; }
.st-item { display:flex; align-items:center; gap:14px; width:100%; padding:14px 16px; text-align:left; cursor:pointer;
  background:linear-gradient(135deg,#fff,var(--tone-soft,#f4ecff)); border:1.5px solid var(--tone-border,rgba(150,115,255,.45));
  border-radius:20px; box-shadow:0 8px 18px rgba(75,80,130,.08); font-family:'Nunito',sans-serif; color:#293b70;
  transition:transform .2s, box-shadow .2s; }
.st-item:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 14px 26px rgba(75,80,130,.14); }
.st-item.is-disabled, .st-item:disabled { opacity:.6; cursor:not-allowed; }
.st-ico { width:44px; height:44px; flex:none; border-radius:14px; display:flex; align-items:center; justify-content:center; }
.st-ico svg { width:22px; height:22px; }
.st-ico--coral { color:#e8603c; background:#ffe6dd; } .st-ico--blue { color:#2f7fe8; background:#e0efff; }
.st-ico--green { color:#249553; background:#d9f9e8; }  .st-ico--purple { color:#8465f4; background:#eee7ff; }
.st-text { flex:1; min-width:0; display:flex; flex-direction:column; }
.st-text strong { font-size:1rem; font-weight:800; } .st-text small { color:#7184B4; font-weight:600; font-size:.82rem; }
.st-chev { color:#7184B4; font-size:1.6rem; line-height:1; }
.st-badge { flex:none; padding:3px 12px; border-radius:999px; background:#fdf0d5; color:#b07a10; font-size:.75rem; font-weight:800; }
.app-teaser-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.app-teaser { display:flex; align-items:center; gap:14px; padding:16px; border-radius:20px; background:rgba(255,255,255,.75);
  border:1.5px dashed rgba(121,106,255,.35); }
.app-teaser-ico { width:56px; height:56px; flex:none; border-radius:16px; display:flex; align-items:center; justify-content:center;
  color:#fff; background:linear-gradient(135deg,#796AFF,#5B8DEF); }
.app-teaser-ico svg { width:32px; height:32px; }
.app-teaser-text { flex:1; min-width:0; display:flex; flex-direction:column; }
.app-teaser-text strong { color:#293b70; font-weight:800; } .app-teaser-text small { color:#7184B4; font-weight:600; font-size:.82rem; }
.sup-link { display:flex; align-items:center; gap:14px; padding:14px 16px; margin-bottom:12px; border-radius:18px; text-decoration:none;
  color:#293b70; font-weight:800; background:#fff; border:1.5px solid rgba(121,106,255,.25); box-shadow:0 6px 14px rgba(75,80,130,.08);
  transition:transform .2s, box-shadow .2s; }
.sup-link:hover { transform:translateY(-2px); box-shadow:0 12px 22px rgba(75,80,130,.14); }
.sup-link svg { width:40px; height:40px; flex:none; }
.sup-val { display:block; color:#7184B4; font-weight:600; font-size:.85rem; word-break:break-all; }
@media (max-width:600px) { .app-teaser-list { grid-template-columns:1fr; } }
@media (max-width:768px){ .stat-card.broadcast{ aspect-ratio:auto; flex-direction:row; padding:12px 14px; gap:12px; } }

/* ===== APP BANNER ===== */
.app-banner-card {
    position: relative;
    max-width: 520px;
    width: calc(100% - 32px);
    padding: 12px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.app-banner-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.app-banner-close:hover { background: rgba(0,0,0,0.75); }
.app-banner-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
}
.app-banner-link-wrap { display: block; }

/* =====================================================
   ADMIN BANNER PAGE — liquid-glass giống trang Thống Kê
   ===================================================== */
.bn-body { position: relative; z-index: 1; }
.bn-intro { margin: -14px 0 28px; max-width: 760px; font-size: 14.5px; font-weight: 600; line-height: 1.6; color: #596995; }
.bn-head { margin-bottom: 18px; }
.bn-head-next { margin-top: 52px; }

/* ----- Form ----- */
.bn-form { display: flex; flex-direction: column; gap: 24px; }
.bn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.bn-span2 { grid-column: 1 / -1; }

.bn-card {
    --bn-accent: #3f8ff5; --bn-soft: #e0efff; --bn-bg: #eaf4ff;
    --bn-border: rgba(150, 200, 255, .70); --bn-ring: rgba(63, 143, 245, .22);
    position: relative; overflow: hidden;
    padding: 26px 28px;
    border-radius: 30px;
    border: 1px solid var(--bn-border);
    background: linear-gradient(135deg, #ffffff, var(--bn-bg));
    box-shadow: 0 18px 32px rgba(75, 80, 130, .12), 0 5px 12px rgba(70, 70, 120, .07), inset 0 1px 1px rgba(255, 255, 255, .95);
}
.bn-card::before {
    content: ""; position: absolute; width: 250px; height: 180px;
    right: -100px; bottom: -70px; border-radius: 50%;
    background: rgba(255, 255, 255, .30); transform: rotate(-25deg); pointer-events: none;
}
.bn-card > * { position: relative; z-index: 1; }

.bn-card-info    { --bn-accent: #3f8ff5; --bn-soft: #e0efff; --bn-bg: #eaf4ff; --bn-border: rgba(150,200,255,.70); --bn-ring: rgba(63,143,245,.22); }
.bn-card-image   { --bn-accent: #8465f4; --bn-soft: #eee7ff; --bn-bg: #f4ecff; --bn-border: rgba(210,180,255,.75); --bn-ring: rgba(132,101,244,.22); }
.bn-card-display { --bn-accent: #d98c0f; --bn-soft: #fff0d2; --bn-bg: #fff6e4; --bn-border: rgba(255,210,130,.75); --bn-ring: rgba(217,140,15,.22); }

.bn-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.bn-card-ico {
    display: flex; align-items: center; justify-content: center; flex: none;
    width: 48px; height: 48px; border-radius: 50%;
    color: var(--bn-accent); background: var(--bn-soft);
}
.bn-card-ico svg { width: 24px; height: 24px; }
.bn-card-head h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.3px; color: #293b70; }
.bn-card-head p { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: #7184B4; }

/* ----- Input kiểu mới ----- */
.bn-field { display: flex; flex-direction: column; gap: 8px; }
.bn-field + .bn-field { margin-top: 18px; }
.bn-field > label { margin: 0; font-size: 14px; font-weight: 800; color: #293b70; }
.banner-opt { font-weight: 600; color: #9aa8cc; font-size: .85em; }

.bn-input {
    width: 100%; height: 50px; padding: 0 16px;
    font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 700; color: #293b70;
    background: rgba(255, 255, 255, .96);
    border: 1.5px solid var(--bn-border);
    border-radius: 16px; outline: none;
    box-shadow: 0 4px 10px rgba(75, 80, 130, .06), inset 0 1px 2px rgba(75, 80, 130, .05);
    transition: border-color .2s, box-shadow .2s;
}
.bn-input::placeholder { color: #9aa8cc; font-weight: 600; }
.bn-input:hover { border-color: var(--bn-accent); }
.bn-input:focus { border-color: var(--bn-accent); box-shadow: 0 0 0 4px var(--bn-ring); }
.bn-input[type=number] { -moz-appearance: textfield; }
.bn-input::-webkit-inner-spin-button,
.bn-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.bn-row2 { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 18px; }
.bn-row2 .bn-field + .bn-field { margin-top: 0; }
.bn-input-unit { position: relative; }
.bn-input-unit .bn-input { padding-right: 64px; }
.bn-input-unit > span {
    position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    font-size: 13px; font-weight: 800; color: var(--bn-accent); pointer-events: none;
}

/* ----- Ô chọn ảnh (dropzone) ----- */
.banner-file-row { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.banner-file-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    min-height: 130px; padding: 18px; text-align: center;
    border-radius: 22px; border: 2px dashed rgba(132, 101, 244, .45);
    background: rgba(255, 255, 255, .78);
    color: #8465f4; font-size: 15px; font-weight: 800;
    cursor: pointer; user-select: none;
    transition: transform .2s, box-shadow .2s, border-color .2s, background .2s;
}
.banner-file-btn svg { width: 34px; height: 34px; }
.banner-file-btn:hover {
    border-color: #8465f4; background: #fff; transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(132, 101, 244, .18);
}
.banner-file-name { font-size: 13px; font-weight: 700; color: #596995; word-break: break-all; text-align: center; }
.banner-file-name:empty { display: none; }
.banner-preview { margin-top: 14px; }
.banner-preview img {
    display: block; width: 100%; max-height: 220px; object-fit: contain;
    border-radius: 18px; border: 1px solid rgba(255, 255, 255, .95); background: #fff;
    box-shadow: 0 8px 20px rgba(75, 80, 130, .14);
}

/* ----- Thanh chứa nút Lưu (tách khỏi thẻ bên dưới) ----- */
.bn-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 18px 22px; border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, .9);
    background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(244,236,255,.65));
    box-shadow: 0 12px 28px rgba(75, 80, 130, .10), inset 0 1px 1px rgba(255, 255, 255, .95);
}
.bn-actions-hint { margin: 0; max-width: 520px; font-size: 13.5px; font-weight: 600; line-height: 1.5; color: #596995; }
.bn-save-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    height: 52px; min-width: 220px; border-radius: 18px; font-size: 16px;
}
.bn-save-btn svg { width: 20px; height: 20px; }

/* ----- Thẻ thống kê banner ----- */
#admin-banner-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
#admin-banner-stats .stat-card { min-height: 190px; cursor: default; }
@media (max-width: 1100px) { #admin-banner-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ----- Danh sách banner ----- */
.bn-list { display: flex; flex-direction: column; gap: 18px; }
.bn-item {
    position: relative;
    display: flex; align-items: center; gap: 20px;
    padding: 18px 22px; border-radius: 26px;
    border: 1px solid rgba(130, 235, 190, .60);
    background: linear-gradient(135deg, #ffffff, #e9fff5);
    box-shadow: 0 14px 28px rgba(75, 80, 130, .10), 0 4px 10px rgba(70, 70, 120, .05), inset 0 1px 1px rgba(255, 255, 255, .95);
    transition: transform .25s, box-shadow .25s;
}
.bn-item:hover { transform: translateY(-3px); box-shadow: 0 20px 34px rgba(75, 80, 130, .15), 0 6px 14px rgba(70, 70, 120, .07); }
.bn-item.is-off { border-color: rgba(190, 195, 215, .70); background: linear-gradient(135deg, #ffffff, #f2f3f8); }
.bn-item.is-off .bn-thumb img { filter: grayscale(.6); opacity: .75; }

.bn-thumb {
    flex: none; width: 140px; height: 94px; overflow: hidden;
    border-radius: 18px; border: 2px solid #fff; background: #fff;
    box-shadow: 0 8px 18px rgba(75, 80, 130, .16);
}
.bn-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bn-info { flex: 1; min-width: 0; }
.bn-item-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bn-item-title strong { font-size: 17px; font-weight: 800; color: #293b70; }
.bn-badge { padding: 4px 12px; border-radius: 99px; font-size: 12px; font-weight: 800; }
.bn-badge.on  { background: #d9f9e8; color: #249553; }
.bn-badge.off { background: #e9ebf3; color: #6b7799; }
.bn-item-link { margin-top: 4px; font-size: 13px; font-weight: 600; color: #7184B4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bn-chip { padding: 5px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 800; }
.bn-chip.c-blue   { background: #e0efff; color: #2f7fe8; }
.bn-chip.c-purple { background: #eee7ff; color: #7a5af0; }
.bn-chip.c-green  { background: #d9f9e8; color: #249553; }
.bn-chip.c-orange { background: #fff0d2; color: #b7791f; }
.bn-chip.c-gray   { background: #eef0f7; color: #6b7799; }

.bn-item-actions { display: flex; flex-direction: column; gap: 10px; flex: none; }
.bn-act {
    min-width: 96px; height: 42px; padding: 0 18px;
    border-radius: 14px; border: 1px solid transparent;
    font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800;
    cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.bn-act:hover { transform: translateY(-2px); }
.bn-act:active { transform: translateY(0) scale(.98); }
.bn-act.ok     { color: #fff; background: linear-gradient(135deg, #34c38f, #249553); box-shadow: 0 8px 16px rgba(36, 149, 83, .30); }
.bn-act.warn   { color: #b7791f; background: #fff0d2; border-color: rgba(255, 195, 90, .60); }
.bn-act.danger { color: #d6336c; background: #ffe5ee; border-color: rgba(255, 140, 180, .60); }

.bn-empty {
    padding: 36px 20px; text-align: center;
    border-radius: 26px; border: 1.5px dashed rgba(132, 101, 244, .40);
    background: rgba(255, 255, 255, .65);
    color: #7184B4; font-size: 14.5px; font-weight: 700;
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
    .bn-grid { grid-template-columns: 1fr; }
    .bn-span2 { grid-column: auto; }
}
@media (max-width: 768px) {
    .bn-head-next { margin-top: 36px; }
    .bn-card { padding: 20px 18px; border-radius: 24px; }
    .bn-row2 { grid-template-columns: 1fr; }
    .bn-actions { flex-direction: column; align-items: stretch; }
    .bn-save-btn { width: 100%; }
    .bn-item { flex-wrap: wrap; padding: 16px; }
    .bn-thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; }
    .bn-item-actions { flex-direction: row; width: 100%; }
    .bn-act { flex: 1; }
}

/* ===== TOGGLE (bật/tắt) ===== */
.bn-toggle-wrap { position: relative; display: flex; align-items: center; justify-content: center; flex: none; }
.bn-switch {
    position: relative; display: inline-block; flex: none;
    width: 52px; height: 30px;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
}
/* input phủ kín toàn bộ công tắc → vùng bấm luôn đúng */
.bn-toggle-input {
    position: absolute; inset: 0; z-index: 2;
    width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.bn-switch .slider {
    position: absolute; inset: 0; border-radius: 999px;
    background: #cfd6ea;
    box-shadow: inset 0 2px 5px rgba(75,80,130,.18);
    transition: background .3s ease, box-shadow .3s ease;
}
.bn-switch .slider::before {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 24px; height: 24px; border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 8px rgba(75,80,130,.30);
    transition: transform .3s cubic-bezier(.3,1.4,.5,1), width .2s ease;
}
.bn-toggle-input:checked + .slider {
    background: linear-gradient(135deg, #34c38f, #249553);
    box-shadow: inset 0 2px 5px rgba(0,0,0,.12), 0 0 0 4px rgba(52,195,143,.18);
}
.bn-toggle-input:checked + .slider::before { transform: translateX(22px); }
.bn-toggle-input:active + .slider::before { width: 28px; }
.bn-toggle-input:checked:active + .slider::before { transform: translateX(18px); }
.bn-toggle-input:focus-visible + .slider { outline: 2px solid #796AFF; outline-offset: 3px; }
.bn-toggle-input:disabled { cursor: not-allowed; }
.bn-toggle-input:disabled + .slider { opacity: .5; }

/* ===== Menu 3 gạch ngang trên mỗi banner ===== */
.bn-more-btn {
    width: 46px; height: 46px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 900; letter-spacing: 1px; line-height: 1;
}
#user-action-dropdown .bn-menu-row {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    margin-bottom: 4px; padding: 10px 14px; border-radius: 10px;
    background: rgba(132,101,244,.08);
    font-size: .95rem; font-weight: 800; color: #293b70;
}
.bn-edit-hint {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 0; padding: 10px 16px;
    border-radius: 14px;
    background: rgba(132,101,244,.10);
    border: 1px dashed rgba(132,101,244,.45);
    color: #5b3fb8; font-size: 13.5px; font-weight: 800;
}
.bn-edit-hint button {
    border: none; background: transparent; color: #8465f4;
    font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 800;
    cursor: pointer; text-decoration: underline; padding: 0;
}

/* ===== ADMIN BANNER: mini loader (danh sách) ===== */
.bn-loading { min-height: 140px; display: flex; align-items: center; justify-content: center; }
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
}
.bn-slide {
  overflow: hidden;
  background-color: white;
  margin: 0 15px;
  height: 80px;
  width: 20px;
  border-radius: 30px;
  box-shadow: 15px 15px 20px rgba(0, 0, 0, 0.1), -15px -15px 30px #fff,
    inset -5px -5px 10px rgba(0, 0, 255, 0.1),
    inset 5px 5px 10px rgba(0, 0, 0, 0.1);
  position: relative;
}
.bn-slide::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 20px;
  width: 20px;
  border-radius: 100%;
  box-shadow: inset 0px 0px 0px rgba(0, 0, 0, 0.3), 0px 420px 0 400px #2697f3,
    inset 0px 0px 0px rgba(0, 0, 0, 0.1);
  animation: animate_2 2.5s ease-in-out infinite;
  animation-delay: calc(-0.5s * var(--i));
}
@keyframes animate_2 {
  0% { transform: translateY(250px); filter: hue-rotate(0deg); }
  50% { transform: translateY(0); }
  100% { transform: translateY(250px); filter: hue-rotate(180deg); }
}

/* =====================================================
   BANNER — countdown, gear, ads-users modal
   ===================================================== */
.app-banner-count {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 6px 14px;
    border-radius: 99px;
    background: rgba(0,0,0,0.62);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .3px;
    pointer-events: none;
}

.bn-gear {
    position: absolute;
    top: 26px;
    right: 30px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.9);
    background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(238,231,255,.85));
    color: #8465f4;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(75,80,130,.16), inset 0 1px 1px rgba(255,255,255,.95);
    transition: transform .2s, box-shadow .2s, color .2s;
}
.bn-gear svg { width: 22px; height: 22px; }
.bn-gear:hover { transform: rotate(40deg) scale(1.06); color: #6a48e0; box-shadow: 0 12px 24px rgba(132,101,244,.28); }
.bn-gear:active { transform: rotate(40deg) scale(.97); }

.bn-field-audience { margin-top: 0; max-width: none; }
#admin-banner-section .bn-card:has(.cs-wrap.open) { overflow: visible; z-index: 30; }

/* ----- Modal quản lý quảng cáo theo user (khung giống modal Giới hạn) ----- */
.modal-card.ads-users-card { max-width: 520px; width: 100%; padding: 0; height: auto; max-height: calc(100dvh - 48px); }
.ads-users-card .glass-modal-header { text-align: center; padding: 22px 20px 16px; }
.ads-users-title {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin: 0; font-size: 19px; font-weight: 800; color: #293b70;
}
.ads-users-title svg { width: 24px; height: 24px; flex: none; color: #796AFF; }
.ads-users-hint { margin: 8px auto 0; max-width: 400px; font-size: .85rem; font-weight: 600; line-height: 1.5; color: #596995; }

.ads-users-body {
    flex: 1 1 auto; min-height: 0; overflow: hidden;
    display: flex; flex-direction: column; gap: 14px;
    padding: 18px 22px 20px;
    background: linear-gradient(180deg, rgba(244,236,255,.35), rgba(238,249,255,.30));
}
.ads-users-search { flex: none; max-width: none; }
.ads-users-list {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    display: flex; flex-direction: column; gap: 12px;
    padding: 2px 4px 6px 2px;
}
.ads-user-row {
    --ar-bg: #e9fff5; --ar-border: rgba(130,235,190,.60); --ar-soft: #d9f9e8; --ar-accent: #249553;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: 20px;
    border: 1px solid var(--ar-border);
    background: linear-gradient(135deg, #ffffff, var(--ar-bg));
    box-shadow: 0 8px 18px rgba(75,80,130,.10), inset 0 1px 1px rgba(255,255,255,.95);
}
.ads-user-row.is-teacher { --ar-bg: #fff6e4; --ar-border: rgba(255,210,130,.65); --ar-soft: #fff0d2; --ar-accent: #b7791f; }
.ads-user-row.is-admin   { --ar-bg: #eaf4ff; --ar-border: rgba(150,200,255,.65); --ar-soft: #e0efff; --ar-accent: #2f7fe8; }
.ads-user-avatar {
    flex: none; width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 800; color: var(--ar-accent); background: var(--ar-soft);
}
.ads-user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ads-user-info strong { font-size: 15px; font-weight: 800; color: #293b70; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ads-user-sub { font-size: 12.5px; font-weight: 700; color: #7184B4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ads-user-row .bn-chip { flex: none; }

.ads-users-card .glass-modal-footer { grid-template-columns: 1fr; padding: 14px 22px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.ads-users-card .glass-modal-footer .glass-modal-primary-btn {
    width: 100%; max-width: 320px; min-width: 0; height: 46px; padding: 0 16px;
    margin: 0 auto;
    border-radius: 14px; font-family: 'Nunito', sans-serif; font-size: 1rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
@media (max-width: 480px) {
    .ads-user-row { flex-wrap: wrap; }
    .ads-user-row .bn-chip { order: 3; }
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(89,105,149,.14);
    color: #596995;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .2s;
}
.modal-close-btn:hover { background: rgba(89,105,149,.26); transform: scale(1.05); }

/* ===== GOI DICH VU: plan cards / chips / pricing ===== */
.plan-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; }
.plan-card { position:relative; display:flex; flex-direction:column; gap:4px; padding:12px 14px; border-radius:16px;
    border:1.5px solid rgba(120,130,180,.25); background:rgba(255,255,255,.7); cursor:pointer; text-align:center;
    font-family:inherit; transition:border-color .15s, box-shadow .15s, transform .15s; }
.plan-card:hover { transform:translateY(-2px); box-shadow:0 6px 16px rgba(80,90,150,.12); }
.plan-card--sel { border-color:var(--tone,#796AFF); box-shadow:0 0 0 3px color-mix(in srgb, var(--tone,#796AFF) 22%, transparent); }
.plan-card--locked { opacity:.75; cursor:default; }
.plan-card strong { font-size:.95rem; color:#293b70; }
.plan-card small { font-size:.72rem; color:#7184B4; line-height:1.45; }
.plan-card em { font-style:normal; font-size:.78rem; font-weight:700; color:var(--tone,#796AFF); }
.plan-lock { font-size:.72rem; color:#3f8ff5; text-decoration:underline; margin-top:2px; }
.plan-chip { display:inline-block; padding:2px 9px; border-radius:999px; font-size:.72rem; font-weight:700; vertical-align:middle; }
.plan-chip--free { background:#eef1f8; color:#596995; }
.plan-chip--unlock1 { background:#eaf4ff; color:#2f7fe8; }
.plan-chip--unlock2 { background:#fff6e4; color:#b7791f; }
.plan-chip--unlock3 { background:#fff0f4; color:#d14d76; }
.plan-chip--muted { background:#eef1f8; color:#8a94b8; }
.plan-table-wrap { overflow-x:auto; border-radius:14px; }
.plan-table { width:100%; border-collapse:collapse; font-size:.82rem; min-width:560px; }
.plan-table th, .plan-table td { padding:8px 10px; text-align:center; border-bottom:1px solid rgba(120,130,180,.15); }
.plan-table th { background:rgba(120,130,180,.08); color:#596995; font-weight:700; font-size:.78rem; }
.plan-table td:first-child, .plan-table th:first-child { text-align:left; color:#596995; }
.plan-col-cur { background:rgba(121,106,255,.08) !important; color:#796AFF !important; font-weight:800; }
.plan-row-cur td { background:rgba(121,106,255,.05); }
.plan-save { color:#249553; font-weight:600; }
.plan-locked { opacity:.85; }

/* ===== TEACHER STATS ===== */
.ts-stat { cursor:default; min-height:130px; padding:18px 20px; }
.ts-num { font-size:2rem !important; letter-spacing:-1px; }
.ts-sub { margin-top:6px; font-size:.75rem; color:#7184B4; font-weight:600; }
#teacher-stats-body .ov-card { margin-bottom:14px; }
#teacher-stats-body .ov-chart { height:120px; }
.ov-bar-sub { background:linear-gradient(#5db9ff,#2f7fe8); }
.ov-bar-asg { background:linear-gradient(#8fe6bb,#249553); }
.ov-legend { display:flex; gap:16px; margin-top:8px; font-size:.75rem; color:#7184B4; }
.ov-legend i { display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:5px; }

/* ===== PHAN TICH AI LOP ===== */
#class-ai-body .ai-report-section { margin-bottom:12px; }

@media (max-width:600px) {
    .plan-cards { grid-template-columns:repeat(2,1fr); }
    .ts-stat { min-height:110px; padding:14px 12px; }
    .ts-num { font-size:1.5rem !important; }
}

/* ===== ADMIN PLAN SETTINGS (A) ===== */
.bn-card-free { --bn-accent:#6b7799; --bn-soft:#eef0f7; --bn-bg:#f4f5fa; --bn-border:rgba(190,195,215,.70); --bn-ring:rgba(107,119,153,.22); }
.bn-plan-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.bn-plan-grid .bn-card { padding:24px 26px; }
.ps-section-title { margin:22px 0 12px; font-size:13px; font-weight:800; letter-spacing:.4px; text-transform:uppercase; color:var(--bn-accent); }
.ps-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:16px; }
.ps-grid .bn-field + .bn-field { margin-top:0; }
.ps-grid .bn-field > label { font-size:13px; }
.ps-null { display:flex; align-items:center; gap:6px; margin-top:6px; font-size:12.5px; font-weight:700; color:#7184B4; }
select.bn-input { appearance:none; cursor:pointer; padding-right:40px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237184B4' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center; }
.bn-input:disabled { opacity:.55; cursor:not-allowed; }
.bn-input.is-invalid { border-color:#d6336c; box-shadow:0 0 0 4px rgba(214,51,108,.15); }
.ps-switch { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:50px; padding:0 16px;
  border-radius:16px; border:1.5px solid var(--bn-border); background:rgba(255,255,255,.96);
  font-size:14px; font-weight:800; color:#293b70; cursor:pointer; }
.ps-switch input { appearance:none; flex:none; width:44px; height:26px; border-radius:99px; background:#d5daea; position:relative; transition:background .2s; cursor:pointer; }
.ps-switch input::after { content:""; position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:#fff; box-shadow:0 2px 6px rgba(0,0,0,.2); transition:transform .2s; }
.ps-switch input:checked { background:var(--bn-accent); }
.ps-switch input:checked::after { transform:translateX(18px); }
.ps-foot { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:24px; padding-top:18px; border-top:1px dashed var(--bn-border); }
.ps-foot .ps-apply { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:700; color:#596995; flex:1; min-width:220px; }
.ps-msg { font-size:13px; font-weight:800; min-height:18px; }
.ps-msg.ok { color:#249553; } .ps-msg.err { color:#d6336c; }
@media (max-width:900px){ .bn-plan-grid{ grid-template-columns:1fr; } }

/* ErrorLog refresh button */
.bn-refresh { display:inline-flex; align-items:center; gap:8px; height:42px; padding:0 18px; border-radius:14px;
  border:1px solid rgba(121,106,255,.35); background:linear-gradient(135deg,#ffffff,#f1ecff); color:#6a54e8;
  font:800 14px 'Nunito',sans-serif; cursor:pointer; box-shadow:0 8px 16px rgba(121,106,255,.18);
  transition:transform .2s, box-shadow .2s; }
.bn-refresh svg { width:18px; height:18px; }
.bn-refresh:hover { transform:translateY(-2px); box-shadow:0 12px 22px rgba(121,106,255,.26); }
.bn-refresh:active { transform:translateY(0) scale(.98); }
.bn-refresh:disabled { opacity:.65; cursor:wait; transform:none; }
.bn-refresh.is-loading svg { animation:bn-spin .8s linear infinite; }
@keyframes bn-spin { to { transform:rotate(360deg); } }

.plan-expiry-banner { display:flex; align-items:center; gap:10px; padding:12px 16px; margin-bottom:14px;
  border-radius:14px; border:1.5px solid rgba(255,159,67,.45); background:linear-gradient(135deg,#fff8ec,#ffeeda);
  color:#8a5a00; font:700 13.5px 'Nunito',sans-serif; }

/* ===== Dropdown đẹp cho Cài đặt gói (admin) ===== */
.bn-plan-grid .bn-card { overflow: visible; }
.bn-plan-grid .bn-card::before { display: none; }
.bn-plan-grid .bn-card:has(.cs-wrap.open) { z-index: 30; }

select.bn-input.cs-native { height: 0; width: 0; padding: 0; border: 0; }
.cs-scope .cs-btn.bn-input { cursor: pointer; text-align: left; display: flex; align-items: center; justify-content: space-between; }
.cs-scope .cs-arrow { border-right-color: var(--bn-accent); border-bottom-color: var(--bn-accent); }
.cs-scope .cs-list { border-color: var(--bn-border); border-radius: 18px; }
.cs-scope .cs-opt:hover { background: var(--bn-soft); }
.cs-scope .cs-opt.selected { background: linear-gradient(135deg, var(--bn-accent), #5B8DEF); color: #fff; }

@supports (appearance: base-select) {
  .cs-scope select,
  .cs-scope select::picker(select) { appearance: base-select; }
  .cs-scope select {
    display: flex; align-items: center; justify-content: space-between;
    background-image: none; padding-right: 16px; cursor: pointer;
  }
  .cs-scope select::picker-icon {
    content: ''; width: 10px; height: 10px;
    border-right: 2.5px solid var(--bn-accent, #796AFF);
    border-bottom: 2.5px solid var(--bn-accent, #796AFF);
    transform: rotate(45deg) translateY(-2px);
    transition: transform .25s ease;
  }
  .cs-scope select:open::picker-icon { transform: rotate(225deg) translateY(-2px); }
  .cs-scope select::picker(select) {
    margin-top: 8px; padding: 8px; max-height: 280px;
    border: 1.5px solid var(--bn-border, rgba(130,95,255,.35));
    border-radius: 18px; background: rgba(255,255,255,.97);
    box-shadow: 0 18px 40px rgba(75,80,130,.25);
    opacity: 0; transform: translateY(-8px) scale(.98);
    transition: opacity .2s ease, transform .2s ease, display .2s allow-discrete, overlay .2s allow-discrete;
  }
  .cs-scope select:open::picker(select) { opacity: 1; transform: none; }
  @starting-style {
    .cs-scope select:open::picker(select) { opacity: 0; transform: translateY(-8px) scale(.98); }
  }
  .cs-scope select option {
    padding: 12px 14px; margin-bottom: 4px; border-radius: 12px;
    color: #293b70; font-weight: 700; cursor: pointer;
  }
  .cs-scope select option::checkmark { display: none; }
  .cs-scope select option:hover { background: #ece2ff; }
  .cs-scope select option:checked {
    background: linear-gradient(135deg, var(--bn-accent, #796AFF), #5B8DEF); color: #fff;
  }
}

/* Bảng giá gói — header giống admin-table (gradient xanh→tím) */
.plan-table thead { background: linear-gradient(90deg, #43CBFF 0%, #9708CC 100%); }
.plan-table thead th { background: transparent; color: #fff; font-weight: 800; letter-spacing: .2px; }
.plan-table thead th.plan-col-cur { background: rgba(255,255,255,.22); color:#fff !important; }

/* ===== Quên mật khẩu inline ===== */
.fp-back-link { background:none; border:none; cursor:pointer; font-size:.85rem; color:#6a54e8; font-weight:700; padding:6px 10px; border-radius:10px; transition:background .15s; }
.fp-back-link:hover { background:rgba(106,84,232,.08); }
#fp-send-btn, #fp-reset-btn { margin-top: 12px; }

#login-step2 .input-group { margin-bottom: 14px; }
#login-step2 .error-message { margin: 4px 0 10px; min-height: 1.2em; }
#login-step2 p[style*='font-size'] { margin-bottom: 16px !important; }
.login-actions { margin-top: 6px; }

/* ===== Teacher stats cards (phuong an A) ===== */
.ts-stat .stat-line { margin-top: 10px; }
.stats-grid .ts-stat .ts-num small { font-size: 1rem; font-weight: 700; color: #7184B4; margin-left: 4px; }

/* ===== PAGER ===== */
.pager-bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px 16px;margin-top:14px;padding:10px 14px;border-radius:20px;background:linear-gradient(135deg,rgba(255,255,255,.85),rgba(244,236,255,.55));border:1px solid rgba(255,255,255,.9);box-shadow:0 8px 18px rgba(75,80,130,.10),inset 0 1px 1px rgba(255,255,255,.95);font-size:.85rem;font-weight:600;color:#596995;order:4;flex:none}
.pager-nav{display:flex;align-items:center;gap:6px}
.pager-btn{width:34px;height:34px;border-radius:12px;border:1px solid rgba(121,106,255,.25);background:#fff;color:#796AFF;font-size:1.05rem;font-weight:800;cursor:pointer;line-height:1}
.pager-btn:disabled{opacity:.4;cursor:not-allowed}
.pager-page{min-width:96px;text-align:center}
.pager-page b{color:#293b70}
.pager-size{display:flex;align-items:center;gap:8px}
.pager-size-input{width:64px;padding:6px 8px;border-radius:12px;border:1px solid rgba(121,106,255,.3);background:#fff;color:#293b70;font-weight:700;text-align:center}
@media (max-width:600px){.pager-bar{justify-content:center}}

/* ===== ErrorLog icon buttons ===== */
.bn-log-actions{display:flex;gap:8px;align-items:center}
.bn-icon-btn{width:42px;height:42px;border-radius:14px;border:1.5px solid;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:transform .2s,box-shadow .2s,opacity .2s}
.bn-icon-btn svg{width:18px;height:18px}
.bn-icon-btn:hover{transform:translateY(-2px)}
.bn-icon-btn:active{transform:translateY(0) scale(.94)}
.bn-icon-btn:disabled{opacity:.55;cursor:wait;transform:none}
.bn-icon-green{background:linear-gradient(135deg,#e9fff5,#d9f9e8);border-color:rgba(36,149,83,.4);color:#249553;box-shadow:0 8px 16px rgba(36,149,83,.18)}
.bn-icon-red{background:linear-gradient(135deg,#fff0f0,#ffe4e4);border-color:rgba(214,51,81,.4);color:#d63351;box-shadow:0 8px 16px rgba(214,51,81,.18)}

/* ===== Custom select trong modal Giới hạn GV ===== */
#teacher-limit-modal .cs-wrap{width:auto}
#teacher-limit-modal #plan-picker .cs-wrap{min-width:200px}
#teacher-limit-modal .cs-wrap:has(>#max-ai-limit-unit){min-width:110px}

/* ===== Mac dinh theme tim cho .cs-scope (banner card / settings card tu override) ===== */
.cs-scope { --bn-accent:#796AFF; --bn-soft:#f0eaff; --bn-bg:#f4ecff; --bn-border:rgba(130,95,255,.35); --bn-ring:rgba(121,106,255,.2); }

/* ===== Filter chips: thumb truot (admin users) ===== */
.admin-filter-chips{position:relative}
.chip-thumb{position:absolute;left:0;top:0;width:0;height:0;border-radius:999px;background:linear-gradient(135deg,#8465f4,#9d7eff);box-shadow:0 6px 16px rgba(132,101,244,.3);transition:left .28s cubic-bezier(.4,0,.2,1),top .28s cubic-bezier(.4,0,.2,1),width .28s cubic-bezier(.4,0,.2,1),height .28s cubic-bezier(.4,0,.2,1),opacity .2s;z-index:0;pointer-events:none;opacity:0}
.filter-chip{position:relative;z-index:1}
.admin-filter-chips .filter-chip.active{background:transparent;border-color:transparent;box-shadow:none;color:#fff}

/* ===== ErrorLog: icon xoay khi loading ===== */
.bn-icon-btn.is-loading svg{animation:bn-spin .8s linear infinite}

/* ===== ErrorLog: nút Chi tiết — phẳng, không nâng/bóng ===== */
.errlog-detail-btn{font-size:.72rem;font-weight:700;color:#796AFF;background:#f0eaff;border:1px solid rgba(121,106,255,.3);border-radius:8px;padding:.28rem .65rem;cursor:pointer;transition:background .15s ease,color .15s ease;white-space:nowrap}
.errlog-detail-btn:hover{background:#e4d9ff;color:#5a3fd0}
.errlog-detail-btn:active{transform:none}

/* ===== Modal Gioi han GV: chinh select dropdown ===== */
#teacher-limit-modal .cs-btn.clay-input{min-height:48px;height:48px;padding:0 14px;font-size:15px}
#teacher-limit-modal .limit-field-ai > div{display:flex;gap:8px;align-items:stretch}
#teacher-limit-modal .limit-field-ai .limit-input{flex:0 0 92px;width:92px}
#teacher-limit-modal .limit-field-ai .cs-wrap{flex:1;min-width:0}
#teacher-limit-modal #plan-picker .cs-wrap{min-width:170px}

/* ===== Loc vai tro nhanh trong header bang users (text trang + mui ten) ===== */
.th-role{white-space:nowrap}
.th-role .role-filter-scope{display:inline-flex}
.th-role .role-filter-wrap{position:relative;display:inline-flex;width:auto}
.th-role .cs-btn.role-filter-btn{display:inline-flex;align-items:center;gap:6px;background:transparent;border:0;color:inherit;font:inherit;font-weight:700;padding:2px 4px;cursor:pointer;white-space:nowrap}
.th-role .cs-btn.role-filter-btn:hover{opacity:.85}
.th-role .cs-btn.role-filter-btn .cs-arrow{border-right-color:#fff;border-bottom-color:#fff}
.role-filter-list{position:fixed;right:auto;top:auto;min-width:180px;z-index:9999}

/* ===== Bang users: chuyen canh muot khi doi loc vai tro ===== */
#admin-users-list .admin-table{animation:auTableIn .3s ease}
@keyframes auTableIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
#admin-users-list .bn-loading{animation:auTableIn .25s ease}

/* ===== Bang gia goi: gia tri loi ich ===== */
.plan-v-good{color:#149a5c;font-weight:800}

/* Bảng so sánh gói: dấu tích SVG + gạch ngang */
.plan-check{width:16px;height:16px;color:#22a06b;display:inline-block;vertical-align:-3px}
.plan-v-yes{color:#22a06b;display:inline-flex}
.plan-v-yes .plan-check{width:18px;height:18px}

/* ===== Teacher stats page polish ===== */
#teacher-stats-body .stats-grid { align-items: stretch; }
#teacher-stats-body .ts-stat { display: flex; flex-direction: column; height: 100%; }
#teacher-stats-body .ts-stat .stat-line { margin-top: auto; padding-top: 12px; }
#teacher-stats-body .ov-card {
    margin: 22px 0;
    cursor: default;
}
#teacher-stats-body .ov-card:hover { transform: none; }
#teacher-stats-body .ov-card-title {
    font-size: 1.05rem; font-weight: 800; color: #293b70;
    margin: 0 0 12px; display: flex; align-items: center; gap: 9px;
}
#teacher-stats-body .ov-card-title::before {
    content: ""; width: 10px; height: 10px; border-radius: 4px; flex: none;
    background: linear-gradient(135deg, #8abaff, #8465f4);
}
#ts-class-select { font-family: inherit; }

/* Nut chon lop -> mau rieng tung lop */
.ts-cls-btn {
    display: inline-flex; align-items: center;
    font-size: .82rem; font-weight: 700; padding: .45rem .95rem;
    border-radius: 12px; border: 1.5px solid; cursor: pointer;
    margin: 0 8px 8px 0; transition: transform .15s ease, box-shadow .15s ease;
}
.ts-cls-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(75,80,130,.18); }
.ts-c0 { background:#eef4ff; color:#2f6fe0; border-color:#c4d9ff; }
.ts-c1 { background:#fff6e4; color:#b7791f; border-color:#ffe3ae; }
.ts-c2 { background:#eafaf0; color:#1d8a4e; border-color:#bfe8cf; }
.ts-c3 { background:#fff0f4; color:#d14d76; border-color:#ffc4d6; }
.ts-c4 { background:#f3ecff; color:#7a4fd0; border-color:#dcc8ff; }
.ts-c5 { background:#e6fbfa; color:#0e8f8a; border-color:#b5ece8; }
.ts-c6 { background:#fff3e6; color:#e07a1f; border-color:#ffd9ae; }
.ts-c7 { background:#eef1f8; color:#596995; border-color:#d5dcf0; }

/* Tieu de muc thong ke ngang hang voi icon */
.ts-ov-head { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.ts-ov-head .ov-card-title { margin:0; }
.ts-ov-head .stat-icon svg { width:24px; height:24px; }

/* ===== Teacher profile: mau the han muc ===== */
.tp-limit.tp-lplan{background:linear-gradient(135deg,#fff,#f0ecff);border-color:rgba(190,165,255,.85)}
.tp-limit.tp-l0{background:linear-gradient(135deg,#fff,#eaf4ff);border-color:rgba(140,190,255,.8)}
.tp-limit.tp-l1{background:linear-gradient(135deg,#fff,#ffeef4);border-color:rgba(255,160,195,.8)}
.tp-limit.tp-l2{background:linear-gradient(135deg,#fff,#e6fbfa);border-color:rgba(90,220,210,.7)}
.tp-limit.tp-l3{background:linear-gradient(135deg,#fff,#fff6e4);border-color:rgba(255,205,120,.85)}
.tp-limit.tp-l4{background:linear-gradient(135deg,#fff,#eafaf0);border-color:rgba(140,220,170,.8)}
.tp-limit.tp-l5{background:linear-gradient(135deg,#fff,#fff3e6);border-color:rgba(255,190,130,.85)}

/* ===== Teacher edit info: hang nhan - input - nut ===== */
.tp-form{display:flex;flex-direction:column;gap:16px}
.tp-row{display:grid;grid-template-columns:150px minmax(0,1fr);align-items:center;gap:14px}
.tp-row-label{font-size:.88rem;font-weight:800;color:#596995;display:flex;align-items:center;gap:7px;white-space:nowrap}
.tp-row-field{display:flex;flex-direction:column;gap:2px}
.tp-row-inputs{display:flex;align-items:center;gap:10px}
.tp-row-inputs .clay-input{flex:1;min-width:0;max-width:420px}
.tp-row-field .tp-note{margin:6px 0 0}
.tp-icon-btn{width:46px;height:46px;min-height:0;padding:0;flex:none;border-radius:14px;display:inline-flex;align-items:center;justify-content:center}
.tp-icon-btn svg{width:20px;height:20px}
.tp-btn-blue{color:#fff;background:linear-gradient(135deg,#6fb3ff,#2f7fe8);border-color:rgba(255,255,255,.35)}
.tp-btn-blue:hover{background:linear-gradient(135deg,#8cc0ff,#3f8ff5)}
.tp-btn-purple{color:#fff;background:linear-gradient(135deg,#b79bff,#7550ee);border-color:rgba(255,255,255,.35)}
.tp-btn-purple:hover{background:linear-gradient(135deg,#c6adff,#8465f4)}
@media (max-width:640px){
    .tp-row{grid-template-columns:1fr;gap:8px}
}

/* ===== Modal doi MK/username/reset: header + footer mau pastel nhu glass modal ===== */
:is(#change-password-modal,#change-username-modal,#reset-password-modal) .modal-card > .modal-title:first-child {
    margin: -32px -32px 18px;
    padding: 20px 28px 16px;
    background:
        radial-gradient(circle at 10% 0%, rgba(255,255,255,.6), transparent 42%),
        radial-gradient(circle at 100% 100%, rgba(255,205,225,.5), transparent 45%),
        linear-gradient(135deg, #d4cafe 0%, #c0dcff 55%, #cdf1ff 100%);
    border-bottom: 1px solid rgba(255,255,255,.7);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 6px 16px rgba(91,104,175,.08);
}
:is(#change-password-modal,#change-username-modal,#reset-password-modal) .modal-actions {
    margin: 26px -32px -32px;
    padding: 14px 20px 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,.6));
    border-top: 1px solid rgba(121,106,255,.15);
    border-radius: 0 0 24px 24px;
}
:is(#change-password-modal,#change-username-modal,#reset-password-modal) .modal-actions .clay-button {
    flex: 1; max-width: 190px; height: 46px; border-radius: 14px; font-weight: 800;
}
:is(#change-password-modal,#change-username-modal,#reset-password-modal) .modal-actions .clay-button.secondary:hover {
    background: linear-gradient(135deg, #796AFF, #5B6EF0);
    color: #fff;
    border-color: transparent;
}
@media (max-width: 768px) {
    :is(#change-password-modal,#change-username-modal,#reset-password-modal) .modal-card > .modal-title:first-child {
        margin: -22px -18px 16px; border-radius: 20px 20px 0 0; padding: 16px 18px 12px;
    }
    :is(#change-password-modal,#change-username-modal,#reset-password-modal) .modal-actions {
        margin: 22px -18px -22px; border-radius: 0 0 20px 20px; padding: 12px 14px 16px;
    }
}

/* 3 modal doi MK/username/reset: an scroll + can giua text nut */
:is(#change-password-modal,#change-username-modal,#reset-password-modal) .modal-card{overflow:hidden}
:is(#change-password-modal,#change-username-modal,#reset-password-modal) .modal-actions .clay-button{display:inline-flex;align-items:center;justify-content:center}

/* Placeholder password khong de len icon mat */
:is(#change-password-modal,#change-username-modal,#reset-password-modal) input[type="password"].clay-input{padding-right:48px}

/* Chan overscroll/rubber-band tren giao dien giao vien */
html:has(:is(#teacher-dashboard, #students-page, #grading-view, #student-dashboard).page.active),
body:has(:is(#teacher-dashboard, #students-page, #grading-view, #student-dashboard).page.active){overscroll-behavior-y:none}
.admin-table-container,.notif-panel,.st-list{overscroll-behavior:contain}


/* ===== TAB TRANG CHU GIAO VIEN ===== */
.home-tabs{position:relative;display:flex;gap:6px;padding:6px;margin:0 auto 18px;width:fit-content;max-width:100%;overflow-x:auto;scrollbar-width:none;border-radius:999px;background:linear-gradient(135deg,rgba(255,255,255,.8),rgba(244,236,255,.55));border:1px solid rgba(255,255,255,.9);box-shadow:0 8px 18px rgba(75,80,130,.10),inset 0 1px 1px rgba(255,255,255,.95)}
.home-tabs::-webkit-scrollbar{display:none}
.home-tab-indicator{position:absolute;top:6px;bottom:6px;left:0;z-index:0;width:var(--w,0);transform:translateX(var(--x,0));border-radius:999px;background:linear-gradient(135deg,#8E7BFF,#796AFF);box-shadow:0 6px 14px rgba(121,106,255,.35);transition:transform .38s cubic-bezier(.3,1.15,.4,1),width .38s cubic-bezier(.3,1.15,.4,1)}
.home-tab{position:relative;z-index:1;flex:0 0 auto;height:40px;padding:0 18px;border:0;border-radius:999px;background:transparent;color:#596995;font-weight:700;font-size:.92rem;cursor:pointer;white-space:nowrap;transition:background .2s,color .2s,box-shadow .2s}
.home-tab:hover:not(.active){background:rgba(121,106,255,.08)}
.home-tab.active{background:transparent;color:#fff;box-shadow:none}
.home-tab-badge{display:inline-block;min-width:20px;margin-left:6px;padding:0 6px;border-radius:999px;background:#FF5C7A;color:#fff;font-size:.72rem;line-height:20px;text-align:center}
.home-tab.active .home-tab-badge{background:#fff;color:#796AFF}

/* ===== MODAL CHON LOP GIAO BAI ===== */
.cp-mode{display:flex;align-items:center;justify-content:center;gap:12px;font-weight:700;color:#7184B4}
.cp-mode-label.on{color:#293b70}
.cp-switch{position:relative;width:54px;height:30px;border-radius:999px;border:0;background:#C9CEE8;cursor:pointer;transition:background .2s}
.cp-switch[aria-checked="true"]{background:#796AFF}
.cp-switch-knob{position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.2);transition:transform .2s}
.cp-switch[aria-checked="true"] .cp-switch-knob{transform:translateX(24px)}
.cp-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin-top:14px;max-height:50vh;overflow:auto;padding:4px}
.cp-class{position:relative;padding:14px 12px 14px 16px;border-radius:18px;border:3px solid transparent;background:rgba(255,255,255,.85);background:color-mix(in srgb,var(--cp-color) 16%,#fff);color:#293b70;font-weight:700;text-align:left;cursor:pointer;box-shadow:0 6px 14px rgba(75,80,130,.10);transition:transform .15s,border-color .15s}
.cp-class::before{content:"";position:absolute;left:0;top:12px;bottom:12px;width:5px;border-radius:0 6px 6px 0;background:var(--cp-color)}
.cp-class:hover{transform:translateY(-2px)}
.cp-class.selected{border-color:#2F80ED}
.cp-check{position:absolute;top:50%;right:10px;transform:translateY(-50%);width:22px;height:22px;border-radius:50%;background:#2F80ED;color:#fff;display:none;align-items:center;justify-content:center}
.cp-class.selected .cp-check{display:flex}
.cp-warn{display:block;margin-top:6px;font-size:.72rem;color:#D9822B;font-weight:700}
.class-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.class-chip{padding:6px 12px;border-radius:999px;font-weight:700;font-size:.85rem;color:#293b70;background:rgba(255,255,255,.85);background:color-mix(in srgb,var(--cp-color) 20%,#fff);border:2px solid var(--cp-color)}


/* ===== LUỒNG TẠO BÀI 3 BƯỚC ===== */
/* (rule nền tím phẳng cũ đã bị khối "NÂNG CẤP GIAO DIỆN TAB TẠO BÀI" thay thế) */
.step-basic{position:relative;overflow:hidden;background:linear-gradient(135deg,#ffffff,#eaf4ff);border:1px solid rgba(150,200,255,.60);border-radius:20px;padding:16px 18px;margin-bottom:14px;box-shadow:0 12px 24px rgba(75,80,130,.10),inset 0 1px 1px rgba(255,255,255,.95);}
.step-basic::before{content:"";position:absolute;width:220px;height:150px;right:-90px;bottom:-60px;border-radius:50%;background:rgba(255,255,255,.35);transform:rotate(-25deg);pointer-events:none;}
.step-label{font-size:.88rem;font-weight:700;color:#293b70;display:block;margin-bottom:.35rem;}
.class-picker-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.class-picker-row .class-chips{margin-top:0;flex:1;min-width:120px;}
.create-mode-picker{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:0;max-height:0;opacity:0;overflow:hidden;transition:max-height .4s cubic-bezier(.3,.9,.3,1),opacity .32s ease,margin .4s ease;}
.create-mode-picker.open{max-height:340px;opacity:1;margin:6px 0 14px;}
.create-mode-card{position:relative;display:flex;align-items:center;gap:12px;text-align:left;border:3px solid transparent;border-radius:18px;padding:14px 16px;cursor:pointer;font-family:inherit;transition:transform .18s,border-color .18s,box-shadow .18s;}
.create-mode-card:nth-child(1){background:linear-gradient(120deg,#e9fff5,#bfeedd);}
.create-mode-card:nth-child(2){background:linear-gradient(120deg,#fff3e2,#ffd9ad);}
.create-mode-card:hover{transform:translateY(-2px);}
.create-mode-card.selected{border-color:#796AFF;box-shadow:0 8px 24px rgba(121,106,255,.22);}
.create-mode-card.locked{opacity:.55;cursor:not-allowed;filter:grayscale(.4);}
.cmc-icon{width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.cmc-icon svg{width:24px;height:24px;}
.cmc-icon-saved{background:#d9f9e8;color:#249553;}
.cmc-icon-new{background:#ffe7cc;color:#d97b1f;}
.cmc-icon-ai{background:#ece5ff;color:#8465f4;}
.cmc-text{display:flex;flex-direction:column;gap:2px;flex:1;}
.cmc-text strong{font-size:1rem;color:#293b70;}
.cmc-text small{font-size:.78rem;color:#7184B4;}
.cmc-check{width:26px;height:26px;border-radius:50%;border:2px solid #c9c2e8;display:flex;align-items:center;justify-content:center;color:transparent;flex-shrink:0;}
.cmc-check svg{width:14px;height:14px;}
.create-mode-card.selected .cmc-check{background:#796AFF;border-color:#796AFF;color:#fff;}
.create-panel{animation:panelIn .28s cubic-bezier(.2,.9,.3,1.2);}
@keyframes panelIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.saved-panel-head{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:10px;}
.search-wrap{position:relative;flex:1;min-width:160px;}
.search-wrap svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:16px;height:16px;color:#7184B4;pointer-events:none;}
.search-wrap .clay-input{padding-left:36px;}
.saved-set-list{display:flex;flex-direction:column;gap:10px;max-height:46vh;overflow:auto;padding-right:4px;}
.saved-set-card{position:relative;display:flex;align-items:center;gap:10px;border:2px solid transparent;border-left:6px solid var(--set-color);border-radius:14px;padding:10px 14px;cursor:pointer;background:linear-gradient(120deg,#fff,color-mix(in srgb,var(--set-color) 7%,#fff));transition:border-color .15s,transform .15s;}
.saved-set-card:hover{transform:translateX(3px);}
.saved-set-card.selected{border-color:#796AFF;background:#f0eaff;}
.ssc-main{flex:1;min-width:0;}
.ssc-main strong{display:block;font-size:.95rem;color:#293b70;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ssc-meta{display:flex;gap:6px;align-items:center;margin-top:4px;flex-wrap:wrap;}
.ssc-chip{font-size:.72rem;font-weight:700;padding:2px 8px;border-radius:999px;background:color-mix(in srgb,var(--set-color) 16%,#fff);color:#293b70;}
.ssc-date{font-size:.72rem;color:#7184B4;}
.ssc-del{border:none;background:transparent;color:#a0a8c0;cursor:pointer;padding:6px;border-radius:8px;flex-shrink:0;}
.ssc-del:hover{color:#f06491;background:#fff0f5;}
.ssc-del svg{width:16px;height:16px;}
.ssc-more{align-self:center;}
.saved-set-empty{display:flex;flex-direction:column;align-items:center;gap:8px;padding:26px 10px;color:#7184B4;}
.saved-set-empty svg{width:44px;height:44px;opacity:.5;}
.ai-scan-card{display:flex;align-items:center;gap:12px;background:linear-gradient(120deg,#ece5ff,#ffe5ee);border-radius:16px;padding:14px 16px;margin-bottom:12px;}
.ai-scan-text{flex:1;display:flex;flex-direction:column;gap:2px;}
.ai-scan-text strong{color:#293b70;}
.ai-scan-text small{color:#7184B4;font-size:.8rem;}
.create-divider{display:flex;align-items:center;gap:12px;color:#a0a8c0;font-size:.82rem;margin:4px 0 14px;}
.create-divider::before,.create-divider::after{content:'';flex:1;height:1px;background:#e3defa;}
.back-to-modes{background:none;border:none;color:#8465f4;font-weight:700;font-size:.85rem;cursor:pointer;padding:0 0 10px;}
.create-actions-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:14px;justify-content:center;}
.sticky-actions{position:sticky;bottom:12px;z-index:5;background:rgba(255,255,255,.82);backdrop-filter:blur(10px);border-radius:16px;padding:10px 12px;box-shadow:0 -4px 24px rgba(41,59,112,.10);}
.part-num{width:26px;height:26px;border-radius:50%;background:linear-gradient(135deg,var(--part-color,#796AFF),color-mix(in srgb,var(--part-color,#796AFF) 70%,#fff));color:#fff;font-weight:800;font-size:.8rem;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.part-type-chip{font-size:.72rem;font-weight:700;padding:3px 10px;border-radius:999px;background:color-mix(in srgb,var(--part-color,#796AFF) 14%,#fff);color:var(--part-color,#796AFF);white-space:nowrap;}
.part-meta{font-size:.78rem;color:#7184B4;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.icon-btn{border:none;background:transparent;color:#7184B4;cursor:pointer;padding:6px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;}
.icon-btn:hover{background:#eef1fb;color:#293b70;}
.icon-btn.danger:hover{background:#fff0f5;color:#f06491;}
.icon-btn svg{width:17px;height:17px;}
.icon-btn .chev{transition:transform .2s;}
.part-card.expanded .icon-btn .chev{transform:rotate(180deg);}
.part-fields-row{display:grid;grid-template-columns:1fr 1fr;gap:0 14px;}
@media (max-width:600px){
  .create-mode-picker{grid-template-columns:1fr;}
  .part-fields-row{grid-template-columns:1fr;}
  .class-picker-row{flex-direction:column;align-items:stretch;}
}


/* ===== PART CARD: header to hơn + type tabs trượt + fields thẳng hàng ===== */
.part-num{width:32px;height:32px;font-size:.92rem;}
.part-type-chip{font-size:.84rem;padding:5px 13px;}
.part-meta{font-size:.85rem;}
.icon-btn{padding:8px;}
.icon-btn svg{width:20px;height:20px;}
.part-header{gap:8px;}

/* Type selector → tab trượt */
#teacher-dashboard .type-selector{
  display:flex;gap:4px;position:relative;
  background:rgba(255,255,255,.78);
  border:1px solid rgba(190,175,255,.45);
  border-radius:14px;padding:4px;margin-bottom:1.5rem;
}
#teacher-dashboard .type-ind{
  position:absolute;top:4px;bottom:4px;border-radius:10px;
  background:linear-gradient(135deg,#796AFF,#5B8DEF);
  box-shadow:0 4px 14px rgba(121,106,255,.35);
  transition:left .3s cubic-bezier(.3,.9,.3,1.15),width .3s cubic-bezier(.3,.9,.3,1.15);
  z-index:0;pointer-events:none;
}
#teacher-dashboard .type-option{
  flex:1;min-width:0;padding:.6rem .3rem;font-size:.8rem;font-weight:700;
  border:none;background:transparent !important;box-shadow:none !important;
  border-radius:10px;color:#5a6a9e;position:relative;z-index:1;
  transition:color .2s,background .2s;
}
#teacher-dashboard .type-option::before{display:none;}
#teacher-dashboard .type-option:hover{background:transparent !important;transform:none;box-shadow:none;color:#293b70;}
#teacher-dashboard .type-option.selected{
  background:transparent !important;color:#fff !important;
  box-shadow:none !important;transform:none;
}
#teacher-dashboard .type-option.selected span{color:#fff;}

/* Đề bài + Tổng điểm cùng chiều cao */
.part-fields-row{align-items:stretch;margin-top:1.5rem;}
.part-fields-row .input-group{display:flex;flex-direction:column;margin-top:0 !important;}
.part-fields-row .clay-textarea,.part-fields-row .clay-input{flex:1;min-height:64px;height:auto;}


/* ===== REFINE: type tab colors, points field, action buttons, prompt ===== */
/* Màu chữ theo loại khi chưa chọn */
#teacher-dashboard .type-option[data-type="multiple-choice"]{color:#2c4a94 !important;}
#teacher-dashboard .type-option[data-type="fill-blank"]{color:#8a4d0e !important;}
#teacher-dashboard .type-option[data-type="true-false"]{color:#0b5f58 !important;}
#teacher-dashboard .type-option[data-type="short-answer"]{color:#5b2ea8 !important;}
#teacher-dashboard .type-option[data-type="sentence-ordering"]{color:#065f46 !important;}
#teacher-dashboard .type-option[data-type="find-mistake"]{color:#8f2f1d !important;}
#teacher-dashboard .type-option[data-type="multiple-choice"]:hover{background:rgba(91,141,239,.10) !important;}
#teacher-dashboard .type-option[data-type="fill-blank"]:hover{background:rgba(244,162,97,.12) !important;}
#teacher-dashboard .type-option[data-type="true-false"]:hover{background:rgba(42,157,143,.10) !important;}
#teacher-dashboard .type-option[data-type="short-answer"]:hover{background:rgba(155,93,229,.10) !important;}
#teacher-dashboard .type-option[data-type="sentence-ordering"]:hover{background:rgba(6,214,160,.10) !important;}
#teacher-dashboard .type-option[data-type="find-mistake"]:hover{background:rgba(231,111,81,.10) !important;}

/* Tổng điểm: ô nhỏ phía trên đề bài */
.part-fields-row{display:flex;flex-direction:column;gap:10px;}
.part-fields-row .points-field{max-width:130px;}
.part-fields-row .points-field .clay-input{min-height:0 !important;height:44px !important;flex:none !important;}
.part-fields-row .clay-textarea{min-height:64px;}

/* Thanh nút: 3 màu, dồn phải */
#new-actions-bar{justify-content:flex-end;}
#total-score-badge{background:linear-gradient(135deg,#e9a72c,#f06491) !important;color:#fff !important;border:none !important;}
.btn-save-set{background:linear-gradient(135deg,#37C9A5,#249553) !important;color:#fff !important;border:none !important;}
.btn-save-main{background:linear-gradient(135deg,#796AFF,#5B8DEF) !important;color:#fff !important;border:none !important;}

/* Ô prompt: bỏ hiệu ứng hover */
.fg-prompt:hover,.fg-prompt:focus{box-shadow:none !important;}


/* =====================================================
   NÂNG CẤP GIAO DIỆN TAB TẠO BÀI — scope #teacher-dashboard
   ===================================================== */

/* 3.1 Vỏ card glass có quầng sáng */
#teacher-dashboard .content-area > .create-assignment-card,
#teacher-dashboard .content-area > .create-assignment-card:hover {
  background:
    radial-gradient(circle at 0% 0%,   rgba(190,170,255,.45), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(160,220,255,.50), transparent 42%),
    radial-gradient(circle at 60% 100%,rgba(255,190,215,.32), transparent 45%),
    rgba(255,255,255,.62);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 25px 55px rgba(74,70,120,.12), 0 8px 20px rgba(90,100,150,.08),
              inset 0 1px 1px rgba(255,255,255,.85);
}
#teacher-dashboard .create-assignment-card > h2 { border-bottom:1px solid rgba(132,101,244,.18); padding-bottom:10px; }

/* 3.2 Bước 1 */
#teacher-dashboard .create-assignment-card .step-basic {
  background: linear-gradient(135deg,#ffffff 0%,#d9ebff 100%);
  border: 1.5px solid rgba(110,175,255,.6);
  border-left: 6px solid #3f8ff5;
}
#teacher-dashboard .create-assignment-card .step-basic .clay-input:focus {
  border-color:#3f8ff5; box-shadow:0 0 0 4px rgba(63,143,245,.18);
}
#teacher-dashboard .create-assignment-card .step-label { color:#293b70; font-weight:800; }

/* 3.3 Thẻ chọn cách tạo */
#teacher-dashboard .create-mode-card {
  --mc:#249553;
  background:linear-gradient(135deg,#fff,color-mix(in srgb,var(--mc) 12%,#fff));
  border:2px solid color-mix(in srgb,var(--mc) 28%,#fff);
  box-shadow:0 8px 18px rgba(75,80,130,.10);
}
#teacher-dashboard .create-mode-card:nth-child(2){ --mc:#e9a72c; }
#teacher-dashboard .create-mode-card.selected{
  border-color:var(--mc);
  box-shadow:0 0 0 4px color-mix(in srgb,var(--mc) 22%,transparent),0 14px 26px rgba(75,80,130,.16);
}
#teacher-dashboard .create-mode-card.selected .cmc-check{ background:var(--mc); border-color:var(--mc); }
#teacher-dashboard .cmc-icon-saved{ background:linear-gradient(135deg,#38C995,#249553); color:#fff; box-shadow:0 6px 14px rgba(36,149,83,.3); }
#teacher-dashboard .cmc-icon-new  { background:linear-gradient(135deg,#f5b52e,#e9822c); color:#fff; box-shadow:0 6px 14px rgba(233,130,44,.3); }

/* 3.4 Panel bộ đề + AI scan */
#teacher-dashboard .saved-set-card.selected{ border-color:var(--set-color); background:color-mix(in srgb,var(--set-color) 14%,#fff); }
#teacher-dashboard .ai-scan-card{
  background:linear-gradient(120deg,#e3d8ff,#cfe6ff 55%,#ffd9ea);
  border:1px solid rgba(255,255,255,.9);
  box-shadow:0 10px 22px rgba(121,106,255,.16);
}
#teacher-dashboard .cmc-icon-ai{ background:linear-gradient(135deg,#9a89ff,#5b8dff); color:#fff; box-shadow:0 6px 14px rgba(121,106,255,.35); }
#teacher-dashboard .create-divider{ color:#7184B4; font-weight:700; }
#teacher-dashboard .create-divider::before,
#teacher-dashboard .create-divider::after{ background:linear-gradient(90deg,transparent,rgba(132,101,244,.35),transparent); }

/* 3.5 Phần bài — màu theo loại câu hỏi */
#teacher-dashboard .create-assignment-card .part-card{
  --part-color:#796AFF;
  background:linear-gradient(135deg,#fff 0%,color-mix(in srgb,var(--part-color) 10%,#fff) 100%);
  border:1.5px solid color-mix(in srgb,var(--part-color) 32%,#fff);
  border-left:6px solid var(--part-color);
  box-shadow:0 10px 22px rgba(75,80,130,.10), inset 0 1px 1px rgba(255,255,255,.95);
  animation:slideUpFade .45s cubic-bezier(.16,1,.3,1) both;
}
#teacher-dashboard .create-assignment-card .part-card:hover{
  border-color:color-mix(in srgb,var(--part-color) 55%,#fff);
  border-left-color:var(--part-color);
  box-shadow:0 16px 30px rgba(75,80,130,.16);
}
#teacher-dashboard .create-assignment-card .part-num{ box-shadow:0 4px 10px color-mix(in srgb,var(--part-color) 45%,transparent); }
#teacher-dashboard .create-assignment-card .part-type-chip{ font-weight:800; border:1px solid color-mix(in srgb,var(--part-color) 30%,transparent); }

/* 3.6 Thanh chọn loại — indicator theo --part-color + chấm màu */
#teacher-dashboard .type-selector{ background:rgba(255,255,255,.7); border:1px solid rgba(255,255,255,.9);
  box-shadow:inset 0 1px 2px rgba(75,80,130,.06); }
#teacher-dashboard .type-ind{
  background:linear-gradient(135deg,var(--part-color),color-mix(in srgb,var(--part-color) 72%,#5B8DEF));
  box-shadow:0 6px 14px color-mix(in srgb,var(--part-color) 45%,transparent);
}
#teacher-dashboard .type-option::after{ content:''; display:inline-block; width:7px; height:7px; margin-left:6px;
  border-radius:50%; background:currentColor; opacity:.55; vertical-align:middle; }
#teacher-dashboard .type-option.selected::after{ background:#fff; opacity:.9; }

/* 3.7 Nhãn, ô nhập, bộ đếm */
#teacher-dashboard .create-assignment-card .part-card .input-group label{
  color:#293b70; font-weight:800; font-size:.92rem; display:flex; align-items:center; gap:8px; }
#teacher-dashboard .create-assignment-card .part-card .input-group label::before{
  content:''; width:8px; height:8px; border-radius:50%; background:var(--part-color); flex:none; }
#teacher-dashboard .create-assignment-card .part-card :is(.clay-input,.clay-textarea){
  border:1.5px solid color-mix(in srgb,var(--part-color) 35%,#fff); background:rgba(255,255,255,.95); }
#teacher-dashboard .create-assignment-card .part-card :is(.clay-input,.clay-textarea):focus{
  border-color:var(--part-color);
  box-shadow:0 0 0 4px color-mix(in srgb,var(--part-color) 20%,transparent); }
#teacher-dashboard .create-assignment-card .question-count{
  display:inline-flex; align-items:center; margin-top:.6rem; padding:5px 14px; border-radius:999px;
  font-size:.85rem; font-weight:800; color:var(--part-color);
  background:color-mix(in srgb,var(--part-color) 13%,#fff);
  border:1px solid color-mix(in srgb,var(--part-color) 28%,transparent); }

/* 3.8 Nút thêm phần — nét đứt */
#teacher-dashboard #add-part-btn{
  width:100%; min-height:54px; border:2px dashed rgba(132,101,244,.45);
  background:rgba(255,255,255,.6); color:#5B6EF0; font-weight:800; box-shadow:none; }
#teacher-dashboard #add-part-btn:hover{ background:rgba(132,101,244,.10); border-color:#8465f4; transform:translateY(-2px); }

/* 3.9 Thanh hành động sticky + badge đúng 10 điểm */
#new-actions-bar{
  padding:12px 14px; border-radius:20px; background:rgba(255,255,255,.7);
  border:1px solid rgba(255,255,255,.9); box-shadow:0 10px 24px rgba(75,80,130,.12);
  position:sticky; bottom:12px; z-index:5;
}
.btn-save-set { box-shadow:0 8px 18px rgba(36,149,83,.32) !important; }
.btn-save-main{ box-shadow:0 8px 18px rgba(121,106,255,.35) !important; }
#total-score-badge{ box-shadow:0 8px 18px rgba(233,130,44,.30); }
#total-score-badge:has(#badge-score-value.ok){ background:linear-gradient(135deg,#38C995,#249553) !important; }

@media (max-width:420px){
  #teacher-dashboard .type-option{font-size:.68rem;padding:.55rem .15rem;}
  #teacher-dashboard .type-option::after{width:5px;height:5px;margin-left:3px;}
}


/* ===== REFINE 2: giọt nước theo màu loại + dọn action bar ===== */
/* Indicator = giọt nước bo dài theo màu loại đang chọn */
#teacher-dashboard .type-ind{
  background:linear-gradient(135deg,var(--ind-c,#796AFF),color-mix(in srgb,var(--ind-c,#796AFF) 68%,#5B8DEF));
  border-radius:52% 48% 56% 44% / 62% 58% 42% 38%;
  transform:rotate(-1.5deg);
  box-shadow:0 6px 16px color-mix(in srgb,var(--ind-c,#796AFF) 50%,transparent);
}

/* Action bar: chỉ còn hàng nút thường, không khung */
#new-actions-bar{
  display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:14px;
  padding:0 !important;border-radius:0 !important;background:none !important;
  border:none !important;box-shadow:none !important;position:static !important;
}

/* Nút thêm phần gọn lại */
#teacher-dashboard #add-part-btn{ min-height:42px; padding:8px 14px; font-size:.9rem; }

/* Bộ đếm số câu: gọn vừa nội dung */
#teacher-dashboard .create-assignment-card .question-count{
  display:inline-flex; align-items:center; width:fit-content; max-width:100%;
  padding:3px 12px; font-size:.8rem;
}


/* ===== REFINE 3: thanh trượt dưới nút + màu dạng bài tươi ===== */
/* Bỏ giọt nước → thanh mảnh dưới nút đang chọn, màu theo loại */
#teacher-dashboard .type-ind{
  top:auto;bottom:3px;height:5px;
  border-radius:999px;
  transform:none;
  background:var(--ind-c,#796AFF);
  box-shadow:0 2px 8px color-mix(in srgb,var(--ind-c,#796AFF) 55%,transparent);
}

/* Màu chữ các loại — tông tươi, đọc rõ trên nền sáng */
#teacher-dashboard .type-option[data-type="multiple-choice"]{color:#2c6fd8 !important;}
#teacher-dashboard .type-option[data-type="fill-blank"]{color:#d97b1f !important;}
#teacher-dashboard .type-option[data-type="true-false"]{color:#0b8f7d !important;}
#teacher-dashboard .type-option[data-type="short-answer"]{color:#8a3fd1 !important;}
#teacher-dashboard .type-option[data-type="sentence-ordering"]{color:#0aa86a !important;}
#teacher-dashboard .type-option[data-type="find-mistake"]{color:#d63c50 !important;}
#teacher-dashboard .type-option[data-type="multiple-choice"]:hover{background:rgba(77,150,255,.12) !important;}
#teacher-dashboard .type-option[data-type="fill-blank"]:hover{background:rgba(255,159,67,.14) !important;}
#teacher-dashboard .type-option[data-type="true-false"]:hover{background:rgba(0,191,165,.12) !important;}
#teacher-dashboard .type-option[data-type="short-answer"]:hover{background:rgba(165,94,234,.12) !important;}
#teacher-dashboard .type-option[data-type="sentence-ordering"]:hover{background:rgba(0,214,143,.14) !important;}
#teacher-dashboard .type-option[data-type="find-mistake"]:hover{background:rgba(255,94,108,.12) !important;}

/* Nút thêm phần gọn vừa nội dung */
#teacher-dashboard #add-part-btn{
  width:auto;display:inline-flex;align-items:center;justify-content:center;
  min-height:0;padding:9px 18px;font-size:.88rem;
}


/* ===== REFINE 4: thanh sát đáy + ô chọn tô màu đặc ===== */
#teacher-dashboard .type-ind{
  bottom:4px;height:4px;z-index:2;
  background:color-mix(in srgb,var(--ind-c,#796AFF) 78%,#1e2a5a);
  box-shadow:none;
}
#teacher-dashboard .type-option.selected{
  background:linear-gradient(135deg,var(--opt-c,#796AFF),color-mix(in srgb,var(--opt-c,#796AFF) 72%,#5B8DEF)) !important;
  color:#fff !important;
  box-shadow:0 6px 16px color-mix(in srgb,var(--opt-c,#796AFF) 45%,transparent);
}


/* ===== REFINE 5: thanh trượt nằm dưới các ô ~0.5cm ===== */
#teacher-dashboard .type-selector{ padding-bottom:18px; }
#teacher-dashboard .type-ind{ bottom:5px; }


/* ===== REFINE 6: type tabs = pill trượt như home tabs ===== */
#teacher-dashboard .type-selector{
  padding:4px;border-radius:16px;
  background:rgba(255,255,255,.78);
  border:1px solid rgba(190,175,255,.45);
}
#teacher-dashboard .type-ind{
  top:4px;bottom:4px;height:auto;
  border-radius:12px;
  background:linear-gradient(135deg,var(--ind-c,#796AFF),color-mix(in srgb,var(--ind-c,#796AFF) 70%,#5B8DEF));
  box-shadow:0 4px 12px color-mix(in srgb,var(--ind-c,#796AFF) 45%,transparent);
  transition:left .3s cubic-bezier(.3,.9,.3,1.15),width .3s cubic-bezier(.3,.9,.3,1.15);
}
#teacher-dashboard .type-option.selected{
  background:transparent !important;
  color:#fff !important;
  box-shadow:none !important;
}

#teacher-dashboard .type-option.selected[data-type]{color:#fff !important;}

#teacher-dashboard .type-ind{z-index:0 !important;}
#teacher-dashboard .type-option{z-index:1 !important;}


/* ===== REFINE 7 ===== */
#teacher-dashboard .create-assignment-card .part-card{ border-left-width:1.5px; }
#teacher-dashboard .create-assignment-card .step-basic{ border-left-width:1.5px; }
#new-actions-bar{ flex-wrap:nowrap; }
#new-actions-bar .clay-button{ flex:1 1 0; min-width:0; font-size:.85rem; padding:10px 6px; white-space:nowrap; }
@media (max-width:420px){
  #new-actions-bar .clay-button{ font-size:.78rem; padding:9px 4px; }
}


/* ===== BATCH UI FIXES v71 ===== */

/* 1. Class picker: bo deu vien, bo canh trai */
.cp-class::before{display:none}
.cp-class{border:2px solid color-mix(in srgb,var(--cp-color) 35%,#fff)}
.cp-class.selected{border-color:#2F80ED}

/* 2. AI scan modal: nut chon file dep + bo hover glow */
.ais-file-drop{display:flex;align-items:center;justify-content:center;gap:10px;min-height:54px;padding:10px 16px;border:2px dashed rgba(132,101,244,.45);border-radius:16px;background:rgba(255,255,255,.7);color:#5B6EF0;font-weight:800;font-size:.95rem;cursor:pointer;transition:background .2s,border-color .2s,transform .15s}
.ais-file-drop svg{width:22px;height:22px;flex:none}
.ais-file-drop:hover{background:rgba(132,101,244,.08);border-color:#8465f4;transform:translateY(-1px)}
#ai-scan-modal .clay-input:hover,#ai-scan-modal .clay-input:focus-visible,
#ai-scan-modal .clay-textarea:hover,#ai-scan-modal .clay-textarea:focus-visible{box-shadow:none}

/* 3. Action bar: desktop nhu cu (can giua, xuong hang duoc), mobile 1 hang */
#teacher-dashboard #new-actions-bar{flex-wrap:wrap;justify-content:center;gap:10px}
#teacher-dashboard #new-actions-bar .clay-button{flex:0 0 auto;font-size:.92rem;padding:.6rem 1.1rem}
@media (max-width:600px){
  #teacher-dashboard #new-actions-bar{flex-wrap:nowrap;gap:6px}
  #teacher-dashboard #new-actions-bar .clay-button{flex:1 1 0;min-width:0;font-size:.78rem;padding:.55rem .3rem;white-space:nowrap}
}

/* 5. Home tab indicator theo mau tung tab */
.home-tab-indicator{background:var(--tab-c,#796AFF);background-image:none;box-shadow:0 6px 14px color-mix(in srgb,var(--tab-c,#796AFF) 45%,transparent)}
.home-tab.active .home-tab-badge{color:var(--tab-c,#796AFF)}

/* 7. Admin user tabs */
.au-tabs{margin:8px 0 14px;width:fit-content;max-width:100%}

/* 8. Result view dong bo giao dien moi */
#result-view .result-summary{background:linear-gradient(135deg,#ffffff 0%,#eef4ff 100%);border:1.5px solid rgba(150,200,255,.6);border-radius:20px;box-shadow:0 14px 30px rgba(75,80,130,.12);padding:1.4rem 1.6rem}
#result-view .score-display{display:flex;align-items:baseline;justify-content:center;gap:12px;flex-wrap:wrap;text-align:center}
#result-view .score-label{display:none}
#result-view .score-value{font-size:2.8rem;font-weight:900;line-height:1.1}
#result-view .score-value.rs-red{color:#f06491}
#result-view .score-value.rs-amber{color:#e9a72c}
#result-view .score-value.rs-green{color:#249553}
#result-view .feedback-text{margin:.8rem 0 0;color:#596995;font-size:.95rem;line-height:1.55}
#result-view .part-header{background:linear-gradient(135deg,var(--pt-color,#796AFF) 0%,color-mix(in srgb,var(--pt-color,#796AFF) 72%,#3a2d7a) 100%) !important;border:1.5px solid color-mix(in srgb,var(--pt-color,#796AFF) 60%,#fff) !important;border-radius:16px !important;box-shadow:0 8px 18px color-mix(in srgb,var(--pt-color,#796AFF) 35%,transparent)}
#result-view .part-header h3{color:#fff}
#result-view .part-header h3::before{display:none}
#result-view .part-header p{color:rgba(255,255,255,.85) !important}
#result-view .question-card{background:#fff;border:1.5px solid rgba(190,200,230,.7);border-radius:16px;padding:1rem 1.2rem;box-shadow:0 6px 14px rgba(75,80,130,.07);margin-bottom:.9rem}
#result-view .question-number{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:34px;padding:0 10px;border-radius:12px;background:linear-gradient(135deg,#8E7BFF,#796AFF);color:#fff;font-weight:800;font-size:.9rem;margin-bottom:.5rem}
#result-view .question-text{font-weight:700;color:#293b70;font-size:1rem;line-height:1.5}
#result-view .submit-section{margin-top:1.4rem}

/* 9. Teacher stats mobile */
@media (max-width:768px){
  #teacher-stats-section .dashboard-panel{padding:14px !important;border-radius:18px}
  #teacher-stats-body .stats-grid{grid-template-columns:repeat(2,1fr) !important;gap:10px !important}
  #teacher-stats-body .stat-card{aspect-ratio:auto !important;min-height:88px;padding:12px 10px !important}
  #teacher-stats-body .stat-card .stat-value,#teacher-stats-body .stat-card .sd-value{font-size:1.5rem !important}
  #teacher-stats-body .ov-card{padding:14px !important;border-radius:16px}
  #teacher-stats-body .ov-chart{height:110px;gap:5px}
  #teacher-stats-body .ov-mini{gap:8px;margin-top:12px}
  #teacher-stats-body .ov-mini > div{padding:10px 12px}
  #teacher-stats-body .ov-mini b{font-size:20px}
  #teacher-stats-body .admin-table-container{overflow-x:auto;-webkit-overflow-scrolling:touch}
  #teacher-stats-body .admin-table{min-width:520px}
  .ts-cls-btn{font-size:.8rem;padding:.45rem .8rem}
}

/* v72 */
.ts-tabs{margin:0 0 14px;width:fit-content;max-width:100%;overflow-x:auto}
.ts-tabs .home-tab{font-size:.85rem;padding:0 14px;height:36px}
@media (max-width:600px){.ts-tabs .home-tab{font-size:.78rem;padding:0 10px;height:34px}}

/* v73 */
.umg-tabs{margin:0 auto 16px;width:fit-content;max-width:100%;overflow-x:auto}
.umg-tabs .home-tab{font-size:.88rem;padding:0 16px}
@media (max-width:600px){.umg-tabs .home-tab{font-size:.8rem;padding:0 11px}}

/* Bulk import modal: nut AI 1 dong mau cong nghe + chan cuon nen */
#bulk-import-modal .modal-card{max-height:calc(100vh - 32px);display:flex;flex-direction:column;overflow:hidden}
#bulk-import-modal .uf-body{overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;min-height:0}
#bulk-import-modal [data-act="aiExtractBulkNames"],#bulk-import-modal [data-act="suggestBulkUsernames"]{background:linear-gradient(135deg,#7b5cff 0%,#00c6ff 100%) !important;color:#fff !important;border:none !important;box-shadow:0 6px 18px rgba(0,160,255,.35),inset 0 1px 0 rgba(255,255,255,.35) !important;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;gap:6px}
#bulk-import-modal [data-act="aiExtractBulkNames"]:hover,#bulk-import-modal [data-act="suggestBulkUsernames"]:hover{transform:translateY(-1px);box-shadow:0 10px 22px rgba(0,160,255,.45),inset 0 1px 0 rgba(255,255,255,.35) !important}

/* v74 - bo hanh mau dam ben trai toan cuc teacher dashboard */
#teacher-dashboard .create-assignment-card .step-basic{border-left:1.5px solid rgba(110,175,255,.6) !important}
#teacher-dashboard .create-assignment-card .part-card{border-left:1.5px solid color-mix(in srgb,var(--part-color,#796AFF) 32%,#fff) !important}
#teacher-dashboard .create-assignment-card .part-card:hover{border-left-color:color-mix(in srgb,var(--part-color,#796AFF) 55%,#fff) !important}
#teacher-dashboard :is(.assignment-item,.user-card,.question-card){border-left-width:1.5px !important;border-left-color:var(--tone-border,rgba(150,200,255,.6)) !important}
#teacher-dashboard :is(.assignment-item,.user-card,.question-card):hover{border-left-color:var(--tone-border,rgba(150,200,255,.6)) !important}
#teacher-dashboard .td-history-item{border-left:1px solid rgba(121,106,255,.12) !important}
#teacher-dashboard .saved-set-card{border-left-width:2px !important}

/* chong luot lo tren mobile */
@media (max-width:768px){
  html,body{overscroll-behavior-y:contain}
  #teacher-dashboard,#students-page,#student-dashboard{overscroll-behavior:contain}
}

/* v75 - bao cao hoc tap */
.sr-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.sr-stat{background:#fff;border:1.5px solid rgba(150,200,255,.5);border-radius:14px;padding:10px 12px;text-align:center;box-shadow:0 6px 14px rgba(75,80,130,.08)}
.sr-stat b{display:block;font-size:1.25rem;font-weight:900;color:#293b70;line-height:1.2}
.sr-stat span{font-size:.75rem;font-weight:700;color:#7184B4}
.sr-chart{margin-top:14px;background:#fff;border:1.5px solid rgba(150,200,255,.5);border-radius:14px;padding:12px 14px}
.sr-chart>b{font-size:.85rem;color:#293b70}
.sr-bars{display:flex;align-items:flex-end;gap:6px;height:120px;margin-top:10px}
.sr-bar{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;min-width:0}
.sr-bar i{width:100%;max-width:34px;border-radius:6px 6px 2px 2px;display:block}
.sr-bar span{font-size:.62rem;color:#7184B4;margin-top:3px}
.sr-legend{display:flex;gap:14px;margin-top:8px;font-size:.72rem;color:#596995}
.sr-legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:4px}
.sr-ai{margin-top:14px;background:linear-gradient(135deg,#f4f0ff,#e8f4ff);border:1.5px solid rgba(123,92,255,.35);border-radius:14px;padding:12px 14px}
.sr-ai b{color:#7b5cff;font-size:.85rem}
.sr-ai p{margin:6px 0 4px;font-size:.88rem;color:#293b70;line-height:1.55;white-space:pre-wrap}
.sr-ai small{color:#7184B4;font-size:.72rem}
.sr-ai-err{background:#fff5f5;border-color:rgba(240,100,145,.35)}
.sr-ai-err b{color:#f06491}
.sr-list{margin-top:14px}
.sr-list>b{font-size:.85rem;color:#293b70}
.sr-row{display:flex;justify-content:space-between;gap:10px;padding:7px 4px;border-bottom:1px dashed rgba(120,130,180,.2);font-size:.82rem;color:#4a5a8a}
.sr-row span:first-child{font-weight:700;color:#293b70}
.sr-row span:last-child{white-space:nowrap;color:#7184B4}
@media (max-width:600px){.sr-grid{grid-template-columns:repeat(2,1fr)}}

/* v80 - dong bo modal AI nhan xet / tong hop voi thiet ke moi */
#class-ai-modal .ai-report-section{
    background:#fff;
    border:1.5px solid rgba(150,200,255,.45);
    border-radius:16px;
    padding:14px 16px;
    margin-bottom:14px;
    box-shadow:0 8px 18px rgba(75,80,130,.07);
}
#class-ai-modal .ai-report-ok{border-color:rgba(56,201,149,.45);background:linear-gradient(135deg,#fff,#f2fbf7)}
#class-ai-modal .ai-report-warn{border-color:rgba(245,181,46,.5);background:linear-gradient(135deg,#fff,#fffaf0)}
#class-ai-modal .ai-report-idea{border-color:rgba(123,92,255,.4);background:linear-gradient(135deg,#fff,#f7f4ff)}
#class-ai-modal .ai-report-section-title{font-size:.92rem;letter-spacing:.2px}
#class-ai-modal .ai-report-section-title::before{display:none}
#class-ai-modal .ai-report-ok .ai-report-section-title{color:#1f9d6c}
#class-ai-modal .ai-report-warn .ai-report-section-title{color:#b07d10}
#class-ai-modal .ai-report-idea .ai-report-section-title{color:#7b5cff}
#class-ai-modal .ai-report-section-content{color:#4a5a8a;font-size:.9rem;line-height:1.65}
#class-ai-modal .limit-body{background:linear-gradient(180deg,rgba(244,240,255,.25),rgba(232,244,255,.2))}
#class-ai-modal .glass-modal-footer{background:rgba(255,255,255,.55)}
#class-ai-modal #class-ai-meta{background:#fff;border:1.5px dashed rgba(120,130,180,.3);border-radius:12px;padding:8px 12px}
#class-ai-modal .limit-body>p{background:#fff;border:1.5px solid rgba(150,200,255,.45);border-radius:14px;padding:14px 16px;color:#596995;font-weight:600;text-align:center}
#class-ai-modal .limit-body>p[style*="f06491"]{border-color:rgba(240,100,145,.4);background:#fff5f7}

/* ===== AI quét tài liệu: chip metadata + khu vực dùng tài liệu ===== */
.ais-meta-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.ais-chip{display:inline-flex;align-items:center;gap:4px;background:rgba(132,101,244,.1);border:1px solid rgba(132,101,244,.25);color:#4a3fb5;font-size:.8rem;font-weight:600;padding:4px 10px;border-radius:999px}
.ais-chip b{font-weight:800}
.fg-doc-check{display:flex;align-items:center;gap:8px;font-size:.88rem;font-weight:700;color:#3d4a7a;cursor:pointer;margin-bottom:8px}
.fg-doc-check input{width:16px;height:16px;accent-color:#8465f4}
.fg-doc-modes{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}
.fg-doc-mode{display:flex;align-items:flex-start;gap:8px;font-size:.85rem;color:#4a5a8a;cursor:pointer;line-height:1.4}
.fg-doc-mode input{margin-top:2px;accent-color:#8465f4}
#ais-card-doc{color:#249553 !important;font-weight:700}

/* ===== O NHAP PHANG: khong bong nang, khong vien sang khi hover/focus ===== */
:is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden]), textarea, select),
:is(.clay-input, .clay-textarea, .clay-select, .cs-btn) {
    transition: background-color .15s ease, border-color .15s ease;
}
:is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden])):hover,
:is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden])):focus,
:is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden])):focus-visible,
:is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden])):active,
:is(textarea):hover,
:is(textarea):focus,
:is(textarea):focus-visible,
:is(textarea):active,
:is(select):hover,
:is(select):focus,
:is(select):focus-visible,
:is(select):active,
:is(.clay-input, .clay-textarea, .clay-select, .cs-btn):hover,
:is(.clay-input, .clay-textarea, .clay-select, .cs-btn):focus,
:is(.clay-input, .clay-textarea, .clay-select, .cs-btn):focus-visible,
:is(.clay-input, .clay-textarea, .clay-select, .cs-btn):active {
    box-shadow: none !important;
    transform: none !important;
    border-color: rgba(90, 100, 140, .45) !important;
    outline: none !important;
}


/* ===== TIEU DE HEADER CANH GIUA (modal rong) ===== */
.ai-report-header--center { position: relative; min-height: 76px; }
.ai-report-header--center .ai-report-title-wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* ===== BROADCAST + FEEDBACK MODAL: O NOI DUNG KHONG PHAT SANG ===== */
#broadcast-modal .clay-input,
#broadcast-modal .clay-input:hover,
#broadcast-modal .clay-input:focus,
#broadcast-modal select.clay-input,
#broadcast-modal select.clay-input:hover,
#broadcast-modal select.clay-input:focus {
    background: rgba(255, 255, 255, 0.92) !important;
    border-color: rgba(121, 106, 255, 0.22) !important;
    box-shadow: none !important;
}
#broadcast-modal .clay-textarea,
#feedback-modal .clay-textarea,
#broadcast-modal .clay-textarea:hover,
#broadcast-modal .clay-textarea:focus,
#broadcast-modal .clay-textarea:focus-visible,
#feedback-modal .clay-textarea:hover,
#feedback-modal .clay-textarea:focus,
#feedback-modal .clay-textarea:focus-visible {
    box-shadow: none !important;
    outline: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1.5px solid rgba(121, 106, 255, 0.22) !important;
    border-radius: 14px !important;
    color: #293b70 !important;
    font-weight: 600 !important;
}
#broadcast-modal .clay-textarea:hover,
#feedback-modal .clay-textarea:hover { background: #fff !important; }
#broadcast-modal .clay-textarea:focus,
#broadcast-modal .clay-textarea:focus-visible,
#feedback-modal .clay-textarea:focus,
#feedback-modal .clay-textarea:focus-visible { background: #fff !important; border-color: #796AFF !important; }

/* ===== THANH CUON: MAU THEO NGU CANH (bien CSS) ===== */
/* Trang giao vien / hoc sinh / lam bai: nen tim nhat */
#teacher-dashboard, #students-page, #student-dashboard, #grading-view, #assignment-view, #result-view {
    --sb-thumb: rgba(122, 92, 245, 0.30);
    --sb-thumb-hover: rgba(122, 92, 245, 0.55);
}
/* Trang admin: tong xanh duong nhat */
#admin-dashboard {
    --sb-thumb: rgba(63, 143, 245, 0.30);
    --sb-thumb-hover: rgba(63, 143, 245, 0.55);
}
/* Modal glass: thumb tim xanh nhat */
.glass-modal-card, .modal-card {
    --sb-thumb: rgba(121, 106, 255, 0.25);
    --sb-thumb-hover: rgba(121, 106, 255, 0.45);
}
/* Modal thong bao theo loai */
.notice-card[data-type="success"] { --sb-thumb: rgba(36, 149, 83, 0.30); --sb-thumb-hover: rgba(36, 149, 83, 0.5); }
.notice-card[data-type="error"] { --sb-thumb: rgba(240, 100, 145, 0.30); --sb-thumb-hover: rgba(240, 100, 145, 0.5); }
.notice-card[data-type="confirm"], .notice-card[data-type="exit"] { --sb-thumb: rgba(233, 167, 44, 0.32); --sb-thumb-hover: rgba(233, 167, 44, 0.55); }
/* Modal chi tiet admin + bang + danh sach thong bao */
.adm-card { --sb-thumb: rgba(132, 101, 244, 0.28); --sb-thumb-hover: rgba(132, 101, 244, 0.5); }
.admin-table-container, .notif-panel { --sb-thumb: rgba(121, 106, 255, 0.30); }

/* Dropdown append vao body: dat lai bien vi mat ke thua */
.cs-list, .role-filter-list { --sb-thumb: rgba(121, 106, 255, 0.28); --sb-w: 5px; }


/* ===== CREATE MODE: TAB CHUYEN DOI CO VIEN THUOC TRUOT ===== */
.create-mode-picker{
    position:relative;
    display:flex !important;
    gap:8px;
    padding:5px;
    background:rgba(255,255,255,.5);
    border:1px solid rgba(255,255,255,.9);
    border-radius:22px;
    box-shadow:inset 0 1px 3px rgba(75,80,130,.06);
    max-height:0;opacity:0;overflow:hidden;margin:0;
    transition:max-height .4s cubic-bezier(.3,.9,.3,1),opacity .32s ease,margin .4s ease;
}
.create-mode-picker.open{max-height:140px;opacity:1;margin:6px 0 14px;}
.create-mode-ind{
    position:absolute;top:5px;bottom:5px;left:0;width:0;
    border-radius:18px;z-index:0;pointer-events:none;
    background:linear-gradient(135deg,#a8d4ff,#8ec2ff);
    box-shadow:0 6px 16px rgba(63,143,245,.28);
    transition:left .42s cubic-bezier(.3,1.05,.4,1),width .42s cubic-bezier(.3,1.05,.4,1),background .3s,box-shadow .3s;
}
.create-mode-picker[data-mode="new"] .create-mode-ind{
    background:linear-gradient(135deg,#ffd9a0,#ffbe6e);
    box-shadow:0 6px 16px rgba(233,167,44,.32);
}
.create-mode-card{
    position:relative;z-index:1;
    flex:1 1 0;min-width:0;
    display:flex;align-items:center;gap:12px;
    text-align:left;border:none !important;border-radius:18px !important;
    padding:14px 16px !important;background:transparent !important;
    box-shadow:none !important;cursor:pointer;font-family:inherit;
    transition:color .2s;
}
.create-mode-card:hover{transform:none !important;background:rgba(255,255,255,.35) !important;}
.create-mode-card .cmc-icon{width:44px;height:44px;border-radius:12px;flex-shrink:0;}
.create-mode-card .cmc-icon svg{width:24px;height:24px;}
.create-mode-card .cmc-text{flex:1;align-items:flex-start;gap:2px;min-width:0;}
.create-mode-card .cmc-text strong{font-size:1rem;color:#596995;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .2s;}
.create-mode-card .cmc-text small{font-size:.78rem;color:#9aa2c4;transition:color .2s;}
.create-mode-card .cmc-check{display:none;}
.create-mode-card.cmm-saved.selected .cmc-text strong{color:#1d4e89;}
.create-mode-card.cmm-saved.selected .cmc-text small{color:#41719f;}
.create-mode-card.cmm-new.selected .cmc-text strong{color:#8a4d00;}
.create-mode-card.cmm-new.selected .cmc-text small{color:#a06a1e;}
.create-mode-card.locked{opacity:.5;cursor:not-allowed;}


/* ===== MEO GOI Y CHO O GHI CHU TAI LIEU (icon bong den) ===== */
.doc-notes-tip{
    display:flex;align-items:flex-start;gap:8px;
    margin:2px 0 8px;padding:9px 12px;
    border-radius:12px;
    background:linear-gradient(135deg,#fff8e6,#ffefd2);
    border:1px solid rgba(233,167,44,.35);
    color:#7a5a17;
    font-size:.8rem;font-weight:600;line-height:1.45;
}
.doc-notes-tip svg{width:16px;height:16px;flex-shrink:0;margin-top:1px;color:#e9a72c;}

/* ===== TAB QUẢN LÍ BỘ ĐỀ ===== */
.sets-card{--sets-accent:#e5484d}
.sets-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.sets-head h2{margin:0;color:var(--sets-accent);display:flex;align-items:center;gap:8px}
.sets-head h2 svg{color:var(--sets-accent)}

/* Nút tạo bộ đề mới — pill đỏ tinh tế */
.sets-create-btn{display:inline-flex;align-items:center;gap:7px;padding:9px 18px;border:none;border-radius:999px;font-weight:800;font-size:.88rem;color:#fff;background:linear-gradient(135deg,#f26d7d,#e5484d);box-shadow:0 8px 18px rgba(229,72,77,.32);cursor:pointer;transition:transform .15s,box-shadow .15s,filter .15s}
.sets-create-btn svg{width:15px;height:15px}
.sets-create-btn:hover{transform:translateY(-2px);box-shadow:0 12px 24px rgba(229,72,77,.42);filter:brightness(1.04)}
.sets-create-btn:active{transform:translateY(0)}

/* Lưới thẻ bộ đề — pastel gradient mỗi thẻ, không viền trái đậm */
#manage-set-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px}
#manage-set-list .saved-set-empty{grid-column:1/-1}
.ms-card{position:relative;border-radius:18px;padding:44px 14px 14px;background:linear-gradient(135deg,var(--ms-c1),var(--ms-c2));border:1.5px solid rgba(255,255,255,.75);box-shadow:0 8px 18px rgba(75,80,130,.10);display:flex;flex-direction:column;gap:8px;min-height:128px;transition:transform .15s,box-shadow .15s}
.ms-card:hover{transform:translateY(-3px);box-shadow:0 14px 28px rgba(75,80,130,.16)}
.ms-icon{width:38px;height:38px;border-radius:12px;background:rgba(255,255,255,.78);display:flex;align-items:center;justify-content:center;color:var(--sets-accent)}
.ms-icon svg{width:20px;height:20px}
.ms-name{font-size:.95rem;font-weight:800;color:#2b2f4a;line-height:1.3;padding-right:28px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ms-meta{display:flex;flex-wrap:wrap;gap:6px;margin-top:auto}
.ms-meta span{font-size:.72rem;font-weight:700;color:#5a6285;background:rgba(255,255,255,.72);padding:3px 9px;border-radius:999px;white-space:nowrap}

/* Nút 3 chấm + menu dọc */
.ms-menu-btn{position:absolute;top:8px;right:8px;width:30px;height:30px;border:none;background:rgba(255,255,255,.72);border-radius:10px;color:#5a6285;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s,color .15s}
.ms-menu-btn:hover{background:#fff;color:var(--sets-accent)}
.ms-menu-btn svg{width:16px;height:16px}
.ms-menu{position:absolute;top:44px;right:8px;z-index:60;min-width:176px;background:rgba(255,255,255,.98);border:1.5px solid rgba(130,95,255,.28);border-radius:14px;box-shadow:0 14px 34px rgba(75,80,130,.30);padding:6px;display:flex;flex-direction:column;animation:csPop .18s ease}
.ms-menu button{display:flex;align-items:center;gap:9px;width:100%;border:none;background:transparent;padding:9px 11px;border-radius:10px;font-weight:700;font-size:.85rem;color:#293b70;cursor:pointer;text-align:left}
.ms-menu button:hover{background:#f0eaff}
.ms-menu button svg{width:15px;height:15px;flex-shrink:0}
.ms-menu .ms-danger{color:#d64560}
.ms-menu .ms-danger:hover{background:#fff0f3}

/* Lớp đã có bài trùng tên: vô hiệu hoá hoàn toàn, không cho chọn */
.cp-class:disabled{opacity:.55;cursor:not-allowed}
.cp-class:disabled:hover{transform:none}
.cp-class:disabled .cp-check{display:none}
.cp-class.cp-dup{border-style:dashed}

/* Chế độ sửa bộ đề trong tab Quản lí: ẩn chọn lớp / chọn cách tạo / nút giao bài */
.create-assignment-card.set-edit-mode .js-class-picker-group,
.create-assignment-card.set-edit-mode #create-mode-picker,
.create-assignment-card.set-edit-mode #panel-saved,
.create-assignment-card.set-edit-mode #save-btn{display:none !important}
.create-assignment-card.set-edit-mode .btn-save-set{order:2}

/* 3 nút kết quả AI đều chiều ngang nhau */
#fg-result-section > .fg-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
#fg-result-section > .fg-actions .fg-action-btn { font-size: .85rem; padding: 0 8px; gap: 6px; line-height: 1.25; }
#fg-refine-panel .fg-actions { grid-template-columns: 1fr; }
@media (max-width: 560px) {
    #fg-result-section > .fg-actions { grid-template-columns: 1fr; }
}

/* The han muc giao vien: the rong hon, can hon */
.tp-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tp-limit { padding: 18px 20px; min-height: 104px; display: flex; flex-direction: column; justify-content: center; }
.tp-limit-value { font-size: 1.65rem; }

/* The thong ke giao vien: the rong hon (it cot hon) */
#teacher-stats-body .stats-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
#teacher-stats-body .stat-card { min-height: 180px; }

/* The thong ke giao vien: can bang hon (gan vuong) */
#teacher-stats-body .stats-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
#teacher-stats-body .stat-card { min-height: 200px; }
