/*
 * VNESchool Premium Analytics Dashboard Stylesheet
 * Brand colors: Vuihoc Orange (#f05123 to #f3a81d), VNESchool Blue (#1e40af, #2563eb, #3b82f6)
 *
 * Font: Inter do các trang PHP tải một lần (link trong view). Không @import thêm ở đây
 * để không tải trùng bộ font.
 */

:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Primary Brand Blue Tokens */
  --primary: #1e40af;
  --primary-hover: #1e3a8a;
  --primary-light: #2563eb;
  --primary-subtle: #eff6ff;
  --primary-border: #bfdbfe;
  --primary-gradient: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);

  /* Accent Brand Orange Tokens */
  --accent: #ea580c;
  --accent-light: #f97316;
  --accent-subtle: #fff7ed;
  --accent-border: #fed7aa;
  --accent-gradient: linear-gradient(135deg, #f05123 0%, #f97316 100%);

  /* Neutral Canvas & Surface Tokens */
  --bg-dashboard: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-canvas: #f4f6fa;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;

  /* Typography Tokens */
  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Mức điểm: khớp reportUtils.bandColors (report-utils.js) */
  --color-gioi: #10b981;
  --color-gioi-bg: #ecfdf5;
  --color-gioi-text: #047857;

  --color-tb: #f59e0b;
  --color-tb-bg: #fffbeb;
  --color-tb-text: #b45309;

  --color-duoi: #ef4444;
  --color-duoi-bg: #fef2f2;
  --color-duoi-text: #b91c1c;

  /* Shadows & Rings */
  --card-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 4px 14px -2px rgba(15, 23, 42, 0.03);
  --card-shadow-hover: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 14px 28px -4px rgba(15, 23, 42, 0.07);
  --dropdown-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.15);

  /* Transitions */
  --transition-smooth: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-card: 14px;
  --radius-btn: 10px;
  --radius-sm: 8px;
}

/* Base resets & styles for report sections */
.cr-hub, .cr-lookup, .cr-app {
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text-body);
}

/* ==========================================================================
   1. CR HUB PAGE (Selection Portal)
   ========================================================================== */
.cr-hub {
  min-height: 80vh;
  background:
    radial-gradient(ellipse 80% 60% at 50% -15%, rgba(37, 99, 235, 0.07), transparent 70%),
    radial-gradient(circle at 100% 100%, rgba(240, 81, 35, 0.04) 0%, transparent 60%),
    #f8fafc;
  padding: 3rem 1.5rem 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cr-hub__inner {
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

.cr-hub__header {
  text-align: center;
  margin-bottom: 2.75rem;
}

.cr-hub__title {
  font-size: clamp(1.875rem, 1.35rem + 2.2vw, 2.5rem);
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.85rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-wrap: balance;
}

.cr-hub__tagline {
  color: #475569;
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 58ch;
  text-wrap: balance;
}

.cr-hub__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .cr-hub__grid {
    gap: 1.25rem;
  }
}

@media (max-width: 960px) {
  .cr-hub__grid {
    grid-template-columns: 1fr;
    max-width: 34rem;
    margin: 0 auto;
    gap: 1.25rem;
  }
}

.cr-hub__card {
  background: #ffffff !important;
  border-radius: var(--radius-card);
  padding: 1.875rem 1.625rem 1.5rem;
  border: 1px solid #e2e8f0;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text-main) !important;
}

.cr-hub__card--dept {
  --level-text: #1e40af;
  --level-soft: #eff6ff;
}

.cr-hub__card--school {
  --level-text: #047857;
  --level-soft: #ecfdf5;
}

.cr-hub__card--class {
  --level-text: #c2410c;
  --level-soft: #fff7ed;
}

.cr-hub__card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border-color: #cbd5e1;
}

.cr-hub__card:focus-visible {
  outline: 3px solid #1e40af;
  outline-offset: 3px;
}

.cr-hub__card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  background: var(--level-soft);
  color: var(--level-text);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cr-hub__card:hover .cr-hub__card-icon {
  transform: scale(1.06);
}

