/* ==========================================================================
   CLASS MANAGER - MODERN DESIGN SYSTEM
   Thay thế Excel điểm danh & quản lý lớp học chuyên nghiệp
   ========================================================================== */

:root {
  /* Primary Colors */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #1e1b4b;

  /* Excel-inspired Deep Blue Header */
  --excel-blue: #1e3a8a;
  --excel-blue-dark: #172554;
  --excel-blue-light: #2563eb;

  /* Status Colors: Attendance (AT) */
  --at-c-bg: #dcfce7;
  --at-c-text: #15803d;
  --at-c-border: #86efac;
  --at-c-solid: #16a34a;

  --at-m-bg: #fef3c7;
  --at-m-text: #b45309;
  --at-m-border: #fcd34d;
  --at-m-solid: #d97706;

  --at-l-bg: #ffedd5;
  --at-l-text: #c2410c;
  --at-l-border: #fdba74;
  --at-l-solid: #ea580c;

  --at-k-bg: #fee2e2;
  --at-k-text: #b91c1c;
  --at-k-border: #fca5a5;
  --at-k-solid: #dc2626;

  /* Status Colors: Homework (HW) */
  --hw-ht-bg: #f0fdf4;
  --hw-ht-text: #166534;
  --hw-ht-border: #bbf7d0;

  --hw-th-bg: #fffbeb;
  --hw-th-text: #92400e;
  --hw-th-border: #fde68a;

  --hw-kh-bg: #fef2f2;
  --hw-kh-text: #991b1b;
  --hw-kh-border: #fecaca;

  --hw-ckt-bg: #f1f5f9;
  --hw-ckt-text: #475569;
  --hw-ckt-border: #cbd5e1;

  /* Neutral UI Colors */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.92);
  --border-light: #e2e8f0;
  --border-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;

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

  /* Dimensions */
  --header-height: 64px;
  --sticky-stt-width: 48px;
  --sticky-name-width: 200px;
  --cell-at-width: 44px;
  --cell-hw-width: 46px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* App Header & Navigation */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.header-container {
  max-width: 1700px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(220, 38, 38, 0.35));
  transition: transform 0.25s ease;
}

.brand-logo-img:hover {
  transform: scale(1.06) rotate(-2deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  line-height: 1.2;
}

.badge-pro {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
  font-size: 0.62rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(220, 38, 38, 0.3);
  display: inline-flex;
  align-items: center;
}

.brand-text p {
  font-size: 0.73rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: 1px;
  line-height: 1.2;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 1;
}

/* Selector Group: Class & Month */
.selector-group {
  display: flex;
  align-items: center;
  background: var(--bg-app);
  padding: 0.22rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  gap: 0.4rem;
}

.select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.select-wrapper label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.select-input {
  border: none;
  background: transparent;
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.82rem;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
}

.select-input:focus {
  background: var(--bg-card);
}

.divider-vertical {
  width: 1px;
  height: 20px;
  background: var(--border-light);
  margin: 0 0.15rem;
}

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

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

.btn-primary {
  background: var(--primary-600);
  color: white;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  background: var(--primary-700);
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-light);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-app);
  border-color: var(--text-muted);
}

.btn-excel {
  background: #107c41;
  color: white;
}

.btn-excel:hover {
  background: #0b5c30;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-md, 8px);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 1rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--bg-app);
  color: var(--text-main);
  border-color: #cbd5e1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  gap: 0.35rem;
}

.btn-header-waiting {
  background: #f59e0b;
  color: #ffffff !important;
  border-color: #d97706 !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.btn-header-waiting:hover {
  background: #d97706;
  color: #ffffff;
}

.btn-header-waiting .badge-waiting-count {
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.btn-header-makeup {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.btn-header-makeup .badge-waiting-count {
  background: #0284c7;
  color: #ffffff;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.btn-danger {
  background: #dc2626;
  color: #ffffff;
  border: 1px solid #b91c1c;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 0.45rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #991b1b;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.2);
}

.btn-delete-user {
  color: #dc2626 !important;
  border-color: #fecaca !important;
  background: #fff5f5 !important;
}

.btn-delete-user:hover {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #991b1b !important;
  transform: scale(1.08);
}

/* Main Container */
.app-main {
  max-width: 1700px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
  flex: 1;
}

/* Excel Sheet Header Banner */
.class-banner {
  background: linear-gradient(135deg, var(--excel-blue-dark), var(--excel-blue));
  color: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.class-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.banner-title-box {
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  padding-right: 1.5rem;
}

.banner-month {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #93c5fd;
  font-weight: 700;
}

.banner-class-name {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0.15rem 0;
  color: white;
}

.banner-teacher {
  font-size: 0.95rem;
  color: #e0e7ff;
  font-style: italic;
  margin-bottom: 0.35rem;
}

.banner-textbook-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md, 8px);
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}

.banner-textbook-row:hover {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(147, 197, 253, 0.4);
}

.banner-textbook-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.banner-textbook-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  margin: 0;
  cursor: pointer;
}

.banner-textbook-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.banner-textbook-select {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 0.25rem 1.6rem 0.25rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2393c5fd'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 0.75rem 0.75rem;
  transition: all 0.2s ease;
  max-width: 360px;
}

.banner-textbook-select:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: #93c5fd;
}

.banner-textbook-select:focus {
  background-color: rgba(30, 58, 138, 0.7);
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3);
}

.banner-textbook-select option {
  background-color: #1e293b;
  color: #f8fafc;
  font-size: 0.85rem;
  padding: 0.4rem;
}

.banner-guide {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.35);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.guide-line {
  margin-bottom: 0.25rem;
}

.guide-line:last-child {
  margin-bottom: 0;
}

.guide-code {
  font-weight: 700;
  color: #fef08a;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.banner-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}

/* Stats Overview Bar */
.stats-bar {
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  padding: 0.9rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-icon.students { background: #eff6ff; color: #2563eb; }
.stat-icon.attendance { background: #ecfdf5; color: #059669; }
.stat-icon.homework { background: #fef3c7; color: #d97706; }
.stat-icon.warning { background: #fef2f2; color: #dc2626; }

.stat-content .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

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

/* Toolbar & Actions */
.matrix-toolbar {
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border-light);
  margin: 0 0.15rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.65rem;
  color: var(--text-light);
  pointer-events: none;
  font-size: 0.9rem;
}

.search-input {
  padding: 0.45rem 0.75rem 0.45rem 2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-app);
  color: var(--text-main);
  font-size: 0.85rem;
  width: 220px;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-500);
  width: 260px;
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-100);
}

/* Matrix Table Wrapper */
.matrix-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-md);
  position: relative;
  max-height: calc(100vh - 280px);
}

/* Custom Scrollbars */
.matrix-wrapper::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}
.matrix-wrapper::-webkit-scrollbar-track {
  background: var(--bg-app);
}
.matrix-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}
.matrix-wrapper::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Attendance Table */
.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
  text-align: center;
}

.matrix-table th,
.matrix-table td {
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 0;
  height: 38px;
}

/* Sticky Columns for Student Info */
.col-sticky-stt {
  position: sticky;
  left: 0;
  width: var(--sticky-stt-width);
  min-width: var(--sticky-stt-width);
  max-width: var(--sticky-stt-width);
  z-index: 20;
  background: var(--bg-card);
}

.col-sticky-name {
  position: sticky;
  left: var(--sticky-stt-width);
  width: var(--sticky-name-width);
  min-width: var(--sticky-name-width);
  max-width: var(--sticky-name-width);
  z-index: 20;
  background: var(--bg-card);
  text-align: left !important;
  padding: 0 0.75rem !important;
  box-shadow: 3px 0 6px -2px rgba(0, 0, 0, 0.08);
}

/* Table Header Structure */
.matrix-table thead {
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-row-sessions th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 0.35rem 0.25rem;
}

.col-sticky-stt.th-header,
.col-sticky-name.th-header {
  background: #f1f5f9;
  z-index: 35;
}

.session-header-cell {
  background: #f8fafc;
  min-width: calc(var(--cell-at-width) + var(--cell-hw-width));
  position: relative;
}

.session-header-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.25rem;
}

.session-date {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--excel-blue-light);
}

.session-day {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.session-actions-btn {
  font-size: 0.65rem;
  opacity: 0.6;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
}
.session-actions-btn:hover {
  opacity: 1;
  color: var(--primary-600);
}

.header-row-sub th {
  background: #f1f5f9;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  height: 26px;
  letter-spacing: 0.05em;
}

.sub-at {
  width: var(--cell-at-width);
  min-width: var(--cell-at-width);
}

.sub-hw {
  width: var(--cell-hw-width);
  min-width: var(--cell-hw-width);
}

/* Student Row */
.matrix-row:hover td {
  background-color: #f8fafc;
}

.matrix-row:hover .col-sticky-stt,
.matrix-row:hover .col-sticky-name {
  background-color: #f1f5f9;
}

.student-stt {
  font-weight: 700;
  color: var(--text-muted);
}

.student-name-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.student-fullname {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.student-fullname:hover {
  color: var(--primary-600);
  text-decoration: underline;
}

/* Attendance & Homework Cells */
.cell-at, .cell-hw {
  cursor: pointer;
  user-select: none;
  transition: background-color var(--transition-fast);
  position: relative;
}

.cell-at:hover, .cell-hw:hover {
  outline: 2px solid var(--primary-500);
  outline-offset: -2px;
  z-index: 10;
}

.cell-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

/* Cell AT Status Styling */
.cell-at[data-status="C"] {
  background-color: var(--at-c-bg);
  color: var(--at-c-text);
  font-weight: 800;
}

.cell-at[data-status="M"] {
  background-color: var(--at-m-bg);
  color: var(--at-m-text);
  font-weight: 800;
}

.cell-at[data-status="L"] {
  background-color: var(--at-l-bg);
  color: var(--at-l-text);
  font-weight: 800;
}

.cell-at[data-status="K"] {
  background-color: var(--at-k-bg);
  color: var(--at-k-text);
  font-weight: 800;
  position: relative;
}

.cell-zalo-trigger {
  position: absolute;
  top: 1px;
  right: 1px;
  font-size: 0.62rem;
  line-height: 1;
  background: #0068ff;
  color: white;
  border-radius: 50%;
  width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 104, 255, 0.4);
  transition: transform 0.15s ease;
  z-index: 12;
}

.cell-zalo-trigger:hover {
  transform: scale(1.35);
  background: #0052cc;
}

.btn-zalo {
  background: #0068ff;
  color: white;
  border: 1px solid #0056d6;
}

.btn-zalo:hover {
  background: #0056d6;
  box-shadow: 0 2px 8px rgba(0, 104, 255, 0.35);
}

/* Biểu tượng và chỉ báo đã hoàn thành học bù */
.badge-makeup-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  margin-left: 2px;
  line-height: 1;
  vertical-align: middle;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
  transition: transform 0.2s ease;
}

.cell-at:hover .badge-makeup-done {
  transform: scale(1.25);
}

.cell-at.cell-makeup-done {
  position: relative;
}

.cell-at.cell-makeup-done::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 3px;
  right: 3px;
  height: 2.5px;
  background: #16a34a;
  border-radius: 1px;
  opacity: 0.8;
}

.cell-at[data-status=""] {
  color: var(--text-light);
}

/* Cell HW Status Styling */
.cell-hw[data-status="HT"] {
  background-color: var(--hw-ht-bg);
  color: var(--hw-ht-text);
  font-weight: 700;
}

.cell-hw[data-status="TH"] {
  background-color: var(--hw-th-bg);
  color: var(--hw-th-text);
  font-weight: 700;
}

.cell-hw[data-status="KH"] {
  background-color: var(--hw-kh-bg);
  color: var(--hw-kh-text);
  font-weight: 700;
}

