.portal-infra {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  max-width: 84rem;
  margin: 0 auto;
}

/* View header */
.portal-infra__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.portal-infra__head-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.portal-infra__title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 650;
  color: var(--color-text-1);
}

.portal-infra__sub {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-4);
  max-width: 48rem;
}

.portal-infra__panel {
  display: flex;
  flex-direction: column;
}

/* Generic vertical stack used inside every tab */
.portal-infra__stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.portal-infra__bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

/* Section headers */
.portal-infra__section-head {
  margin-bottom: 0.625rem;
}

.portal-infra__section-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-1);
}

.portal-infra__section-sub {
  margin: 0.125rem 0 0;
  font-size: 0.75rem;
  color: var(--color-text-4);
}

/* Two-column split */
.portal-infra__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 60rem) {
  .portal-infra__split {
    grid-template-columns: 1fr;
  }
}

/* Shared cell styles */
.portal-infra__cell-stack {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.portal-infra__cell-strong {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-1);
}

.portal-infra__cell-code {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-text-3);
  background: var(--color-bg-code);
  padding: 0.0625rem 0.3125rem;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.portal-infra__mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-2);
}

.portal-infra__muted {
  font-size: 0.75rem;
  color: var(--color-text-4);
}

/* Region load cell */
.portal-infra__load {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-infra__load-pct {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-text-3);
  min-width: 2.25rem;
  text-align: right;
}

/* Metric strip (audit) */
.portal-infra__metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

@media (max-width: 50rem) {
  .portal-infra__metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── API keys ───────────────────────────────────────────────────────────── */
.portal-infra__keys {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.portal-infra__key {
  padding: 0 !important;
  overflow: hidden;
}

.portal-infra__key-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.875rem 1.125rem;
  background: transparent;
  text-align: left;
  transition: background var(--motion-fast);
}

.portal-infra__key-head:hover {
  background: var(--color-bg-hover);
}

.portal-infra__key-id {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.portal-infra__key-head-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.portal-infra__chevron {
  font-size: 1.125rem;
  color: var(--color-text-5);
  transition: transform var(--motion-fast);
  line-height: 1;
}

.portal-infra__chevron.is-open {
  transform: rotate(90deg);
}

.portal-infra__key-body {
  padding: 0 1.125rem 1.125rem;
  border-top: 1px solid var(--color-border-light);
}

.portal-infra__kv {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.875rem 1.25rem;
  margin: 1rem 0 0;
}

@media (max-width: 48rem) {
  .portal-infra__kv {
    grid-template-columns: repeat(2, 1fr);
  }
}

.portal-infra__kv-wide {
  grid-column: 1 / -1;
}

.portal-infra__kv dt {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-5);
  margin-bottom: 0.25rem;
}

.portal-infra__kv dd {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-2);
}

.portal-infra__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

/* Modal form */
.portal-infra__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-infra__perm-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.portal-infra__modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem;
}

/* ── Security ───────────────────────────────────────────────────────────── */
.portal-infra__banner {
  margin-top: 1rem;
}

.portal-infra__certs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

@media (max-width: 60rem) {
  .portal-infra__certs {
    grid-template-columns: repeat(2, 1fr);
  }
}

.portal-infra__cert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.portal-infra__cert-detail {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--color-text-4);
  line-height: 1.4;
}

/* Encryption key management */
.portal-infra__keymgmt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.portal-infra__keymgmt-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

/* Compliance attestations — same grid rhythm as certs, but each card stacks
   a framework chip + report link, so it needs a little more vertical room. */
.portal-infra__attestations {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 60rem) {
  .portal-infra__attestations {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 36rem) {
  .portal-infra__attestations {
    grid-template-columns: 1fr;
  }
}

.portal-infra__attestation {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.portal-infra__attestation-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-blue);
  text-decoration: none;
}

.portal-infra__attestation-link:hover {
  text-decoration: underline;
}

/* ── Storage ────────────────────────────────────────────────────────────── */
.portal-infra__usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}

.portal-infra__usage-value {
  font-size: 1.25rem;
  font-weight: 650;
  color: var(--color-text-1);
}

.portal-infra__usage-value .portal-infra__muted {
  font-size: 0.875rem;
  font-weight: 400;
}

.portal-infra__providers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.portal-infra__provider {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
}

.portal-infra__provider-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-md);
  background: var(--color-blue-light);
  color: var(--color-blue);
  font-size: 0.875rem;
}

.portal-infra__provider-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.portal-infra__provider-meta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

/* Lifecycle timeline */
.portal-infra__lifecycle {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 1rem;
}

.portal-infra__lifecycle-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.625rem 0.75rem;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
}

.portal-infra__lifecycle-stage.is-active {
  background: var(--color-green-light);
  border-color: var(--color-green-border);
}

.portal-infra__lifecycle-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-text-5);
}

.portal-infra__lifecycle-stage.is-active .portal-infra__lifecycle-dot {
  background: var(--color-green);
}

.portal-infra__lifecycle-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-1);
}

.portal-infra__lifecycle-arrow {
  display: flex;
  align-items: center;
  color: var(--color-text-5);
  font-size: 0.875rem;
}

/* ── Audit ──────────────────────────────────────────────────────────────── */
.portal-infra__event {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-infra__event span {
  font-size: 0.8125rem;
  color: var(--color-text-2);
}

/* ── Table skeleton ─────────────────────────────────────────────────────── */
.portal-infra__table-skel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
}

.portal-infra__table-skel-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 1rem;
  align-items: center;
}
