/* ==========================================================================
   THIẾT KẾ GIAO DIỆN HỆ THỐNG LMS NỘI BỘ (PREMIUM BRIGHT & CLEAN LIGHT MODE)
   ========================================================================== */

/* Font Inter được load qua <link> trong header.ejs — không cần @import ở đây */

:root {
  /* Bảng màu chính (Harmonious Palette - Premium Light Mode) */
  --bg-deep: #f8fafc;          /* Slate 50 - extremely clean bright background */
  --bg-card: #ffffff;          /* Pure white for cards and layout blocks */
  --bg-card-hover: #ffffff;
  --border-light: #e2e8f0;     /* Slate 200 - soft gray border */
  --border-glow: rgba(37, 99, 235, 0.3); /* Soft NHP Tech blue glow */
  
  /* Gradients tinh tế và cao cấp */
  --primary-gradient: linear-gradient(135deg, #0052cc 0%, #2563eb 100%);  /* NHP Tech Blue */
  --secondary-gradient: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%); /* Teal 600 - 500 */
  --alert-gradient: linear-gradient(135deg, #ea580c 0%, #f43f5e 100%);    /* Orange to Rose */
  
  /* Cấp bậc màu văn bản rõ ràng */
  --text-main: #0f172a;        /* Slate 900 - dark text with high readability */
  --text-muted: #64748b;       /* Slate 500 - elegant subtitle/description color */
  --text-accent: #2563eb;      /* NHP Tech Blue - core interactive brand color */
  
  --font-title: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Shadows nâng cao tạo chiều sâu (Premium shadow hierarchy) */
  --shadow-glow: 0 4px 20px rgba(37, 99, 235, 0.1);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 10px 25px -5px rgba(37, 99, 235, 0.1), 0 8px 16px -6px rgba(0, 0, 0, 0.02);
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & THIẾT LẬP CƠ BẢN
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  /* Background gradients cực nhẹ tạo nét tinh tế */
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.04) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(255, 107, 53, 0.035) 0px, transparent 50%);
  background-attachment: fixed;
}

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: #6366f1;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-main);
  line-height: 1.3;
}

/* ==========================================================================
   OVERRIDE TOÀN CỤC: Hủy gradient text trên heading (dùng CSS attribute selector)
   Tất cả h1/h2 dùng inline background-clip trick sẽ bị override về màu solid.
   ========================================================================== */

h1[style*="-webkit-background-clip"],
h2[style*="-webkit-background-clip"] {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: var(--text-main) !important;
  color: var(--text-main) !important;
  font-weight: 700 !important;
}

/* Đồng bộ font-size h1 toàn app — font-size inline style sẽ ghi đè nếu cần */
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 600; }

/* ==========================================================================
   BỐ CỤC CHUNG (LAYOUT)
   ========================================================================== */

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Màu Trắng Tinh Tế */
.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #f1f5f9;
  padding: 1.75rem 1rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.02);
}

.sidebar nav {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding-right: 0.15rem;
}

/* Custom scrollbar cho sidebar */
.sidebar nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar nav::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.1);
  border-radius: 4px;
}
.sidebar nav::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.2);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 2.25rem;
  padding-left: 0.5rem;
  cursor: pointer;
  text-decoration: none;
}

.logo-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-light, #e2e8f0);
  padding: 4px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-container:hover .logo-badge {
  transform: scale(1.05) rotate(-2deg);
}

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

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.logo-text-accent {
  color: #2563eb;
}

html[data-theme="dark"] .logo-text-accent {
  color: #3b82f6;
}

.logo-badge-lms {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: linear-gradient(135deg, #0052cc, #2563eb);
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
  line-height: 1;
}

html[data-theme="dark"] .logo-badge {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
  cursor: pointer;
}

.logo-container i {
  color: #4f46e5;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-container:hover i {
  transform: rotate(-10deg) scale(1.08);
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  color: #64748b;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.nav-item a:hover {
  background: #f8fafc;
  color: var(--text-main);
}

.nav-item a:hover i {
  color: var(--text-accent);
}

.nav-item.active a {
  background: rgba(37, 99, 235, 0.08);
  color: var(--text-accent);
  border-color: rgba(37, 99, 235, 0.15);
}

.nav-item.active a i {
  color: var(--text-accent);
}

.nav-item a i {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
  color: #94a3b8;
  transition: color 0.2s ease;
}

/* Nhãn phần nhóm trong sidebar */
.nav-section-label {
  list-style: none;
  padding: 1.1rem 0.85rem 0.45rem 0.85rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.nav-section-label::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: #f1f5f9;
}

.nav-divider {
  list-style: none;
  height: 1px;
  background: #f1f5f9;
  margin: 0.65rem 0.85rem;
}

/* Sidebar profile card widget */
.sb-profile-card {
  padding: 0.75rem 0.85rem;
  margin-top: auto;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #ffffff;
}

.sb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.18);
}

.sb-profile-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex-grow: 1;
}

.sb-profile-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-profile-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0.05rem;
}

.sb-logout-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #fee2e2;
  background: #fff5f5;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s;
  flex-shrink: 0;
  text-decoration: none;
}

.sb-logout-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Khu vực nội dung chính */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2.25rem;
  min-height: 100vh;
  min-width: 0; /* Prevents children from expanding flex container beyond viewport */
}

/* Universal Topbar */
.top-bar {
  background: #ffffff !important;
  border: 1px solid var(--border-light) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01), 0 2px 4px -1px rgba(0, 0, 0, 0.01) !important;
  border-radius: 12px;
}

/* ==========================================================================
   BANNER ĐỒNG VAI (IMPERSONATION)
   ========================================================================== */

.impersonation-banner {
  background: var(--alert-gradient);
  color: #fff;
  padding: 0.75rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.2);
  animation: pulse-border 2s infinite;
  font-weight: 600;
}

.impersonation-banner a {
  background: #fff;
  color: #ef4444;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.impersonation-banner a:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

/* ==========================================================================
   CÁC THÀNH PHẦN GIAO DIỆN ĐẸP (COMPONENTS)
   ========================================================================== */

/* Thẻ Card Sáng Đẹp (Minimalist Elegant Card) */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-hover);
}

/* Nút bấm Premium (Buttons) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.3);
  color: #fff !important;
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.25);
  color: #fff !important;
}

/* Bảng thống kê KPI Cards (Dashboard Grid) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.kpi-card {
  padding: 1.5rem;
  border-radius: 14px;
}

.kpi-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: #4f46e5;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.kpi-value.secondary {
  color: #0d9488;
}

/* Danh sách khóa học dạng Grid */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.course-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.course-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.course-card:hover {
  transform: translateY(-4px);
}

.course-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.course-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* Thanh Tiến độ học tập (Progress Bar) */
.progress-container {
  width: 100%;
  background: #f1f5f9;
  height: 7px;
  border-radius: 4px;
  margin-top: auto;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--secondary-gradient);
  border-radius: 4px;
  transition: width 0.5s ease-in-out;
}

/* ==========================================================================
   GIAO DIỆN BÀI HỌC CHI TIẾT (LEARNING SCREEN)
   ========================================================================== */

.learning-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  margin-top: 1.5rem;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.learning-layout.sidebar-collapsed {
  grid-template-columns: 1fr;
}

.learning-main {
  min-width: 0;
  flex: 1;
}

.learning-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.learning-layout.sidebar-collapsed .learning-sidebar {
  display: none;
}

@media (max-width: 1024px) {
  .learning-layout {
    grid-template-columns: 1fr;
  }
  .learning-layout.sidebar-collapsed .learning-sidebar {
    display: none;
  }
}

.video-container {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  aspect-ratio: 16/9;
  background: #0f172a;
}

.video-container video, .video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Focus Mode Button */
.btn-theater-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 0.55rem 1.15rem;
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
  user-select: none;
}

.btn-theater-toggle:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.btn-theater-toggle i {
  color: #4f46e5;
  font-size: 0.95rem;
}

.btn-theater-toggle.active i {
  color: #ef4444;
}

/* Sidebar Custom Scrollbar styling */
.lesson-list-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.lesson-list-sidebar::-webkit-scrollbar {
  width: 6px;
}