.cr-hub__card-title {
  font-size: 1.1875rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-wrap: balance;
}

.cr-hub__card-desc {
  font-size: 0.9375rem;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 1.5rem;
  flex: 1;
}

.cr-hub__card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.875rem;
  border-top: 1px solid #f1f5f9;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--level-text);
}

.cr-hub__card-action svg {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cr-hub__card:hover .cr-hub__card-action svg {
  transform: translateX(4px);
}

/* ==========================================================================
   1b. REPORT SHELL (Top bar + Footer) — dùng chung cho các trang báo cáo
   ========================================================================== */
.cr-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.cr-topbar__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cr-topbar__logo {
  display: block;
  flex-shrink: 0;
}

.cr-topbar__logo img {
  display: block;
  width: auto;
  max-width: 8.5rem;
  height: auto;
}

.cr-topbar__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.625rem;
}

.cr-topbar__scope {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--text-body);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.cr-topbar__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.5rem 1.05rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cr-topbar__cta:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  box-shadow: 0 8px 18px -8px rgba(30, 64, 175, 0.55);
  transform: translateY(-1px);
}

.cr-topbar__cta:focus-visible {
  outline: 3px solid #1e40af;
  outline-offset: 2px;
}

.cr-topbar__logo:focus-visible {
  outline: 3px solid #1e40af;
  outline-offset: 4px;
  border-radius: 4px;
}

@media (max-width: 640px) {
  .cr-topbar__inner {
    padding: 0.625rem 1rem;
  }

  .cr-topbar__scope {
    display: none;
  }

  .cr-topbar__logo img {
    max-width: 7rem;
  }
}

/* Footer */
.cr-footer {
  background: #0f172a;
  border-top: 1px solid #1e293b;
  color: #cbd5e1;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.cr-footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.75rem 1.5rem 2.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.125rem;
  text-align: center;
}

.cr-footer__logo {
  display: inline-block;
  background: #ffffff;
  border-radius: 12px;
  padding: 0.5rem 0.875rem;
  line-height: 0;
}

.cr-footer__logo img {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
}

.cr-footer__brand {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f8fafc;
}

.cr-footer__address {
  margin: 0;
  max-width: 62ch;
  font-size: 0.875rem;
  line-height: 1.65;
  color: #94a3b8;
}

.cr-footer__contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  font-size: 0.875rem;
  color: #e2e8f0;
}

.cr-footer__label {
  color: #fdba74;
  font-weight: 700;
}

.cr-footer__copy {
  background: #0a0f1d;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ==========================================================================
   2. CR LOOKUP PAGE (Class / School / Dept Code Input)
   ========================================================================== */
.cr-lookup {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: 
    radial-gradient(ellipse at 50% 10%, rgba(37, 99, 235, 0.05), transparent 70%),
    #f8fafc;
}

.cr-lookup__card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 2.5rem;
  box-shadow: var(--card-shadow-hover);
  border: 1px solid #e2e8f0;
  text-align: center;
}

.cr-lookup__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #eff6ff;
  color: var(--primary-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.cr-lookup__title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.cr-lookup__hint { 
  color: var(--text-muted); 
  font-size: 0.9rem; 
  margin-bottom: 1.75rem; 
}

.cr-lookup__form {
  text-align: left;
}

.cr-lookup__label {
  display: block;
  font-size: 0.775rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  margin-bottom: 0.5rem;
}

.cr-lookup__input {
  width: 100%;
  padding: 0.85rem 1.15rem;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-btn);
  font-size: 1.05rem;
  font-weight: 500;
  outline: none;
  box-sizing: border-box;
  background: #ffffff;
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.cr-lookup__input:focus { 
  border-color: var(--primary-light); 
  box-shadow: var(--focus-ring);
  background: #ffffff;
}

.cr-lookup__error {
  color: #dc2626;
  font-size: 0.85rem;
  margin-top: 0.75rem;
  font-weight: 500;
  background: #fef2f2;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #fee2e2;
  display: flex;
  align-items: center;
  gap: 6px;
}

button.cr-lookup__submit {
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.9rem;
  border: none;
  border-radius: var(--radius-btn);
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(240, 81, 35, 0.25);
  transition: var(--transition-smooth);
}

button.cr-lookup__submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(240, 81, 35, 0.35);
}

