.impact-table {
  width: 100%;
  display: block;
}

.impact-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

#impactGrid {
  table-layout: fixed;
}

#impactGrid col[data-column="student"] {
  width: 12rem;
}

#impactGrid col[data-column="spacer"] {
  width: 2rem;
}

#impactGrid col[data-column="grade"] {
  width: 4rem;
}

#impactGrid col[data-column="teacher"] {
  width: 12rem;
}

#impactGrid col[data-column="ela_03ach"],
#impactGrid col[data-column="ela_ach"],
#impactGrid col[data-column="ela_lg"],
#impactGrid col[data-column="ela_lq"],
#impactGrid col[data-column="math_ach"],
#impactGrid col[data-column="math_lg"],
#impactGrid col[data-column="math_lq"],
#impactGrid col[data-column="sci_ach"],
#impactGrid col[data-column="soc_stud_ach"] {
  width: 4rem;
}

#impactGrid col[data-column="total_points"] {
  width: 13rem;
}

#impactGrid col[data-column="school_share"] {
  width: 13rem;
}

#impactGrid td,
#impactGrid th {
  overflow: hidden;
  text-overflow: ellipsis;
}

.impact-table col[data-col="total_comp"] {
  width: 1%;
  white-space: nowrap;
}

.impact-table tbody tr:hover td.impact-cell {
  background: rgba(148, 163, 184, 0.08);
}

.impact-table .group-row {
  background: #f9fbff;
  font-weight: 600;
}

.impact-table .group-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  margin-right: 0.35rem;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  min-width: 1.125rem;
}

.impact-table .group-name {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  line-height: 1.1;
}

.impact-table .child-row[hidden] {
  display: none;
}

.impact-table tbody td[data-col="total_comp"],
.impact-table thead th[data-col="total_comp"] {
  text-align: center;
}

.impact-table thead th {
  background: #f1f5f9;
  color: #334155;
  font-size: 1.12rem;
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.impact-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}

.impact-table thead th.sortable::after {
  content: '\25BE';
  font-size: 0.95rem;
  margin-left: 4px;
  opacity: 0.35;
}

.impact-table thead th.sortable.sort-asc::after {
  content: '\25B2';
  opacity: 0.85;
}

.impact-table thead th.sortable.sort-desc::after {
  content: '\25BC';
  opacity: 0.85;
}

.impact-table tbody td {
  padding: 10px 12px;
  font-size: 1.15rem;
  color: #1f2937;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
  white-space: nowrap;
  background: transparent;
}

#impactGrid td[data-column="teacher"] {
  font-size: 1rem;
}

.impact-table tbody td.flag-cell {
  padding: 0;
}

.impact-table tbody td.flag-cell .flag-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 0;
  transition: background-color 0.2s ease, color 0.2s ease;
  position: relative;
  cursor: default;
}

.impact-table tbody td.flag-cell[data-flag="yes"] .flag-label {
  background: rgba(22, 163, 74, 0.24);
  color: #14532d;
  border: 1px solid rgba(22, 163, 74, 0.45);
}

.impact-table tbody td.flag-cell[data-flag="no"] .flag-label {
  background: rgba(220, 38, 38, 0.22);
  color: #7f1d1d;
  border: 1px solid rgba(220, 38, 38, 0.42);
}

.impact-table tbody td.flag-cell .flag-label[data-points]::after {
  content: attr(data-points);
  position: absolute;
  inset-inline-start: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 5;
}

.impact-table tbody td.flag-cell .flag-label[data-points]::before {
  content: '';
  position: absolute;
  inset-inline-start: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(4px) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-left: 1px solid rgba(15, 23, 42, 0.12);
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 4;
  rotate: 45deg;
}

.impact-table tbody td.flag-cell .flag-label[data-points]:hover::after,
.impact-table tbody td.flag-cell .flag-label[data-points]:hover::before,
.impact-table tbody td.flag-cell .flag-label[data-points]:focus-visible::after,
.impact-table tbody td.flag-cell .flag-label[data-points]:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.impact-table tbody td.flag-cell .flag-label[data-points]:hover::before,
.impact-table tbody td.flag-cell .flag-label[data-points]:focus-visible::before {
  transform: translateX(-50%) translateY(0) rotate(45deg);
}

.impact-status-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