.lesson-list-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.lesson-list-sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.lesson-list-sidebar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.lesson-details {
  margin-top: 1.5rem;
}

.lesson-tab-nav {
  display: inline-flex;
  gap: 0.25rem;
  background: rgba(15, 23, 42, 0.04);
  padding: 0.3rem;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.55rem 1.15rem;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  border-radius: 7px;
  transition: var(--transition-smooth);
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.02);
}

.tab-btn.active {
  color: #4f46e5;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  color: #334155; /* Slate 700 - smooth text color */
}

/* Sidebar Danh sách bài học */
.lesson-list-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.lesson-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  transition: var(--transition-smooth);
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
}

.lesson-list-item.active {
  border-color: #4f46e5;
  background: rgba(79, 70, 229, 0.04);
  color: #4f46e5;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.06);
}

.lesson-list-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

/* Khung Chat Thảo luận */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 400px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
}

.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-msg {
  background: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  max-width: 85%;
  align-self: flex-start;
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.chat-msg-sender {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-accent);
  margin-bottom: 0.25rem;
}

.chat-input-area {
  display: flex;
  padding: 0.75rem;
  border-top: 1px solid var(--border-light);
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: var(--text-main);
}

.chat-input:focus {
  outline: none;
  border-color: #4f46e5;
}

/* Trợ lý học tập AI (AI Panel Widget) */
.ai-panel {
  margin-top: 2rem;
  border: 1px solid rgba(79, 70, 229, 0.2);
  box-shadow: 0 4px 30px rgba(79, 70, 229, 0.05);
  background: #ffffff;
}

.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1rem;
}

.ai-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ai-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-chat-box {
  height: 250px;
  overflow-y: auto;
  border-radius: 10px;
  background: #f1f5f9;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-msg {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  max-width: 90%;
  font-size: 0.9rem;
  line-height: 1.5;
}

.ai-msg.user {
  background: rgba(79, 70, 229, 0.1);
  color: #1e1b4b;
  align-self: flex-end;
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.ai-msg.assistant {
  background: #ffffff;
  color: var(--text-main);
  align-self: flex-start;
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Hiệu ứng nhấp nháy AI */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 0.5rem;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing-bounce 1s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Trắc nghiệm AI */
.quiz-widget {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: rgba(6, 182, 212, 0.03);
  border-radius: 14px;
  border: 1px solid rgba(6, 182, 212, 0.1);
}

.quiz-option {
  display: block;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  margin-top: 0.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.quiz-option:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.quiz-option.correct {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #064e3b;
  font-weight: 600;
}

.quiz-option.incorrect {
  background: rgba(244, 63, 94, 0.15);
  border-color: #f43f5e;
  color: #4c0519;
  font-weight: 600;
}

/* ==========================================================================
   FORM NHẬP LIỆU & BẢNG SỐ LIỆU (FORMS & TABLES)
   ========================================================================== */

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], textarea, select {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.7rem 0.95rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

input[type="text"]::placeholder, input[type="email"]::placeholder, input[type="password"]::placeholder, textarea::placeholder {
  color: #94a3b8;
  opacity: 1;
}

input[type="text"]:hover, input[type="email"]:hover, input[type="password"]:hover, input[type="number"]:hover, input[type="date"]:hover, textarea:hover, select:hover {
  border-color: #cbd5e1;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="number"]:focus, input[type="date"]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-main);
}

/* Bảng số liệu (Tables) */
.custom-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}

.custom-table th, .custom-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.custom-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f8fafc;
}

.custom-table tr:hover {
  background: #f1f5f9;
}

/* ==========================================================================
   HIỆU ỨNG CHUYỂN ĐỘNG (ANIMATIONS)
   ========================================================================== */

@keyframes typing-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.3); }
  70% { box-shadow: 0 0 0 8px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

/* ==========================================================================
   MA TRẬN VAI TRÒ & THÔNG BÁO NỔI (ROLE MATRIX & TOAST NOTIFICATION)
   ========================================================================== */

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.matrix-table th {
  padding: 1.25rem 1rem;
  border-bottom: 2px solid var(--border-light);
  font-family: var(--font-title);
  color: var(--text-main);
}

.matrix-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.matrix-row {
  transition: var(--transition-smooth);
}

.matrix-row:hover {
  background: #f8fafc;
}

.matrix-checkbox-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.matrix-checkbox {
  cursor: pointer;
  width: 1.2rem;
  height: 1.2rem;
  accent-color: #4f46e5;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.matrix-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  accent-color: var(--text-muted);
}

/* Toast Container & Box */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
}

.toast-box {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  min-width: 300px;
  max-width: 450px;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-box.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   GIAO DIỆN BẢNG ĐIỀU KHIỂN & BÁO CÁO (ADMIN MANAGEMENT & REPORTS OVERRIDES)
   ========================================================================== */

/* Overrides các phần tử có inline styles tối từ EJS nhằm đảm bảo tương phản */
[style*="color: #cbd5e1"], 
[style*="color:#cbd5e1"] {
  color: var(--text-muted) !important;
}

[style*="color: #f1f5f9"], 
[style*="color:#f1f5f9"] {
  color: var(--text-main) !important;
}

[style*="background: rgba(255, 255, 255, 0.03)"],
[style*="background:rgba(255,255,255,0.03)"] {
  background: #f8fafc !important;
}

[style*="background: rgba(255, 255, 255, 0.02)"],
[style*="background:rgba(255,255,255,0.02)"] {
  background: #f8fafc !important;
}

[style*="border: 1px solid var(--border-light)"],
[style*="border:1px solid var(--border-light)"] {
  border-color: var(--border-light) !important;
}

[style*="background: #0f172a"],
[style*="background:#0f172a"] {
  background: var(--bg-card) !important;
}

/* Thông tin chi tiết user trong sidebar */
.user-profile-card {
  background: rgba(248, 250, 252, 0.8) !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  backdrop-filter: blur(8px);
  border-radius: 14px !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.user-profile-card:hover {
  background: #ffffff !important;
  border-color: rgba(79, 70, 229, 0.2) !important;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.04);
  transform: translateY(-2px);
}

.user-profile-card div {
  color: var(--text-main) !important;
}

.user-profile-card span {
  color: var(--text-muted) !important;
}

/* Banner chứa thông tin thống kê và icon online counter */
[style*="color: #10b981"] {
  color: #0d9488 !important; /* Thay thế màu xanh lá cây chói bằng màu ngọc bích sang trọng */
}

/* Override background cho các phần highlight nháp hoặc feedback */
[style*="background: rgba(139, 92, 246, 0.05)"] {
  background: rgba(79, 70, 229, 0.05) !important;
  color: var(--text-main) !important;
}

[style*="color: #cbd5e1"] span {
  color: var(--text-main) !important;
}

/* Các nhãn tùy chọn trong cấu hình phòng ban và lộ trình */
[style*="color: #cbd5e1"] {
  color: var(--text-muted) !important;
}

/* Auth screens overrides for Light Mode */
.error-alert, .alert-error {
  background: #fee2e2 !important;
  border: 1px solid #fca5a5 !important;
  color: #b91c1c !important;
}

.success-alert, .alert-success {
  background: #ccfbf1 !important;
  border: 1px solid #99f6e4 !important;
  color: #0f766e !important;
}

.form-input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: var(--text-main) !important;
}

.form-input:focus {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
}

.login-logo-wrap, .auth-logo {
  background: rgba(79, 70, 229, 0.08) !important;
  border: 1px solid rgba(79, 70, 229, 0.2) !important;
}

.login-logo-wrap i, .auth-logo i {
  color: #4f46e5 !important;
}

.info-hint, .requirement-box {
  color: var(--text-muted) !important;
}

.divider {
  color: var(--text-muted) !important;
}

.hint-box {
  background: #f1f5f9 !important;
  border: 1px solid var(--border-light) !important;
  color: var(--text-muted) !important;
}

.form-input-otp {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #4f46e5 !important;
}

.timer-container {
  background: #f8fafc !important;
  border: 1px solid var(--border-light) !important;
  color: var(--text-muted) !important;
}

.timer-value {
  color: #4f46e5 !important;
}

