:root {
  --bg: #f2efe7;
  --ink: #1f1f1f;
  --card: #fffdf8;
  --line: #d7cfbe;
  --brand: #1f5f8b;
  --brand-2: #c55a11;
  --danger: #b11b2b;
  --ok: #1c7c54;
  --shadow: 0 20px 45px rgba(31, 31, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, rgba(31, 95, 139, 0.12), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(197, 90, 17, 0.1), transparent 45%),
    var(--bg);
  font-family: "IBM Plex Sans", "Segoe UI", "Trebuchet MS", sans-serif;
  line-height: 1.45;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(50px);
}

.bg-shape-a {
  top: -120px;
  left: -120px;
  width: 320px;
  height: 320px;
  background: rgba(31, 95, 139, 0.26);
}

.bg-shape-b {
  right: -140px;
  bottom: -140px;
  width: 360px;
  height: 360px;
  background: rgba(197, 90, 17, 0.2);
}

.container {
  width: min(1400px, 96vw);
  margin: 0 auto;
  padding: 26px 0 40px;
}

.hero {
  margin-bottom: 16px;
  padding: 18px 22px;
  background: linear-gradient(135deg, #103f5d, #0f7a70);
  color: #f8fbff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  animation: slideDown 0.45s ease;
}

.hero h1 {
  margin: 0;
  font-family: "Avenir Next", "Century Gothic", "Franklin Gothic Medium", sans-serif;
  letter-spacing: 0.3px;
}

.hero p {
  margin: 6px 0 0;
}

.hero-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.hero-copy {
  min-width: 280px;
}

.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-actions form {
  margin: 0;
}

.grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
  animation: fadeIn 0.35s ease;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1.08rem;
}

.messages {
  margin: 0;
  padding-left: 18px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e5edf3;
  border: 1px solid #bfd2e4;
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 0.85rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.inline-form {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

input,
select,
button,
.button,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 9px;
  background: #fff;
}

button,
.button {
  border: 0;
  border-radius: 9px;
  padding: 8px 12px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

button.primary {
  background: var(--ok);
}

button.ghost {
  background: #1f4460;
}

button.danger {
  background: var(--danger);
}

button.muted {
  background: #7d8792;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 8px 6px;
  vertical-align: top;
  text-align: left;
}

th {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: #184e73;
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.actions form {
  margin: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
}

.table-wrap table {
  width: 100%;
}

.table-services {
  min-width: 980px;
}

.table-endpoints {
  min-width: 1080px;
}

.table-users {
  min-width: 460px;
}

.warn-box {
  border: 1px solid #e6b36a;
  background: #fff4df;
  color: #6f4204;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
}

pre {
  background: #171d22;
  color: #f0f6fa;
  border-radius: 10px;
  padding: 12px;
  overflow: auto;
  max-height: 520px;
}

code {
  font-family: "IBM Plex Mono", "Consolas", monospace;
}

.endpoint-card {
  margin-bottom: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.section-head h2 {
  margin-bottom: 0;
}

.access-code {
  word-break: break-all;
}

.copy-btn {
  background: #2e6f95;
}

.copy-all-btn {
  background: #1f5f8b;
}

.login-body {
  min-height: 100vh;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 96vw);
}

.login-card h1 {
  margin: 0 0 10px;
  font-size: 1.6rem;
}

.login-card p {
  margin: 0 0 14px;
}

.login-form {
  display: grid;
  gap: 10px;
}

@media (max-width: 1040px) {
  .grid.two,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero-toolbar {
    flex-direction: column;
  }

  .hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .hero-actions form,
  .hero-actions .button {
    width: 100%;
  }

  .hero-actions button,
  .hero-actions .button {
    width: 100%;
    text-align: center;
  }

  .inline-form {
    flex-direction: column;
  }

  .container {
    width: min(100%, 100vw);
    padding: 14px 8px 24px;
  }

  .card {
    padding: 10px;
  }

  th,
  td {
    padding: 7px 5px;
    font-size: 0.84rem;
  }

  .copy-btn,
  .copy-all-btn {
    white-space: nowrap;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