.cell-hw[data-status="CKT"] {
  background-color: var(--hw-ckt-bg);
  color: var(--hw-ckt-text);
  font-weight: 600;
}

.cell-hw[data-status=""] {
  color: var(--text-light);
}

/* Material / Book Status Column */
.col-books {
  min-width: 130px;
  padding: 0 0.5rem !important;
  text-align: center;
  font-style: italic;
  font-weight: 600;
  color: var(--text-secondary);
}

.book-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.book-tag.distributed {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.book-tag.pending {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
}

/* Summary Columns per Student */
.col-student-stats {
  min-width: 90px;
  padding: 0 0.5rem !important;
  font-weight: 600;
}

.progress-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  justify-content: center;
}

.rate-badge {
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}
.rate-badge.high { background: #dcfce7; color: #15803d; }
.rate-badge.mid { background: #fef3c7; color: #b45309; }
.rate-badge.low { background: #fee2e2; color: #b91c1c; }

.col-actions {
  min-width: 115px;
  padding: 0 0.4rem !important;
}

.actions-cell-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.btn-monthly-eval {
  color: #0284c7 !important;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease;
  border-radius: 4px;
}

.btn-monthly-eval:hover {
  transform: scale(1.18);
  background: rgba(2, 132, 199, 0.15) !important;
}

/* Summary Footer Rows */
.matrix-footer-row th,
.matrix-footer-row td {
  background: #f8fafc !important;
  font-weight: 700;
  font-size: 0.76rem;
  color: var(--text-secondary);
  height: 34px;
}

.footer-label {
  text-align: right !important;
  padding-right: 0.75rem !important;
  color: var(--text-main) !important;
  font-weight: 700;
}

/* Quick Status Selector Popover */
.status-popover {
  position: absolute;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 0.4rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 150px;
  animation: fadeIn 0.12s ease-out;
}

.status-popover.active {
  display: flex;
}

.popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-main);
  text-align: left;
}

.popover-item:hover {
  background: var(--bg-app);
}

.popover-key {
  font-size: 0.68rem;
  color: var(--text-light);
  background: var(--border-light);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  margin-left: 0.5rem;
}

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

.modal-backdrop.active {
  display: flex;
  animation: fadeIn 0.15s ease-out;
}

/* Modal xếp chồng (Nested Modals) - luôn hiển thị nổi bật trên cùng */
.modal-backdrop.modal-nested,
#modal-edit-grade-type,
#modal-edit-eval-col {
  z-index: 2200 !important;
  background: rgba(15, 23, 42, 0.7);
}

/* Modal Chỉnh Sửa / Xếp Lịch Học Bù - luôn hiển thị đè lên trên modal Quản Lý Lịch Học Bù */
#modal-schedule-makeup {
  z-index: 9999 !important;
  background: rgba(15, 23, 42, 0.75);
}

#modal-schedule-makeup .modal-card {
  z-index: 10000 !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.modal-backdrop.modal-nested .modal-card,
#modal-edit-grade-type .modal-card,
#modal-edit-eval-col .modal-card {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-lg {
  max-width: 780px;
}

/* ── Modal Nhận Xét Tháng – tối ưu chiều cao & hiển thị trọn vẹn ở 100% Zoom ─────────────── */
#modal-student-profile .modal-card,
.modal-student-profile-custom {
  width: 95vw !important;
  max-width: 1180px !important;
  height: 90vh !important;
  max-height: 92vh !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

#modal-student-profile .modal-header {
  flex: 0 0 auto !important;
  padding: 0.65rem 1.25rem !important;
  border-bottom: 1px solid var(--border-light) !important;
}

#modal-student-profile .modal-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
}

#modal-student-profile .modal-body,
#modal-student-profile #profile-content {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 0.75rem 1.15rem 0.85rem 1.15rem !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.65rem !important;
}

#modal-student-profile .modal-footer,
#modal-student-profile #modal-student-profile-footer {
  flex: 0 0 auto !important;
  padding: 0.65rem 1.25rem !important;
  border-top: 1px solid var(--border-light) !important;
  background: var(--bg-app) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 0.5rem !important;
  flex-wrap: wrap !important;
  z-index: 5 !important;
}

/* Khối dải stat-grid siêu gọn (Top KPI Ribbon) */
#modal-student-profile .profile-stats-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 0.55rem !important;
  margin-bottom: 0 !important;
  width: 100% !important;
}

@media (max-width: 768px) {
  #modal-student-profile .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

#modal-student-profile .profile-stat-card {
  padding: 0.42rem 0.75rem !important;
  border-radius: var(--radius-md) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 0.1rem !important;
}

#modal-student-profile .profile-stat-card .stat-val {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  margin: 0.05rem 0 !important;
}

#modal-student-profile .profile-stat-card .stat-title {
  font-size: 0.66rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.4px !important;
}

#modal-student-profile .profile-stat-card .stat-sub {
  font-size: 0.68rem !important;
  opacity: 0.9 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Bố cục Dashboard 2 Cột linh hoạt */
.meval-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(390px, 1.18fr);
  gap: 0.75rem;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 940px) {
  .meval-dashboard-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
}

.meval-col-left {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.meval-col-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

/* Khối Chương trình học thu gọn */
#modal-student-profile .meval-curriculum-card {
  padding: 0.5rem 0.75rem !important;
  margin-bottom: 0 !important;
  border-radius: var(--radius-md) !important;
}

#modal-student-profile .meval-curriculum-header {
  margin-bottom: 0.35rem !important;
}

#modal-student-profile .curriculum-main-title {
  font-size: 0.84rem !important;
  font-weight: 700 !important;
}

#modal-student-profile .curriculum-sub-title {
  font-size: 0.68rem !important;
}

#modal-student-profile .curriculum-badge-pill {
  padding: 0.25rem 0.55rem !important;
  gap: 0.3rem !important;
}

#modal-student-profile .curriculum-badge-pill .pill-title {
  font-size: 0.7rem !important;
}

#modal-student-profile .curriculum-badge-pill .pill-value {
  font-size: 0.78rem !important;
}

/* Khối Nhận xét tháng thu gọn */
#modal-student-profile .meval-section {
  margin-top: 0 !important;
  padding: 0.65rem 0.8rem !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  justify-content: space-between !important;
}

#modal-student-profile .meval-header-row {
  margin-bottom: 0.45rem !important;
  padding-bottom: 0.35rem !important;
}

#modal-student-profile .meval-heading {
  font-size: 0.86rem !important;
  font-weight: 800 !important;
}

#modal-student-profile .meval-form-group {
  margin-bottom: 0.4rem !important;
}

#modal-student-profile .meval-form-group:last-child {
  margin-bottom: 0.2rem !important;
}

#modal-student-profile .meval-label {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  margin-bottom: 0.2rem !important;
}

/* Textarea nhận xét thu gọn & tự động co giãn */
#modal-student-profile .meval-textarea {
  min-height: 46px !important;
  max-height: 140px !important;
  font-size: 0.82rem !important;
  padding: 0.38rem 0.65rem !important;
  line-height: 1.4 !important;
  resize: vertical !important;
  border-radius: 6px !important;
}

#modal-student-profile .meval-footer-bar {
  margin-top: 0.4rem !important;
  padding-top: 0.4rem !important;
}

/* Khối điểm danh & kết quả theo buổi thu gọn */
#modal-student-profile .profile-history-section {
  margin-top: 0 !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden !important;
  background: var(--bg-card) !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 380px !important;
}

#modal-student-profile .profile-section-header {
  padding: 0.45rem 0.75rem !important;
  background: var(--bg-app) !important;
  border-bottom: 1px solid var(--border-light) !important;
  flex-shrink: 0 !important;
}

#modal-student-profile .profile-section-title {
  font-size: 0.82rem !important;
  font-weight: 700 !important;
}

#modal-student-profile .meval-cards-container,
#modal-student-profile .meval-table-container {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  max-height: 430px !important;
  padding: 0.5rem 0.65rem !important;
}

#modal-student-profile .meval-compact-grid {
  max-height: none !important;
  padding: 0.25rem 0 !important;
}

#modal-student-profile .cs-card {
  padding: 0.35rem 0.45rem;
}

.meval-toggle-btn {
  background: transparent;
  color: var(--text-muted);
  transition: all 0.18s ease;
}

.meval-toggle-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-main);
}

.meval-toggle-btn.active {
  background: var(--excel-blue-light, #0284c7) !important;
  color: #ffffff !important;
}

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

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

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--text-main);
  background: var(--border-light);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.95rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

.toast {
  background: var(--text-main);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideInRight 0.25s ease-out;
}