/* Fix kpi-value gradient text — override về màu solid phù hợp */
.kpi-value[style*="-webkit-background-clip"] {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #4f46e5 !important;
  color: #4f46e5 !important;
}
/* Teal / secondary gradient */
.kpi-value[style*="secondary-gradient"],
.kpi-value[style*="0d9488"],
.kpi-value[style*="14b8a6"] {
  -webkit-text-fill-color: #0d9488 !important;
  color: #0d9488 !important;
}
/* Orange / alert gradient */
.kpi-value[style*="alert-gradient"],
.kpi-value[style*="f59e0b"],
.kpi-value[style*="d97706"],
.kpi-value[style*="ea580c"] {
  -webkit-text-fill-color: #d97706 !important;
  color: #d97706 !important;
}
.kpi-value.secondary {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #0d9488 !important;
  color: #0d9488 !important;
}


/* Badge Trạng Thái Premium */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  -webkit-text-fill-color: currentColor;
}
.badge-success {
  background: rgba(16, 185, 129, 0.08) !important;
  color: #0d9488 !important;
  border: 1px solid rgba(16, 185, 129, 0.2) !important;
}
.badge-warning {
  background: rgba(245, 158, 11, 0.08) !important;
  color: #d97706 !important;
  border: 1px solid rgba(245, 158, 11, 0.2) !important;
}
.badge-secondary {
  background: rgba(148, 163, 184, 0.08) !important;
  color: #64748b !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
}
.badge-info {
  background: rgba(99, 102, 241, 0.08) !important;
  color: #4f46e5 !important;
  border: 1px solid rgba(99, 102, 241, 0.2) !important;
}

/* ==========================================================================
   DASHBOARD HỌC VIÊN CAO CẤP (PREMIUM REDESIGNED CLASS SYSTEM)
   ========================================================================== */

/* Hero Banner */
.student-hero {
  padding: 2.5rem;
  margin-bottom: 2rem;
  border: none;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #0f766e 100%);
  position: relative;
  overflow: hidden;
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(49, 46, 129, 0.18);
  border-radius: 16px;
}
.student-hero::before {
  content: '';
  position: absolute;
  right: -50px;
  top: -50px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(20, 184, 166, 0.15);
  filter: blur(55px);
  pointer-events: none;
}
.student-hero::after {
  content: '';
  position: absolute;
  right: 180px;
  bottom: -80px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  filter: blur(45px);
  pointer-events: none;
}
.student-hero-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}
.student-hero-badge {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ccfbf1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-block;
}
.student-hero-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: #ffffff;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.student-hero-subtitle {
  color: #cbd5e1;
  font-size: 0.95rem;
  margin: 0;
  max-width: 580px;
  font-weight: 500;
  line-height: 1.5;
}
.student-hero-stats-container {
  display: flex;
  gap: 1.25rem;
  flex-shrink: 0;
}
.student-hero-stat-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1.1rem 1.6rem;
  border-radius: 16px;
  text-align: center;
  min-width: 120px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
}
.student-hero-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: block;
}
.student-hero-stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0.25rem 0 0 0;
  line-height: 1;
}
.student-hero-stat-value.active { color: #38bdf8; }
.student-hero-stat-value.done { color: #34d399; }

/* Quick Resume Card */
.quick-resume-card {
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border: 1px solid var(--border-light);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}
.quick-resume-media {
  position: relative;
  flex-shrink: 0;
}
.quick-resume-media img {
  width: 110px;
  height: 70px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.quick-resume-play-icon {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: #4f46e5;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  color: #ffffff;
  font-size: 0.72rem;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.quick-resume-card-completed {
  border: 1px solid rgba(16, 185, 129, 0.25);
  background: #ffffff;
}

/* Course Row Layout */
.course-list-row {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border-radius: 14px;
  transition: var(--transition-smooth);
  background: #ffffff;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
}
.course-list-row:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.course-list-row-image {
  width: 140px;
  height: 85px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.course-list-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}
.course-list-row-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.course-list-row-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* Sidebar Scrollable Panel to prevent vertical overflow */
.sidebar-scroll-panel {
  max-height: 350px;
  overflow-y: auto;
  padding-right: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.sidebar-scroll-panel::-webkit-scrollbar {
  width: 5px;
}
.sidebar-scroll-panel::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-scroll-panel::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 4px;
}
.sidebar-scroll-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.45);
}

/* Calendar Badge */
.calendar-badge {
  border-radius: 10px;
  width: 45px;
  height: 45px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.calendar-badge.normal {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
}
.calendar-badge.normal .badge-month { color: #8b5cf6; }
.calendar-badge.normal .badge-day { color: #8b5cf6; }

.calendar-badge.overdue {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
}
.calendar-badge.overdue .badge-month { color: #ef4444; }
.calendar-badge.overdue .badge-day { color: #ef4444; }

.badge-month {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1;
}
.badge-day {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 2px;
}

/* Roadmap/Timeline */
.roadmap-timeline-wrapper {
  position: relative;
  padding-left: 1.25rem;
  border-left: 2px solid var(--border-light);
  margin-left: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.roadmap-node {
  position: relative;
}
.roadmap-dot {
  position: absolute;
  left: -26px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #06b6d4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* ==========================================================================
   TÁI THIẾT KẾ UI/UX MODERN SAAS STYLE
   ========================================================================== */

/* Modern KPI Cards */
.kpi-card-modern {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-card);
}
.kpi-card-modern:hover {
  border-color: rgba(79, 70, 229, 0.2);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.kpi-icon-container {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.kpi-icon-container.blue {
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.12);
}
.kpi-icon-container.green {
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.12);
}
.kpi-icon-container.purple {
  background: rgba(139, 92, 246, 0.08);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.12);
}
.kpi-icon-container.amber {
  background: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.12);
}
.kpi-card-modern-info {
  flex: 1;
  min-width: 0;
}
.kpi-card-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-weight: 500;
}

/* Pulsing Indicator */
.online-indicator-pulsing {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: online-pulse 2s infinite;
  vertical-align: middle;
}
@keyframes online-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Quick Actions Redesign */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.quick-action-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: var(--transition-smooth);
  text-decoration: none !important;
  box-shadow: var(--shadow-card);
  height: 100%;
}
.quick-action-tile:hover {
  border-color: rgba(79, 70, 229, 0.3);
  background: rgba(79, 70, 229, 0.01);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.quick-action-tile:hover .quick-action-icon {
  transform: scale(1.08);
}
.quick-action-icon {
  font-size: 1.4rem;
  color: var(--text-accent);
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
}
.quick-action-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}
.quick-action-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Timeline Activity Logs */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  transition: var(--transition-smooth);
}
.timeline-item:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.timeline-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  padding-top: 0.15rem;
}
.timeline-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.timeline-body {
  flex: 1;
  min-width: 0;
}
.timeline-user {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.85rem;
}
.timeline-action-text {
  font-size: 0.85rem;
  color: var(--text-main);
  margin-left: 0.25rem;
}
.timeline-details {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

/* Chip Badge styles */
.chip-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
  line-height: 1.2;
}
.chip-badge.blue {
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.15);
}
.chip-badge.green {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.15);
}
.chip-badge.red {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.15);
}
.chip-badge.gray {
  background: rgba(100, 116, 139, 0.08);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.15);
}
.chip-badge.purple {
  background: rgba(139, 92, 246, 0.08);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.15);
}
.chip-badge.amber {
  background: rgba(245, 158, 11, 0.08);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.15);
}

/* drag & drop uploads (compact inline row format) */
.compact-upload-zone {
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 0.65rem 0.95rem;
  background: #f8fafc;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  min-height: 42px;
}
.compact-upload-zone:hover {
  border-color: var(--text-accent);
  background: rgba(79, 70, 229, 0.02);
}
.compact-upload-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}
.compact-upload-icon {
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}
.compact-upload-zone:hover .compact-upload-icon {
  color: var(--text-accent);
}
.compact-upload-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compact-upload-btn {
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--text-main);
  font-weight: 600;
  transition: var(--transition-smooth);
  white-space: nowrap;
}
.compact-upload-zone:hover .compact-upload-btn {
  border-color: var(--text-accent);
  color: var(--text-accent);
}

