.admin-content {
  max-width: 1120px;
}

.admin-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.admin-hero h1 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(30px, 3.4vw, 42px);
  letter-spacing: -1.6px;
}

.admin-hero p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.admin-stats article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 25px rgba(23, 53, 55, 0.04);
}

.admin-stats strong,
.admin-stats span {
  display: block;
}

.admin-stats strong {
  font-family: "Manrope", sans-serif;
  font-size: 26px;
  letter-spacing: -1px;
}

.admin-stats span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.database-design-card {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 26px;
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid #d7e6e2;
  border-radius: 9px;
  background: linear-gradient(105deg, #f8fcfb, #ecf6f3);
}

.database-design-card h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 20px;
}

.database-design-card p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.schema-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  align-content: center;
}

.schema-grid span {
  padding: 10px 11px;
  border: 1px solid #d2e2df;
  border-radius: 5px;
  background: white;
  color: #37595c;
  font-size: 11px;
  font-weight: 700;
}

.account-table-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.account-table-header,
.account-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.7fr 0.7fr 0.7fr 0.9fr 0.9fr;
  gap: 14px;
  align-items: center;
  padding: 0 20px;
}

.account-table-header {
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  background: #fafbf9;
  color: #859294;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.1px;
}

.account-row {
  min-height: 66px;
  border-bottom: 1px solid var(--soft-line);
  color: #5c6f72;
  font-size: 11px;
}

.account-row:last-child {
  border-bottom: 0;
}

.account-empty {
  padding: 24px 22px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.account-row strong {
  color: var(--ink);
  font-size: 12px;
}

.status,
.hash {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.status.active,
.hash {
  background: var(--teal-soft);
  color: var(--teal);
}

.status.inactive {
  background: #f2eee5;
  color: #98733b;
}

.security-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.security-rules article {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.security-rules h3 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
}

.security-rules p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

@media (max-width: 940px) {
  .admin-stats,
  .security-rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .database-design-card {
    grid-template-columns: 1fr;
  }

  .schema-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .admin-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-stats,
  .security-rules {
    grid-template-columns: 1fr;
  }

  .account-table-card {
    overflow-x: auto;
  }

  .account-table-header,
  .account-row {
    min-width: 760px;
  }
}

/* ---- 角色操作按钮 ---- */
.role-button {
  border: 1px solid var(--line);
  padding: 6px 9px;
  border-radius: 6px;
  background: white;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.role-button.grant {
  border-color: var(--teal);
  color: var(--teal);
}

.role-button.grant:hover {
  background: var(--teal);
  color: white;
}

.role-button.revoke {
  border-color: #e0b87c;
  color: #98733b;
}

.role-button.revoke:hover {
  background: #f7f0e2;
  color: #7d5e2f;
}

.role-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