button.cr-lookup__submit:disabled { 
  opacity: 0.6; 
  cursor: wait; 
}

.cr-link-home {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  transition: var(--transition-smooth);
}

.cr-link-home:hover {
  color: var(--primary-light);
  border-color: #cbd5e1;
  background: #f8fafc;
}

/* ==========================================================================
   3. DASHBOARD SHELL (Header, Tabs)
   ========================================================================== */
.cr-app {
  --gap: 16px;
  width: 100%;
  box-sizing: border-box;
  padding: 20px max(20px, calc((100% - 1320px) / 2)) 48px;
  color: var(--text-body);
  background: var(--bg-canvas);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.45;
}

.cr-app *,
.cr-app *::before,
.cr-app *::after {
  box-sizing: border-box;
}

/* Màu chọn văn bản của riêng phần báo cáo (mặc định là xanh hệ thống) */
.cr-app ::selection {
  background: #dbeafe;
  color: var(--text-main);
}

.cr-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 12px;
}

.cr-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cr-header__home {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.cr-header__home:hover {
  color: var(--primary-light);
  border-color: #cbd5e1;
}

.cr-header__titles {
  min-width: 0;
}

.cr-header__title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.25;
}

.cr-header__meta {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.cr-meta-item + .cr-meta-item::before {
  content: "·";
  margin: 0 8px;
  color: #cbd5e1;
}

.cr-header__right {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.cr-header__updated {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

/* Tabs dạng segmented */
.cr-tabs {
  display: inline-flex;
  background: #e9edf3;
  border-radius: 10px;
  padding: 3px;
}

.cr-tabs__btn {
  border: none;
  background: transparent;
  height: 32px;
  padding: 0 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-radius: 8px;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.cr-tabs__btn:hover:not(.is-active) {
  color: var(--text-main);
}

.cr-tabs__btn.is-active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* Vòng focus rõ cho các nút tự dựng (mặc định trình duyệt bị mờ trên nền xám) */
.cr-tabs__btn:focus-visible,
.cr-seg__btn:focus-visible,
.cr-filters__clear:focus-visible,
.cr-week-clear:focus-visible,
.cr-shortcut:focus-visible,
.cr-link-btn:focus-visible,
.cr-expand:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* ==========================================================================
   4. FILTERS BAR (Dropdowns, Week Range)
   ========================================================================== */
/* Thanh bộ lọc: dính đầu trang để luôn nhìn thấy phạm vi đang xem khi cuộn bảng dài */
.cr-filters {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
  background: #ffffff;
  border-radius: var(--radius-card);
  padding: 12px 16px;
  margin-bottom: var(--gap);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.cr-filters__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0;
}

.cr-filters__item > span {
  line-height: 1.2;
}

.cr-filters__item--grow {
  flex: 1 1 200px;
  max-width: 320px;
}

.cr-app select,
.cr-filters__item select {
  min-width: 130px;
  width: 100%;
  height: 36px;
  padding: 0 30px 0 10px;
  border: 1px solid #d5dbe4;
  border-radius: 8px;
  background-color: #ffffff;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  font-size: 0.8125rem;
  transition: var(--transition-smooth);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

.cr-app select:hover {
  border-color: #b6c0ce;
}

.cr-app select:focus {
  border-color: var(--primary-light);
  box-shadow: var(--focus-ring);
}

.cr-app select.cr-select--strong {
  min-width: 180px;
  font-weight: 600;
  border-color: #93c5fd;
  background-color: #f8fbff;
}

/* Khoảng tuần: [từ] ——slider—— [đến] gói trong một ô cao bằng dropdown */
.cr-filters__item--week {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 36px;
  row-gap: 4px;
  width: 260px;
  max-width: 100%;
}

/* Ô chọn tuần luôn dồn sang cuối thanh bộ lọc */
.cr-filters .cr-filters__item--week {
  margin-left: auto;
}

/* Thanh bộ lọc chỉ có một nhóm điều khiển: giữ bên trái, không dồn sang cuối */
.cr-filters--compact .cr-filters__item--week {
  margin-left: 0;
}

.cr-week-header {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  line-height: 1.2;
}

.cr-week-clear {
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  flex: none;
}

.cr-week-clear:hover {
  background: #fee2e2;
  color: #ef4444;
}

.cr-week-inputs {
  grid-row: 2;
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #d5dbe4;
  border-radius: 8px;
  padding: 0 4px;
  height: 36px;
  transition: var(--transition-smooth);
}

.cr-week-inputs:focus-within {
  border-color: var(--primary-light);
  box-shadow: var(--focus-ring);
}

.cr-week-inputs input[type="number"] {
  flex: 0 0 34px;
  width: 34px;
  min-width: 0 !important;
  border: none !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  height: 100% !important;
  text-align: center;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  -moz-appearance: textfield;
}

.cr-week-inputs input[type="number"]::-webkit-outer-spin-button,
.cr-week-inputs input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cr-week-inputs > span {
  visibility: hidden;
}

.cr-slider-container {
  grid-row: 2;
  grid-column: 1;
  align-self: center;
  position: relative;
  height: 16px;
  margin: 0 42px;
}

.cr-slider-container input[type="range"] {
  position: absolute;
  inset: 0;
  margin: 0;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  z-index: 2;
  height: 16px;
  width: 100%;
  cursor: pointer;
}

.cr-slider-container input[type="range"]::-webkit-slider-runnable-track {
  background: transparent;
  height: 16px;
}

.cr-slider-container input[type="range"]::-webkit-slider-thumb {
  pointer-events: all;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--primary-light);
  background-color: #ffffff;
  -webkit-appearance: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  cursor: pointer;
}

.cr-slider-container input[type="range"]::-moz-range-thumb {
  pointer-events: all;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--primary-light);
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  cursor: pointer;
}

.cr-slider-container input[type="range"]::-moz-range-track {
  background: transparent;
}

.cr-slider-track {
  width: 100%;
  height: 4px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 4px;
  background: #e2e8f0;
}

.cr-filters__clear {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 0 10px;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  height: 36px;
}

.cr-filters__clear:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.cr-filters__clear::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3e%3cpath d='M3 12a9 9 0 1 0 3-6.7L3 8'/%3e%3cpath d='M3 3v5h5'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-size: contain;
}

/* Gợi ý "Chọn lớp / Chọn trường để xem kết quả" */
.cr-filters__tip {
  align-self: center;
  color: var(--primary-light);
  font-size: 0.8125rem;
  font-weight: 500;
}

@media (max-width: 768px) {
  .cr-filters {
    padding: 12px;
    position: static; /* thanh bộ lọc dính sẽ chiếm gần hết màn hình nhỏ */
  }
  .cr-filters__item {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }
  .cr-filters__item--grow {
    max-width: none;
  }
  .cr-filters__item--week,
  .cr-filters .cr-filters__item--week {
    flex: 1 1 100%;
    width: 100%;
    margin-left: 0;
  }
}

/* ==========================================================================
   4b. SECTION, LỐI TẮT, NGÀY LÀM BÀI
   ========================================================================== */
/* Lối tắt tới section "Ngày làm bài": nhãn đổi theo khoảng ngày đang chọn */
.cr-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--primary-border);
  border-radius: 999px;
  background: var(--primary-subtle);
  color: var(--primary);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.cr-shortcut:hover {
  background: #dbeafe;
}

/* Section: nhóm nội dung trên nền canvas. Không có panel bao quanh để không lồng thẻ. */
.cr-section {
  min-width: 0;
}

.cr-section + .cr-section {
  margin-top: 28px;
}

.cr-section__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text-main);
}

