/* Admin Infrastructure (master goal V·D·21, page 38): page styles, moved from inline data-sty attributes. */

/* ---- tones and badges ------------------------------------------------------------------------ */
.infra-tone-ok, .infra-tone-up { color: #16a34a; }
.infra-tone-warn, .infra-tone-degraded { color: #d97706; }
.infra-tone-bad, .infra-tone-down { color: #dc2626; }
.infra-tone-muted { color: #64748b; }
.infra-tone-faint, .infra-tone-unknown { color: #94a3b8; }
.infra-tone-slate, .infra-tone-neutral { color: #475569; }
.infra-tone-info { color: #2563eb; }
.infra-badge--ok { background: #dcfce7; color: #166534; }
.infra-badge--warn { background: #fef9c3; color: #854d0e; }
.infra-badge--bad { background: #fee2e2; color: #991b1b; }
.infra-badge--info { background: #dbeafe; color: #1e40af; }
.infra-badge--neutral { background: #e2e8f0; color: #475569; }
.infra-badge--faint { background: #f1f5f9; color: #94a3b8; }
.infra-badge--muted { background: #f1f5f9; color: #64748b; }
.infra-badge--slate { background: #f1f5f9; color: #475569; }
.infra-badge--amber { background: #fef3c7; color: #92400e; }

/* ---- page shell ------------------------------------------------------------------------------ */
.infra-page { padding: 0; max-width: 1400px; margin: 0 auto; }
.infra-banner { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 13px; background: #f1f5f9; }
.infra-banner.infra-tone-info { background: #dbeafe; color: #1e40af; }
.infra-banner.infra-tone-ok { background: #dcfce7; color: #166534; }
.infra-banner.infra-tone-warn { background: #fef9c3; color: #854d0e; }
.infra-banner.infra-tone-bad { background: #fee2e2; color: #991b1b; }
.infra-banner.infra-tone-neutral { background: #f1f5f9; color: #475569; }
/* The KPI row holds the shared IT4YOpsKit metric tiles (admin-ops-kit.css). */
.infra-kpi-row { margin-bottom: 14px; }
.infra-tabs-bar { border-bottom: 1px solid #e2e8f0; margin-bottom: 12px; }
/* On a narrow screen the tab strip is a select (design proposal 66): one control, no horizontal scrolling. */
.infra-tab-select-field { display: none; padding-block: 8px; }
@media (max-width: 720px) {
  .infra-tabs-bar .infra-tabs { display: none; }
  .infra-tabs-bar .infra-tab-select-field { display: flex; }
}
body.is-mobile .infra-tabs-bar .infra-tabs, body.force-mobile-preview .infra-tabs-bar .infra-tabs { display: none; }
body.is-mobile .infra-tabs-bar .infra-tab-select-field, body.force-mobile-preview .infra-tabs-bar .infra-tab-select-field { display: flex; }
.infra-tabs { display: flex; gap: 0; }
.infra-tab {
  padding: 10px 18px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; background: transparent;
  border-bottom: 2px solid transparent; color: var(--muted);
}
.infra-tab.is-active { border-bottom-color: var(--accent); color: var(--accent); }

/* ---- shared states --------------------------------------------------------------------------- */
.infra-loading { display: flex; align-items: center; gap: 10px; padding: 20px; color: #64748b; }
.infra-error { padding: 14px 16px; background: #fee2e2; color: #991b1b; border-radius: 8px; font-weight: 600; }
.infra-error-note { font-weight: 400; font-size: 12px; margin-top: 4px; }
.infra-error-small { padding: 12px 14px; background: #fee2e2; color: #991b1b; border-radius: 6px; font-size: 13px; font-weight: 600; }
.infra-retry {
  margin-top: 10px; padding: 6px 14px; border: 1px solid #fecaca; background: #fff; color: #991b1b; border-radius: 6px;
  cursor: pointer; font-size: 13px;
}
.infra-empty { text-align: center; padding: 40px; color: var(--muted); }
.infra-empty-icon { font-size: 34px; }
.infra-empty-title { font-size: 15px; font-weight: 600; margin-top: 8px; color: var(--text-dim); }
.infra-empty-text { font-size: 13px; margin-top: 4px; }
.infra-stale {
  padding: 10px 14px; margin-bottom: 12px; background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; border-radius: 8px;
  font-size: 13px;
}
.infra-stale-small { margin-top: 8px; padding: 6px 10px; background: #fef3c7; color: #92400e; border-radius: 6px; font-size: 12px; font-weight: 600; }
.infra-hidden { display: none; }
.infra-visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.infra-pad { padding: 6px 0; }
.infra-caption { padding: 2px 0 6px; font-variant-numeric: tabular-nums; }
.infra-faint-note { color: #94a3b8; font-size: 12px; }
.infra-faint-small { color: #94a3b8; font-size: 11px; }

/* ---- buttons and inputs ---------------------------------------------------------------------- */
.infra-btn-ghost { padding: 7px 12px; border: 1px solid #cbd5e1; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; }
.infra-btn-strong { padding: 8px 14px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.infra-btn-primary { font-size: 11px; padding: 4px 10px; border: none; border-radius: 4px; cursor: pointer; background: #3b82f6; color: #fff; }
.infra-btn-primary:disabled, .infra-btn-save:disabled { opacity: .55; cursor: not-allowed; }
.infra-btn-stale {
  margin-inline-start: 10px; padding: 4px 10px; border: 1px solid #fcd34d; background: #fff; color: #92400e; border-radius: 6px;
  cursor: pointer; font-size: 12px;
}
.infra-btn-inline { margin-inline-start: 6px; font-size: 11px; padding: 2px 8px; }
.infra-btn-small { font-size: 11px; padding: 3px 9px; }
.infra-btn-danger {
  font-size: 11px; padding: 3px 9px; border-radius: 6px; border: 1px solid #fca5a5; background: #fff; color: #b91c1c;
  font-weight: 600; cursor: pointer;
}
.infra-btn-danger.is-disabled { border-color: #e2e8f0; color: #94a3b8; cursor: not-allowed; opacity: .6; }
.infra-btn-save { padding: 8px 18px; background: #10b981; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }
.infra-btn-cancel { padding: 8px 18px; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; cursor: pointer; }
.infra-spacer { flex: 1; }

/* ---- tables ---------------------------------------------------------------------------------- */
.infra-row { border-bottom: 1px solid #f1f5f9; }
.infra-cell { padding: 8px 12px; }
.infra-cell-error { font-size: 11px; color: #dc2626; }
.infra-strong { font-weight: 600; }
.infra-mono-plain { font-family: monospace; }
.infra-mono-small { font-family: monospace; font-size: 11px; }
.infra-flag { font-size: 18px; }
.infra-pill { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.infra-default-mark { font-size: 11px; color: #3b82f6; }
.infra-chip { font-size: 10px; padding: 0 6px; border-radius: 8px; white-space: nowrap; }
.infra-chip--info { font-size: 11px; background: #dbeafe; color: #1e40af; border-radius: 3px; padding: 1px 5px; margin-inline-start: 4px; }
.infra-chip--outline { color: #64748b; background: #f8fafc; border: 1px solid #e2e8f0; }
/* ---- ops-kit sections of the Locations, Yotta and undelivered-events panels (design proposal 71) ------------- */
#infra-panel > .ops-card, #infra-panel > .ops-metrics, #infra-panel > .ops-notice { margin-block-end: 14px; }
.infra-yotta-win .ops-card-head { padding-block-end: 8px; }

/* ---- services, streams, workers, circuit breakers -------------------------------------------- */
.infra-section { margin-bottom: 16px; }
.infra-section-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.infra-service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.infra-service {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; padding: 8px 10px; display: flex; align-items: center;
  gap: 8px;
}
.infra-service-dot { font-size: 14px; }
.infra-service-name { font-size: 12px; font-weight: 600; color: #1e293b; }
.infra-service-meta { font-size: 11px; color: #94a3b8; }
.infra-stream-name { padding: 8px 12px; font-size: 12px; font-family: monospace; color: #2563eb; }
.infra-stream-len { padding: 8px 12px; text-align: end; font-weight: 600; color: #1e293b; }
.infra-stream-len.infra-tone-warn { color: #d97706; }
.infra-worker { border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; background: #f1f5f9; color: #475569; }
.infra-worker--up { background: #dcfce7; color: #166534; }
.infra-worker--down { background: #fee2e2; color: #991b1b; }
.infra-worker--stale { background: #fef9c3; color: #854d0e; }
.infra-worker-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.infra-worker-name { font-weight: 600; font-size: 14px; }
.infra-worker-state { font-size: 11px; background: rgba(0, 0, 0, .06); border-radius: 12px; padding: 2px 8px; }
.infra-worker-metrics { font-size: 12px; }
.infra-worker-metric { font-size: 11px; color: #64748b; }
.infra-worker-error { font-size: 11px; color: #dc2626; margin-top: 4px; }
.infra-cb-provider { padding: 10px 12px; font-size: 13px; font-weight: 600; }
.infra-cb-state { border-radius: 4px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.infra-cb-meta { padding: 10px 12px; font-size: 12px; color: #64748b; }
.infra-cb-time { padding: 10px 12px; font-size: 11px; color: #94a3b8; }

/* ---- dead letters ---------------------------------------------------------------------------- */
.infra-dlq-error span { display: block; max-inline-size: 240px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--muted); }
.infra-dlq-empty { display: grid; gap: 4px; justify-items: center; color: var(--ok, #16a34a); }

/* ---- topology -------------------------------------------------------------------------------- */
.infra-topo-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 18px; margin-bottom: 14px; }
.infra-topo-title { margin: 0 0 2px; font-size: 15px; font-weight: 700; }
.infra-topo-sub { margin: 0 0 14px; font-size: 12px; color: #64748b; }
.infra-topo-cell { padding: 7px 12px; border-bottom: 1px solid #f1f5f9; font-size: 12px; }
.infra-topo-name, .infra-topo-status { font-weight: 600; }
.infra-topo-streams { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.infra-topo-stream { border: 1px solid #e2e8f0; border-radius: 6px; padding: 9px 11px; background: #f8fafc; }
.infra-topo-stream-name { font-size: 12px; font-weight: 600; color: #1e293b; font-family: monospace; }
.infra-topo-stream-meta { font-size: 11px; color: #64748b; margin-top: 2px; }
.infra-topo-workers { display: flex; flex-wrap: wrap; gap: 7px; }
.infra-topo-worker { border: 1px solid #e2e8f0; border-radius: 999px; padding: 4px 11px; font-size: 12px; background: #f8fafc; font-family: monospace; }
.infra-doc { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 18px; }
.infra-doc-title { margin: 0 0 2px; font-size: 15px; font-weight: 700; color: #92400e; }
.infra-doc-sub { margin: 0 0 14px; font-size: 12px; color: #a16207; }
.infra-doc-diagram {
  font-family: monospace; font-size: 12px; line-height: 1.9; color: #1e293b; background: #fff; border-radius: 6px; padding: 16px;
  overflow-x: auto;
}
.infra-doc-pre { margin: 0; }
.infra-doc-note { margin-top: 12px; font-size: 12px; color: #a16207; }

/* ---- locations ------------------------------------------------------------------------------- */
.infra-form { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.infra-form-title { font-weight: 700; margin-bottom: 12px; }
.infra-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.infra-form-actions { margin-top: 14px; display: flex; gap: 8px; }
/* The Add/Edit location dialog (design proposal 72) and the state-change dialog's list of what each state does. */
.infra-loc-overlay {
  position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 23, 42, .55); overflow-y: auto;
}
.infra-loc-dialog { inline-size: 100%; max-inline-size: 720px; margin: 0; box-shadow: 0 20px 50px rgba(15, 23, 42, .3); }
.infra-state-impacts { display: grid; gap: 8px; margin: 12px 0; }
.infra-state-impacts dt { font-weight: 600; }
.infra-state-impacts dd { margin: 0; color: #475569; }
.infra-dlq-xref { margin: 0 0 12px; color: #475569; font-size: 13px; }
.infra-label { font-size: 12px; color: #475569; }
.infra-label--check { display: flex; align-items: center; gap: 6px; margin-top: 18px; }
.infra-input { width: 100%; padding: 6px; border: 1px solid #cbd5e1; border-radius: 6px; margin-top: 3px; }

/* ---- Yotta availability ---------------------------------------------------------------------- */
.infra-yotta-cold { min-height: 300px; color: #64748b; }
.infra-yotta-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.infra-yotta-fresh { padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; flex: 1; min-width: 220px; }
.infra-yotta-alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 12px; font-weight: 600; }
.infra-yotta-win-note { font-size: 11px; color: #64748b; }
.infra-yotta-foot { margin-top: 10px; }
.infra-cap { font-weight: 700; white-space: nowrap; }
.infra-cap-age { font-size: 11px; color: #94a3b8; margin-top: 1px; }
.infra-cap-note { font-size: 10px; margin-top: 1px; font-weight: 600; }
.infra-probe-slot { margin-top: 6px; }
.infra-probe-btn { font-size: 11px; padding: 3px 9px; }
.infra-synced { color: #64748b; font-size: 12px; white-space: nowrap; }

/* ---- logs and pager -------------------------------------------------------------------------- */
.infra-log-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 16px; margin-top: 14px; }
.infra-log-card--flat { margin-top: 0; }
.infra-log-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.infra-card-title { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.infra-log-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.infra-log-body { margin-top: 8px; }
.infra-log-hint { margin-top: 4px; font-size: 12px; }
.infra-log-entry { border-bottom: 1px solid #f1f5f9; padding: 5px 0; }
.infra-log-summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.infra-log-when { margin-inline-start: auto; color: #64748b; font-size: 12px; }
.infra-log-details { padding: 8px 4px 4px 24px; font-size: 12px; }
.infra-log-row { display: flex; gap: 10px; padding: 2px 0; }
.infra-log-key { min-width: 150px; color: #64748b; flex-shrink: 0; }
.infra-log-value { word-break: break-word; }
.infra-hist-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.infra-hist-sources { margin-inline-start: auto; font-size: 11px; color: #94a3b8; }
.infra-hist-day {
  margin: 12px 0 2px; font-size: 11px; font-weight: 700; color: #94a3b8; letter-spacing: .05em; text-transform: uppercase;
  border-bottom: 1px solid #f1f5f9; padding-bottom: 3px;
}
.infra-hist-row { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; flex-wrap: wrap; }
.infra-hist-region { font-family: monospace; font-size: 11px; color: #94a3b8; }
.infra-hist-trans { font-size: 12px; white-space: nowrap; }
.infra-hist-arrow { margin: 0 5px; color: #94a3b8; }
.infra-hist-to { font-weight: 700; }
.infra-hist-meta { margin-inline-start: auto; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.infra-hist-when { color: #64748b; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.infra-hist-rel { color: #94a3b8; font-size: 11px; white-space: nowrap; }
.infra-hist-detail { flex: 1 0 100%; font-size: 12px; color: #64748b; padding: 2px 0 0 2px; }
.infra-hist-legend {
  display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; padding-top: 8px; border-top: 1px solid #f1f5f9; font-size: 11px;
  color: #64748b; line-height: 1.5;
}
.infra-legend-mark { font-weight: 700; }
.infra-not-recorded { color: #cbd5e1; }
.infra-pager {
  position: relative; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}
.infra-pager-range { font-size: 12px; color: #64748b; font-variant-numeric: tabular-nums; }
.infra-pager-buttons { display: flex; gap: 4px; margin-inline-start: auto; flex-wrap: wrap; }
.infra-pager-gap { padding: 0 3px; color: #94a3b8; }
.infra-pager-btn {
  min-width: 30px; padding: 4px 9px; border-radius: 6px; font-size: 12px; line-height: 1.2; font-variant-numeric: tabular-nums;
  white-space: nowrap; border: 1px solid #cbd5e1; background: #fff; color: #0f172a; font-weight: 500; cursor: pointer;
}
.infra-pager-btn.is-current { border-color: #2563eb; background: #2563eb; color: #fff; font-weight: 700; }
.infra-pager-btn.is-disabled { color: #cbd5e1; cursor: not-allowed; opacity: .55; }
.infra-pager-foot { margin-top: 6px; font-size: 11px; }
