:root {
  --bg: #f5f1e8;
  --panel: #fffaf1;
  --panel-strong: #ffffff;
  --border: #dbc9ab;
  --ink: #1f1b16;
  --muted: #6f6251;
  --accent: #c16a2b;
  --accent-dark: #8d4316;
  --danger: #b33a2f;
  --success: #2f7a49;
  --shadow: 0 18px 50px rgba(90, 63, 32, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(193, 106, 43, 0.18), transparent 22%),
    linear-gradient(180deg, #f8f1e4 0%, #f2ede6 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
.ghost-btn {
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

button:hover,
.ghost-btn:hover {
  background: var(--accent-dark);
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--border);
}

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

.danger-soft {
  background: #c77258;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header,
.site-footer {
  background: rgba(255, 250, 241, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(219, 201, 171, 0.6);
}

.site-footer {
  border-bottom: none;
  border-top: 1px solid rgba(219, 201, 171, 0.6);
  margin-top: 2rem;
}

.header-inner,
.nav,
.inline-form {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.header-inner {
  justify-content: space-between;
  padding: 1rem 0;
}

.brand {
  font-size: 1.15rem;
  font-weight: 800;
}

.nav a {
  color: var(--muted);
}

.nav a.active {
  color: var(--ink);
  font-weight: 700;
}

.page {
  padding: 2rem 0 3rem;
}

.hero,
.page-head {
  margin-bottom: 1.5rem;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-radius: 18px;
  background: rgba(255, 250, 241, 0.82);
  border: 1px solid rgba(219, 201, 171, 0.95);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-weight: 700;
}

.tab-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  background: rgba(31, 27, 22, 0.08);
  color: var(--ink);
  font-size: 0.82rem;
}

.tab-pill.active {
  background: linear-gradient(135deg, rgba(193, 106, 43, 0.16), rgba(255, 255, 255, 0.95));
  color: var(--accent-dark);
  border-color: rgba(193, 106, 43, 0.35);
}

.tab-pill.active span {
  background: rgba(193, 106, 43, 0.15);
  color: var(--accent-dark);
}

.hero {
  padding: 1.8rem;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(193, 106, 43, 0.18), rgba(255, 255, 255, 0.9)),
    var(--panel-strong);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-dark);
  font-size: 0.75rem;
}

h1,
h2 {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}

.compact-tip {
  margin: -0.25rem 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.card {
  background: rgba(255, 250, 241, 0.94);
  border: 1px solid rgba(219, 201, 171, 0.9);
  border-radius: 24px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.notice-card {
  border-color: rgba(179, 58, 47, 0.35);
  background:
    linear-gradient(135deg, rgba(179, 58, 47, 0.08), rgba(255, 250, 241, 0.95)),
    rgba(255, 250, 241, 0.96);
}

.notice-card h2,
.notice-list {
  color: var(--danger);
}

.narrow-card {
  max-width: 520px;
}

.stack-form,
.filter-grid {
  display: grid;
  gap: 1rem;
}

.filter-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

label span {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  background: white;
}

.flash {
  border-radius: 16px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.flash.success {
  background: rgba(47, 122, 73, 0.12);
  color: var(--success);
}

.flash.error {
  background: rgba(179, 58, 47, 0.12);
  color: var(--danger);
}

.status-box,
.token-box {
  margin-top: 1rem;
}

.token-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px dashed var(--border);
  background: white;
}

code,
pre {
  font-family: "SFMono-Regular", "Menlo", monospace;
}

.plain-list {
  padding-left: 1.2rem;
  margin: 0;
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 1.8rem;
  border-radius: 999px;
  background: rgba(31, 27, 22, 0.08);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
}

.count-pill.success {
  background: rgba(47, 122, 73, 0.15);
  color: var(--success);
}

.count-pill.failed,
.count-pill.rejected {
  background: rgba(179, 58, 47, 0.12);
  color: var(--danger);
}

.status-pill.pending {
  background: rgba(193, 106, 43, 0.15);
  color: var(--accent-dark);
}

.status-pill.approved {
  background: rgba(47, 122, 73, 0.15);
  color: var(--success);
}

.status-pill.rejected,
.status-pill.disabled {
  background: rgba(179, 58, 47, 0.15);
  color: var(--danger);
}

.tag {
  background: rgba(31, 27, 22, 0.08);
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.9rem 0.8rem;
  border-bottom: 1px solid rgba(219, 201, 171, 0.7);
}

th {
  color: var(--muted);
  font-size: 0.9rem;
}

.actions {
  min-width: 300px;
}

.actions .inline-form {
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.actions input,
.actions select {
  min-width: 120px;
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

.log-pre {
  max-width: 380px;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: anywhere;
  word-break: keep-all;
  margin: 0;
}

.log-pre.log-response {
  line-height: 1.5;
}

.applicant-cell {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 180px;
}

.applicant-name {
  font-weight: 600;
}

.applicant-token {
  display: inline-block;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.8rem;
  color: var(--muted);
  background: rgba(31, 27, 22, 0.08);
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

  .header-inner,
  .nav {
    flex-wrap: wrap;
  }

  .tab-bar {
    gap: 0.6rem;
  }

  .token-box {
    flex-direction: column;
    align-items: stretch;
  }
}