/* Đầu section: tiêu đề bên trái, công cụ/lối tắt bên phải */
.cr-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.cr-section__head .cr-section__title {
  margin: 0;
}

/* Section "Ngày làm bài": dùng màu nhấn cam của phần ngày làm bài */
.cr-section--day .cr-section__title {
  color: #c2410c;
}

.cr-section .cr-filters:last-child,
.cr-section > .cr-card:last-child,
.cr-section > .cr-skeleton-wrapper:last-child {
  margin-bottom: 0;
}

.cr-section--day .cr-skeleton-wrapper {
  background: #ffffff;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  padding: 16px 18px;
}

/* Nút nhóm dạng segmented (khoảng ngày, tab nhỏ Đã làm/Chưa làm); cùng dáng .cr-tabs nhưng không dính JS chuyển tab chính */
.cr-seg,
.cr-subtabs {
  display: inline-flex;
  background: #f3e6d8;
  border-radius: 10px;
  padding: 3px;
}

.cr-seg__btn {
  border: none;
  background: transparent;
  height: 32px;
  padding: 0 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-radius: 8px;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.cr-seg__btn:hover:not(.is-active) {
  color: var(--text-main);
}

.cr-seg__btn.is-active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.cr-day-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 14px;
}

.cr-day-custom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.cr-day-custom input {
  height: 36px;
  padding: 0 8px;
  border: 1px solid #d5dbe4;
  border-radius: 8px;
  background: #ffffff;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
}

