.matrix-shell {
  display: grid;
  gap: 14px;
  max-width: 100%;
  color: #132238;
}

.matrix-hero,
.matrix-toolbar,
.matrix-section,
.matrix-blockers {
  border: 1px solid #d7e1ef;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.matrix-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #ffffff 0%, #edf6ff 100%);
}

.matrix-hero h1,
.matrix-section h2,
.matrix-blockers h2 {
  margin: 0;
  letter-spacing: 0;
}

.matrix-hero h1 {
  font-size: 1.7rem;
  line-height: 1.12;
}

.matrix-hero p,
.matrix-section p,
.matrix-card p,
.matrix-blockers li {
  color: #51627a;
}

.matrix-hero p,
.matrix-section p,
.matrix-card p {
  margin: 6px 0 0;
}

.matrix-kicker {
  display: inline-flex;
  margin-bottom: 5px;
  color: #1f3b92;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.matrix-hero__status {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: 240px;
  font-weight: 800;
  color: #1e2b3f;
}

.matrix-hero__status small {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
}

.matrix-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.matrix-card {
  border: 1px solid #d8e2f0;
  border-radius: 10px;
  background: #ffffff;
  padding: 13px 14px;
}

.matrix-card--danger {
  border-color: #fecaca;
  background: #fff8f8;
}

.matrix-card span {
  display: block;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.matrix-card strong {
  display: block;
  margin-top: 5px;
  color: #0f172a;
  font-size: 1.45rem;
  line-height: 1.1;
}

.matrix-blockers {
  padding: 14px 16px;
}

.matrix-blockers ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.matrix-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 190px auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
}

.matrix-toolbar label {
  display: grid;
  gap: 5px;
  color: #4b5d75;
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
}

.matrix-toolbar input,
.matrix-toolbar select {
  min-height: 36px;
  border: 1px solid #ccd8e8;
  border-radius: 9px;
  background: #ffffff;
  color: #102033;
  font: 700 0.85rem/1.2 "Manrope", "Segoe UI", sans-serif;
  padding: 0 10px;
}

.matrix-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.matrix-toolbar output {
  grid-column: 1 / -1;
  color: #56687f;
  font-size: 0.78rem;
  font-weight: 700;
}

.matrix-section {
  overflow: hidden;
}

.matrix-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #e4ebf5;
}

.matrix-section__header h2 {
  font-size: 1.05rem;
}

.matrix-section__count {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eaf3ff;
  color: #194c8f;
  font-size: 0.76rem;
  font-weight: 900;
  padding: 7px 10px;
}

.matrix-table-wrap {
  overflow: auto;
  max-width: 100%;
}

.matrix-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.matrix-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f8fc;
  color: #53657d;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.matrix-table th,
.matrix-table td {
  border-bottom: 1px solid #e4ebf5;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.matrix-table tr:hover td {
  background: #f8fbff;
}

.matrix-table a {
  color: #0f63c7;
  font-weight: 800;
  text-decoration: none;
}

.matrix-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  padding: 4px 8px;
  white-space: nowrap;
}

.matrix-status--verde {
  background: #dcfce7;
  color: #166534;
}

.matrix-status--verde_controlado {
  background: #e0f2fe;
  color: #075985;
}

.matrix-status--parcial {
  background: #fef3c7;
  color: #92400e;
}

.matrix-status--bloqueado {
  background: #fee2e2;
  color: #991b1b;
}

.matrix-status--no_verde {
  background: #ffe4e6;
  color: #9f1239;
}

@media (max-width: 1080px) {
  .matrix-summary-grid,
  .matrix-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .matrix-toolbar__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .matrix-hero,
  .matrix-section__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .matrix-hero__status {
    justify-items: start;
    min-width: 0;
  }

  .matrix-summary-grid,
  .matrix-toolbar {
    grid-template-columns: 1fr;
  }

  .matrix-table {
    min-width: 820px;
  }
}
