* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #eef2f6;
  color: #17202a;
}

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

.wide-page {
  align-items: start;
}

.panel {
  width: min(820px, 100%);
  padding: 26px;
  background: #ffffff;
  border: 1px solid #d7e0e8;
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(30, 45, 62, 0.1);
}

.header,
.result-head,
.input-row,
.pickup-row,
.button-row {
  display: flex;
  align-items: center;
}

.header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #5b6b7c;
  font-size: 13px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.status {
  min-width: 76px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf3f8;
  color: #405469;
  font-size: 13px;
  text-align: center;
}

.status.success {
  background: #e7f6ee;
  color: #17633a;
}

.status.error {
  background: #fdecea;
  color: #9f2a1d;
}

.pickup-form {
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #32475b;
  font-size: 14px;
}

.input-row {
  gap: 10px;
}

.login-row {
  display: flex;
  gap: 10px;
}

.login-row input {
  flex: 1;
}

.login-row button {
  flex: 0 0 auto;
}

.login-status {
  margin-top: 8px;
  color: #6d7d8e;
  font-size: 13px;
}

.login-status.success {
  color: #17633a;
}

.login-status.error {
  color: #9f2a1d;
}

.pickup-row {
  align-items: stretch;
  gap: 10px;
}

input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 13px;
  border: 1px solid #c5d0dc;
  border-radius: 6px;
  color: #17202a;
  font-size: 16px;
  outline: none;
}

select {
  height: 44px;
  padding: 0 12px;
  border: 1px solid #c5d0dc;
  border-radius: 6px;
  background: #ffffff;
  color: #17202a;
  font-size: 15px;
  outline: none;
}

input:focus {
  border-color: #1677c4;
  box-shadow: 0 0 0 3px rgba(22, 119, 196, 0.14);
}

button {
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: #1677c4;
  color: #ffffff;
  font-size: 15px;
  cursor: pointer;
}

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

.link-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #c5d0dc;
  border-radius: 6px;
  background: #ffffff;
  color: #32475b;
  text-decoration: none;
  font-size: 14px;
}

.result-box {
  border: 1px solid #d7e0e8;
  border-radius: 8px;
  overflow: hidden;
}

.result-head {
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #d7e0e8;
  color: #405469;
  font-size: 14px;
}

pre {
  min-height: 260px;
  max-height: 52vh;
  margin: 0;
  padding: 16px;
  overflow: auto;
  background: #101820;
  color: #d7f5e9;
  font: 14px/1.6 Consolas, "SFMono-Regular", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

pre.error {
  color: #ffb4a8;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

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

textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  padding: 12px;
  border: 1px solid #c5d0dc;
  border-radius: 6px;
  color: #17202a;
  font: 14px/1.6 Consolas, "SFMono-Regular", monospace;
  outline: none;
}

.card-textarea {
  flex: 1;
  min-height: 118px;
}

textarea:focus {
  border-color: #1677c4;
  box-shadow: 0 0 0 3px rgba(22, 119, 196, 0.14);
}

.button-row {
  gap: 10px;
}

.compact-actions {
  gap: 8px;
}

.admin-result {
  margin-bottom: 18px;
}

.export-panel {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #d7e0e8;
  border-radius: 8px;
  background: #f8fafc;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #d7e0e8;
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 14px;
}

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

th {
  background: #f8fafc;
  color: #405469;
  font-weight: 600;
}

.muted {
  color: #6d7d8e;
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 13px;
}

.status-pill.available {
  background: #e7f6ee;
  color: #17633a;
}

.status-pill.used {
  background: #fdecea;
  color: #9f2a1d;
}

.status-pill.disabled {
  background: #eef2f6;
  color: #5b6b7c;
}

@media (max-width: 560px) {
  .page {
    padding: 14px;
  }

  .panel {
    padding: 18px;
  }

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

  .input-row,
  .login-row,
  .pickup-row,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

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

  button {
    width: 100%;
  }
}