.cr-day-custom input:focus {
  border-color: var(--primary-light);
  box-shadow: var(--focus-ring);
}

.cr-day-range__text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.cr-day-summary {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-main);
}

.cr-subtabs {
  margin-bottom: 12px;
}

#cr-day-student-body .cr-kpi__stats {
  margin-bottom: 14px;
}

/* Tên học sinh bấm được để mở tab "Chi tiết học sinh" */
.cr-link-btn {
  padding: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  color: var(--primary-light);
  cursor: pointer;
  text-align: left;
}

.cr-link-btn:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .cr-shortcut {
    flex: 1 1 100%;
    justify-content: space-between;
  }
  .cr-day-range {
    gap: 8px;
  }
  .cr-seg {
    width: 100%;
  }
  .cr-seg .cr-seg__btn {
    flex: 1 1 0;
    padding: 0 6px;
  }
  .cr-day-custom {
    flex: 1 1 100%;
  }
  .cr-day-custom input {
    flex: 1 1 0;
    min-width: 0;
  }
  .cr-subtabs {
    width: 100%;
  }
  .cr-subtabs .cr-seg__btn {
    flex: 1 1 0;
  }
  #cr-day-search {
    width: 100%;
  }
}

/* ==========================================================================
   5. GRID & CARDS
   ========================================================================== */