.impact-status-legend .legend-entry {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.impact-status-legend .legend-dot {
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.impact-status-legend .legend-dot--on {
  color: #166534;
}

.impact-status-legend .legend-dot--off {
  color: #b91c1c;
}

.impact-status-legend .legend-separator {
  opacity: 0.7;
}

.impact-cell {
  min-width: 0;
  padding: 10px 12px;
}

.impact-center-row {
  --impact-left-grow: 0;
  --impact-right-grow: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.impact-center-row .impact-left,
.impact-center-row .impact-right {
  flex-shrink: 1;
  flex-basis: 0;
  height: 12px;
  border-radius: 999px;
  background: #eef2f7;
  transition: flex-grow 0.25s ease, min-width 0.25s ease, filter 0.2s ease;
  overflow: hidden;
}

.impact-center-row .impact-left {
  flex-grow: var(--impact-left-grow, 0);
  position: relative;
  overflow: visible;
  display: flex;
  align-items: stretch;
  background: transparent;
}

.impact-center-row .impact-right {
  flex-grow: var(--impact-right-grow, 100);
}

#impactGrid td.impact-cell {
  background: #ffffff;
}

#impactGrid tbody tr:hover td.impact-cell {
  background: rgba(148, 163, 184, 0.08);
}

#impactGrid td.impact-cell .impact-left,
#impactGrid td.impact-cell .impact-right {
  height: 14px;
}

#impactGrid td.impact-cell .impact-label {
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 6px 14px rgba(15, 23, 42, 0.05);
}

#impactGrid td.impact-cell .impact-value {
  font-variant-numeric: tabular-nums;
}

#impactGrid td.impact-cell .impact-left .impact-dot {
  width: 14px;
  height: 14px;
}

.impact-left[data-positive="false"] {
  min-width: 0;
  background: #eef2f7;
}

.impact-left[data-minfill="true"] {
  min-width: 8px;
}

.impact-left .impact-fill {
  flex: 1 1 auto;
  display: flex;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  background: #eef2f7;
  transition: filter 0.2s ease;
}

.impact-fill__achieved,
.impact-fill__remainder {
  flex-basis: 0;
  flex-grow: 0;
  min-width: 0;
  transition: flex-grow 0.25s ease;
  border-radius: inherit;
}

.impact-fill__achieved {
  flex-grow: var(--impact-achieved-grow, 0);
  background: rgba(22, 163, 74, 0.24);
  border: 1px solid rgba(22, 163, 74, 0.45);
}

.impact-fill__remainder {
  flex-grow: var(--impact-remaining-grow, 0);
  background: rgba(220, 38, 38, 0.22);
  border: 1px solid rgba(220, 38, 38, 0.42);
}

.impact-left[data-has-remainder="true"] .impact-fill__achieved {
  border-inline-end: none;
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

.impact-left[data-has-achieved="true"] .impact-fill__remainder {
  border-inline-start: none;
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

.impact-left:not([data-has-dot="true"]) .impact-fill__remainder,
.impact-left[data-has-remainder="false"] .impact-fill__remainder {
  display: none;
}

.impact-left[data-positive="false"] .impact-fill__achieved,
.impact-left[data-positive="false"] .impact-fill__remainder {
  flex-grow: 0;
  display: none;
}

.impact-left[data-positive="false"] .impact-fill {
  background: #eef2f7;
}

.impact-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.03);
  line-height: 1;
  white-space: nowrap;
  font-weight: 600;
  font-size: 1.12rem;
  color: #0f172a;
}

.impact-cell .impact-label[data-points] {
  position: relative;
  cursor: default;
}

.impact-cell .impact-label[data-points]::after {
  content: attr(data-points);
  position: absolute;
  inset-inline-start: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  padding: 6px 10px 14px;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 6;
  clip-path: polygon(0% 0%, 100% 0%, 100% 78%, 55% 78%, 50% 100%, 45% 78%, 0% 78%);
}

.impact-cell .impact-label[data-points]:hover::after,
.impact-cell .impact-label[data-points]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.impact-value {
  font-variant-numeric: tabular-nums;
  color: #1f2937;
}

.impact-badge {
  display: none !important;
}

.impact-table tbody tr:hover .impact-label {
  box-shadow: 0 0 0 1px rgba(58, 154, 229, 0.18);
}

.impact-table tbody tr:hover .impact-left {
  filter: brightness(1.04);
}

/* .impact-table tbody tr:nth-child(odd) {
  background: #f8fafc;
} */

.impact-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  gap: 12px;
}

.impact-pagination__info {
  font-size: 1.15rem;
  color: #64748b;
}

.impact-pagination__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.impact-pagination__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.15rem;
  color: #64748b;
}

.impact-pagination__label select {
  min-width: 80px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 1.15rem;
}

.impact-pagination__buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.impact-pagination__buttons span {
  font-size: 1.15rem;
  color: #64748b;
}

