:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #f4f6fb;
  color: #1d2535;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(111, 83, 255, 0.12), transparent 30rem),
    linear-gradient(180deg, #f8f9fd 0%, #eff2f8 100%);
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.topbar,
.toolbar,
.section-heading,
.generated-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #6a52e8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 8px;
  font-size: 19px;
}

.server-clock {
  padding: 10px 14px;
  border: 1px solid #dce1ed;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  color: #536078;
  font-size: 13px;
}

.card {
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid rgba(216, 221, 234, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 50px rgba(39, 47, 73, 0.07);
}

.login-card {
  width: min(440px, 100%);
  margin: 70px auto 0;
}

.muted {
  margin-bottom: 18px;
  color: #6d778a;
  font-size: 14px;
  line-height: 1.6;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
  color: #465168;
  font-size: 13px;
  font-weight: 650;
}

input,
textarea {
  width: 100%;
  border: 1px solid #ccd3e1;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: #1d2535;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input {
  min-height: 43px;
  padding: 0 12px;
}

textarea {
  padding: 12px;
  resize: vertical;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 14px;
  line-height: 1.7;
}

input:focus,
textarea:focus {
  border-color: #7157ed;
  box-shadow: 0 0 0 3px rgba(113, 87, 237, 0.13);
}

button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: #6850df;
  color: #fff;
  cursor: pointer;
  font-weight: 750;
  transition: transform 0.12s, opacity 0.12s, background 0.12s;
}

button:hover {
  background: #5b43d1;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-secondary {
  border: 1px solid #d5daea;
  background: #fff;
  color: #4e5970;
}

.button-secondary:hover {
  background: #f5f6fa;
}

.button-quiet {
  background: transparent;
  color: #727c90;
}

.button-quiet:hover {
  background: #e9ecf4;
}

.toolbar {
  justify-content: flex-end;
  margin-bottom: 14px;
}

.generate-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px;
  gap: 0 16px;
}

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

.actions {
  display: flex;
  justify-content: flex-end;
}

.message {
  min-height: 20px;
  margin: 8px 0 0;
  color: #b53a4d;
  font-size: 14px;
}

.message.success {
  color: #187e5a;
}

.generated {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #cfc8f8;
  border-radius: 12px;
  background: #f7f5ff;
}

.generated-heading {
  margin-bottom: 12px;
  color: #503cae;
}

.table-card {
  padding-left: 0;
  padding-right: 0;
}

.table-card > .section-heading,
.table-card > .message {
  padding-left: 24px;
  padding-right: 24px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

th,
td {
  padding: 13px 12px;
  border-top: 1px solid #edf0f5;
  text-align: left;
  vertical-align: middle;
}

th:first-child,
td:first-child {
  padding-left: 24px;
}

th:last-child,
td:last-child {
  padding-right: 24px;
}

th {
  color: #778196;
  font-size: 12px;
  font-weight: 750;
}

.status {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf0f5;
  color: #667085;
  font-weight: 750;
}

.status-active {
  background: #e2f7ef;
  color: #167253;
}

.status-unused {
  background: #e8efff;
  color: #3e62a8;
}

.status-expired,
.status-revoked {
  background: #fbe8eb;
  color: #a93447;
}

.status-online {
  background: #e2f7ef;
  color: #167253;
}

.status-offline {
  background: #edf0f5;
  color: #667085;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.code-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-code-button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #d5daea;
  background: #fff;
  color: #4e5970;
  font-size: 12px;
}

.copy-code-button:hover {
  background: #f5f6fa;
}

.legacy-code {
  color: #9a6470;
  font-size: 12px;
}

.force-release-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #cdd8f6;
  background: #fff;
  color: #3d5f9c;
  font-size: 12px;
}

.force-release-button:hover {
  background: #f1f5ff;
}

.revoke-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #efc9d0;
  background: #fff;
  color: #a93447;
  font-size: 12px;
}

.revoke-button:hover {
  background: #fff2f4;
}

[hidden] {
  display: none !important;
}

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

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

  .card {
    padding: 18px;
    border-radius: 14px;
  }

  .generate-grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }
}
