:root {
  color-scheme: light;
  --bg: #eef3f1;
  --panel: #ffffff;
  --panel-soft: #f7faf8;
  --line: #d8e0dc;
  --text: #1f2926;
  --muted: #65736d;
  --blue: #1f6f8b;
  --blue-dark: #155273;
  --green: #1f7a4d;
  --red: #b43d3d;
  --shadow: 0 18px 55px rgba(24, 40, 34, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(42, 136, 102, 0.14), transparent 34%),
    linear-gradient(135deg, #eef3f1 0%, #f8f4ec 100%);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 34px 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.generator-panel {
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid #d5c878;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff08a, #ffd84a);
  color: #18201d;
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.brand h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: -0.03em;
}

.language-pills {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
}

.pill {
  min-width: 46px;
  height: 36px;
  border: 1px solid #d3ddd8;
  border-radius: 999px;
  background: #f7faf8;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: default;
}

.pill.active {
  background: #e5f2ec;
  border-color: #a9d6c0;
  color: var(--green);
}

.generator-form {
  display: grid;
  gap: 17px;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 15px;
  font-weight: 750;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid #ccd8d2;
  border-radius: 14px;
  background: #fff;
  color: #222b28;
  font: 500 16px/1.45 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  outline: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 1px 2px rgba(24, 40, 34, 0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus,
.field textarea:focus {
  border-color: #74b696;
  box-shadow: 0 0 0 4px rgba(47, 139, 97, 0.12);
}

.field input {
  height: 52px;
  padding: 0 15px;
}

.field textarea {
  min-height: 118px;
  padding: 14px 15px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9aa6a1;
}

.hint-box {
  border: 1px solid #d7e2dc;
  border-radius: 16px;
  background: var(--panel-soft);
  padding: 14px 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.hint-box p {
  margin: 0 0 6px;
}

.hint-box p:last-child {
  margin-bottom: 0;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  font-size: 17px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(31, 111, 139, 0.22);
}

.primary-button:hover {
  filter: brightness(1.04);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.primary-button.small {
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
}

.results {
  margin-top: 24px;
}

.result-header,
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-header h2,
.admin-card h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.result-actions button,
.admin-link,
.danger-button {
  border: 1px solid #c8d4ce;
  border-radius: 12px;
  background: #fff;
  color: #303936;
  padding: 9px 13px;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.danger-button {
  color: var(--red);
}

.results textarea {
  width: 100%;
  border: 1px solid #ccd8d2;
  border-radius: 14px;
  padding: 14px;
  font: 14px/1.5 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  resize: vertical;
}

.status {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.status.error {
  color: var(--red);
}

.status.success {
  color: var(--green);
}

.footer {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
}

.admin-shell {
  width: min(100%, 1220px);
  margin: 0 auto;
  padding: 28px;
}

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

.admin-header h1 {
  margin: 0;
  font-size: 36px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-card {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(26, 35, 48, 0.08);
}

.created-token {
  display: grid;
  gap: 8px;
  border-color: #9ac7ab;
  background: #eef9f1;
}

.created-token code {
  display: block;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.admin-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.admin-note code {
  color: var(--text);
  overflow-wrap: anywhere;
}

.admin-form {
  display: grid;
  grid-template-columns: 1.8fr 0.6fr 0.8fr auto;
  gap: 14px;
  align-items: end;
}

.admin-form label {
  display: grid;
  gap: 7px;
}

.admin-form input {
  height: 42px;
  border: 1px solid #c9cdd1;
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid #eceef1;
  padding: 11px 8px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eceff3;
  color: #4b5158;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.active {
  background: #e5f6ec;
  color: #166438;
}

.status-pill.expired,
.status-pill.revoked,
.status-pill.limited {
  background: #fae9e9;
  color: #9a2929;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

@media (max-width: 760px) {
  .shell,
  .admin-shell {
    padding: 14px;
  }

  .generator-panel {
    padding: 20px;
  }

  .topbar,
  .admin-header,
  .result-header {
    align-items: stretch;
    flex-direction: column;
  }

  .brand h1 {
    font-size: 28px;
  }

  .brand-icon {
    width: 46px;
    height: 46px;
    font-size: 28px;
  }

  .language-pills {
    align-self: flex-start;
  }

  .admin-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.admin-note code {
  color: var(--text);
  overflow-wrap: anywhere;
}

.admin-form {
    grid-template-columns: 1fr;
  }
}