.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
.toast.info { background: #2563eb; }

/* Day pills selector for auto scheduler */
.days-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.day-pill {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  user-select: none;
}

.day-pill input[type="checkbox"] {
  accent-color: var(--primary-600);
}

.day-pill.active {
  background: var(--primary-50);
  border-color: var(--primary-500);
  color: var(--primary-700);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

/* Responsive Styles */
@media (max-width: 1024px) {
  .class-banner {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .banner-title-box {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.75rem;
  }
  .banner-actions {
    align-items: flex-start;
  }
  .stats-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
  }
  .header-controls {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .stats-bar {
    grid-template-columns: 1fr;
  }
  .col-sticky-name {
    width: 140px;
    min-width: 140px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Kho Lưu Trữ Các Tháng (Monthly Archive Cards) */
.archive-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition-normal);
  position: relative;
}

.archive-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-500);
  transform: translateY(-2px);
}

.archive-card.active-month {
  border: 2px solid var(--primary-600);
  background: var(--bg-card);
}

.archive-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.archive-month-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.archive-month-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.archive-badge {
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.archive-badge.active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.archive-badge.archived {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.archive-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: var(--bg-app);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  font-size: 0.78rem;
}

.archive-stat-box .label {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.archive-stat-box .val {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.95rem;
}

.archive-actions-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}

/* ==================== VIEW MODE TABS & SCORE TRACKING ==================== */
.view-mode-tabs {
  display: inline-flex;
  background: var(--bg-app);
  padding: 3px;
  border-radius: var(--radius-md);
  gap: 3px;
  border: 1px solid var(--border-light);
}

.view-mode-tab {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.view-mode-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.6);
}

.view-mode-tab.active {
  background: var(--bg-surface);
  color: var(--primary-700);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 700;
}

/* Sub-header Score */
.sub-score {
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  background: #f0fdfa;
  color: #0d9488;
  border-right: 1px solid var(--border-light);
  min-width: 48px;
}

/* Score Cell */
.cell-score {
  min-width: 46px;
  width: 50px;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  border-right: 1px solid var(--border-light);
  user-select: none;
  padding: 0 2px !important;
}

.cell-score:hover {
  background-color: #ecfeff !important;
  outline: 2px solid #06b6d4;
  outline-offset: -2px;
  z-index: 5;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  transition: transform 0.15s ease;
}

.cell-score:hover .score-badge:not(.score-empty) {
  transform: scale(1.08);
}

.score-badge.score-excellent {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.score-badge.score-good {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.score-badge.score-fair {
  background: #fef9c3;
  color: #a16207;
  border: 1px solid #fde047;
}

.score-badge.score-average {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.score-badge.score-poor {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.score-badge.score-empty {
  color: var(--text-light);
  font-weight: normal;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
  opacity: 0.6;
}

.cell-score:hover .score-badge.score-empty {
  opacity: 1;
  border-color: #06b6d4;
  color: #0891b2;
}

/* Inline Score Editor Popover */
.score-popover {
  position: absolute;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 170px;
}

/* Rank Badge */
.rank-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.rank-badge.rank-excellent {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.rank-badge.rank-good {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.rank-badge.rank-fair {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.rank-badge.rank-average {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.rank-badge.rank-poor {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.col-student-score {
  min-width: 80px;
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.col-student-rank {
  min-width: 95px;
  text-align: center;
}

.footer-stat-score {
  background: #f0fdfa;
  color: #0f766e;
  font-weight: 800;
  font-size: 0.8rem;
  text-align: center;
  border-right: 1px solid var(--border-light);
}

.stat-icon.score {
  background: #ecfdf5;
  color: #059669;
}

.grade-weight-pill {
  font-size: 0.7rem;
  font-weight: 800;
  background: #eff6ff;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.grade-col-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-th-action {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 2px 5px;
  line-height: 1.2;
  transition: all 0.15s ease;
}

.btn-th-action:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

.btn-edit-gt-action {
  font-size: 0.72rem;
  padding: 1px 4px;
  background: rgba(254, 240, 138, 0.7);
  border: 1px solid #fde047;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-edit-gt-action:hover {
  background: #fde047;
  transform: scale(1.1);
}

.btn-add-score-col-action {
  font-size: 0.75rem;
  padding: 2px 7px;
  background: #fef08a;
  color: #854d0e;
  border: 1px solid #facc15;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.btn-add-score-col-action:hover {
  background: #fde047;
  color: #713f12;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-del-gt-action {
  font-size: 0.72rem;
  padding: 1px 4px;
  background: rgba(254, 226, 226, 0.8);
  border: 1px solid #fca5a5;
  border-radius: 4px;
  cursor: pointer;
  color: #dc2626;
  transition: all 0.15s ease;
}

.btn-del-gt-action:hover {
  background: #fee2e2;
  border-color: #ef4444;
  transform: scale(1.1);
}

.btn-bulk-fill-col-action {
  color: #b45309;
  background: #fef3c7;
  border-color: #fde68a;
  font-weight: 700;
}

.btn-bulk-fill-col-action:hover {
  background: #fde68a;
  color: #92400e;
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.25);
  transform: translateY(-1px);
}

.eval-score-input.input-error {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
  color: #b91c1c !important;
}

/* Quick Preset Chips for Grade Types */
.quick-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.btn-preset-chip {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset-chip:hover {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
  transform: translateY(-1px);
}

.btn-preset-chip.active {
  background: #0284c7;
  color: white;
  border-color: #0284c7;
}

/* ==================== ADMIN & AUTHENTICATION STYLES ==================== */
.admin-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Login Screen */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, rgba(2, 132, 199, 0.08), transparent 60%),
              radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.06), transparent 50%),
              var(--bg-app);
  padding: 1.5rem;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  animation: fadeIn 0.3s ease;
}

.login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-icon {
  font-size: 2.75rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  animation: bounce 2s infinite ease-in-out;
}

.login-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.login-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.login-hints {
  border-top: 1px dashed var(--border-color);
  margin-top: 1.25rem;
  padding-top: 0.75rem;
}

/* User Profile Chip in Header */
.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-profile-chip:hover {
  border-color: var(--primary-500);
  box-shadow: var(--shadow-sm);
}

.user-avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #4338ca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-chip-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-chip-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.8rem;
}

.user-chip-role {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Admin Dashboard Elements */
.admin-banner-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #0284c7 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}

.admin-banner-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.admin-banner-card p {
  font-size: 0.85rem;
  opacity: 0.9;
  max-width: 650px;
  line-height: 1.45;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.admin-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.admin-table th {
  background: var(--bg-app);
  padding: 0.75rem 0.85rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  font-weight: 700;
  white-space: nowrap;
}

.admin-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.admin-table th.th-admin-actions,
.admin-table td.td-admin-actions {
  width: 180px;
  min-width: 180px;
  text-align: center;
  white-space: nowrap;
  padding: 0.55rem 0.4rem;
}

.admin-user-actions-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.admin-user-actions-box .btn-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  padding: 0;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}

.admin-table tbody tr:hover {
  background-color: rgba(2, 132, 199, 0.04);
}

/* Badges for Admin Table */
.badge-role {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-role.admin {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-role.teacher {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-status {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-status.active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.badge-status.inactive {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.class-pill-tag {
  display: inline-block;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin: 2px;
  color: var(--text-main);
}

.class-pill-tag.all {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
  font-weight: 700;
}

/* ==================== BẢNG NHẬN XÉT BUỔI HỌC (HIGH CONTRAST & ELEGANT UI) ==================== */
.modal-card.modal-evaluation-entry {
  width: 96vw;
  max-width: 1260px;
  background: #ffffff !important;
  border-radius: var(--radius-lg);
  border: 1px solid #cbd5e1;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.45);
  color: #0f172a;
}

.modal-evaluation-entry .modal-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 1.5rem;
}

.modal-evaluation-entry .modal-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}

.modal-evaluation-entry .modal-body {
  background: #f8fafc;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-evaluation-entry .modal-footer {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 1rem 1.5rem;
}

.eval-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.eval-session-select-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.eval-actions-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.eval-actions-group .btn-sm,
.eval-actions-group .eval-toggle-scores-label,
.eval-actions-group .eval-align-select-wrapper {
  padding: 0.32rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.eval-align-select-wrapper {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: #334155;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.eval-align-select-wrapper:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.eval-align-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.eval-align-select {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e293b;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.eval-align-select:hover {
  border-color: #94a3b8;
}

.eval-align-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.eval-hint-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.9rem;
  font-size: 0.82rem;
  color: #1e40af;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.eval-hint-banner strong {
  color: #1d4ed8;
}

.eval-hint-banner #eval-columns-count-text {
  font-weight: 700;
  color: #1e40af;
}

/* Căn chỉnh giao diện xem trước (UI): modal-body căn giữa khung bảng */
.modal-evaluation-entry .modal-body {
  text-align: center;
}

.modal-evaluation-entry .eval-toolbar,
.modal-evaluation-entry .eval-hint-banner {
  text-align: left;
}

.eval-table-wrapper {
  margin: 0.5rem auto 0 auto;
  text-align: center;
  display: inline-block;
  max-height: 520px;
  overflow: auto;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  background-color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  width: fit-content;
  max-width: 100%;
}

.eval-custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0f172a;
}

/* 1. Bật Word-Wrap & Tối ưu padding cho toàn bộ cell */
.eval-custom-table th,
.eval-custom-table td {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.35rem 4px; /* Thu gọn padding ngang còn 4px */
  font-size: 0.86rem;
  line-height: 1.25;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.eval-custom-table th:last-child,
.eval-custom-table td:last-child {
  border-right: none;
}

.eval-custom-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Thanh kéo điều chỉnh độ rộng cột (Column Resizer) */
.eval-custom-table .resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  cursor: col-resize;
  user-select: none;
  height: 100%;
  z-index: 25;
  touch-action: none;
  transition: background-color 0.15s ease;
}

.eval-custom-table .resizer:hover,
.eval-custom-table .resizer.resizing {
  background-color: #4f46e5; /* Màu highlight khi rê chuột hoặc đang kéo */
}

body.is-col-resizing {
  user-select: none !important;
  cursor: col-resize !important;
}

body.is-col-resizing * {
  cursor: col-resize !important;
}

.eval-custom-table th.th-stt,
.eval-custom-table th.th-student-name {
  top: 0;
  z-index: 15;
}

/* 2. Ép chiều rộng cho cột 'STT' (khoảng 40px - 50px) */
.eval-custom-table th.th-stt,
.eval-custom-table td.td-stt {
  width: 44px;
  max-width: 50px;
  min-width: 40px;
  text-align: center;
  padding: 0.35rem 2px;
  box-sizing: border-box;
}

.eval-custom-table th.th-stt {
  background: #f8fafc;
  color: #475569;
  vertical-align: middle;
  font-size: 0.78rem;
  font-weight: 800;
  border-bottom: 2px solid #cbd5e1;
}

/* 2. Chiều rộng ban đầu cho cột 'Học sinh' (tự động xuống dòng) */
.eval-custom-table th.th-student-name,
.eval-custom-table td.col-student-name-cell {
  width: 160px;
  min-width: 120px;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.eval-custom-table th.th-student-name {
  text-align: left;
  padding: 0.32rem 6px 0.32rem 8px;
  vertical-align: middle;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  border-bottom: 2px solid #cbd5e1;
  line-height: 1.2;
}

/* Tier 1 Group Headers */
.eval-custom-table th.th-eval-grp {
  padding: 0.32rem 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.eval-custom-table th.th-eval-grp.grp-old {
  background: #dbeafe;
  color: #1e40af;
  border-bottom: 3px solid #3b82f6;
  border-left: 1.5px solid #bfdbfe;
  border-right: 1.5px solid #bfdbfe;
}

.eval-custom-table th.th-eval-grp.grp-new {
  background: #dcfce7;
  color: #166534;
  border-bottom: 3px solid #22c55e;
  border-left: 1.5px solid #bbf7d0;
  border-right: 1.5px solid #bbf7d0;
}

.eval-custom-table th.th-eval-grp.grp-skill {
  background: #f3e8ff;
  color: #6b21a8;
  border-bottom: 3px solid #a855f7;
  border-left: 1.5px solid #e9d5ff;
  border-right: 1.5px solid #e9d5ff;
}

.eval-custom-table th.th-eval-grp.grp-score {
  background: #fef3c7;
  color: #92400e;
  border-bottom: 3px solid #f59e0b;
  border-left: 1.5px solid #fde68a;
  border-right: 1.5px solid #fde68a;
}

.eval-custom-table th.th-eval-grp.grp-other {
  background: #f1f5f9;
  color: #334155;
  border-bottom: 3px solid #94a3b8;
}

/* 3. Tối ưu Header thead cho các cột nhận xét (line-height 1.2, chữ dài rớt dòng gọn gàng) */
.eval-custom-table th.th-eval-sub {
  line-height: 1.25;
  font-size: 0.8rem;
  padding: 0.28rem 3px;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* 2. Chiều rộng mặc định các cột Nhận xét */
.eval-custom-table th.th-eval-sub:not(.th-eval-score-header),
.eval-custom-table td.eval-data-cell:not(.td-eval-score) {
  width: 110px;
  min-width: 65px;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* 2. Chiều rộng mặc định cho cột 'Phát âm cần cải thiện' */
.eval-custom-table th.th-eval-sub[data-col-id="col-vocab"],
.eval-custom-table td.eval-data-cell[data-col-id="col-vocab"],
.eval-custom-table th.col-pronunciation,
.eval-custom-table td.col-pronunciation,
.eval-custom-table th.col-col-vocab,
.eval-custom-table td.col-col-vocab {
  width: 135px;
  min-width: 90px;
}

.eval-col-header-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.2rem;
  line-height: 1.2;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.eval-col-header-box > span {
  display: inline-block;
  line-height: 1.2;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-weight: 700;
  color: #1e293b;
}

.eval-col-header-box .btn-th-action {
  font-size: 0.65rem;
  padding: 1px 3px;
  line-height: 1;
  opacity: 0.7;
  border-radius: 3px;
}

.eval-col-header-box .btn-th-action:hover {
  opacity: 1;
}

/* 2. Chiều rộng mặc định cho cột 'Điểm kiểm tra' */
.eval-custom-table th.th-eval-score-header,
.eval-custom-table td.td-eval-score {
  width: 70px;
  min-width: 50px;
  text-align: center;
  padding: 0.25rem 2px;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.eval-toggle-scores-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

/* Student Row Styles */
.eval-custom-table tbody tr {
  background: #ffffff;
  transition: background-color 0.15s ease;
}

.eval-custom-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.eval-custom-table tbody tr:hover {
  background: #eff6ff;
}

.eval-custom-table td.td-stt {
  text-align: center;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
  background: inherit;
  padding: 0.35rem 2px;
  vertical-align: middle;
}

.std-stt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
}

.eval-custom-table td.col-student-name-cell {
  background: inherit;
  font-weight: 600;
  color: #0f172a;
  text-align: left;
  padding: 0.35rem 6px;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  vertical-align: middle;
  line-height: 1.25;
}

.std-name-flex {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
}

.std-fullname {
  font-weight: 700;
  color: #1e293b;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.25;
}

.nick-tag {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 0.05rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Data Cells & Smart Badges */
.eval-data-cell {
  text-align: center;
  vertical-align: middle;
  padding: 0.25rem 3px;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.eval-table-wrapper {
  --eval-text-align: justify;
}

.eval-table-wrapper[data-align="left"] {
  --eval-text-align: left;
}

.eval-table-wrapper[data-align="center"] {
  --eval-text-align: center;
}

.eval-table-wrapper[data-align="right"] {
  --eval-text-align: right;
}

.eval-table-wrapper[data-align="justify"] {
  --eval-text-align: justify;
}

.eval-data-cell:not(.td-eval-score) {
  text-align: var(--eval-text-align, justify);
  text-justify: inter-word;
}

.eval-cell-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: block;
}

/* 2. Textarea Nhận xét tự động xuống dòng, hỗ trợ auto-resize và badge hiển thị */
textarea.feedback-input,
.eval-cell-input {
  width: 100%;
  min-height: 36px;
  resize: none; /* Chặn kéo giãn kích thước thủ công */
  overflow: hidden; /* Xóa thanh cuộn mặc định */
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  border: 1px solid transparent; /* Giữ viền liền mạch với bảng */
  outline: none;
  padding: 6px;
  border-radius: 4px;
  background-color: transparent;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  text-align: var(--eval-text-align, justify);
  text-justify: inter-word;
  line-height: 1.3;
  cursor: text;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

/* Modifier rules theo data-align có độ ưu tiên cao */
.eval-table-wrapper[data-align="left"] textarea.feedback-input,
.eval-table-wrapper[data-align="left"] .eval-cell-input,
.eval-table-wrapper[data-align="left"] .eval-data-cell:not(.td-eval-score) {
  text-align: left !important;
  text-justify: auto !important;
}

.eval-table-wrapper[data-align="center"] textarea.feedback-input,
.eval-table-wrapper[data-align="center"] .eval-cell-input,
.eval-table-wrapper[data-align="center"] .eval-data-cell:not(.td-eval-score) {
  text-align: center !important;
  text-justify: auto !important;
}

.eval-table-wrapper[data-align="right"] textarea.feedback-input,
.eval-table-wrapper[data-align="right"] .eval-cell-input,
.eval-table-wrapper[data-align="right"] .eval-data-cell:not(.td-eval-score) {
  text-align: right !important;
  text-justify: auto !important;
}

.eval-table-wrapper[data-align="justify"] textarea.feedback-input,
.eval-table-wrapper[data-align="justify"] .eval-cell-input,
.eval-table-wrapper[data-align="justify"] .eval-data-cell:not(.td-eval-score) {
  text-align: justify !important;
  text-justify: inter-word !important;
}

textarea.feedback-input:hover,
.eval-cell-input:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

textarea.feedback-input:focus,
.eval-cell-input:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
  cursor: text;
}

/* Smart Status Badges inside Cells (Áp dụng cho cả textarea.feedback-input và badge) */
textarea.feedback-input.badge-success,
.eval-cell-input.badge-success {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

textarea.feedback-input.badge-primary,
.eval-cell-input.badge-primary {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

textarea.feedback-input.badge-danger,
.eval-cell-input.badge-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

textarea.feedback-input.badge-info,
.eval-cell-input.badge-info {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}

textarea.feedback-input.badge-neutral,
.eval-cell-input.badge-neutral {
  background: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
}

/* 2. Integrated Score Inputs (48px gọn gàng vừa vặn trong cột 60px - 80px) */
.eval-score-input,
.score-input {
  width: 48px;
  max-width: 54px;
  min-width: 40px;
  box-sizing: border-box;
  border: 1.5px solid #cbd5e1;
  outline: none;
  background: #ffffff;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #1e293b;
  padding: 0.2rem 0.15rem;
  border-radius: 6px;
  cursor: text;
  transition: all 0.15s ease;
}

.eval-score-input:hover,
.score-input:hover {
  border-color: #94a3b8;
}

.eval-score-input:focus,
.score-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
  background: #fffdf5;
}

.eval-avg-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 26px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.85rem;
  background: #f1f5f9;
  color: #475569;
}

.eval-avg-badge.excellent {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.eval-avg-badge.good {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.eval-avg-badge.fair {
  background: #fef9c3;
  color: #a16207;
  border: 1px solid #fde047;
}

.eval-avg-badge.average {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.eval-avg-badge.poor {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.eval-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.eval-rank-badge.excellent {
  background: #dcfce7;
  color: #15803d;
}

.eval-rank-badge.good {
  background: #eff6ff;
  color: #1d4ed8;
}

.eval-rank-badge.fair {
  background: #fef9c3;
  color: #a16207;
}

.eval-rank-badge.average {
  background: #f1f5f9;
  color: #475569;
}

.eval-rank-badge.poor {
  background: #fee2e2;
  color: #b91c1c;
}

/* Popover for Quick Choices */
.eval-preset-popover {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-md);
  padding: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-width: 170px;
  max-width: 260px;
  animation: fadeIn 0.15s ease;
}

.eval-preset-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.28rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.eval-preset-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.eval-preset-btn.badge-success {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}
.eval-preset-btn.badge-success:hover {
  background: #bbf7d0;
}

.eval-preset-btn.badge-primary {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.eval-preset-btn.badge-primary:hover {
  background: #dbeafe;
}

.eval-preset-btn.badge-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.eval-preset-btn.badge-danger:hover {
  background: #fecaca;
}

.eval-preset-btn.badge-info {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}
.eval-preset-btn.badge-info:hover {
  background: #e9d5ff;
}

/* Print Styles */
@media print {
  body * {
    visibility: hidden;
  }
  #eval-table-print-area,
  #eval-table-print-area * {
    visibility: visible;
  }
  #eval-table-print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    max-height: none;
    overflow: visible;
    border: none;
  }
  .eval-custom-table {
    width: 100%;
    border: 2px solid #000000;
    border-collapse: collapse;
  }
  .eval-custom-table th,
  .eval-custom-table td {
    border: 1.5px solid #000000 !important;
    background: transparent !important;
    color: #000000 !important;
  }
  .eval-cell-input {
    border: none !important;
    background: transparent !important;
    color: #000000 !important;
  }
  .btn-th-action, .btn-edit-eval-col-action, .btn-del-eval-col-action, .nick-tag, .std-stt-badge {
    display: none !important;
  }
}

/* ==========================================================
   XUẤT ẢNH BẢNG NHẬN XÉT (HTML2CANVAS EXPORT STYLES)
   ========================================================== */

/* Header tiêu đề bảng khi xuất ảnh (Banner xanh chỉ đặt width: 100%, không đặt fixed pixel) */
.eval-export-header {
  display: none;
  background: #1e3a8a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid #1e40af;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.eval-table-wrapper.is-exporting-image .eval-export-header {
  display: flex !important;
}

/* Khối bên trái: Logo + Tên trung tâm + Tiêu đề bảng */
.eval-export-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.eval-export-logo-img {
  height: 48px;
  width: auto;
  max-height: 50px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}

.eval-export-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eval-export-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  line-height: 1.2;
  white-space: nowrap;
}

.eval-export-subtitle {
  font-size: 0.84rem;
  font-weight: 700;
  color: #93c5fd;
  margin-top: 3px;
  line-height: 1.2;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Khối bên phải: Thông tin lớp, buổi học, giáo viên phụ trách */
.eval-export-meta {
  text-align: right;
  font-size: 0.84rem;
  color: #dbeafe;
  line-height: 1.45;
  flex-shrink: 0;
  white-space: nowrap;
}

.eval-export-meta strong {
  color: #ffffff;
  font-weight: 700;
}

/* Footer chân trang khi xuất ảnh: 1 hàng ngang cân đối gồm tên hệ thống, SĐT và Website */
.eval-export-footer {
  display: none;
  background: #f8fafc;
  color: #475569;
  padding: 7px 16px;
  font-size: 0.78rem;
  font-style: normal;
  border-top: 1px solid #cbd5e1;
  text-align: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  line-height: 1.3;
}

.eval-export-footer span {
  display: inline-block;
  vertical-align: middle;
}

.eval-export-footer strong {
  color: #1e293b;
  font-weight: 600;
}

.eval-export-footer .eval-footer-sep {
  margin: 0 8px;
  color: #94a3b8;
  font-weight: 400;
}

.eval-table-wrapper.is-exporting-image .eval-export-footer {
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin-bottom: 0 !important;
}

/* Trạng thái container khi xuất ảnh: ép sát kích thước theo nội dung bảng (max-content & inline-block) */
.eval-table-wrapper.is-exporting-image {
  background-color: #ffffff !important;
  max-height: none !important;
  overflow: visible !important;
  height: auto !important;
  width: max-content !important;
  min-width: max-content !important;
  max-width: unset !important;
  margin: 0 auto !important;
  padding: 0 !important;
  padding-bottom: 0 !important;
  display: inline-block !important;
  box-shadow: none !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 8px !important;
  text-align: center !important;
}

/* Ẩn các nút hành động chỉnh sửa/xóa cột và dropdown khi xuất ảnh */
.is-exporting-image .btn-th-action,
.is-exporting-image .btn-edit-eval-col-action,
.is-exporting-image .btn-del-eval-col-action,
.is-exporting-image .dropdown-arrow {
  display: none !important;
  visibility: hidden !important;
}

/* Bỏ sticky header khi xuất ảnh để html2canvas không bị lệch vị trí */
.is-exporting-image .eval-custom-table th {
  position: static !important;
  top: auto !important;
  box-shadow: none !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

.is-exporting-image .eval-custom-table td {
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

/* Đảm bảo thẻ table bên trong không bị giãn 100%, ôm sát theo kích thước cột */
.is-exporting-image .eval-custom-table {
  background: #ffffff !important;
  border-collapse: separate !important;
  width: auto !important;
  min-width: unset !important;
  max-width: unset !important;
}

.is-exporting-image .eval-cell-input,
.is-exporting-image textarea.feedback-input,
.is-exporting-image .eval-cell-badge {
  cursor: default !important;
  pointer-events: none !important;
  box-shadow: none !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  line-height: 1.25 !important;
  text-align: justify !important;
  text-justify: inter-word !important;
}

/* ==========================================================
   WAITING STUDENTS & CAMBRIDGE LEVEL BADGES
   ========================================================== */

.badge-waiting-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0 4px;
}

.waiting-table th,
.waiting-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.waiting-table tbody tr {
  background: var(--bg-surface);
  transition: background-color 0.15s ease;
}

.waiting-table tbody tr:nth-child(even) {
  background: var(--bg-app);
}

.waiting-table tbody tr:hover {
  background: rgba(245, 158, 11, 0.08);
}

/* Cambridge Level Badges */
.badge-cambridge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.badge-cambridge-chua {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.badge-cambridge-pre-starters {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-cambridge-starters {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.badge-cambridge-movers {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

.badge-cambridge-flyers {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
}

.badge-cambridge-ket {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.badge-cambridge-pet {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.badge-cambridge-fce {
  background: #ffe4e6;
  color: #be123c;
  border: 1px solid #fca5a5;
}

.badge-cambridge-ielts {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
}

/* Action Buttons inside Table */
.waiting-action-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: center;
}

.btn-action-sm {
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
}

.btn-action-edit {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}

.btn-action-edit:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.btn-action-delete {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.btn-action-delete:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-action-enroll {
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff;
  border-color: #047857;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
}

.btn-action-enroll:hover {
  background: linear-gradient(135deg, #047857, #065f46);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(5, 150, 105, 0.35);
}

/* ==================== MAKEUP LESSONS (LỊCH HỌC BÙ) ==================== */
.badge-makeup-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-makeup-pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-makeup-done {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.badge-makeup-cancelled {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* Visual Classification Badges: [Học bù] vs [Bổ trợ] */
.badge-lesson-type {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-type-makeup {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-type-supplementary {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.btn-action-complete {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.btn-action-complete:hover {
  background: #d1fae5;
  color: #047857;
  border-color: #6ee7b7;
}

.btn-action-cancel-makeup {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.btn-action-cancel-makeup:hover {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fdba74;
}

.btn-action-zalo {
  background: #eff6ff;
  color: #0068ff;
  border: 1px solid #bfdbfe;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-action-zalo:hover {
  background: #0068ff;
  color: white;
  border-color: #0056d6;
  box-shadow: 0 2px 6px rgba(0, 104, 255, 0.35);
  transform: translateY(-1px);
}

.popover-makeup-btn {
  border-top: 1px solid var(--border-light) !important;
  margin-top: 4px;
  padding-top: 6px;
  color: #0284c7 !important;
  font-weight: 700 !important;
}

.popover-makeup-btn:hover {
  background: #f0f9ff !important;
  color: #0369a1 !important;
}

/* Quick time slots for makeup modal */
.makeup-time-slots-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.btn-time-slot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-light, #cbd5e1);
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #334155);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-time-slot:hover {
  background: var(--bg-hover, #f1f5f9);
  border-color: #0284c7;
  color: #0284c7;
}

.btn-time-slot.active {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.35);
}

/* Dynamic conflict alert box for makeup modal */
.makeup-conflict-box {
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  font-size: 0.84rem;
  line-height: 1.45;
  transition: all 0.2s ease;
}

.makeup-conflict-box.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  color: #92400e;
}

.makeup-conflict-box.empty {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #10b981;
  color: #166534;
}

.makeup-conflict-box.info {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #64748b;
}

/* Overdue makeup lessons alert card */
.overdue-item-card {
  background: var(--bg-card);
  border: 1px solid #fed7aa;
  border-left: 4px solid #ea580c;
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  transition: all 0.25s ease;
}

.overdue-item-card:hover {
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.12);
  border-color: #fdba74;
}

.overdue-question-box {
  background: #fff7ed;
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  border: 1px dashed #fdba74;
  color: #9a3412;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
}

/* ==========================================================================
   MAKEUP MANAGER MODAL & TABLE RESPONSIVENESS OPTIMIZATIONS
   Loại bỏ thanh cuộn ngang, nới rộng modal và tối ưu cột thao tác + ghi chú
   ========================================================================== */

#modal-makeup-manager .modal-card,
.modal-card.modal-card-xl {
  max-width: 1240px !important;
  width: 95% !important;
}

#modal-makeup-manager .waiting-table-container {
  overflow-x: hidden !important;
  width: 100% !important;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

#modal-makeup-manager .waiting-table {
  width: 100% !important;
  table-layout: auto !important;
  border-collapse: collapse;
}

#modal-makeup-manager .waiting-table th,
#modal-makeup-manager .waiting-table td {
  padding: 0.65rem 0.55rem;
  vertical-align: middle;
  box-sizing: border-box;
}

#modal-makeup-manager .waiting-table th:last-child,
#modal-makeup-manager .waiting-table td:last-child {
  width: 155px !important;
  min-width: 155px !important;
  max-width: 165px !important;
  white-space: nowrap !important;
  text-align: center !important;
  padding: 0.5rem 0.35rem !important;
}

#modal-makeup-manager .cell-makeup-notes {
  max-width: 180px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  cursor: help;
}

/* ==========================================================================
   HÀNG LỊCH HỌC BÙ ĐÃ HOÀN THÀNH (LÀM MỜ, NỀN DỊU, PHÂN BIỆT RÕ VỚI CHỜ HỌC)
   ========================================================================== */

#modal-makeup-manager .waiting-table tr.makeup-row-completed {
  background-color: var(--bg-app, #f8fafc) !important;
  opacity: 0.62 !important;
  transition: all 0.25s ease;
}

#modal-makeup-manager .waiting-table tr.makeup-row-completed:hover {
  opacity: 0.92 !important;
  background-color: #f1f5f9 !important;
}

#modal-makeup-manager .waiting-table tr.makeup-row-completed td {
  color: var(--text-muted, #64748b) !important;
}

#modal-makeup-manager .waiting-table tr.makeup-row-completed td div,
#modal-makeup-manager .waiting-table tr.makeup-row-completed td span:not(.badge-makeup-status):not(.badge-lesson-type),
#modal-makeup-manager .waiting-table tr.makeup-row-completed td strong {
  color: #64748b !important;
}

#modal-makeup-manager .waiting-table tr.makeup-row-completed .badge-makeup-done {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
}

#modal-makeup-manager .waiting-action-group {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
  justify-content: center !important;
  align-items: center !important;
  white-space: nowrap !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

.btn-action-icon {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  padding: 4px !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.95rem !important;
  border-radius: var(--radius-sm) !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
}

.btn-action-icon:hover {
  transform: translateY(-1px);
}

/* ==========================================================
   MULTI-TEACHER ASSIGNMENT MODAL STYLING
   ========================================================== */
#modal-classes .modal-card {
  max-width: 640px;
}

.class-teachers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.class-teacher-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-app);
  padding: 8px 10px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}

.class-teacher-row:hover {
  border-color: var(--primary-light, #93c5fd);
}

.class-teacher-select {
  flex: 3;
  min-width: 0;
}

.class-teacher-role-select {
  flex: 2;
  min-width: 135px;
}

.btn-remove-teacher-row {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.btn-remove-teacher-row:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
  transform: scale(1.05);
}

.btn-remove-teacher-row:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--border-light);
  background: transparent;
  color: var(--text-muted);
}

.btn-outline-primary {
  background: transparent;
  border: 1px solid var(--primary, #3b82f6);
  color: var(--primary, #3b82f6);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline-primary:hover:not(:disabled) {
  background: var(--primary, #3b82f6);
  color: #ffffff;
}

/* ==========================================================================
   NOTIFICATION BELL & DROPDOWN COMPONENT (HỌC BÙ HÔM NAY)
   ========================================================================== */

.notification-bell-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn-notification {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  color: var(--text-main);
}

.btn-notification:hover {
  background: var(--bg-hover, rgba(0, 0, 0, 0.05));
  border-color: var(--border-medium, #cbd5e1);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

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

.bell-icon {
  font-size: 1.15rem;
  line-height: 1;
  display: inline-block;
  transition: transform 0.25s ease;
}

.btn-notification:hover .bell-icon {
  animation: bellWobble 0.6s ease-in-out;
}

@keyframes bellWobble {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(15deg); }
  40% { transform: rotate(-15deg); }
  60% { transform: rotate(8deg); }
  80% { transform: rotate(-8deg); }
  100% { transform: rotate(0deg); }
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--bg-card, #ffffff), 0 2px 5px rgba(239, 68, 68, 0.4);
  z-index: 2;
  pointer-events: none;
  animation: badgePulse 2.5s infinite;
}

@keyframes badgePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: -8px;
  width: 380px;
  max-width: calc(100vw - 24px);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.18), 0 6px 16px -4px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: notifDropdownIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-app, #f8fafc);
}

.notification-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notification-header-title h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.notification-date-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.notification-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.notification-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md, 10px);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  user-select: none;
}

.notification-item:hover {
  background: var(--bg-hover, #f1f5f9);
  border-color: #818cf8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.notification-item:active {
  transform: scale(0.99);
}

.notification-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  border: 1px solid #dbeafe;
}

.notification-item-content {
  flex: 1;
  min-width: 0;
}

.notification-item-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.notification-item-title strong {
  color: #4f46e5;
}

.notification-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.notification-item-time {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: #0284c7;
}

.notification-item-status {
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.notification-item-status.pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.notification-item-status.completed {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.notification-item-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.4rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border-light, #e2e8f0);
}

.notification-item-action-hint {
  font-size: 0.73rem;
  color: #6366f1;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-notification-mark-read {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-app, #f8fafc);
  border: 1px solid var(--border-medium, #cbd5e1);
  color: var(--text-muted, #64748b);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-notification-mark-read:hover {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(22, 163, 74, 0.15);
}

.btn-notification-mark-read .check-icon {
  font-weight: 800;
  color: #16a34a;
}

/* Kiểu hiển thị cho thông báo ĐÃ XEM (không bị xóa, nền xám nhạt, mờ hơn để phân biệt) */
.notification-item.read {
  background: var(--bg-app, #f8fafc);
  opacity: 0.72;
  border-color: var(--border-light, #e2e8f0);
}

.notification-item.read:hover {
  opacity: 0.94;
  background: #f1f5f9;
  border-color: var(--border-medium, #cbd5e1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.notification-item.read .notification-item-icon {
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
}

.notification-item.read .notification-item-title strong {
  color: #64748b;
}

.badge-read-status {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm, 6px);
  user-select: none;
}

.badge-read-status .check-icon {
  color: #16a34a;
  font-weight: 800;
}

.btn-mark-all-read {
  background: transparent;
  border: none;
  color: #4f46e5;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-mark-all-read:hover {
  background: rgba(99, 102, 241, 0.12);
  color: #3730a3;
}

.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  gap: 0.6rem;
}

.notification-empty-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.notification-empty-text {
  font-size: 0.88rem;
  font-weight: 500;
}

.notification-footer {
  padding: 0.6rem 0.85rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-app, #f8fafc);
  text-align: center;
}

.btn-notification-view-all {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4f46e5;
  cursor: pointer;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.btn-notification-view-all:hover {
  background: rgba(79, 70, 229, 0.08);
  color: #3730a3;
}

/* Special Overdue Makeup Alert Item in Notification Dropdown */
.notification-overdue-alert-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1.5px solid #f97316;
  border-left: 4.5px solid #ea580c;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(234, 88, 12, 0.12);
  transition: all 0.2s ease;
  user-select: none;
}

.notification-overdue-alert-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
  border-color: #ea580c;
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
}

.notification-overdue-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ea580c;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(234, 88, 12, 0.3);
}

.notification-overdue-body {
  flex: 1;
  min-width: 0;
}

.notification-overdue-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 0.25rem;
}

.notification-overdue-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #9a3412;
  letter-spacing: 0.03em;
}

.notification-overdue-pill {
  background: #ea580c;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  white-space: nowrap;
}

.notification-overdue-desc {
  font-size: 0.8rem;
  color: #7c2d12;
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.notification-overdue-action-prompt {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #ea580c;
}

/* ==========================================================================
   USER PROFILE FLOATING FOOTER (GÓC DƯỚI BÊN PHẢI MÀN HÌNH)
   ========================================================================== */

.user-profile-floating-footer {
  position: fixed;
  bottom: 15px;
  right: 15px;
  background: var(--bg-card, #ffffff);
  padding: 6px 10px;
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  border: 1px solid var(--border-light, #e5e7eb);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-profile-floating-footer:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16), 0 3px 8px rgba(0, 0, 0, 0.08);
}

.user-profile-floating-footer .user-profile-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  background: var(--bg-app, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.user-profile-floating-footer .user-profile-chip:hover {
  background: var(--bg-hover, #f1f5f9);
  border-color: var(--primary-300, #a5b4fc);
}

.user-profile-floating-footer .user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-100, #e0e7ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.user-profile-floating-footer .user-chip-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-profile-floating-footer .user-chip-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main, #1e293b);
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-profile-floating-footer .user-chip-role {
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-profile-floating-footer .btn-floating-admin {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-md, 8px);
  white-space: nowrap;
}

.user-profile-floating-footer .btn-floating-logout {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #dc2626;
  padding: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-profile-floating-footer .btn-floating-logout:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  transform: scale(1.05);
}

/* --- Avatar & User Profile Popover Styles --- */
.main-avatar-img,
.chat-avatar-img,
.chat-header-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.user-profile-menu-popover {
  position: fixed;
  bottom: 64px;
  right: 180px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  width: 230px;
  padding: 8px 0;
  z-index: 10001;
  animation: popoverFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 10px;
}

.user-menu-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  overflow: hidden;
  flex-shrink: 0;
}

.user-menu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-menu-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-menu-info strong {
  font-size: 0.85rem;
  color: var(--text-primary, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-divider {
  height: 1px;
  background: var(--border-color, #e2e8f0);
  margin: 4px 0;
}

.user-menu-actions {
  display: flex;
  flex-direction: column;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary, #334155);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.user-menu-btn:hover {
  background: var(--bg-hover, #f1f5f9);
}

.user-menu-btn.text-danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

.avatar-upload-dropzone:hover {
  border-color: #3b82f6 !important;
  background: #eff6ff !important;
}

/* ===================================================
   REAL-TIME WEBSOCKET STATUS BADGE (DURABLE OBJECTS)
   =================================================== */
.ws-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #f8fafc);
  color: var(--text-muted, #64748b);
  transition: all 0.25s ease;
  user-select: none;
}

.ws-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #94a3b8;
  display: inline-block;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.ws-status-badge.connected {
  border-color: #86efac;
  background: #f0fdf4;
  color: #15803d;
}
.ws-status-badge.connected .ws-status-dot {
  background-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.ws-status-badge.connecting {
  border-color: #fde047;
  background: #fefce8;
  color: #a16207;
}
.ws-status-badge.connecting .ws-status-dot {
  background-color: #eab308;
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.25);
  animation: pulse-ws 1.5s infinite;
}

.ws-status-badge.disconnected, .ws-status-badge.error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}
.ws-status-badge.disconnected .ws-status-dot,
.ws-status-badge.error .ws-status-dot {
  background-color: #ef4444;
}

@keyframes pulse-ws {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ===================================================
   REAL-TIME CHAT & MESSENGER DIRECT MESSAGING
   =================================================== */

/* Nút mở chat trong thanh floating footer */
.btn-floating-chat {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-md, 8px);
  background: linear-gradient(135deg, #0084ff 0%, #0099ff 100%);
  color: #ffffff !important;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 132, 255, 0.32);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.btn-floating-chat:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 132, 255, 0.45);
  filter: brightness(1.06);
}

.btn-floating-chat.chat-open {
  background: #0073e6;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chat-online-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 9999px;
  backdrop-filter: blur(4px);
}

.chat-unread-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #e41e3f;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(228, 30, 63, 0.5);
  border: 2px solid var(--bg-card, #ffffff);
  animation: bounce-badge 1s ease infinite alternate;
}

@keyframes bounce-badge {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

/* KHUNG CHAT CHUẨN FACEBOOK MESSENGER */
.chat-widget-card {
  position: fixed;
  bottom: 68px;
  right: 18px;
  width: 338px;
  max-width: calc(100vw - 24px);
  height: 485px;
  max-height: calc(100vh - 90px);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 18px;
  box-shadow: 0 12px 28px 0 rgba(0, 0, 0, 0.2), 0 2px 4px 0 rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.96);
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.chat-widget-card.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Header chuẩn Facebook Messenger */
.chat-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #ffffff;
  border-bottom: 1px solid #f0f2f5;
  color: #050505;
  flex-shrink: 0;
}

.chat-header-main {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.chat-back-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0084ff;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.chat-back-btn:hover {
  background: #f0f2f5;
}

.chat-header-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.chat-header-avatar-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #0084ff, #00c6ff);
}

.chat-header-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: #31a24c;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  line-height: 1.25;
}

.chat-header-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #050505;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-status {
  font-size: 11.5px;
  color: #65676b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-tool-btn {
  background: transparent;
  border: none;
  color: #0084ff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.chat-tool-btn:hover {
  background: #f0f2f5;
}

/* ===================================================
   THANH BOTTOM BAR & POPUP DANH SÁCH ONLINE (EXPAND/COLLAPSE)
   =================================================== */

/* Thanh Bottom Bar thu gọn số lượng online */
.chat-online-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 12px;
  background: #f8fafc;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 11.5px;
  color: #65676b;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.chat-online-bottom-bar:hover {
  background: #f0f2f5;
  color: #0084ff;
}

.chat-online-bar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-online-pulse-dot {
  width: 7px;
  height: 7px;
  background: #31a24c;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(49, 162, 76, 0.6);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(49, 162, 76, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(49, 162, 76, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(49, 162, 76, 0); }
}

.chat-online-status-text {
  font-weight: 500;
  white-space: nowrap;
}

.chat-online-bar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #0084ff;
}

.chat-online-arrow-icon {
  display: inline-block;
  font-size: 9px;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-online-bottom-bar.is-open .chat-online-arrow-icon {
  transform: rotate(180deg);
}

/* Khung Popup / Dropdown danh sách giáo viên trực tuyến */
.chat-online-dropdown {
  position: absolute;
  bottom: 82px;
  left: 10px;
  right: 10px;
  max-height: 290px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  z-index: 1050;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-online-dropdown.hidden {
  display: none !important;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  pointer-events: none;
}

.chat-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #f0f2f5;
  flex-shrink: 0;
}

.chat-dropdown-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-dropdown-dot {
  width: 8px;
  height: 8px;
  background: #31a24c;
  border-radius: 50%;
}

.chat-dropdown-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #050505;
}

.chat-dropdown-badge {
  font-size: 10px;
  font-weight: 600;
  background: #e7f3ff;
  color: #0084ff;
  padding: 1px 6px;
  border-radius: 10px;
}

.chat-dropdown-close-btn {
  background: transparent;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #65676b;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.chat-dropdown-close-btn:hover {
  background: #e4e6eb;
  color: #050505;
}

.chat-dropdown-list {
  overflow-y: auto;
  max-height: 240px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scrollbar-width: thin;
}

.chat-dropdown-list::-webkit-scrollbar {
  width: 4px;
}

.chat-dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}

/* Từng dòng giáo viên / phòng chung trong danh sách */
.chat-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.chat-user-item:hover {
  background: #f0f2f5;
}

.chat-user-item.is-active {
  background: #e7f3ff;
}

.chat-user-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.chat-user-avatar-wrap {
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.chat-user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.chat-user-avatar.global-icon {
  background: linear-gradient(135deg, #0084ff, #00c6ff);
  font-size: 14px;
}

.chat-user-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  background: #31a24c;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
}

.chat-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  overflow: hidden;
}

.chat-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #050505;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-user-meta {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-user-role {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
}

.chat-user-role.role-admin {
  background: #fee2e2;
  color: #b91c1c;
}

.chat-user-role.role-teacher {
  background: #e0e7ff;
  color: #4338ca;
}

.chat-user-action {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-user-btn {
  font-size: 11px;
  font-weight: 600;
  color: #0084ff;
  background: transparent;
  border: none;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.chat-user-unread {
  background: #e41e3f;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 10px;
  padding: 1px 6px;
  line-height: 1.2;
}

/* Dòng chảy tin nhắn chuẩn Facebook Messenger */
.chat-messages-stream {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #ffffff;
  scroll-behavior: smooth;
}

.chat-messages-stream::-webkit-scrollbar {
  width: 5px;
}

.chat-messages-stream::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.14);
  border-radius: 3px;
}

/* Empty State */
.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
  text-align: center;
  padding: 24px 16px;
  color: #65676b;
}

.chat-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.chat-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: #050505;
  margin-bottom: 4px;
}

.chat-empty-hint {
  font-size: 12.5px;
  line-height: 1.4;
  margin: 0;
  max-width: 240px;
}

/* Bong bóng tin nhắn chuẩn Messenger */
.chat-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  animation: fadeInMsg 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Tin nhắn của chính mình (Messenger Blue #0084ff) */
.chat-bubble-row.is-me {
  justify-content: flex-end;
}

.chat-bubble-row.is-me .chat-bubble-content {
  max-width: 82%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.chat-bubble-row.is-me .chat-bubble-text {
  background: #0084ff;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 18px 18px 4px 18px;
  font-size: 14px;
  line-height: 1.34;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-bubble-row.is-me .chat-bubble-meta {
  font-size: 11px;
  color: #8a8d91;
  margin-top: 2px;
  padding-right: 4px;
}

/* Tin nhắn của người khác (Messenger Soft Grey #e4e6eb) */
.chat-bubble-row.is-other {
  justify-content: flex-start;
}

.chat-bubble-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.chat-bubble-row.is-other .chat-bubble-content {
  max-width: 82%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.chat-sender-name {
  font-size: 11px;
  font-weight: 500;
  color: #65676b;
  margin-bottom: 2px;
  margin-left: 4px;
}

.chat-bubble-row.is-other .chat-bubble-text {
  background: #e4e6eb;
  color: #050505;
  padding: 8px 12px;
  border-radius: 18px 18px 18px 4px;
  font-size: 14px;
  line-height: 1.34;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-bubble-row.is-other .chat-bubble-meta {
  font-size: 11px;
  color: #8a8d91;
  margin-top: 2px;
  padding-left: 4px;
}

.chat-time {
  font-size: 11px;
}

/* THANH SOẠN THẢO CHUẨN FACEBOOK MESSENGER */
.chat-input-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: #ffffff;
  border-top: 1px solid #f0f2f5;
  flex-shrink: 0;
}

.chat-input-pill {
  flex: 1;
  background: #f0f2f5;
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
}

.chat-message-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  color: #050505;
  resize: none;
  min-height: 20px;
  max-height: 80px;
  line-height: 1.35;
}

.chat-message-input::placeholder {
  color: #8a8d91;
}

.btn-chat-action {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #0084ff;
  transition: transform 0.12s ease;
  flex-shrink: 0;
  padding: 0;
}

.btn-chat-action:hover {
  transform: scale(1.12);
}

.btn-chat-like {
  font-size: 20px;
  line-height: 1;
}

.btn-chat-send {
  color: #0084ff;
}

/* RESPONSIVE CHO THIẾT BỊ DI ĐỘNG */
@media (max-width: 640px) {
  .chat-widget-card {
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    height: 72vh;
    bottom: 60px;
  }
  
  .user-profile-floating-footer {
    right: 8px;
    left: 8px;
    justify-content: space-between;
  }

  .chat-btn-text {
    display: none;
  }
}

/* ==========================================================================
   BẢNG CHI TIẾT HỌC SINH & NHẬN XÉT THÁNG (MONTHLY EVALUATIONS)
   ========================================================================== */
.modal-student-profile-custom {
  max-width: 1180px !important;
  width: 95vw !important;
  height: 90vh !important;
  max-height: 92vh !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  margin-bottom: 0;
}

.profile-stat-card {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.profile-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.profile-stat-card.stat-attendance {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.profile-stat-card.stat-attendance .stat-title { color: #065f46; }
.profile-stat-card.stat-attendance .stat-val { color: #15803d; }
.profile-stat-card.stat-attendance .stat-sub { color: #166534; }

.profile-stat-card.stat-homework {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.profile-stat-card.stat-homework .stat-title { color: #1e40af; }
.profile-stat-card.stat-homework .stat-val { color: #1d4ed8; }
.profile-stat-card.stat-homework .stat-sub { color: #2563eb; }

.profile-stat-card.stat-score {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.profile-stat-card.stat-score .stat-title { color: #166534; }
.profile-stat-card.stat-score .stat-val { color: #047857; }
.profile-stat-card.stat-score .stat-sub { color: #15803d; }

.profile-stat-card.stat-absence {
  background: #fef2f2;
  border-color: #fecaca;
}
.profile-stat-card.stat-absence .stat-title { color: #991b1b; }
.profile-stat-card.stat-absence .stat-val { color: #dc2626; }
.profile-stat-card.stat-absence .stat-sub { color: #b91c1c; }

.profile-stat-card .stat-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.profile-stat-card .stat-val {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0.35rem 0;
}

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

/* Lịch sử chi tiết từng buổi */
.profile-history-section {
  margin-top: 1.25rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

.profile-section-header {
  padding: 0.75rem 1rem;
  background: var(--bg-app);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meval-table-container {
  max-height: 260px;
  overflow-y: auto;
}

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

.meval-history-table th {
  background: var(--bg-app);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 2;
}

.meval-history-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}

.meval-history-table tbody tr:hover {
  background: rgba(0, 132, 255, 0.04);
}

.meval-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.meval-badge-present { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.meval-badge-late { background: #fef9c3; color: #a16207; border: 1px solid #fde047; }
.meval-badge-excused { background: #ffedd5; color: #c2410c; border: 1px solid #fdba74; }
.meval-badge-unexcused { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.meval-badge-empty { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }

.meval-badge-hw-done { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.meval-badge-hw-incomplete { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.meval-badge-done { box-shadow: 0 0 0 1.5px #10b981 inset !important; font-weight: 700 !important; }

/* Thẻ chú thích "(đã bù)" hiển thị cạnh trạng thái vắng L hoặc K */
.meval-makeup-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 700;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  margin-left: 0.35rem;
  letter-spacing: 0.01em;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  cursor: help;
}

.meval-makeup-tag:hover {
  background: #a7f3d0;
  border-color: #34d399;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

body.dark-mode .meval-makeup-tag {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.38);
}

.meval-score-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: #ccfbf1;
  color: #0f766e;
  border: 1px solid #99f6e4;
  font-weight: 800;
  font-size: 0.84rem;
  min-width: 32px;
  text-align: center;
}

/* =====================================================
   COMPACT SESSION CARDS — Lịch sử điểm danh gọn
   ===================================================== */

/* =====================================================
   COMPACT SESSION CARDS — Bố cục 2 hàng cân đối & căn giữa
   ===================================================== */

/* Khung chứa các hàng thẻ buổi học căn giữa */
.meval-compact-grid,
.scm-rows-container {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.5rem;
  overflow-x: hidden;
  align-items: center;
}

/* Từng hàng buổi học cân đối, căn giữa tuyệt đối */
.scm-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  gap: 0.65rem;
  width: 100%;
  box-sizing: border-box;
}

/* Trạng thái rỗng */
.meval-compact-empty {
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.83rem;
  width: 100%;
}

/* Thẻ buổi học nhỏ gọn (Session Card Mini) */
.scm-card {
  flex: 0 1 125px;
  width: 125px;
  max-width: 140px;
  min-width: 95px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.scm-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  border-color: #3b82f6;
}

@media (max-width: 620px) {
  .scm-row {
    flex-wrap: wrap;
    gap: 0.45rem;
  }
  .scm-card {
    flex: 1 1 92px;
    max-width: 130px;
  }
}

/* Tiêu đề thẻ buổi học */
.scm-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light, #e2e8f0);
  padding: 0.35rem 0.4rem 0.3rem 0.4rem;
  text-align: center;
}

.scm-header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  line-height: 1.2;
}

.scm-date {
  font-size: 0.84rem;
  font-weight: 700;
  color: #1d4ed8;
}

.scm-day {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.scm-buoi {
  font-size: 0.64rem;
  font-weight: 600;
  color: #94a3b8;
  display: block;
  margin-top: 1px;
}

/* Thân thẻ: 3 cột AT - HW - Điểm chuẩn theo bảng điểm lớp */
.scm-body {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--bg-card, #ffffff);
}

.scm-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.12rem 0.4rem 0.12rem;
  border-right: 1px solid var(--border-light, #f1f5f9);
}

.scm-col:last-child {
  border-right: none;
}

.scm-col-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  line-height: 1;
}

.scm-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  width: 100%;
}

/* Các nhãn trạng thái trực quan */
.scm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 0.12rem 0.25rem;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

/* AT Badges */
.scm-badge-at-c {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.scm-badge-at-l {
  background: #fef9c3;
  color: #a16207;
  border: 1px solid #fde047;
}

.scm-badge-at-p {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.scm-badge-at-k {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.scm-badge-at-makeup {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #34d399;
  font-size: 0.68rem;
  padding: 0.1rem 0.2rem;
}

.scm-sub-makeup {
  font-size: 0.62rem;
  display: inline-block;
  font-weight: 800;
  color: #059669;
  margin-left: 1px;
}

/* HW Badges */
.scm-badge-hw-ht {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.scm-badge-hw-ch {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* Score Badges */
.scm-badge-score-val {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #6ee7b7;
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  font-weight: 800;
}

.scm-badge-score-pending {
  border: 1px dashed #cbd5e1;
  color: #94a3b8;
  font-size: 0.72rem;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
}

.scm-badge-empty {
  color: #cbd5e1;
  font-weight: 500;
}

/* Dòng ghi chú bài kiểm tra ở đáy thẻ */
.scm-test-tag {
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.63rem;
  font-weight: 600;
  padding: 0.2rem 0.35rem;
  border-top: 1px solid #dbeafe;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}/* Đảm bảo ảnh xuất luôn ở giao diện sáng (Light theme) sang trọng khi chụp html2canvas */
.modal-student-profile-custom.is-exporting-png .scm-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: none !important;
  transform: none !important;
}
.modal-student-profile-custom.is-exporting-png .scm-header {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
.modal-student-profile-custom.is-exporting-png .scm-date {
  color: #1d4ed8 !important;
}
.modal-student-profile-custom.is-exporting-png .scm-body {
  background: #ffffff !important;
}
.modal-student-profile-custom.is-exporting-png .scm-col {
  border-color: #f1f5f9 !important;
}
.modal-student-profile-custom.is-exporting-png .scm-badge-at-c {
  background: #dcfce7 !important;
  color: #15803d !important;
  border-color: #86efac !important;
}
.modal-student-profile-custom.is-exporting-png .scm-badge-at-l {
  background: #fef9c3 !important;
  color: #a16207 !important;
  border-color: #fde047 !important;
}
.modal-student-profile-custom.is-exporting-png .scm-badge-at-p {
  background: #ffedd5 !important;
  color: #c2410c !important;
  border-color: #fdba74 !important;
}
.modal-student-profile-custom.is-exporting-png .scm-badge-at-k {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #fca5a5 !important;
}
.modal-student-profile-custom.is-exporting-png .scm-badge-at-makeup {
  background: #d1fae5 !important;
  color: #065f46 !important;
  border-color: #34d399 !important;
}
.modal-student-profile-custom.is-exporting-png .scm-badge-hw-ht {
  background: #dcfce7 !important;
  color: #15803d !important;
  border-color: #86efac !important;
}
.modal-student-profile-custom.is-exporting-png .scm-badge-hw-ch {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #fca5a5 !important;
}
.modal-student-profile-custom.is-exporting-png .scm-badge-score-val {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border-color: #6ee7b7 !important;
}
.modal-student-profile-custom.is-exporting-png .scm-test-tag {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #dbeafe !important;
}

/* Khu vực Nhận xét tháng của Giáo viên */
.meval-section {
  margin-top: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.meval-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.meval-heading {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meval-form-group {
  margin-bottom: 1rem;
}

.meval-form-group:last-child {
  margin-bottom: 0.5rem;
}

.meval-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.meval-textarea {
  width: 100%;
  border-radius: 8px;
  border: 1.5px solid var(--border-light);
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  font-family: inherit;
  line-height: 1.5;
  background: var(--bg-input, #ffffff);
  color: var(--text-main);
  resize: vertical;
  min-height: 64px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.meval-textarea:focus {
  outline: none;
  border-color: #0084ff;
  box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.15);
}

.meval-textarea::placeholder {
  color: #9ca3af;
  font-style: italic;
  font-size: 0.82rem;
}

.meval-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.meval-status-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* --- Khối Chương Trình Học & Trình Độ Học Sinh (Monthly Evaluation Dialog) --- */
.meval-curriculum-card {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.7) 0%, rgba(245, 243, 255, 0.7) 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 2px 6px rgba(0, 80, 200, 0.04);
  transition: all 0.2s ease;
}

.meval-curriculum-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.meval-curriculum-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.meval-curriculum-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(0, 132, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.curriculum-main-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.curriculum-sub-title {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.curriculum-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
  align-items: center;
}

.curriculum-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.curriculum-badge-pill.pill-book {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e40af;
}

.curriculum-badge-pill.pill-level {
  background: #faf5ff;
  border: 1px solid #d8b4fe;
  color: #6b21a8;
}

.curriculum-badge-pill .pill-title {
  font-size: 0.76rem;
  font-weight: 600;
  opacity: 0.85;
}

.curriculum-badge-pill .pill-value {
  font-weight: 700;
  font-size: 0.86rem;
}

.curriculum-notes-row {
  margin-top: 0.65rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.02);
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border-light);
}

.meval-curriculum-edit-panel {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(0, 132, 255, 0.25);
  animation: fadeIn 0.2s ease;
}

.curriculum-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

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

.curriculum-form-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.3rem;
}

.curriculum-actions-bar {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ==========================================================================
   NÚT XUẤT BÁO CÁO & ĐỊNH DẠNG CHỤP ẢNH HTML2CANVAS (NHẬN XÉT THÁNG)
   ========================================================================== */
.btn-export-profile-img:hover {
  background: linear-gradient(135deg, #4338ca, #2563eb) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35) !important;
}

.btn-export-profile-img:active {
  transform: translateY(0);
}

.btn-export-profile-xls:hover {
  background: linear-gradient(135deg, #047857, #059669) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.35) !important;
}

.btn-export-profile-xls:active {
  transform: translateY(0);
}

.btn-export-profile-img:disabled,
.btn-export-profile-xls:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Định dạng tối ưu khi chụp ảnh toàn bộ modal bằng html2canvas */
.modal-student-profile-custom.is-exporting-png {
  max-height: none !important;
  min-height: 0 !important;
  height: auto !important;
  width: 880px !important;
  max-width: 880px !important;
  overflow: visible !important;
  box-shadow: none !important;
  border-radius: 12px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #1f2937 !important;
  padding: 0 !important;
  margin: 0 auto !important;
}

.modal-student-profile-custom.is-exporting-png .modal-header,
.modal-student-profile-custom.is-exporting-png .modal-footer,
.modal-student-profile-custom.is-exporting-png .modal-close,
.modal-student-profile-custom.is-exporting-png #btn-toggle-curriculum-edit,
.modal-student-profile-custom.is-exporting-png .curriculum-actions-bar,
.modal-student-profile-custom.is-exporting-png .meval-curriculum-edit-panel,
.modal-student-profile-custom.is-exporting-png .meval-header-controls,
.modal-student-profile-custom.is-exporting-png .profile-history-actions,
.modal-student-profile-custom.is-exporting-png #meval-view-toggle,
.modal-student-profile-custom.is-exporting-png .meval-footer-bar {
  display: none !important;
}

.modal-student-profile-custom.is-exporting-png .modal-body {
  flex: none !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  padding: 1.15rem 1.4rem 1.35rem 1.4rem !important;
  gap: 0.85rem !important;
  background: #ffffff !important;
  margin: 0 !important;
}

.modal-student-profile-custom.is-exporting-png .meval-table-container {
  display: block !important;
  max-height: none !important;
  overflow: visible !important;
}

.modal-student-profile-custom.is-exporting-png .meval-compact-grid,
.modal-student-profile-custom.is-exporting-png .scm-rows-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.7rem !important;
  max-height: none !important;
  overflow: visible !important;
  align-items: center !important;
  padding: 0.5rem 0 !important;
}

.modal-student-profile-custom.is-exporting-png .scm-row {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: stretch !important;
  gap: 0.65rem !important;
  width: 100% !important;
  flex-wrap: nowrap !important;
}

.modal-student-profile-custom.is-exporting-png .scm-card {
  flex: 0 1 125px !important;
  width: 125px !important;
  max-width: 140px !important;
}

.modal-student-profile-custom.is-exporting-png .meval-history-table {
  width: 100% !important;
  border-collapse: collapse !important;
}

.modal-student-profile-custom.is-exporting-png .profile-stat-card {
  box-shadow: none !important;
  transform: none !important;
}

.modal-student-profile-custom.is-exporting-png .meval-textarea-export {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #1e293b;
  min-height: 52px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   EVALUATION SHEET REALTIME AUTO-SAVE & LIVE BROADCAST STYLES
   ========================================================================== */
.eval-autosave-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #059669;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: all 0.25s ease;
  user-select: none;
}

.eval-autosave-indicator.is-saving {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #d97706;
}

.sync-dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: syncDotPulse 2s infinite;
}

.eval-autosave-indicator.is-saving .sync-dot-live {
  background-color: #f59e0b;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: syncDotPulse 0.8s infinite;
}

@keyframes syncDotPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1.15);
    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);
  }
}

@keyframes cellLiveHighlight {
  0% {
    background-color: rgba(16, 185, 129, 0.4) !important;
    box-shadow: 0 0 0 2px #10b981;
  }
  50% {
    background-color: rgba(16, 185, 129, 0.2) !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.5);
  }
  100% {
    background-color: transparent;
    box-shadow: none;
  }
}

.cell-live-updated {
  animation: cellLiveHighlight 1.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative;
  z-index: 5;
}

/* ==========================================================================
   BÁO CÁO NHẬN XÉT THÁNG - MẪU XUẤT ẢNH CHUYÊN NGHIỆP (OFF-SCREEN EXPORT CANVAS)
   ========================================================================== */
#monthly-eval-export-canvas {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1020px;
  background: #ffffff !important;
  color: #1e293b !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  z-index: -9999;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.1);
  border: 1px solid #cbd5e1;
}

#monthly-eval-export-canvas * {
  box-sizing: border-box;
}

.mexp-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 55%, #2563eb 100%) !important;
  color: #ffffff !important;
  padding: 16px 24px;
  border-bottom: 3px solid #f59e0b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.mexp-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mexp-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.mexp-brand-title {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff !important;
  line-height: 1.2;
}

.mexp-brand-sub {
  font-size: 0.94rem;
  font-weight: 700;
  color: #fef08a !important;
  margin-top: 4px;
  letter-spacing: 0.3px;
}

.mexp-meta {
  text-align: right;
  font-size: 0.84rem;
  color: #e0f2fe !important;
  line-height: 1.5;
}

.mexp-meta strong {
  color: #ffffff !important;
}

.mexp-body {
  padding: 20px 24px;
  background: #ffffff !important;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mexp-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.mexp-stat-card {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mexp-stat-attendance { background: #f0fdf4 !important; border-color: #86efac !important; color: #15803d !important; }
.mexp-stat-homework { background: #eff6ff !important; border-color: #93c5fd !important; color: #1d4ed8 !important; }
.mexp-stat-score { background: #ecfdf5 !important; border-color: #6ee7b7 !important; color: #047857 !important; }
.mexp-stat-absence { background: #fef2f2 !important; border-color: #fca5a5 !important; color: #dc2626 !important; }

.mexp-stat-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.mexp-stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 2px 0;
}

.mexp-stat-sub {
  font-size: 0.72rem;
  opacity: 0.9;
}

.mexp-section {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc !important;
  padding: 14px 16px;
}

.mexp-section-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #1e3a8a !important;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mexp-eval-box {
  background: #ffffff !important;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 10px;
}

.mexp-eval-box:last-child {
  margin-bottom: 0;
}

.mexp-eval-box.box-completed { border-left: 4px solid #10b981 !important; }
.mexp-eval-box.box-improvement { border-left: 4px solid #f59e0b !important; }
.mexp-eval-box.box-attitude { border-left: 4px solid #3b82f6 !important; }

.mexp-eval-label {
  font-weight: 700;
  font-size: 0.84rem;
  margin-bottom: 4px;
}

.box-completed .mexp-eval-label { color: #047857 !important; }
.box-improvement .mexp-eval-label { color: #b45309 !important; }
.box-attitude .mexp-eval-label { color: #1d4ed8 !important; }

.mexp-eval-text {
  font-size: 0.88rem;
  color: #1e293b !important;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.mexp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: #ffffff !important;
}

.mexp-table th {
  background: #f1f5f9 !important;
  color: #334155 !important;
  font-weight: 700;
  padding: 8px 10px;
  border: 1px solid #cbd5e1 !important;
  text-align: center;
}

.mexp-table td {
  padding: 8px 10px;
  border: 1px solid #e2e8f0 !important;
  text-align: center;
  color: #1e293b !important;
}

.mexp-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.76rem;
}

.mexp-badge-c { background: #dcfce7 !important; color: #15803d !important; border: 1px solid #86efac !important; }
.mexp-badge-l { background: #fef9c3 !important; color: #a16207 !important; border: 1px solid #fde047 !important; }
.mexp-badge-p { background: #ffedd5 !important; color: #c2410c !important; border: 1px solid #fdba74 !important; }
.mexp-badge-k { background: #fee2e2 !important; color: #b91c1c !important; border: 1px solid #fca5a5 !important; }
.mexp-badge-makeup { background: #d1fae5 !important; color: #065f46 !important; border: 1px solid #34d399 !important; }
.mexp-badge-hw-ht { background: #dcfce7 !important; color: #15803d !important; border: 1px solid #86efac !important; }
.mexp-badge-hw-kht { background: #fee2e2 !important; color: #b91c1c !important; border: 1px solid #fca5a5 !important; }
.mexp-badge-score { background: #ecfdf5 !important; color: #047857 !important; border: 1px solid #6ee7b7 !important; font-weight: 800; font-size: 0.82rem; }

.mexp-signatures-row {
  display: flex;
  justify-content: space-between;
  padding: 16px 40px 10px 40px;
  margin-top: 8px;
  background: #ffffff !important;
}

.mexp-sig-col {
  text-align: center;
  width: 260px;
}

.mexp-sig-title {
  font-weight: 800;
  font-size: 0.88rem;
  color: #1e3a8a !important;
  text-transform: uppercase;
}

.mexp-sig-note {
  font-size: 0.75rem;
  color: #64748b !important;
  font-style: italic;
  margin-top: 3px;
}

.mexp-sig-space {
  height: 60px;
}

.mexp-footer {
  background: #1e3a8a !important;
  color: #ffffff !important;
  padding: 10px 20px;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid #1e40af;
}

.mexp-footer-left {
  opacity: 0.95;
  color: #ffffff !important;
}

.mexp-footer-right {
  font-weight: 600;
  color: #fef08a !important;
}

/* ==========================================================================
   BQT ANNOUNCEMENT BANNER (BAN QUẢN TRỊ)
   ========================================================================== */

/* Toggle Switch */
.bqt-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.bqt-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.bqt-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.bqt-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .25s ease;
  border-radius: 26px;
}

.bqt-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s ease;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.bqt-switch input:checked + .bqt-slider {
  background: linear-gradient(135deg, #10b981, #059669);
}

.bqt-switch input:checked + .bqt-slider:before {
  transform: translateX(22px);
}

/* Content Type Radio Group */
.bqt-radio-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.bqt-radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-app);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.bqt-radio-pill:hover {
  border-color: var(--excel-blue-light);
}

.bqt-radio-pill.active {
  border-color: var(--excel-blue-light);
  background: rgba(37, 99, 235, 0.08);
  color: var(--excel-blue-light);
}

.bqt-radio-pill input {
  accent-color: var(--excel-blue-light);
}

/* Admin Banner Preview Card */
.bqt-live-preview-box {
  background: var(--bg-app);
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.bqt-preview-window {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Modal BQT Banner (Index Popup) */
.modal-bqt-banner-card {
  max-width: 640px;
  width: 95%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  animation: bqtPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg-card);
}

@keyframes bqtPopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-bqt-header {
  background: linear-gradient(135deg, #1e3a8a, #0f172a);
  color: #ffffff;
  padding: 1.15rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-bqt-header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-bqt-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.modal-bqt-body {
  padding: 1.5rem;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-bqt-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.85rem 0;
  line-height: 1.35;
}

.modal-bqt-image-wrap {
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: #000;
  text-align: center;
}

.modal-bqt-img {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  display: block;
}

.modal-bqt-content {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-bqt-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-app);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================
   BQT NOTIFICATION CARD INSIDE NOTIFICATION BELL DROPDOWN
   ========================================================== */
.notification-bqt-wrapper {
  padding: 0.65rem 0.75rem 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.06) 0%, rgba(79, 70, 229, 0.01) 100%);
}

.notification-bqt-item {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  color: #ffffff;
  border-radius: var(--radius-md, 10px);
  padding: 0.75rem 0.85rem;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.28);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  text-align: left;
}

.notification-bqt-item::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.notification-bqt-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.42);
  border-color: rgba(255, 255, 255, 0.4);
}

.notification-bqt-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.notification-bqt-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fbbf24;
}

.notification-bqt-tag .pulse-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.4);
  animation: bqtPulse 1.8s infinite;
}

.notification-bqt-new-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
  animation: badgePulse 2s infinite;
}

.notification-bqt-viewed-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #e0e7ff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
}

.notification-bqt-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.notification-bqt-desc {
  font-size: 0.76rem;
  color: #e0e7ff;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-bqt-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.2rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.72rem;
  font-weight: 600;
  color: #fbbf24;
}

.notification-bqt-arrow {
  transition: transform 0.2s ease;
}

.notification-bqt-item:hover .notification-bqt-arrow {
  transform: translateX(3px);
}

@keyframes bqtPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ==========================================================
   TOPBAR RESPONSIVE OPTIMIZATIONS (PREVENT HORIZONTAL OVERFLOW)
   ========================================================== */
.btn-label-short {
  display: none;
}

@media (max-width: 1440px) {
  .header-container {
    padding: 0.4rem 0.85rem;
    gap: 0.5rem;
  }
  .header-controls {
    gap: 0.38rem;
  }
  .selector-group {
    gap: 0.25rem;
    padding: 0.18rem 0.35rem;
  }
  .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.76rem;
  }
  .select-input {
    font-size: 0.8rem;
    padding: 0.18rem 0.35rem;
    max-width: 160px;
  }
}

@media (max-width: 1280px) {
  .btn-label-long {
    display: none !important;
  }
  .btn-label-short {
    display: inline !important;
  }
  .brand-text p {
    display: none; /* Hide subtitle on compact screens */
  }
  .brand-text h1 {
    font-size: 1.05rem;
  }
  .brand-logo {
    width: 36px;
    height: 36px;
  }
  #ws-realtime-badge .ws-status-text {
    display: none; /* Only keep the pulsing dot */
  }
  #ws-realtime-badge {
    padding: 0.32rem 0.45rem;
    min-width: unset;
  }
  .select-input {
    max-width: 135px;
  }
}

@media (max-width: 1024px) {
  .header-container {
    flex-wrap: wrap;
    row-gap: 0.45rem;
  }
  .brand-section {
    flex-grow: 1;
  }
  .header-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