.impact-pagination__buttons .btn {
  padding: 4px 12px;
}

.impact-pagination__buttons .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: #64748b;
}

.impact-kpi-sticky {
  position: relative;
  top: auto;
  z-index: auto;
  padding: 0;
  margin-bottom: 1.5rem;
  background: transparent;
}

.impact-kpi-sticky .row {
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0 !important;
}

.selector-filter-card[data-role="pm-selector-card"] .selector-card-body {
  justify-items: stretch;
}

.selector-filter-card[data-role="pm-selector-card"] .selector-carousel-wrapper {
  width: 100%;
  justify-self: stretch;
}

.selector-filter-card[data-role="pm-selector-card"] .selector-carousel-wrapper .subject-carousel {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0;
}

.selector-filter-card[data-role="pm-selector-card"] .subject-toggle {
  flex: 0 0 auto;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.selector-filter-card[data-role="pm-selector-card"] .selector-value-trigger {
  flex: 1 1 auto;
  text-align: center;
  min-width: 0;
}

.selector-option-card.is-disabled,
.selector-option-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.impact-kpi-card[role="button"] {
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.impact-kpi-card[role="button"]:hover,
.impact-kpi-card[role="button"]:focus-visible {
  border-color: rgba(44, 70, 225, 0.45);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.impact-kpi-card[data-active="true"],
.impact-kpi-card[aria-pressed="true"] {
  border-color: transparent;
  background-image: linear-gradient(#ffffff, #ffffff), linear-gradient(135deg, #6af0c4, #3a9ae5, #2c46e1);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 6px 12px rgba(44, 70, 225, 0.18);
  transform: translateY(-1px);
}

.impact-kpi-card[role="button"]:focus-visible .card-body {
  outline: none;
}

.impact-kpi-card[role="button"] .card-body {
  min-height: 100%;
}

.impact-kpi-card[role="button"][aria-pressed="true"] .card-body,
.impact-kpi-card[data-active="true"] .card-body {
  color: #0f172a;
}

.impact-kpi-card[data-kpi="total"] .card-body {
  justify-content: flex-start;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
}

.impact-kpi-card[data-kpi="total"] .card-body .fs-4 {
  margin-top: auto;
  margin-bottom: auto;
}

.impact-kpi-card[data-kpi="total"] .card-body .card-title-detail {
  display: block !important;
}

.impact-kpi-card[data-kpi="total"] .card-body .text-muted,
.impact-kpi-card[data-kpi="total"] .card-body .d-flex.text-muted {
  display: none !important;
}

@media (max-width: 1024px) {
  .impact-pagination__controls {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .impact-table tbody td {
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .impact-center-row {
    min-width: 180px;
    gap: 0.5rem;
  }
  .impact-label {
    padding: 2px 6px;
  }
  .impact-badge {
    display: none;
  }
}

/* --- Status Matrix Reset ----------------------------------------- */
.impact-table tbody td.status-cell {
  padding: 0;
  text-align: center;
  vertical-align: middle;
  background: transparent;
}

.impact-table tbody td.status-cell .status-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 8px 8px;
  border: none;
  background: transparent;
  font-size: 0;
  letter-spacing: 0;
  color: #64748b;
  position: relative;
}

.impact-left .impact-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.25), 0 1px 4px rgba(15, 23, 42, 0.2);
  pointer-events: none;
  z-index: 2;
}

.impact-table tbody td.status-cell .status-badge::before {
  content: none;
  display: none;
}
.impact-table tbody td.status-cell .status-badge[data-points]::after {
  content: attr(data-points);
  position: absolute;
  inset-inline-start: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  padding: 6px 10px 14px;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 5;
  clip-path: polygon(0% 0%, 100% 0%, 100% 78%, 55% 78%, 50% 100%, 45% 78%, 0% 78%);
}

.impact-table tbody td.status-cell .status-badge[data-points]:hover::after,
.impact-table tbody td.status-cell .status-badge[data-points]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


.impact-table tbody td.status-cell[data-status="on"] {
  background: rgba(22, 163, 74, 0.24);
  border: 1px solid rgba(22, 163, 74, 0.45);
  box-sizing: border-box;
}

.impact-table tbody td.status-cell[data-status="on"] .status-badge {
  color: #14532d;
}

.impact-table tbody td.status-cell[data-status="on"] .status-badge::before {
  background: currentColor;
}

.impact-table tbody td.status-cell[data-status="off"] {
  background: rgba(220, 38, 38, 0.22);
  border: 1px solid rgba(220, 38, 38, 0.42);
  box-sizing: border-box;
}

.impact-table tbody td.status-cell[data-status="off"] .status-badge {
  color: #991b1b;
}

.impact-table tbody td.status-cell[data-status="off"] .status-badge::before {
  background: currentColor;
}
/* 
.impact-table tbody td.status-cell[data-status="null"] {
  background: rgba(148, 163, 184, 0.16);
  border: 1px dashed rgba(148, 163, 184, 0.8);
  box-sizing: border-box;
}

.impact-table tbody td.status-cell[data-status="null"] .status-badge {
  color: #64748b;
}

.impact-table tbody td.status-cell[data-status="null"] .status-badge::before {
  background: transparent;
  border: 2px dashed rgba(148, 163, 184, 0.8);
  border-radius: 999px;
  box-sizing: border-box;
  background-color: rgba(148, 163, 184, 0.08);
} */

.impact-table tbody td.status-cell[data-status="null"] {
  background: rgba(107, 114, 128, 0.28); 
  border: 1px solid rgba(107, 114, 128, 0.45);
  box-sizing: border-box;
}

/* rgba(107, 114, 128, 0.14);  */

.impact-table tbody td.status-cell[data-status="null"] .status-badge {
  color: #374151; /* gray-700 text color */
}

.impact-table tbody td.status-cell[data-status="null"] .status-badge::before {
  background: currentColor;
}

.impact-table tbody td.status-cell[data-status="na"] {
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(203, 213, 225, 0.9);
  box-sizing: border-box;
}

.impact-table tbody td.status-cell[data-status="na"] .status-badge {
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(100, 116, 139, 1);      
}

.impact-table tbody td.status-cell[data-status="na"] .status-badge::before {
  display: none;
}

#impactGrid th[data-column="ela_03ach"],  #impactGrid td[data-column="ela_03ach"],
#impactGrid th[data-column="ela_ach"],    #impactGrid td[data-column="ela_ach"],
#impactGrid th[data-column="ela_lg"],     #impactGrid td[data-column="ela_lg"],
#impactGrid th[data-column="ela_lq"],     #impactGrid td[data-column="ela_lq"],
#impactGrid th[data-column="math_ach"],   #impactGrid td[data-column="math_ach"],
#impactGrid th[data-column="math_lg"],    #impactGrid td[data-column="math_lg"],
#impactGrid th[data-column="math_lq"],    #impactGrid td[data-column="math_lq"],
#impactGrid th[data-column="sci_ach"],    #impactGrid td[data-column="sci_ach"],
#impactGrid th[data-column="soc_stud_ach"], #impactGrid td[data-column="soc_stud_ach"] {
  width: 5rem;
}

/* Collapse column tracks when the view hides their cells */
#impactGrid[data-view="students"] col[data-column="spacer"],
#impactGrid[data-view="teacher"]  col[data-column="teacher"],
#impactGrid[data-view="grade"]    col[data-column="teacher"],
#impactGrid[data-view="grade"]    col[data-column="grade"] {
  display: none !important;        /* Chrome/Edge/Firefox */
  visibility: collapse !important; /* Safari-friendly collapse */
  width: 0 !important;
}


/* Prevent always-present pseudo-tooltips from affecting layout */
.impact-cell .impact-label[data-points]::after,
.impact-table tbody td.status-cell .status-badge[data-points]::after,
.impact-table tbody td.flag-cell   .flag-label[data-points]::after {
  content: none !important;
}

/* Reusable fixed tooltip that never changes page width */
#impact-fixed-tooltip {
  position: fixed;       /* relative to viewport */
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;

  /* your current white chip style */
  background: #fff;
  border: 1px solid rgba(2, 6, 23, 0.12);
  box-shadow:
    0 10px 16px rgba(2, 6, 23, 0.08),
    0 4px 6px rgba(2, 6, 23, 0.06);
  border-radius: 10px;
  padding: 6px 10px;
  font: 500 13.3px/1.25 system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: #0f172a;
  white-space: pre-line;
}

#impact-fixed-tooltip[data-side="top"]::after,
#impact-fixed-tooltip[data-side="bottom"]::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  margin-inline: auto;
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
}
#impact-fixed-tooltip[data-side="top"]::after {
  bottom: -6px;
  border-top: 6px solid #fff;
  filter: drop-shadow(0 1px 0 rgba(2, 6, 23, 0.12));
}
#impact-fixed-tooltip[data-side="bottom"]::after {
  top: -6px;
  border-bottom: 6px solid #fff;
  filter: drop-shadow(0 -1px 0 rgba(2, 6, 23, 0.12));
}

#impact-fixed-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}
/* --- End Status Matrix Reset ------------------------------------- */       