.cr-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.cr-row--equal {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* Hàng có bảng rộng (ma trận nhiều cột) ở cột lớn hơn */
.cr-row--wide-first {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}

@media (max-width: 992px) {
  .cr-row,
  .cr-row--equal,
  .cr-row--wide-first {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cr-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  border: 1px solid var(--border-color);
  min-width: 0;
}

.cr-card + .cr-card,
.cr-row + .cr-card {
  margin-top: 0;
}

.cr-view > .cr-card,
.cr-view > div > .cr-card,
.sr-tab-content > .cr-card,
.dp-tab-content > .cr-card {
  margin-bottom: var(--gap);
}

.cr-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.cr-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text-main);
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.cr-card__head .cr-card__title {
  margin: 0;
}

.cr-card__hint {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
}

.cr-card__tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cr-card__tools select {
  height: 32px;
  min-width: 120px;
}

/* Khung biểu đồ: chiều cao cố định, canvas co theo (maintainAspectRatio: false) */
.cr-chart-wrap {
  position: relative;
  width: 100%;
  height: 260px;
}

.cr-chart-wrap--sm {
  height: 220px;
}

.cr-chart-wrap--lg {
  height: 320px;
}

.cr-chart-wrap > .cr-skeleton-wrapper,
.cr-chart-wrap > .cr-skeleton-wrapper > .cr-skeleton__chart {
  height: 100%;
}

/* ==========================================================================
   6. KPI
   ========================================================================== */
.cr-card--kpi {
  display: flex;
  flex-direction: column;
}

.cr-kpi__stats,
.cr-kpi__grid {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
}

.cr-kpi__item,
.cr-kpi__stats > div {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 16px;
  border-left: 1px solid var(--border-subtle);
}

.cr-kpi__item:first-child,
.cr-kpi__stats > div:first-child {
  padding-left: 0;
  border-left: none;
}

.cr-kpi__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cr-kpi__value {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cr-kpi__value small {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-light);
  letter-spacing: 0;
}

.cr-kpi__value--score {
  color: var(--primary-light);
}

/* Ô số liệu chưa có dữ liệu: dấu gạch mờ, không tranh chỗ với số thật */
.cr-kpi__value.is-empty {
  color: var(--text-light);
}

.cr-kpi__pct {
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

@media (max-width: 520px) {
  .cr-kpi__stats,
  .cr-kpi__grid {
    flex-wrap: wrap;
    row-gap: 12px;
  }
  .cr-kpi__item,
  .cr-kpi__stats > div {
    flex: 1 1 45%;
  }
}

/* Thanh phân bố mức điểm */
.cr-bands {
  margin-top: auto;
}

.cr-bands__head {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
}

.cr-bands__bar {
  display: flex;
  gap: 2px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef1f5;
  margin-bottom: 10px;
}

.cr-bands__seg {
  height: 100%;
  font-size: 0;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
}

.cr-bands__seg[style*="width:0%"],
.cr-bands__seg[style*="width: 0%"] {
  display: none;
}

.cr-bands__seg--duoi { background: var(--color-duoi); }
.cr-bands__seg--tb { background: var(--color-tb); }
.cr-bands__seg--gioi { background: var(--color-gioi); }

.cr-bands__legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.cr-bands__legend li {
  display: inline-flex;
  align-items: center;
}

.cr-bands__legend .dot,
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
}

.dot--duoi { background: var(--color-duoi); }
.dot--tb { background: var(--color-tb); }
.dot--gioi { background: var(--color-gioi); }

.cr-bands__legend span {
  color: var(--text-main);
  margin-left: 4px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Phân bố mức điểm trong thẻ KPI: mỗi mức một dòng (nhãn – thanh – %) */
.cr-dist {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.cr-dist__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cr-dist__row {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  font-size: 0.8125rem;
}

.cr-dist__label {
  display: inline-flex;
  align-items: center;
  color: var(--text-body);
  white-space: nowrap;
}

.cr-dist__label small {
  margin-left: 6px;
  color: var(--text-light);
  font-size: 0.75rem;
}

.cr-dist__track {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #eef1f5;
  overflow: hidden;
}

.cr-dist__track .cr-bands__seg {
  display: block;
  border-radius: 999px;
}

.cr-dist__pct {
  text-align: right;
  font-weight: 600;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 520px) {
  .cr-dist__row {
    grid-template-columns: 128px minmax(0, 1fr) 40px;
    gap: 8px;
  }
  .cr-dist__label small {
    display: none;
  }
}

/* ==========================================================================
   7. TABLES
   ========================================================================== */
.cr-search {
  width: 240px;
  max-width: 100%;
  height: 34px;
  padding: 0 10px 0 32px;
  border: 1px solid #d5dbe4;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  font-size: 0.8125rem;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='11' cy='11' r='8'%3e%3c/circle%3e%3cline x1='21' y1='21' x2='16.65' y2='16.65'%3e%3c/line%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 14px;
  transition: var(--transition-smooth);
}

.cr-search:focus {
  border-color: var(--primary-light);
  box-shadow: var(--focus-ring);
}

.cr-table-wrap {
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #ffffff;
}

.cr-table-wrap--scroll {
  max-height: 560px;
}

/* Thanh cuộn của vùng bảng: theo bảng màu, không phải thanh mặc định của hệ điều hành */
.cr-table-wrap::-webkit-scrollbar,
.dp-table-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.cr-table-wrap::-webkit-scrollbar-thumb,
.dp-table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border: 3px solid #ffffff;
  border-radius: 999px;
}

.cr-table-wrap::-webkit-scrollbar-thumb:hover,
.dp-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.cr-table-wrap::-webkit-scrollbar-track,
.dp-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.cr-table,
.dp-school-list-table,
.dp-heatmap-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8125rem;
  text-align: left;
  color: var(--text-body);
}

/* Ô bảng không xuống dòng: bảng rộng ra và vùng bảng cuộn ngang thay vì bóp chữ */
.cr-table td,
.cr-table th,
.dp-school-list-table td,
.dp-school-list-table th {
  white-space: nowrap;
}

.cr-table td.cr-cell-wrap {
  white-space: normal;
  min-width: 200px;
}

.cr-table th,
.cr-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.cr-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  border-bottom-color: var(--border-color);
}