/* Syllabus Timeline / Lesson Outline (Full-width configuration) */
.syllabus-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.syllabus-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.15rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-card);
}
.syllabus-item:hover {
  border-color: rgba(79, 70, 229, 0.25);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.syllabus-item-main {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
  flex: 1;
}
.syllabus-item-index {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card-hover, #f1f5f9);
  border: 1px solid var(--border-light, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.syllabus-item:hover .syllabus-item-index {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.3);
}
.syllabus-item-content {
  min-width: 0;
  flex: 1;
}
.syllabus-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.syllabus-item-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.syllabus-item-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}
.syllabus-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
  background: #f8fafc;
}
.syllabus-action-btn.view {
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
}
.syllabus-action-btn.view:hover {
  background: #4f46e5;
  color: #ffffff;
}
.syllabus-action-btn.edit {
  background: rgba(139, 92, 246, 0.08);
  color: #8b5cf6;
}
.syllabus-action-btn.edit:hover {
  background: #8b5cf6;
  color: #ffffff;
}
.syllabus-action-btn.delete {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}
.syllabus-action-btn.delete:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Empty State Card */
.empty-state-card {
  border: 2px dashed #e2e8f0;
  border-radius: 16px;
  padding: 3.5rem 2rem;
  text-align: center;
  background: var(--bg-card);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f8fafc;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  border: 1px solid #e2e8f0;
}
.empty-state-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}
.empty-state-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 360px;
  line-height: 1.5;
  margin: 0;
}

/* ==========================================================================
   SIDEBAR COLLAPSED & TOGGLE
   ========================================================================== */

/* Toggle Button on Sidebar border */
.sidebar-toggle-btn {
  position: absolute;
  top: 1.8rem;
  right: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  z-index: 101;
  transition: var(--transition-smooth);
  outline: none;
}

.sidebar-toggle-btn:hover {
  background: #f8fafc;
  color: #4f46e5;
  border-color: #cbd5e1;
  transform: scale(1.08);
}

/* Sidebar transition smooth */
.sidebar {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed state styles */
.sidebar-collapsed .sidebar {
  width: 70px;
  padding: 1.75rem 0.5rem 1.25rem 0.5rem;
}

.sidebar-collapsed .main-content {
  margin-left: 70px;
}

.sidebar-collapsed .sidebar .logo-brand,
.sidebar-collapsed .sidebar .logo-text,
.sidebar-collapsed .sidebar .nav-item a span,
.sidebar-collapsed .sidebar .nav-section-label,
.sidebar-collapsed .sidebar .nav-divider,
.sidebar-collapsed .sidebar .sb-profile-meta,
.sidebar-collapsed .sidebar .sb-logout-btn {
  display: none !important;
}

.sidebar-collapsed .sidebar .logo-container {
  padding-left: 0;
  justify-content: center;
}

.sidebar-collapsed .sidebar .nav-item a {
  justify-content: center;
  padding: 0.65rem 0;
}

.sidebar-collapsed .sidebar .sb-profile-card {
  padding: 0.75rem 0;
  justify-content: center;
  border-top: none;
}

.sidebar-collapsed .sidebar-toggle-btn i {
  transform: rotate(180deg);
}

/* Media Query for mobile responsive off-canvas drawer */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(0);
    transition: transform 0.3s ease;
  }
  .sidebar-collapsed .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .sidebar-collapsed .main-content {
    margin-left: 0;
  }
}

/* ==========================================================================
   DARK MODE TOÀN HỆ THỐNG (Áp dụng cho Navbar, Sidebar, Content, Cards, v.v.)
   ========================================================================== */

html[data-theme="dark"],
body[data-theme="dark"] {
  --bg-deep: #0b0f19;
  --bg-card: #151b2b;
  --bg-card-hover: #1e293b;
  --border-light: #1e293b;
  --border-glow: rgba(37, 99, 235, 0.4);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-accent: #60a5fa;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  background-color: #0b0f19 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] body {
  background-color: #0b0f19 !important;
  color: #f8fafc !important;
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(255, 107, 53, 0.06) 0px, transparent 50%) !important;
}

/* 1. Đảm bảo hiển thị sắc nét cho tất cả chữ và tiêu đề trong Dark Mode */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] strong,
html[data-theme="dark"] b {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-theme="dark"] p,
html[data-theme="dark"] label,
html[data-theme="dark"] li,
html[data-theme="dark"] td,
html[data-theme="dark"] th {
  color: #f1f5f9;
}

html[data-theme="dark"] small,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .subtitle {
  color: #94a3b8 !important;
}

/* 2. Tự động override các mã màu tối inline gây chìm chữ khi sang nền tối */
html[data-theme="dark"] [style*="color: #1e293b"],
html[data-theme="dark"] [style*="color: #0f172a"],
html[data-theme="dark"] [style*="color: #334155"],
html[data-theme="dark"] [style*="color: #475569"],
html[data-theme="dark"] [style*="color: #4338ca"],
html[data-theme="dark"] [style*="color:#1e293b"],
html[data-theme="dark"] [style*="color:#0f172a"],
html[data-theme="dark"] [style*="color:#334155"],
html[data-theme="dark"] [style*="color:#475569"],
html[data-theme="dark"] [style*="color:#4338ca"] {
  color: #f8fafc !important;
}

html[data-theme="dark"] [style*="color: #64748b"],
html[data-theme="dark"] [style*="color:#64748b"] {
  color: #cbd5e1 !important;
}

