#stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin: 0 0 1rem;
}

#stats .stat {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .65rem;
  min-width: 0;
  padding: 1rem 1.1rem;
  border: 1px solid #e0e6ed;
  border-radius: .7rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(20 36 58 / 5%);
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

#stats .stat:hover {
  transform: translateY(-1px);
  border-color: #c5d3df;
  box-shadow: 0 5px 14px rgb(20 36 58 / 8%);
}

#stats .stat-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .65rem;
  color: #68788e;
  font-size: .78rem;
  font-weight: 550;
}

#stats .stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: .45rem;
  background: #edf5ef;
  color: #31734f;
  font-size: 1rem;
}

#stats .stat-value {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .45rem;
  margin: 0;
  color: #172738;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -.04em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

#stats .stat-badge {
  display: inline-block;
  max-width: 100%;
  padding: .22rem .4rem;
  border-radius: .3rem;
  background: #f0f3f6;
  color: #667589;
  font-size: .63rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

#stats .stat > small {
  color: #77869a;
  font-size: .7rem;
  line-height: 1.45;
}

.dashboard-section {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dashboard-health {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-width: 0;
  margin: 0;
  padding: .8rem 1rem;
  border: 1px solid #cbe8d5;
  border-radius: .65rem;
  background: #effaf2;
  color: #264837;
}

.dashboard-health[data-state="warning"] {
  border-color: #f0d6a7;
  background: #fff8eb;
  color: #69480e;
}

.dashboard-health[data-state="unknown"] {
  border-color: #d8e0e8;
  background: #f5f8fa;
  color: #435365;
}

.dashboard-health-indicator {
  flex: 0 0 .7rem;
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: #2f9a58;
  box-shadow: 0 0 0 4px rgb(47 154 88 / 12%);
}

.dashboard-health[data-state="warning"] .dashboard-health-indicator {
  background: #cc8219;
  box-shadow: 0 0 0 4px rgb(204 130 25 / 12%);
}

.dashboard-health[data-state="unknown"] .dashboard-health-indicator {
  background: #8795a4;
  box-shadow: 0 0 0 4px rgb(135 149 164 / 12%);
}

.dashboard-health-copy {
  display: grid;
  gap: .1rem;
  min-width: 0;
}

.dashboard-health-copy .eyebrow {
  color: currentColor;
  font-size: .58rem;
  letter-spacing: .12em;
  opacity: .72;
}

.dashboard-health-copy strong {
  font-size: .85rem;
  line-height: 1.3;
}

.dashboard-health-copy p {
  margin: 0;
  color: inherit;
  font-size: .73rem;
  line-height: 1.4;
  opacity: .82;
}

.dashboard-health-summary {
  margin-left: auto;
  color: inherit;
  font-size: .73rem;
  white-space: nowrap;
  opacity: .82;
}

.dashboard-attention-panel,
.dashboard-panel {
  min-width: 0;
  border-color: #e0e6ed;
  border-radius: .7rem;
  box-shadow: 0 1px 2px rgb(20 36 58 / 5%);
}

.dashboard-attention-panel .panel-heading,
.dashboard-panel .panel-heading {
  align-items: center;
  padding: 1rem 1.1rem .75rem;
}

.dashboard-attention-panel .panel-heading h2,
.dashboard-panel .panel-heading h2 {
  color: #1f3042;
  font-size: .9rem;
  font-weight: 650;
}

.dashboard-attention-panel .panel-heading p,
.dashboard-panel .panel-heading p {
  margin-top: .25rem;
  color: #75849a;
  font-size: .72rem;
}

.dashboard-attention-panel .count {
  margin: 0;
  background: #f0f3f6;
  color: #65758a;
  font-size: .65rem;
}

.dashboard-attention {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  padding: .15rem 1.1rem 1.1rem;
}

.dashboard-attention-item {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  min-height: 3.35rem;
  padding: .55rem .65rem;
  border: 1px solid #e1e7ee;
  border-radius: .55rem;
  background: #fff;
  color: #2b3b4e;
  text-align: left;
}

.dashboard-attention-item:hover {
  border-color: #c7d4e0;
  background: #fbfcfd;
}

.dashboard-attention-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: .5rem;
  background: #fff3df;
  color: #a86410;
  font-weight: 700;
}

