.matrix-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(99,102,241,0.12);
  box-shadow: 0 4px 24px rgba(99,102,241,0.10), 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 16px;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  transition: box-shadow 0.25s ease;
}

.matrix-card:hover {
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.matrix-header {
  margin-bottom: 8px;
}

.matrix-icon {
  font-size: 14px;
  margin-right: 4px;
  vertical-align: middle;
}

.matrix-title {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  vertical-align: middle;
}

.matrix-subtitle {
  display: block;
  font-size: 9.5px;
  color: #7a7a7a;
  margin-top: 1px;
  margin-left: 18px;
}

.matrix-table-container {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 350px;
  overflow: auto;
  border-radius: 4px;
  border: 1px solid #dee2e6;
  box-sizing: border-box;
}

.matrix-table {
  margin-bottom: 0 !important;
  font-size: 9.5px;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  table-layout: auto;
}

.matrix-table th {
  background-color: #f8f9fa !important;
  color: #495057;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  padding: 4px 3px;
  border-bottom: 2px solid #dee2e6 !important;
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

/* Sticky Data Owner column */
.matrix-table .sticky-col {
  position: sticky;
  left: 0;
  background-color: #ffffff;
  z-index: 5;
  border-right: 2px solid #dee2e6 !important;
  box-shadow: 2px 0 4px rgba(0,0,0,0.03);
  min-width: 90px;
  max-width: 100px;
}

.matrix-table th.sticky-col {
  z-index: 15;
  background-color: #f8f9fa !important;
}

.owner-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 1px 2px;
  overflow: hidden;
}

.owner-name {
  font-weight: 600;
  color: #212529;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.owner-email {
  font-size: 8px;
  color: #6c757d;
  margin-top: 0px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.cell-data {
  text-align: center;
  vertical-align: middle !important;
  padding: 3px 2px !important;
  transition: all 0.2s ease;
  min-width: 32px;
}

.cell-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0px;
}

.cell-fraction {
  font-weight: 600;
  font-size: 9.5px;
}

.cell-pct {
  font-size: 7.5px;
  opacity: 0.8;
}

.cell-dash {
  color: #adb5bd;
}

/* Completion based background colors */
.cell-completed {
  background-color: #e2f9e9 !important;
  color: #1b5e20 !important;
}

.cell-completed:hover {
  background-color: #d0f4da !important;
}

.cell-in-progress {
  background-color: #fff3cd !important;
  color: #856404 !important;
}

.cell-in-progress:hover {
  background-color: #ffeeba !important;
}

.cell-zero {
  background-color: #fdf2f2 !important;
  color: #c81e1e !important;
}

.cell-zero:hover {
  background-color: #fde8e8 !important;
}

.cell-empty {
  background-color: #fafbfc !important;
}

/* Overall Summary Column */
.cell-overall {
  vertical-align: middle !important;
  padding: 4px 6px !important;
  min-width: 70px;
}

.overall-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.overall-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.overall-fraction {
  color: #495057;
}

.overall-pct {
  color: #0d6efd;
}

.progress-bar-container {
  width: 100%;
  height: 2.5px;
  background-color: #e9ecef;
  border-radius: 1.2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: #0d6efd;
  border-radius: 1.2px;
  transition: width 0.4s ease;
}

/* State wrappers */
.loading-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  text-align: center;
}

.empty-icon {
  font-size: 20px;
  margin-bottom: 6px;
  opacity: 0.7;
}

.empty-title {
  font-size: 11px;
  font-weight: 600;
  color: #495057;
  margin-bottom: 2px;
}

.empty-text {
  font-size: 10px;
  color: #6c757d;
  max-width: 200px;
}

/* ── Matrix Controls and Reusable Filter Search ── */
.matrix-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}

.matrix-header-text {
  display: flex;
  flex-direction: column;
}

.matrix-search-input-wrapper {
  position: relative;
  width: 280px;
}

.matrix-search-input {
  width: 100%;
  padding: 6px 12px 6px 32px;
  font-size: 11px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  outline: none;
  font-family: 'Inter', sans-serif;
  color: #1E293B;
  transition: all 0.15s ease;
}

.matrix-search-input:focus {
  border-color: #6366F1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.matrix-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  font-size: 11px;
}

/* ── Sorting Headers ── */
.header-sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}

.header-sortable:hover {
  background-color: #E2E8F0 !important;
  color: #1E293B !important;
}

.header-cell-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 6px;
}

.sort-icon-container {
  display: inline-flex;
  align-items: center;
  color: #94A3B8;
  font-size: 10px;
  transition: color 0.15s ease;
}

.header-sortable:hover .sort-icon-container {
  color: #475569;
}

.sort-icon-active {
  color: #6366F1 !important;
}

.sort-icon-inactive {
  opacity: 0.4;
}