/* 3. Tự động override các thẻ có nền trắng inline sang nền tối tinh tế */
html[data-theme="dark"] [style*="background: #ffffff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:#ffffff"],
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background-color: #ffffff"],
html[data-theme="dark"] [style*="background-color: #fff"],
html[data-theme="dark"] [style*="background-color:#ffffff"],
html[data-theme="dark"] [style*="background-color:#fff"] {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

/* Nền các box thông báo/thống kê màu pastel trong Dark Mode */
html[data-theme="dark"] [style*="background: #fff7ed"],
html[data-theme="dark"] [style*="background: #fffbeb"],
html[data-theme="dark"] [style*="background: #fff1f2"],
html[data-theme="dark"] [style*="background: #fdf2f8"],
html[data-theme="dark"] [style*="background: #f8fafc"] {
  background: #1a2234 !important;
  border-color: #334155 !important;
}

/* Sidebar / Navbar bên trái trong Dark Mode */
html[data-theme="dark"] .sidebar {
  background: #111827 !important;
  border-right-color: #1e293b !important;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .logo-text {
  color: #f8fafc !important;
}

html[data-theme="dark"] .sidebar .nav-item a {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .sidebar .nav-item a:hover {
  background: #1f2937 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .sidebar .nav-item a:hover i {
  color: #60a5fa !important;
}

html[data-theme="dark"] .sidebar .nav-item.active a {
  background: rgba(37, 99, 235, 0.22) !important;
  color: #93c5fd !important;
  border-color: rgba(37, 99, 235, 0.4) !important;
}

html[data-theme="dark"] .sidebar .nav-item.active a i {
  color: #93c5fd !important;
}

html[data-theme="dark"] .nav-section-label {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .nav-section-label::after,
html[data-theme="dark"] .nav-divider {
  background: #1e293b !important;
}

html[data-theme="dark"] .sb-profile-card {
  background: #111827 !important;
  border-top-color: #1e293b !important;
}

html[data-theme="dark"] .sb-profile-name {
  color: #f8fafc !important;
}

html[data-theme="dark"] .sb-profile-role {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .sb-logout-btn {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .sb-logout-btn:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
}

html[data-theme="dark"] .sidebar-toggle-btn {
  background: #1f2937 !important;
  border-color: #374151 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .sidebar-toggle-btn:hover {
  background: #374151 !important;
  color: #ffffff !important;
  border-color: #6366f1 !important;
}

/* Notification Widget trong Dark Mode */
html[data-theme="dark"] #notification-bell-btn {
  background: #1f2937 !important;
  border-color: #374151 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] #notification-bell-btn:hover {
  background: #374151 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] #notification-dropdown {
  background: #111827 !important;
  border-color: #374151 !important;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .notif-dropdown-header {
  background: #0f172a !important;
  border-bottom-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .notif-item {
  border-bottom-color: #1e293b !important;
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .notif-item:hover {
  background: #1f2937 !important;
}

html[data-theme="dark"] .notif-item.unread {
  background: rgba(99, 102, 241, 0.15) !important;
}

/* 4. Cards, Containers, Tables, Forms trong Dark Mode */
html[data-theme="dark"] .card,
html[data-theme="dark"] .glass-card,
html[data-theme="dark"] .cm-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .content-box,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .exercise-article-wrapper,
html[data-theme="dark"] .coursera-attachment-card,
html[data-theme="dark"] .exercise-audio-player-card,
html[data-theme="dark"] .exercise-quiz-guidance-box {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .quiz-option-label {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .quiz-option-label:hover {
  background: #1e293b !important;
  border-color: #6366f1 !important;
}

html[data-theme="dark"] .quiz-option-label.selected,
html[data-theme="dark"] .quiz-option-label:has(input:checked) {
  background: rgba(99, 102, 241, 0.18) !important;
  border-color: #818cf8 !important;
}

html[data-theme="dark"] .quiz-nav-dot {
  border-color: #374151 !important;
  color: #cbd5e1 !important;
  background: #151b2b !important;
}

html[data-theme="dark"] .quiz-nav-dot.answered {
  background: #4f46e5 !important;
  color: #ffffff !important;
  border-color: #6366f1 !important;
}

html[data-theme="dark"] .table,
html[data-theme="dark"] .custom-table,
html[data-theme="dark"] table {
  color: #f8fafc !important;
  background: transparent !important;
}

html[data-theme="dark"] thead th {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-bottom-color: #334155 !important;
}

html[data-theme="dark"] tbody td {
  border-bottom-color: #1e293b !important;
  color: #f1f5f9 !important;
}

html[data-theme="dark"] tbody tr:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-control {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] .form-control:focus {
  border-color: #818cf8 !important;
  background: #1e293b !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
}

html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .cm-modal,
html[data-theme="dark"] .cm-modal-content,
html[data-theme="dark"] #course-overview-modal {
  background: #151b2b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .cm-modal-header,
html[data-theme="dark"] .cm-modal-footer {
  border-color: #1e293b !important;
}

html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-outline,
html[data-theme="dark"] .btn-light {
  background: #1e293b !important;
  border-color: #374151 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .btn-outline:hover,
html[data-theme="dark"] .btn-light:hover {
  background: #334155 !important;
  border-color: #6366f1 !important;
  color: #ffffff !important;
}

/* 5. Giao diện xem Thời gian biểu / Lịch làm việc trong Dark Mode */
html[data-theme="dark"] .schedule-wrapper,
html[data-theme="dark"] .timeline-container {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .schedule-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .nav-btn,
html[data-theme="dark"] .week-display-badge {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .nav-btn:hover {
  background: #334155 !important;
  color: #818cf8 !important;
}

html[data-theme="dark"] .day-slot-cell {
  background: #151b2b !important;
  border-color: #1e293b !important;
}

html[data-theme="dark"] .timeline-section-header {
  background: #1a2234 !important;
  border-color: #1e293b !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .today-col-bg {
  background: rgba(99, 102, 241, 0.12) !important;
}

html[data-theme="dark"] .shift-item-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] #viewRepContentText,
html[data-theme="dark"] #compareReasonBox {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* 6. Module Quản Lý Khóa Học & Admin (.cm-*) trong Dark Mode */
html[data-theme="dark"] .cm-sticky-toolbar {
  background: rgba(11, 15, 25, 0.95) !important;
  border-bottom-color: #1e293b !important;
}

html[data-theme="dark"] .cm-page-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .cm-page-subtitle {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .cm-filter-tabs {
  background: #151b2b !important;
  border-color: #1e293b !important;
}

html[data-theme="dark"] .cm-tab-btn {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .cm-tab-btn.active {
  background: rgba(99, 102, 241, 0.22) !important;
  color: #818cf8 !important;
}

html[data-theme="dark"] .cm-search-wrapper input {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .cm-create-form {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .cm-create-header {
  border-bottom-color: #1e293b !important;
}

html[data-theme="dark"] .cm-create-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .cm-create-subtitle {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .cm-create-icon {
  background: rgba(99, 102, 241, 0.18) !important;
  color: #818cf8 !important;
}

html[data-theme="dark"] .cm-table-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .cm-table {
  background: #151b2b !important;
}

html[data-theme="dark"] .cm-table thead {
  background: #1e293b !important;
  border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .cm-table th {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .cm-table td {
  border-bottom-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .cm-table tbody tr {
  background: #151b2b !important;
}

html[data-theme="dark"] .cm-table tbody tr:hover {
  background: #1e293b !important;
}

html[data-theme="dark"] .cm-course-title {
  color: #f8fafc !important;
}

html[data-theme="dark"] .cm-course-desc {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .cm-course-img {
  background: #1e293b !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .cm-badge-open {
  background: rgba(13, 148, 136, 0.2) !important;
  color: #2dd4bf !important;
  border-color: rgba(13, 148, 136, 0.35) !important;
}

html[data-theme="dark"] .cm-badge-restricted {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}

html[data-theme="dark"] .cm-badge-published {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

html[data-theme="dark"] .cm-badge-draft {
  background: rgba(148, 163, 184, 0.15) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
}

html[data-theme="dark"] .cm-btn-lessons {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .cm-btn-lessons:hover {
  background: #334155 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .cm-btn-toggle {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .cm-btn-toggle:hover {
  background: #334155 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .cm-btn-edit {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #818cf8 !important;
}

html[data-theme="dark"] .cm-btn-edit:hover {
  background: rgba(99, 102, 241, 0.2) !important;
  border-color: #818cf8 !important;
}

html[data-theme="dark"] .cm-btn-delete {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f87171 !important;
}

html[data-theme="dark"] .cm-btn-delete:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #f87171 !important;
}

html[data-theme="dark"] .cm-pagination {
  background: #111827 !important;
  border-top-color: #1e293b !important;
}

html[data-theme="dark"] .cm-pagination-info {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .cm-page-btn {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .cm-page-btn:hover {
  background: #334155 !important;
  color: #818cf8 !important;
  border-color: #818cf8 !important;
}

html[data-theme="dark"] .cm-page-btn.active {
  background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

html[data-theme="dark"] .cm-modal {
  background: #151b2b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .cm-modal-header {
  border-bottom-color: #1e293b !important;
}

html[data-theme="dark"] .cm-modal-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .cm-modal-close {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}
html[data-theme="dark"] .cm-modal-close:hover {
  background: #334155 !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .cm-assign-panel {
  background: #0b0f19 !important;
  border-color: #1e293b !important;
}
html[data-theme="dark"] .cm-assign-panel::-webkit-scrollbar-thumb {
  background: #334155 !important;
}
html[data-theme="dark"] .cm-assign-label {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .cm-assign-label:hover {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .cm-assign-group-header {
  color: #818cf8 !important;
  border-bottom-color: rgba(99, 102, 241, 0.25) !important;
}
html[data-theme="dark"] .cm-assign-group-btn {
  color: #38bdf8 !important;
}
html[data-theme="dark"] .cm-assign-group-btn:hover {
  color: #7dd3fc !important;
}

/* 7. Module Quản Lý Bài Học (.chapter-*) trong Dark Mode */
html[data-theme="dark"] .chapter-block {
  background: #151b2b !important;
  border-color: #1e293b !important;
}

html[data-theme="dark"] .chapter-header {
  background: #1a2234 !important;
  border-bottom-color: #1e293b !important;
}

html[data-theme="dark"] .btn-back-modern {
  background: #151b2b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .btn-back-modern:hover {
  background: #1e293b !important;
  color: #818cf8 !important;
  border-color: #818cf8 !important;
}

/* 8. Module Bài Kiểm Tra (.as-*) trong Dark Mode */
html[data-theme="dark"] .as-header .as-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .as-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
}

html[data-theme="dark"] .as-card-header {
  border-bottom-color: #1e293b !important;
  background: #1a2234 !important;
}

html[data-theme="dark"] .as-card-title {
  color: #ffffff !important;
}

/* 9. Module Danh Mục Khóa Học (.cb-*) trong Dark Mode */
html[data-theme="dark"] .cb-stats,
html[data-theme="dark"] .cb-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .cb-stat {
  border-right-color: #1e293b !important;
}

html[data-theme="dark"] .cb-stat:hover {
  background: #1e293b !important;
}

html[data-theme="dark"] .cb-card:hover {
  border-color: #334155 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .cb-tab {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .cb-tab:hover {
  border-color: #818cf8 !important;
  color: #818cf8 !important;
}

html[data-theme="dark"] .cb-tab.active {
  background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

html[data-theme="dark"] .cb-search-wrap input,
html[data-theme="dark"] .cb-select {
  background-color: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

/* 10. Module Chi Tiết Khóa Học (.cd-*) trong Dark Mode */
html[data-theme="dark"] .cd-hero-card,
html[data-theme="dark"] .cd-lesson-card,
html[data-theme="dark"] .cd-sidebar-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .cd-enrollment-bar {
  background: #111827 !important;
  border-color: #1e293b !important;
}

html[data-theme="dark"] .cd-progress-track {
  background: #1e293b !important;
}

html[data-theme="dark"] .cd-btn-action.outline {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .cd-btn-action.outline:hover {
  background: #334155 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .cd-lesson-card:hover {
  background: #1e293b !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .cd-lesson-card.locked {
  background: #111827 !important;
  opacity: 0.6;
}

/* 11. Module Quản Trị Giáo Trình Bài Giảng trong Dark Mode */
html[data-theme="dark"] .topic-header {
  background: rgba(99, 102, 241, 0.12) !important;
  border-bottom-color: rgba(99, 102, 241, 0.2) !important;
}

html[data-theme="dark"] .topic-header:hover {
  background: rgba(99, 102, 241, 0.2) !important;
}

html[data-theme="dark"] .syllabus-item {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .syllabus-item:hover {
  background: #1e293b !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .syllabus-item-index {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #94a3b8 !important;
}

html[data-theme="dark"] .syllabus-item:hover .syllabus-item-index {
  background: rgba(99, 102, 241, 0.22) !important;
  border-color: rgba(99, 102, 241, 0.45) !important;
  color: #a5b4fc !important;
}

/* 12. Dashboard Dark Mode Styles */
html[data-theme="dark"] .dashboard-upcoming-item {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .dashboard-upcoming-item:hover {
  background: #1e293b !important;
}

html[data-theme="dark"] .dashboard-quick-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .dashboard-quick-card:hover {
  background: #1e293b !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .student-stat-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
}

html[data-theme="dark"] .course-list-row {
  background: #151b2b !important;
  border-color: #1e293b !important;
}

html[data-theme="dark"] .course-list-row:hover {
  background: #1e293b !important;
}

/* 13. Nhật Ký Hoạt Động Gần Đây & Timeline trong Dark Mode */
html[data-theme="dark"] .timeline-item {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .timeline-item:hover {
  background: #1e293b !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .timeline-icon-box {
  background: #1e293b !important;
  color: #818cf8 !important;
}

html[data-theme="dark"] .timeline-time {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .timeline-user {
  color: #ffffff !important;
}

html[data-theme="dark"] .chip-badge.gray {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .chip-badge.gray strong {
  color: #f8fafc !important;
}

html[data-theme="dark"] .chip-badge.blue {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #60a5fa !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
}

html[data-theme="dark"] .chip-badge.green {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

html[data-theme="dark"] .chip-badge.red {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}

html[data-theme="dark"] .chip-badge.purple {
  background: rgba(139, 92, 246, 0.2) !important;
  color: #a78bfa !important;
  border-color: rgba(139, 92, 246, 0.35) !important;
}

html[data-theme="dark"] .chip-badge.amber {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}

/* 14. Nhật Ký Hệ Thống Audit Logs (.aud-*) trong Dark Mode */
html[data-theme="dark"] .aud-filter-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .aud-label {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .aud-input-wrap input,
html[data-theme="dark"] .aud-select,
html[data-theme="dark"] .aud-date-input {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .aud-btn-reset {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .aud-btn-reset:hover {
  background: #334155 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .aud-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .aud-card-header {
  border-bottom-color: #1e293b !important;
  background: #151b2b !important;
}

html[data-theme="dark"] .aud-table thead {
  background: #1e293b !important;
}

html[data-theme="dark"] .aud-table th {
  color: #94a3b8 !important;
  border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .aud-table td {
  border-bottom-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .aud-table tbody tr {
  background: #151b2b !important;
}

html[data-theme="dark"] .aud-table tbody tr:hover {
  background: #1e293b !important;
}

html[data-theme="dark"] .aud-detail-item {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .aud-detail-item strong {
  color: #f8fafc !important;
}

html[data-theme="dark"] .aud-detail-text {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .aud-pagination-bar {
  background: #111827 !important;
  border-top-color: #1e293b !important;
}

html[data-theme="dark"] .aud-page-btn {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .aud-page-btn:hover:not([disabled]) {
  background: #334155 !important;
  color: #818cf8 !important;
  border-color: #818cf8 !important;
}

/* 15. Nội Dung Bài Học Markdown & Bài Đọc (.markdown-body, .exercise-article-content) trong Dark Mode */
html[data-theme="dark"] .markdown-body,
html[data-theme="dark"] .exercise-article-content {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .markdown-body h1,
html[data-theme="dark"] .markdown-body h2,
html[data-theme="dark"] .markdown-body h3,
html[data-theme="dark"] .markdown-body h4,
html[data-theme="dark"] .markdown-body h5,
html[data-theme="dark"] .markdown-body h6,
html[data-theme="dark"] .markdown-body strong,
html[data-theme="dark"] .exercise-article-content h1,
html[data-theme="dark"] .exercise-article-content h2,
html[data-theme="dark"] .exercise-article-content h3,
html[data-theme="dark"] .exercise-article-content h4 {
  color: #ffffff !important;
}

html[data-theme="dark"] .markdown-body p,
html[data-theme="dark"] .markdown-body li,
html[data-theme="dark"] .exercise-article-content p,
html[data-theme="dark"] .exercise-article-content li {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .markdown-body code {
  background: #1e293b !important;
  color: #f472b6 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .markdown-body blockquote,
html[data-theme="dark"] .exercise-article-content blockquote {
  background: #1e293b !important;
  border-left-color: #818cf8 !important;
  color: #cbd5e1 !important;
  border-top-color: #1e293b !important;
  border-right-color: #1e293b !important;
  border-bottom-color: #1e293b !important;
}

html[data-theme="dark"] .markdown-body blockquote p {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .markdown-body table,
html[data-theme="dark"] .exercise-article-content table {
  border-color: #334155 !important;
}

html[data-theme="dark"] .markdown-body th,
html[data-theme="dark"] .exercise-article-content th {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .markdown-body td,
html[data-theme="dark"] .exercise-article-content td {
  background-color: #151b2b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .markdown-body tr:nth-child(even) td {
  background-color: #1a2234 !important;
}

html[data-theme="dark"] .markdown-body hr {
  background: #334155 !important;
}

html[data-theme="dark"] #rendered-markdown-content,
html[data-theme="dark"] #rendered-main-content {
  color: #e2e8f0 !important;
}

/* 16. Cấu Trúc Khóa Học & Quản Lý Bài Học (.chapter-block, .topic-block, .syllabus-item) */
html[data-theme="dark"] .chapter-block,
html[data-theme="dark"] .topic-block {
  background: #151b2b !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] .chapter-header {
  background: #1e293b !important;
  border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .chapter-header:hover {
  background: #253349 !important;
}

html[data-theme="dark"] .topic-header {
  background: #1a2234 !important;
  border-bottom-color: #1e293b !important;
}

html[data-theme="dark"] .topic-header:hover {
  background: #202b40 !important;
}

html[data-theme="dark"] .topic-lessons-container,
html[data-theme="dark"] .chapter-lessons,
html[data-theme="dark"] [id^="topic-lessons-"] {
  background: #151b2b !important;
}

html[data-theme="dark"] .syllabus-item {
  background: #151b2b !important;
  border-color: #1e293b !important;
}

html[data-theme="dark"] .syllabus-item:hover {
  background: #1e293b !important;
  border-color: #6366f1 !important;
}

html[data-theme="dark"] .syllabus-item-index {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #94a3b8 !important;
}

html[data-theme="dark"] .syllabus-item:hover .syllabus-item-index {
  background: rgba(99, 102, 241, 0.22) !important;
  border-color: rgba(99, 102, 241, 0.45) !important;
  color: #a5b4fc !important;
}

html[data-theme="dark"] .btn-back-modern {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #94a3b8 !important;
}

html[data-theme="dark"] .btn-back-modern:hover {
  background: #1e293b !important;
  border-color: #6366f1 !important;
  color: #818cf8 !important;
}

/* 17. Tổng Quan Bài Học & Nội Dung (.lo-*) */
html[data-theme="dark"] .lo-stat {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .lo-stat-value {
  color: #f8fafc !important;
}
html[data-theme="dark"] .lo-stat-label {
  color: #94a3b8 !important;
}
html[data-theme="dark"] .lo-nav-btn {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #818cf8 !important;
}
html[data-theme="dark"] .lo-nav-btn:hover {
  background: #1e293b !important;
  border-color: #6366f1 !important;
  color: #a5b4fc !important;
}
html[data-theme="dark"] .lo-filter-bar {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .lo-table-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}
html[data-theme="dark"] .lo-table-head-bar {
  border-bottom-color: #1e293b !important;
}
html[data-theme="dark"] .lo-table thead {
  background: #1e293b !important;
}
html[data-theme="dark"] .lo-table th {
  color: #94a3b8 !important;
  border-bottom-color: #334155 !important;
}
html[data-theme="dark"] .lo-table tbody tr {
  background: #151b2b !important;
}
html[data-theme="dark"] .lo-table td {
  border-bottom-color: #1e293b !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .lo-table tbody tr:hover {
  background: #1e293b !important;
}
html[data-theme="dark"] .lo-lesson-title {
  color: #f8fafc !important;
}
html[data-theme="dark"] .lo-pagination {
  background: #111827 !important;
  border-top-color: #1e293b !important;
}
html[data-theme="dark"] .lo-page-btn {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .lo-page-btn:hover:not(:disabled) {
  background: #334155 !important;
  color: #818cf8 !important;
  border-color: #818cf8 !important;
}
html[data-theme="dark"] .lo-toggle-btn {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .lo-toggle-btn:hover {
  background: #334155 !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .lo-accordion-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
}
html[data-theme="dark"] .lo-accordion-trigger:hover {
  background: #1e293b !important;
}
html[data-theme="dark"] .lo-accordion-body {
  background: #0f172a !important;
  border-top-color: #1e293b !important;
}
html[data-theme="dark"] .lo-lesson-row-mini {
  border-bottom-color: #1e293b !important;
}
html[data-theme="dark"] .lo-lesson-row-mini:hover {
  background: #1e293b !important;
}
html[data-theme="dark"] .lo-mini-title {
  color: #f8fafc !important;
}
html[data-theme="dark"] .lo-course-chip {
  background: rgba(99,102,241,0.15) !important;
  border-color: rgba(99,102,241,0.3) !important;
  color: #818cf8 !important;
}
html[data-theme="dark"] .lo-order-badge {
  background: rgba(99,102,241,0.15) !important;
  border-color: rgba(99,102,241,0.3) !important;
  color: #818cf8 !important;
}
html[data-theme="dark"] .lo-edit-btn {
  background: rgba(99,102,241,0.15) !important;
  border-color: rgba(99,102,241,0.3) !important;
  color: #818cf8 !important;
}
html[data-theme="dark"] .lo-edit-btn:hover {
  background: rgba(99,102,241,0.3) !important;
  color: #a5b4fc !important;
}

/* 18. Bài Kiểm Tra & Bài Tập Teams (.as-*) */
html[data-theme="dark"] .as-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}
html[data-theme="dark"] .as-card-header {
  border-bottom-color: #1e293b !important;
  background: #151b2b !important;
}
html[data-theme="dark"] .as-tabs-bar {
  background: #111827 !important;
  border-bottom-color: #1e293b !important;
}
html[data-theme="dark"] .as-tab-btn {
  color: #94a3b8 !important;
}
html[data-theme="dark"] .as-tab-btn:hover {
  color: #f8fafc !important;
  background: rgba(255, 255, 255, 0.04) !important;
}
html[data-theme="dark"] .as-tab-btn.active {
  border-bottom-color: #8b5cf6 !important;
  color: #a78bfa !important;
  background: rgba(139, 92, 246, 0.12) !important;
}
html[data-theme="dark"] .as-table thead {
  background: #1e293b !important;
}
html[data-theme="dark"] .as-table th {
  color: #94a3b8 !important;
  border-bottom-color: #334155 !important;
}
html[data-theme="dark"] .as-table tbody tr {
  background: #151b2b !important;
}
html[data-theme="dark"] .as-table td {
  border-bottom-color: #1e293b !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .as-table tbody tr:hover {
  background: #1e293b !important;
}
html[data-theme="dark"] .as-btn-action {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .as-modal {
  background: #151b2b !important;
  border: 1px solid #1e293b !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7) !important;
}
html[data-theme="dark"] .as-modal-head,
html[data-theme="dark"] .as-modal-foot {
  background: #151b2b !important;
  border-color: #1e293b !important;
}
html[data-theme="dark"] .as-modal-body {
  background: #151b2b !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .as-stats {
  background: #151b2b !important;
  border-color: #1e293b !important;
}
html[data-theme="dark"] .as-stat {
  border-right-color: #1e293b !important;
}
html[data-theme="dark"] .as-stat:hover {
  background: #1e293b !important;
}
html[data-theme="dark"] .as-empty {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #cbd5e1 !important;
}

/* 19. Ma Trận Vai Trò & Phân Quyền (.rbac-*) */
html[data-theme="dark"] .rbac-create-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}
html[data-theme="dark"] .rbac-create-body {
  border-top-color: #1e293b !important;
}
html[data-theme="dark"] .rbac-matrix-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}
html[data-theme="dark"] .rbac-table thead tr {
  background: #1e293b !important;
  border-bottom-color: #334155 !important;
}
html[data-theme="dark"] .rbac-table th {
  color: #94a3b8 !important;
}
html[data-theme="dark"] .rbac-group-row {
  background: #1a2234 !important;
  border-top-color: #1e293b !important;
  border-bottom-color: #1e293b !important;
}
html[data-theme="dark"] .rbac-item-row {
  background: #151b2b !important;
  border-bottom-color: #1e293b !important;
}
html[data-theme="dark"] .rbac-item-row:hover {
  background: #1e293b !important;
}
html[data-theme="dark"] .rbac-perm-desc {
  color: #f8fafc !important;
}
html[data-theme="dark"] .rbac-perm-key {
  color: #94a3b8 !important;
}
html[data-theme="dark"] .rbac-role-name {
  color: #818cf8 !important;
}

/* 20. Chi Tiết Khóa Học (.cd-*) */
html[data-theme="dark"] .cd-hero-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
}
html[data-theme="dark"] .cd-img-wrapper {
  background: #111827 !important;
  border-color: #1e293b !important;
}
html[data-theme="dark"] .cd-enrollment-bar {
  background: #111827 !important;
  border-color: #1e293b !important;
}
html[data-theme="dark"] .cd-status-icon.none {
  background: #1e293b !important;
  color: #94a3b8 !important;
}
html[data-theme="dark"] .cd-progress-track {
  background: #1e293b !important;
}
html[data-theme="dark"] .cd-overview-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
  border-left-color: #6366f1 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
}
html[data-theme="dark"] .cd-overview-card:hover {
  background: #1e293b !important;
}
html[data-theme="dark"] .cd-overview-title {
  color: #f8fafc !important;
}
html[data-theme="dark"] .cd-overview-sub {
  color: #94a3b8 !important;
}
html[data-theme="dark"] .cd-overview-tag {
  background: rgba(99, 102, 241, 0.15) !important;
  color: #818cf8 !important;
}
html[data-theme="dark"] .cd-chapter-group {
  background: #151b2b !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
}
html[data-theme="dark"] .cd-chapter-group summary {
  background: #1e293b !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .cd-chapter-group summary:hover,
html[data-theme="dark"] details > summary:hover {
  background: #253349 !important;
}
html[data-theme="dark"] .cd-topic-container {
  background: #151b2b !important;
  border-color: #1e293b !important;
}
html[data-theme="dark"] .cd-topic-header {
  background: #1a2234 !important;
  border-left-color: #6366f1 !important;
}
html[data-theme="dark"] .cd-topic-title {
  color: #f8fafc !important;
}
html[data-theme="dark"] .cd-direct-header {
  background: #1a2234 !important;
  border-bottom-color: #1e293b !important;
  color: #94a3b8 !important;
}
html[data-theme="dark"] .cd-lesson-card {
  background: #151b2b !important;
  border-bottom-color: #1e293b !important;
}
html[data-theme="dark"] .cd-lesson-card:hover {
  background: #1e293b !important;
  border-color: #6366f1 !important;
}
html[data-theme="dark"] .cd-lesson-card.locked {
  background: #0f172a !important;
}
html[data-theme="dark"] .cd-lesson-title {
  color: #f8fafc !important;
}
html[data-theme="dark"] .cd-sidebar-block {
  background: #151b2b !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
}
html[data-theme="dark"] .cd-sidebar-title {
  border-bottom-color: #1e293b !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .cd-btn-action.outline {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .cd-btn-action.outline:hover {
  background: #334155 !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .cd-path-link-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}
html[data-theme="dark"] .cd-path-card-icon-box {
  background: #151b2b !important;
  border-color: #334155 !important;
}
html[data-theme="dark"] #course-overview-modal {
  background: #151b2b !important;
  border: 1px solid #1e293b !important;
}
html[data-theme="dark"] #course-overview-modal > div:first-child,
html[data-theme="dark"] #course-overview-modal > div:last-child {
  background: #1e293b !important;
  border-color: #334155 !important;
}
html[data-theme="dark"] #course-overview-modal h3,
html[data-theme="dark"] #course-overview-modal .overview-content {
  color: #f8fafc !important;
}

/* 21. Kho Khóa Học & Danh Sách Khóa Học (.cb-*) */
html[data-theme="dark"] .cb-stats {
  background: #151b2b !important;
  border-color: #1e293b !important;
}
html[data-theme="dark"] .cb-stat {
  border-right-color: #1e293b !important;
}
html[data-theme="dark"] .cb-stat:hover {
  background: #1e293b !important;
}
html[data-theme="dark"] .cb-search-wrap input {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .cb-select {
  background-color: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .cb-tab {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #94a3b8 !important;
}
html[data-theme="dark"] .cb-tab:hover {
  color: #818cf8 !important;
  border-color: #818cf8 !important;
}
html[data-theme="dark"] .cb-tab.active {
  background: #6366f1 !important;
  color: #fff !important;
}
html[data-theme="dark"] .cb-card {
  background: #151b2b !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
}
html[data-theme="dark"] .cb-card:hover {
  background: #1e293b !important;
  border-color: #6366f1 !important;
}
html[data-theme="dark"] .cb-card-thumb {
  background: #111827 !important;
}
html[data-theme="dark"] .cb-card-title {
  color: #f8fafc !important;
}
html[data-theme="dark"] .cb-card-foot {
  border-top-color: #1e293b !important;
}
html[data-theme="dark"] .cb-btn-ghost {
  background: #1e293b !important;
  color: #818cf8 !important;
  border: 1px solid #334155 !important;
}
html[data-theme="dark"] .cb-btn-ghost:hover {
  background: #334155 !important;
  color: #a5b4fc !important;
}
html[data-theme="dark"] .cb-btn-disabled {
  background: #1e293b !important;
  color: #64748b !important;
}
html[data-theme="dark"] .cb-empty {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .cb-load-more button {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

/* 22. Hộp Tải Lên Tệp & Đính Kèm (.compact-upload-zone) */
html[data-theme="dark"] .compact-upload-zone {
  background: #111827 !important;
  border-color: #334155 !important;
}
html[data-theme="dark"] .compact-upload-zone:hover {
  background: #1e293b !important;
  border-color: #6366f1 !important;
}
html[data-theme="dark"] .compact-upload-text {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .compact-upload-btn {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #818cf8 !important;
}
html[data-theme="dark"] .compact-upload-zone:hover .compact-upload-btn {
  background: #334155 !important;
  border-color: #818cf8 !important;
  color: #a5b4fc !important;
}

/* 23. Trình Đọc Tài Liệu Word & Text Đảm Bảo Nền Trắng Chữ Đen Rõ Nét Trong Mọi Theme */
html[data-theme="dark"] #docx-guidance-container,
html[data-theme="dark"] #docx-main-container,
html[data-theme="dark"] #docx-sidebar-container,
html[data-theme="dark"] #txt-guidance-container,
html[data-theme="dark"] .docx-rendered,
html[data-theme="dark"] .docx-wrapper,
html[data-theme="dark"] section.docx {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

html[data-theme="dark"] #docx-guidance-container *,
html[data-theme="dark"] #docx-main-container *,
html[data-theme="dark"] #docx-sidebar-container *,
html[data-theme="dark"] #txt-guidance-container *,
html[data-theme="dark"] .docx-rendered *,
html[data-theme="dark"] .docx-wrapper *,
html[data-theme="dark"] section.docx * {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

html[data-theme="dark"] #docx-guidance-container table,
html[data-theme="dark"] #docx-guidance-container td,
html[data-theme="dark"] #docx-guidance-container th,
html[data-theme="dark"] #docx-main-container table,
html[data-theme="dark"] #docx-main-container td,
html[data-theme="dark"] #docx-main-container th,
html[data-theme="dark"] section.docx table,
html[data-theme="dark"] section.docx td,
html[data-theme="dark"] section.docx th {
  border: 1px solid #475569 !important;
  border-color: #475569 !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
}

/* 24. Lịch Học & Deadline (.dl-*) và Bài Đánh Giá (.as-*) trong Dark Mode */
html[data-theme="dark"] .dl-stats,
html[data-theme="dark"] .dl-item,
html[data-theme="dark"] .dl-empty,
html[data-theme="dark"] .as-stats,
html[data-theme="dark"] .as-card,
html[data-theme="dark"] .as-empty {
  background: #151b2b !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .dl-stat,
html[data-theme="dark"] .as-stat {
  border-right-color: #1e293b !important;
}

html[data-theme="dark"] .dl-stat:hover,
html[data-theme="dark"] .dl-item:hover,
html[data-theme="dark"] .as-stat:hover,
html[data-theme="dark"] .as-card:hover {
  background: #1e293b !important;
}

html[data-theme="dark"] .dl-info-title,
html[data-theme="dark"] .dl-stat-val,
html[data-theme="dark"] .dl-deadline-date,
html[data-theme="dark"] .as-card-title,
html[data-theme="dark"] .as-stat-val {
  color: #f8fafc !important;
}

html[data-theme="dark"] .dl-info-sub,
html[data-theme="dark"] .dl-stat-label,
html[data-theme="dark"] .dl-deadline-label,
html[data-theme="dark"] .dl-progress-row,
html[data-theme="dark"] .as-card-creator,
html[data-theme="dark"] .as-stat-label {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .dl-tab-count,
html[data-theme="dark"] .as-tab-count {
  background: #1e293b !important;
  color: #94a3b8 !important;
}

html[data-theme="dark"] .dl-bar-wrap {
  background: #1e293b !important;
}

html[data-theme="dark"] .dl-btn-outline,
html[data-theme="dark"] .as-btn-outline {
  background: #1e293b !important;
  color: #f8fafc !important;
  border: 1px solid #334155 !important;
}

html[data-theme="dark"] .dl-btn-outline:hover,
html[data-theme="dark"] .as-btn-outline:hover {
  background: #334155 !important;
  color: #ffffff !important;
}
