.scorecard-layout {
  margin-top: 24px;
  display: grid;
  gap: 20px;
}

.panel-header {
  display: flex;
  gap: 12px;
}

.inline-header {
  padding: 0 0 18px;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
}

.scorecard-summary-grid,
.scorecard-chart-grid,
.scorecard-table-grid,
.assessment-grid {
  display: grid;
  gap: 16px;
}

.scorecard-summary-grid,
.assessment-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.scorecard-chart-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scorecard-table-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-card h3,
.assessment-card h3 {
  margin-top: 0;
}

.table-card {
  overflow: hidden;
}

.compact-data {
  grid-template-columns: 172px 1fr;
}

.tight-list {
  gap: 10px;
}

.tight-list li {
  list-style: none;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(246, 248, 245, 0.92);
}

.methodology-note p {
  margin: 0;
}

.assessment-card {
  border-top: 4px solid transparent;
}

.assessment-card.good {
  border-top-color: #15803d;
}

.assessment-card.warn {
  border-top-color: #d97706;
}

.assessment-card.alert {
  border-top-color: #b91c1c;
}

.assessment-card.neutral {
  border-top-color: #64748b;
}

.assessment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.assessment-headline {
  margin: 10px 0 14px;
  color: var(--ink);
  min-height: 56px;
}

.assessment-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.assessment-metric span {
  color: var(--muted);
  font-size: 13px;
}

.assessment-metric strong {
  font-size: 28px;
  line-height: 1;
  color: #0c3352;
}

.assessment-copy {
  margin-bottom: 0;
}

.chart-host {
  min-height: 290px;
}

.chart-shell {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.94) 100%),
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.09), transparent 52%);
}

.chart-shell svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px 0;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 12px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.axis-label,
.tick-label {
  fill: var(--muted);
  font-size: 12px;
  font-family: Georgia, "Times New Roman", serif;
}

.grid-line {
  stroke: rgba(87, 112, 106, 0.16);
  stroke-width: 1;
}

.axis-line {
  stroke: rgba(20, 35, 31, 0.28);
  stroke-width: 1;
}

.scorecard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 960px;
}

.recent-table {
  min-width: 1500px;
}

.scorecard-table th,
.scorecard-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  font-size: 13px;
  white-space: nowrap;
  text-align: right;
  background: rgba(248, 246, 241, 0.96);
}

.scorecard-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #edf2e8;
}

.scorecard-table .sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: left;
  background: #f3f5ee;
}

.scorecard-table tbody .sticky-col {
  background: rgba(248, 246, 241, 1);
}

.scorecard-table th:first-child,
.scorecard-table td:first-child {
  border-left: 1px solid var(--line);
}

.detail-cell {
  display: grid;
  gap: 4px;
}

.detail-cell span {
  color: var(--muted);
}

.bar-cell {
  display: grid;
  grid-template-columns: minmax(70px, auto) 1fr;
  gap: 10px;
  align-items: center;
}

.bar-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(20, 35, 31, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f766e 0%, #1f8a70 100%);
}

.status-pill,
.signal-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-pill.good,
.signal-pill.good {
  background: rgba(21, 128, 61, 0.12);
  color: #166534;
}

.status-pill.warn,
.signal-pill.warn {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}

.status-pill.alert,
.signal-pill.alert {
  background: rgba(185, 28, 28, 0.14);
  color: #991b1b;
}

.status-pill.neutral,
.signal-pill.neutral {
  background: rgba(15, 23, 42, 0.08);
  color: #475569;
}

.delta-negative {
  color: #166534;
  font-weight: 700;
}

.delta-positive {
  color: #991b1b;
  font-weight: 700;
}

.table-scroll {
  overflow: auto;
}

@media (max-width: 1480px) {
  .scorecard-summary-grid,
  .assessment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scorecard-chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .scorecard-table-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .scorecard-summary-grid,
  .assessment-grid {
    grid-template-columns: 1fr;
  }
}
