/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.125rem; }
.tile-label { color: var(--ink-2); font-size: 0.8125rem; }
.tile-value { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile-sub { color: var(--ink-3); font-size: 0.75rem; margin-top: 2px; }

/* buttons: outline by default; .primary (black/white) for a form's action; .brand (green pill) for at most one
   main action per page */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.125rem; padding: 0.4375rem 0.875rem;
  border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  font-size: 0.8125rem; font-weight: 500; line-height: 1.2; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--bg)); }
.btn.brand { background: var(--brand); border-color: transparent; color: var(--brand-ink); font-weight: 600; border-radius: 999px; padding-inline: 1rem; }
.btn.brand:hover { background: var(--brand-hover); }
.btn.brand:active { transform: scale(0.98); }
.btn.danger { background: var(--critical); border-color: transparent; color: #fff; }
.btn.danger:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.sm { min-height: 1.875rem; padding: 0.3125rem 0.6875rem; font-size: 0.78125rem; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border: 1px solid transparent; background: transparent;
  cursor: pointer; font-size: 20px; line-height: 1; color: var(--ink-2); padding: 0; border-radius: var(--radius-md); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.linkish { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--border-strong);
  text-underline-offset: 0.2em; cursor: pointer; }
.linkish:hover { color: var(--ink); }

/* status dot, badges, alerts */
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.live { background: var(--success); }
.dot.warn { background: var(--warning); }
.dot.bad { background: var(--critical); }
.pill { display: inline-flex; align-items: center; gap: 0.3125rem; padding: 0.0625rem 0.4375rem; border-radius: var(--radius-sm); background: var(--surface-2);
  font-size: 0.71875rem; font-weight: 500; line-height: 1.5; color: var(--ink-2); white-space: nowrap; }
.pill.success { color: var(--success); background: var(--success-dim); }
.pill.warning { color: var(--warning); background: var(--warning-dim); }
.pill.danger { color: var(--critical); background: var(--critical-dim); }
.sev { font-family: var(--mono); font-size: 0.71875rem; padding: 0 0.375rem; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); }
.sev.P0, .sev.P1 { color: var(--critical); background: var(--critical-dim); }
.notice { display: flex; gap: 8px; align-items: baseline; color: var(--ink-2); padding: 6px 0; }
.alert { display: grid; grid-template-columns: auto 1fr auto; gap: 0.625rem; align-items: start; padding: 0.875rem 1rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-2); }
.alert .dot { margin-top: 0.4rem; }
.alert b { display: block; font-weight: 600; }
.alert span { color: var(--ink-2); font-size: 0.8125rem; }
.alert.info { background: var(--info-dim); border-color: transparent; }
.alert.info .dot { background: var(--info); }
.alert.danger { background: var(--critical-dim); border-color: transparent; }
.alert.danger .dot { background: var(--critical); }

/* lists & tables */
.rows > .row { display: flex; align-items: center; gap: 12px; padding: 0.75rem 1.25rem; border-top: 1px solid var(--border); }
.rows > .row:first-child { border-top: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.row-title .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--ink-3); font-size: 0.8125rem; display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.prref { font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-2); white-space: nowrap; }
.logtail { margin: 8px 0 0; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm); font: 11.5px/1.5 var(--mono); color: var(--ink-2);
  white-space: pre-wrap; word-break: break-word; max-height: 120px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: 0.8125rem; padding: 0.625rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 0.6875rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 1.25rem; }
th:last-child, td:last-child { padding-right: 1.25rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr:hover td { background: var(--hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.title-cell { max-width: 420px; }
.title-cell .t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.counts { display: inline-flex; gap: 4px; }

/* overlays */
.tooltip { position: fixed; z-index: 70; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12px; padding: 6px 8px; border-radius: var(--radius-sm); white-space: pre; }
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 400; display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end; }
.toast { background: var(--ink); color: var(--bg); padding: 0.625rem 0.875rem; border-radius: var(--radius-md); max-width: 22rem;
  box-shadow: var(--shadow-pop); animation: toast-in 0.18s ease-out; }
.toast.error { background: var(--critical); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
