.system-admin-management {
  min-height: 100%;
  background: var(--page-bg, #f6f7fb);
  color: var(--text-primary, #182230);
}

.system-admin-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 38px 64px;
}

.system-admin-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.system-admin-header h1 {
  margin: 0;
  font-size: clamp(25px, 3vw, 36px);
  letter-spacing: -.02em;
}

.lede {
  max-width: 690px;
  margin: 12px 0 0;
  color: #64748b;
  line-height: 1.7;
}

.system-admin-header-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.system-admin-header-actions { justify-content: flex-end; }

.test-control-trigger { white-space: nowrap; }

.test-control-modal[hidden] { display: none; }
.test-control-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 22px; }
.test-control-backdrop { position: absolute; inset: 0; border: 0; background: rgba(15, 23, 42, .48); cursor: default; }
.test-control-dialog { position: relative; width: min(760px, 100%); max-height: min(700px, calc(100vh - 44px)); overflow: auto; padding: 25px; border: 1px solid #dbe3ee; border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(15, 23, 42, .25); }
.test-control-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.test-control-dialog-header h2 { margin: 0; font-size: 24px; }
.test-control-description { margin: 16px 0 20px; color: #475569; font-size: 13px; line-height: 1.65; }
.test-control-stage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.test-control-stage { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 2px 11px; align-items: center; min-height: 78px; padding: 13px 15px; border: 1px solid #dbe3ee; border-radius: 13px; background: #f8fafc; color: #1e293b; text-align: left; cursor: pointer; }
.test-control-stage:hover:not(:disabled) { border-color: #93c5fd; background: #eff6ff; }
.test-control-stage:disabled { cursor: not-allowed; opacity: .48; }
.test-control-stage span { grid-row: span 2; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #dbeafe; color: #1d4ed8; font-weight: 800; }
.test-control-stage strong { font-size: 14px; }
.test-control-stage small { color: #64748b; font-size: 11px; line-height: 1.4; }
.test-control-modal-status { margin: 18px 0 0; color: #64748b; font-size: 12px; line-height: 1.5; }

.status-badge,
.step-state {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge[data-tone="test"] { background: #dcfce7; color: #166534; }
.status-badge[data-tone="readonly"] { background: #e0e7ff; color: #3730a3; }
.status-badge[data-tone="error"] { background: #fee2e2; color: #991b1b; }

.system-admin-notice {
  margin: 24px 0 18px;
  padding: 13px 16px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
  color: #475569;
  line-height: 1.55;
}

.system-admin-notice[data-tone="error"] { border-color: #fecaca; background: #fff7f7; color: #991b1b; }
.system-admin-notice[data-tone="success"] { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }

.system-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.system-admin-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

.system-admin-grid .system-admin-card { padding: 21px 21px 19px; }
.lifecycle-card { margin-top: 16px; padding: 21px 24px 19px; }
.flow-card { margin-top: 16px; padding: 22px 24px 13px; }

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
}

.card-heading h2 { margin: 0; font-size: 17px; }
.card-icon { color: #64748b; font-size: 21px; }
.flow-caption { color: #64748b; font-size: 12px; }

.key-value-list { margin: 0; }
.key-value-list > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid #f1f5f9; }
.key-value-list > div:last-child { border-bottom: 0; }
.key-value-list dt { color: #64748b; font-size: 12px; }
.key-value-list dd { margin: 0; color: #1e293b; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px !important; letter-spacing: .01em; }
.muted { margin: 14px 0 0; color: #94a3b8; font-size: 12px; line-height: 1.55; }

.primary-button,
.secondary-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}

.primary-button { border: 1px solid #1d4ed8; background: #2563eb; color: #fff; }
.primary-button:hover:not(:disabled) { background: #1d4ed8; }
.secondary-button { border: 1px solid #cbd5e1; background: #fff; color: #334155; }
.secondary-button:hover:not(:disabled) { border-color: #94a3b8; background: #f8fafc; }
.primary-button:disabled,
.secondary-button:disabled { cursor: not-allowed; opacity: .48; }

.flow-list { list-style: none; margin: 0; padding: 0; }
.flow-list li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 16px 0; border-bottom: 1px solid #f1f5f9; }
.flow-list li:last-child { border-bottom: 0; }
.step-number { display: inline-grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: #eff6ff; color: #2563eb; font-size: 13px; font-weight: 800; }
.flow-list strong { font-size: 14px; }
.flow-list p { margin: 5px 0 0; color: #64748b; font-size: 12px; line-height: 1.5; }

.system-admin-help { margin-top: 16px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
.system-admin-help summary { padding: 16px 19px; cursor: pointer; font-size: 14px; font-weight: 750; }
.help-body { padding: 0 19px 18px; color: #475569; font-size: 13px; line-height: 1.65; }
.help-body p { margin: 10px 0 0; }

@media (max-width: 920px) {
  .system-admin-grid { grid-template-columns: 1fr; }
  .system-admin-shell { padding: 26px 22px 50px; }
}

@media (max-width: 620px) {
  .system-admin-header { flex-direction: column; }
  .system-admin-header-actions { justify-content: flex-start; }
  .flow-list li { grid-template-columns: 30px minmax(0, 1fr); }
  .flow-list li > .step-state,
  .flow-list li > button { grid-column: 2; justify-self: start; }
  .test-control-stage-grid { grid-template-columns: 1fr; }
  .test-control-dialog { padding: 20px; }
}