.cr-table tbody tr:last-child td {
  border-bottom: none;
}

.cr-table tbody tr:hover td {
  background: #f8fafc;
}

.cr-table .is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cr-table .cr-cell-muted {
  color: var(--text-muted);
  white-space: nowrap;
}

.cr-table .cr-cell-strong {
  color: var(--text-main);
  font-weight: 500;
}

.cr-muted {
  color: var(--text-light);
}

.cr-table tr.cr-row-student {
  cursor: pointer;
}

.cr-student-name {
  color: var(--text-main);
  font-weight: 500;
}

.cr-table tr.is-inactive {
  cursor: default;
}

.cr-table tr.is-inactive .cr-student-name {
  color: var(--text-muted);
  font-weight: 400;
}

.cr-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--text-light);
  font-size: 0.6875rem;
  font-weight: 500;
  vertical-align: 1px;
}

.cr-table tr.cr-row-subject td {
  background: #fbfcfe;
  color: var(--text-muted);
}

.cr-table tr.cr-row-subject td:first-child {
  padding-left: 44px;
}

.cr-expand {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  margin-right: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  color: var(--primary-light);
  background: var(--primary-subtle);
  vertical-align: -3px;
}

.cr-expand--none {
  background: transparent;
}

.cr-row-student:hover .cr-expand:not(.cr-expand--none) {
  background: var(--primary-light);
  color: #ffffff;
}

