/* ---------- Host stats (beside the server header) ---------- */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.stat-card {
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  min-width: 0;
}

.stat-card.system {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  row-gap: 12px;
}
.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 84px;
  padding: 0 4px;
  text-align: center;
}
.metric .gauge {
  margin-bottom: 5px;
}
.metric-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.metric-sub {
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-card.sensors {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 250px;
}
.stat-card.sensors .metric-label {
  margin-bottom: 2px;
}
.sensor {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}
.sensor svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}
.sensor-name {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.sensor b {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.sensor b.warn {
  color: var(--amber);
}
.sensor b.crit {
  color: var(--red);
}

.stat-card.network {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 270px;
}
.net-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.net-note {
  min-width: 0;
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre;
}
.net-speeds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.net-speed {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.net-label {
  font-size: 0.72rem;
  font-weight: 650;
}
.net-speed.rx .net-label {
  color: var(--accent-2);
}
.net-speed.tx .net-label {
  color: var(--accent);
}
.net-speed b {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.net-graph svg {
  display: block;
  width: 100%;
  height: 30px;
  overflow: visible;
}
.net-graph .area {
  fill: color-mix(in srgb, var(--accent-2) 18%, transparent);
  stroke: none;
}
.net-graph polyline {
  vector-effect: non-scaling-stroke;
  stroke-width: 1.5;
}
.net-graph .rx {
  stroke: var(--accent-2);
}
.net-graph .tx {
  stroke: var(--accent);
}

/* Availability card + outage history */
.stat-card.availability {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 220px;
  padding: 10px 12px;
}
.stat-card.availability .net-head {
  gap: 6px;
}
.stat-card.availability :is(.metric-label, .net-label, .net-note) {
  font-size: 0.65rem;
}
.avail-pcts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.avail-pct {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.avail-pct b,
.avail-tile b {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat-card.availability .avail-pct b {
  font-size: 0.9rem;
}
.avail-pct .net-label,
.avail-tile .net-label {
  color: var(--muted);
}
.avail-pct.warn b,
.avail-tile b.warn {
  color: var(--amber);
}
.avail-pct.crit b,
.avail-tile b.crit {
  color: var(--red);
}
.avail-note {
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.3;
}
.stat-card.availability .btn {
  align-self: flex-start;
  margin-top: 0;
  padding: 4px 8px;
  font-size: 0.7rem;
}

.avail-dialog {
  width: min(560px, calc(100vw - 24px));
}
.avail-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.avail-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
}
.avail-strip {
  position: relative;
  height: 22px;
  border-radius: 8px;
  overflow: hidden;
  background: color-mix(in srgb, var(--green) 28%, transparent);
}
.avail-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--red);
}
.avail-mark.app {
  background: var(--amber);
  opacity: 0.7;
}
.avail-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--muted);
}
.avail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.avail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
}
.avail-when {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.avail-len {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.avail-empty {
  margin: 0;
  padding: 14px 0;
  text-align: center;
}

.info-dialog {
  width: min(560px, calc(100vw - 24px));
}
.info-section {
  display: flex;
  flex-direction: column;
}
.info-section h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}
.info-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 4px 12px;
  align-items: start;
  padding: 7px 0;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}
.info-row .metric-label {
  padding-top: 3px;
}
.info-values {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.info-value {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.info-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.info-value .icon-btn {
  flex: none;
  width: 26px;
  height: 26px;
}
.info-error p {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--red);
}
.info-error svg {
  width: 16px;
  height: 16px;
}
.info-btn {
  flex: none;
}
@media (max-width: 480px) {
  .info-row {
    grid-template-columns: 1fr;
  }
}

/* Ring gauge (percent in the middle) or an icon badge, same size. */
.gauge {
  --c: var(--accent-2);
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.gauge.warn {
  --c: var(--amber);
}
.gauge.crit {
  --c: var(--red);
}
.gauge svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  stroke-width: 3.5;
}
.gauge .track {
  stroke: color-mix(in srgb, var(--text) 10%, transparent);
}
.gauge .value {
  stroke: var(--c);
  transition: stroke-dasharray 0.6s ease;
}
.gauge span {
  font-size: 0.8rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.gauge:is(.warn, .crit) span {
  color: var(--c);
}
.gauge.badge {
  border-radius: 50%;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
}
.gauge.badge svg {
  position: static;
  width: 20px;
  height: 20px;
  transform: none;
  stroke-width: 2;
}

/* Container CPU / memory / network on Docker cards */
.card .usage {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.usage-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text) 5%, transparent);
  font-size: 0.75rem;
  white-space: pre;
}
.usage-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.usage-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

