.admin-page {
  background: var(--bg);
}

.admin-shell {
  display: grid;
  gap: 14px;
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
  padding: 30px 0 56px;
}

.admin-shell .eyebrow,
.admin-shell h1,
.admin-shell h2,
.admin-shell h3,
.admin-shell h4,
.admin-shell p {
  margin-top: 0;
}

.admin-shell h1 {
  margin-bottom: 0;
  font-size: 1.8rem;
  line-height: 1.15;
}

.admin-shell .lead {
  max-width: 760px;
  margin-bottom: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.admin-shell .hidden {
  display: none !important;
}

.admin-shell .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.admin-shell .panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.admin-shell .panel h2 {
  margin-bottom: 14px;
  font-size: 1.05rem;
  line-height: 1.3;
}

.admin-shell form {
  display: grid;
  gap: 12px;
}

.admin-shell label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--ink-soft);
  font-size: .78rem;
  font-weight: 750;
}

.admin-shell input,
.admin-shell select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}

.admin-shell input:focus,
.admin-shell select:focus {
  outline: 3px solid color-mix(in srgb, var(--primary) 18%, transparent);
  border-color: var(--primary);
}

.admin-shell button,
.admin-shell .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--primary);
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: .82rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.admin-shell button:hover,
.admin-shell .button-link:hover {
  filter: brightness(.95);
}

.admin-shell button.secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.admin-shell .hint,
.admin-shell .meta {
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.admin-shell .hint {
  margin-bottom: 12px;
}

.admin-shell .row,
.admin-shell .actions,
.admin-shell .compact-actions,
.admin-shell .plan-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.admin-shell .row {
  justify-content: space-between;
}

.admin-shell .row h2,
.admin-shell .row p {
  margin-bottom: 4px;
}

.admin-shell .actions {
  margin: 12px 0 16px;
}

.admin-shell #adminIdentityText {
  color: var(--muted);
  font-size: .82rem;
}

.admin-shell #adminSessionArea.panel {
  display: grid;
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.admin-shell .metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 9px;
  margin: 4px 0 8px;
}

.admin-shell .metric {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.admin-shell .metric strong {
  font-size: 1.15rem;
  line-height: 1.2;
}

.admin-shell .metric span {
  color: var(--muted);
  font-size: .72rem;
}

.admin-shell .subpanel {
  min-width: 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.admin-shell .subpanel h3 {
  margin-bottom: 7px;
  font-size: .98rem;
}

.admin-shell .subpanel h4 {
  margin: 14px 0 6px;
  font-size: .84rem;
}

.admin-shell .stack {
  display: grid;
  gap: 0;
}

.admin-shell .invite-row,
.admin-shell .member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.admin-shell .invite-main,
.admin-shell .member-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-shell .invite-main > strong,
.admin-shell .member-main > strong {
  font-size: .84rem;
  overflow-wrap: anywhere;
}

.admin-shell .inline-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
  margin: 12px 0;
}

.admin-shell .admin-grant-form {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.admin-shell .message:empty {
  display: none;
}

.admin-shell .message:not(:empty) {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: .82rem;
}

.admin-shell .message[data-error="1"] {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  color: var(--danger);
}

@media (max-width: 720px) {
  .admin-shell {
    width: min(100% - 24px, 560px);
    padding-top: 20px;
  }

  .admin-shell .grid,
  .admin-shell .inline-form,
  .admin-shell .admin-grant-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-shell .inline-form > button,
  .admin-shell .admin-grant-form > button {
    width: 100%;
  }

  .admin-shell .invite-row,
  .admin-shell .member-row {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-shell .compact-actions,
  .admin-shell .plan-controls {
    align-items: stretch;
  }

  .admin-shell .compact-actions > button,
  .admin-shell .plan-controls > button,
  .admin-shell .plan-controls > select {
    flex: 1 1 150px;
  }
}