/* Nhãn điểm theo mức */
.cr-score-badge {
  display: inline-block;
  min-width: 40px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8125rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.cr-score-badge--gioi {
  background: var(--color-gioi-bg);
  color: var(--color-gioi-text);
}

.cr-score-badge--tb {
  background: var(--color-tb-bg);
  color: var(--color-tb-text);
}

.cr-score-badge--duoi {
  background: var(--color-duoi-bg);
  color: var(--color-duoi-text);
}

/* Thanh phân bố mức điểm thu nhỏ trong bảng */
.cr-minibar {
  display: flex;
  gap: 1px;
  width: 100%;
  min-width: 90px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef1f5;
}

.cr-minibar .cr-bands__seg {
  cursor: pointer;
}

/* Tỉ lệ tham gia: số + thanh mảnh + % */
.cr-participation {
  display: grid;
  grid-template-columns: auto minmax(40px, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.cr-participation__num {
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
}

.cr-participation__num small {
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 400;
}

.cr-participation__track {
  height: 6px;
  border-radius: 999px;
  background: #eef1f5;
  overflow: hidden;
}

.cr-participation__track > span {
  display: block;
  height: 100%;
  background: var(--primary-light);
  border-radius: 999px;
}

.cr-participation__pct {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ==========================================================================
   8. STUDENT DETAIL VIEW
   ========================================================================== */
#cr-student-no-selection {
  background: #ffffff;
  padding: 40px 16px;
}

/* ==========================================================================
   9. SKELETON, EMPTY, BANNER
   ========================================================================== */
.cr-skeleton-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

[hidden],
.cr-skeleton-wrapper[hidden],
canvas[hidden] {
  display: none !important;
}

.cr-skeleton__line,
.cr-skeleton__block,
.cr-skeleton__table-row,
.cr-skeleton__chart {
  background: linear-gradient(90deg, #f1f4f8 25%, #e9edf3 50%, #f1f4f8 75%);
  background-size: 200% 100%;
  animation: cr-shimmer 1.6s infinite ease-in-out;
  border-radius: 8px;
}

@keyframes cr-shimmer {
  0% { background-position: 150% 0; }
  100% { background-position: -150% 0; }
}

.cr-skeleton__line--bar {
  height: 10px;
  width: 100%;
  border-radius: 999px;
}

.cr-skeleton__grid-stats {
  display: flex;
  gap: 16px;
}

.cr-skeleton__block--stat {
  height: 52px;
  flex: 1;
}

.cr-skeleton__table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.cr-skeleton__table-row {
  height: 30px;
  width: 100%;
}

.cr-skeleton__table-row--header {
  height: 26px;
  opacity: 0.7;
}

.cr-skeleton__chart {
  width: 100%;
  height: 220px;
}

/* Hiện dần khi có dữ liệu */
#cr-kpi-body:not([hidden]),
#cr-students-table-wrap:not([hidden]),
canvas:not([hidden]),
.dp-table-wrap:not([hidden]),
#dp-kpi-body:not([hidden]),
#dp-matrix-body:not([hidden]),
#sr-kpi-body:not([hidden]),
#sr-matrix-body:not([hidden]),
#cr-student-detail-content:not([hidden]) {
  animation: cr-fade-in 0.3s ease-out forwards;
}

@keyframes cr-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Chuyển tab: khoảnh khắc duy nhất của trang — panel mới trồi lên nhẹ */
.cr-view,
.sr-tab-content,
.dp-tab-content {
  animation: cr-panel-in 0.32s var(--ease-out-expo) both;
}

@keyframes cr-panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cr-view,
  .sr-tab-content,
  .dp-tab-content,
  #cr-kpi-body:not([hidden]),
  #cr-students-table-wrap:not([hidden]),
  canvas:not([hidden]),
  .dp-table-wrap:not([hidden]),
  #dp-kpi-body:not([hidden]),
  #dp-matrix-body:not([hidden]),
  #sr-kpi-body:not([hidden]),
  #sr-matrix-body:not([hidden]),
  #cr-student-detail-content:not([hidden]) {
    animation: none !important;
  }
}

.cr-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 16px;
  font-size: 0.8125rem;
  background: #f8fafc;
  border-radius: 10px;
  margin: 0;
}

/* Trạng thái rỗng dạng khối: dùng cho vùng biểu đồ và vùng bảng không có dữ liệu */
.cr-empty--block {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  height: 100%;
  padding: 24px 16px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
}

.cr-kpi__stats + .cr-empty,
.cr-bands + .cr-empty {
  margin-top: 12px;
  padding: 10px;
}

.cr-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: var(--gap);
  font-size: 0.8125rem;
}

.cr-banner--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fee2e2;
}

.cr-banner__btn {
  border: 1px solid #fca5a5;
  background: #ffffff;
  color: #b91c1c;
  border-radius: 8px;
  padding: 4px 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
}

.cr-banner__btn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}

/* Tooltip của thanh phân bố mức điểm */
.cr-band-tooltip {
  background: #0f172a;
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: var(--dropdown-shadow);
  font-family: var(--font-family);
  font-size: 0.75rem;
  color: #ffffff;
  line-height: 1.4;
  pointer-events: none;
  z-index: 9999;
}

.cr-band-tooltip div {
  text-align: left !important;
}

.cr-band-tooltip span {
  color: #ffffff !important;
}

/* Thẻ trong hàng lưới không cộng thêm margin dưới; thẻ chứa biểu đồ co giãn khớp chiều cao hàng */
.cr-app .cr-row > .cr-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.cr-app .cr-row > .cr-card > .cr-chart-wrap {
  flex: 1;
  height: auto;
  min-height: 250px;
}
