/* Cards, tables, badges, empty states - the containers content lives in. */

.card {
  background: var(--c-surface);
  border: var(--border-thin);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: var(--border-thin);
}
.card__title { font-size: var(--text-base); font-weight: var(--weight-bold); }
.card__subtitle { font-size: var(--text-xs); color: var(--c-text-muted); }
.card__body { padding: var(--space-5); }
.card__body--flush { padding: 0; }
.card__footer {
  padding: var(--space-3) var(--space-5);
  border-top: var(--border-thin);
  background: var(--c-surface-sunken);
}

/* Metric tile: one number, one label, optional trend. */
.metric { padding: var(--space-4) var(--space-5); }
.metric__label {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.metric__value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-top: var(--space-1);
}
.metric__note { font-size: var(--text-xs); color: var(--c-text-subtle); margin-top: var(--space-1); }

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th {
  position: sticky;
  top: 0;
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--c-surface-sunken);
  border-bottom: var(--border-thin);
  white-space: nowrap;
}
.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--c-surface-raised); }
.table__num { font-variant-numeric: tabular-nums; text-align: right; }
.table__mono { font-family: var(--font-mono); font-size: var(--text-xs); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-full);
  background: var(--c-surface-sunken);
  color: var(--c-text-muted);
  white-space: nowrap;
}
.badge--ok     { background: var(--c-ok-bg);     color: var(--c-ok); }
.badge--warn   { background: var(--c-warn-bg);   color: var(--c-warn); }
.badge--danger { background: var(--c-danger-bg); color: var(--c-danger); }
.badge--info   { background: var(--c-info-bg);   color: var(--c-info); }

/* A coloured dot is not enough on its own - the label carries the meaning
   for anyone who cannot distinguish the hues. */
.status { display: inline-flex; align-items: center; gap: var(--space-2); }
.status__dot {
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  background: var(--c-text-subtle);
  flex-shrink: 0;
}
.status--ok     .status__dot { background: var(--c-ok); }
.status--warn   .status__dot { background: var(--c-warn); }
.status--danger .status__dot { background: var(--c-danger); }
.status--live   .status__dot { background: var(--c-ok); animation: pulse 2s var(--ease) infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(63 185 80 / 0.5); }
  50%      { box-shadow: 0 0 0 5px rgb(63 185 80 / 0); }
}

/* Empty state: says what is missing and what to do about it. */
.empty { padding: var(--space-7) var(--space-5); text-align: center; }
.empty__title { font-weight: var(--weight-medium); margin-bottom: var(--space-2); }
.empty__text { color: var(--c-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-4); }

/* Loading placeholder that matches the shape of what is coming. */
.skeleton {
  background: linear-gradient(90deg, var(--c-surface-sunken) 25%, var(--c-surface-raised) 50%, var(--c-surface-sunken) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius-sm);
  height: 1em;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: var(--text-sm);
}
.alert--info   { background: var(--c-info-bg);   border-color: var(--c-info);   color: var(--c-text); }
.alert--ok     { background: var(--c-ok-bg);     border-color: var(--c-ok);     color: var(--c-text); }
.alert--warn   { background: var(--c-warn-bg);   border-color: var(--c-warn);   color: var(--c-text); }
.alert--danger { background: var(--c-danger-bg); border-color: var(--c-danger); color: var(--c-text); }