.dashboard-attention-item[data-state="warning"] .dashboard-attention-icon {
  background: #fff0ec;
  color: #b74332;
}

.dashboard-attention-item > span:nth-child(2) {
  display: grid;
  gap: .18rem;
  min-width: 0;
}

.dashboard-attention-item b,
.dashboard-attention-item small {
  overflow-wrap: anywhere;
}

.dashboard-attention-item b {
  font-size: .72rem;
  line-height: 1.35;
}

.dashboard-attention-item small {
  color: #74839a;
  font-size: .65rem;
  line-height: 1.35;
}

.dashboard-attention-arrow {
  color: #94a2b4;
  font-size: .9rem;
}

.dashboard-all-clear {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .4rem .1rem .55rem;
  color: #286743;
}

.dashboard-all-clear > span {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: .5rem;
  background: #eaf6ee;
  font-weight: 700;
}

.dashboard-all-clear div {
  display: grid;
  gap: .2rem;
}

.dashboard-all-clear b {
  font-size: .75rem;
}

.dashboard-all-clear small {
  color: #6f8376;
  font-size: .68rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(19rem, .9fr);
  gap: 1rem;
  align-items: stretch;
}

.dashboard-text-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  flex: 0 0 auto;
  padding: .35rem .2rem;
  border: 0;
  background: transparent;
  color: #347449;
  font-size: .72rem;
  font-weight: 650;
}

.dashboard-checks,
.dashboard-tests {
  padding: 0 1.1rem;
}

.dashboard-check {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .68rem 0;
  border-top: 1px solid #edf0f4;
}

.dashboard-check > span:last-child,
.dashboard-test > div {
  display: grid;
  gap: .18rem;
  min-width: 0;
}

.dashboard-check b,
.dashboard-test b {
  color: #34455b;
  font-size: .73rem;
  font-weight: 600;
}

.dashboard-check small,
.dashboard-test small {
  color: #78879b;
  font-size: .67rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.dashboard-check-dot {
  flex: 0 0 .55rem;
  width: .55rem;
  height: .55rem;
  margin-top: .25rem;
  border-radius: 50%;
  background: #a0adbb;
}

.dashboard-check[data-state="good"] .dashboard-check-dot {
  background: #38a166;
}

.dashboard-check[data-state="warning"] .dashboard-check-dot {
  background: #d48b2b;
}

.dashboard-links {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  padding: .75rem 1.1rem 1rem;
  border-top: 1px solid #edf0f4;
}

.dashboard-links .button {
  min-height: 2rem;
  padding: .4rem .7rem;
  border-color: #dce4eb;
  color: #4a5c70;
  font-size: .7rem;
}

.dashboard-test {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .7rem 0;
  border-top: 1px solid #edf0f4;
}

.dashboard-test-status {
  flex: 0 0 4.3rem;
  padding: .24rem .35rem;
  border-radius: .35rem;
  background: #fff3df;
  color: #96600e;
  font-size: .63rem;
  font-weight: 700;
  text-align: center;
}

.dashboard-test[data-state="passed"] .dashboard-test-status {
  background: #e8f6ec;
  color: #287044;
}

.dashboard-test[data-state="failed"] .dashboard-test-status,
.dashboard-test[data-state="partial"] .dashboard-test-status {
  background: #fff0ec;
  color: #ac4433;
}

.dashboard-panel-footer {
  border-top: 1px solid #edf0f4;
  margin-top: .2rem;
}

.dashboard-panel-footer .text-button {
  padding: .75rem 1.1rem;
  color: #347449;
  font-size: .7rem;
}

.dashboard-empty {
  padding: .4rem 1.1rem 1.1rem;
}

.dashboard-empty b {
  color: #34455b;
  font-size: .75rem;
}

.dashboard-empty p {
  margin: .25rem 0 .7rem;
  color: #78879b;
  font-size: .68rem;
}

@media (max-width: 1200px) {
  #stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 700px) {
  .dashboard-health {
    align-items: flex-start;
  }

  .dashboard-health-summary {
    display: none;
  }

  .dashboard-attention {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  #stats .stat {
    transition: none;
  }
}
