.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 18px 18px 0;
}

.card-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.card-description {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.card-body {
  padding: 18px;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-link {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

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

.metric {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
}

.metric-value {
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
}

.metric-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: var(--blue);
  background: #eff6ff;
}

:root[data-theme="dark"] .metric-icon {
  background: rgba(96, 165, 250, 0.14);
}

.metric-icon svg {
  width: 17px;
  height: 17px;
}

.metric-accent-green .metric-icon {
  color: var(--success);
  background: #ecfdf5;
}

:root[data-theme="dark"] .metric-accent-green .metric-icon {
  background: rgba(52, 211, 153, 0.14);
}

.metric-accent-amber .metric-icon {
  color: var(--amber);
  background: #fffbeb;
}

:root[data-theme="dark"] .metric-accent-amber .metric-icon {
  background: rgba(251, 191, 36, 0.14);
}

.metric-accent-red .metric-icon {
  color: var(--danger);
  background: #fef2f2;
}

:root[data-theme="dark"] .metric-accent-red .metric-icon {
  background: rgba(248, 113, 113, 0.14);
}

.metric-pill {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--success);
  background: #ecfdf5;
  font-size: 11px;
  font-weight: 800;
}

:root[data-theme="dark"] .metric-pill {
  background: rgba(52, 211, 153, 0.14);
}

.metric-pill-danger {
  color: var(--danger);
  background: #fef2f2;
}

:root[data-theme="dark"] .metric-pill-danger {
  background: rgba(248, 113, 113, 0.14);
}

@media (max-width: 980px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }
}
