:root {
  --bg: #0c0d0b;
  --panel: rgba(24, 25, 21, 0.88);
  --panel-soft: rgba(33, 35, 29, 0.72);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(216, 255, 107, 0.48);
  --text: #f7f7f1;
  --muted: #aaa99f;
  --green: #d9ff62;
  --green-soft: #9bd47c;
  --danger: #ff6b6b;
  --ok: #71e1a2;
  --shadow: 0 24px 100px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-family: Inter, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 12% 16%, rgba(216, 255, 98, 0.09), transparent 28%),
    radial-gradient(circle at 82% 20%, rgba(119, 201, 160, 0.08), transparent 30%),
    var(--bg);
  background-size: 24px 24px, 24px 24px, auto, auto, auto;
}

body.overlay-open {
  overflow: hidden;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 255, 98, 0.42) rgba(255, 255, 255, 0.045);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.045);
}

*::-webkit-scrollbar-thumb {
  border: 2px solid rgba(16, 18, 14, 0.95);
  border-radius: 999px;
  background: rgba(216, 255, 98, 0.42);
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(216, 255, 98, 0.64);
}

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

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

.public-shell {
  min-height: 100vh;
  padding: 28px 72px 64px;
  display: flex;
  flex-direction: column;
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

.text-brand {
  text-transform: uppercase;
}

.online-pill,
.hero-meta span,
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 999px;
  color: #d9d9cf;
}

.online-pill {
  padding: 8px 14px;
  font-size: 14px;
}

.online-pill span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #54d38b;
  box-shadow: 0 0 16px #54d38b;
}

.extract-panel {
  position: relative;
  width: min(1040px, calc(100vw - 48px));
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-block {
  position: relative;
  padding: 66px 70px 26px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 6px;
}

.eyebrow span {
  width: 24px;
  height: 1px;
  background: var(--green);
}

.hero-block h1 {
  position: relative;
  margin: 12px 0 18px;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.08;
  letter-spacing: 0;
  z-index: 1;
}

.hero-block h1 strong {
  color: var(--green);
  font-style: normal;
}

.hero-block p {
  position: relative;
  max-width: 840px;
  margin: 0;
  color: #c2c0b7;
  font-size: 18px;
  line-height: 1.7;
  z-index: 1;
}

.hero-desc {
  white-space: nowrap;
}

.hero-meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  z-index: 1;
}

.hero-meta span {
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 700;
}

.ghost-word {
  position: absolute;
  top: 34px;
  right: 22px;
  color: rgba(255, 255, 255, 0.035);
  font-size: clamp(80px, 12vw, 150px);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.inventory-showcase {
  position: absolute;
  right: 38px;
  top: 30px;
  z-index: 1;
  width: 204px;
  min-height: 112px;
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: "Microsoft YaHei", "微软雅黑", "Segoe UI", Arial, sans-serif;
  border: 1px solid rgba(216, 255, 98, 0.42);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(216, 255, 98, 0.2), rgba(255, 255, 255, 0.035) 54%, rgba(113, 225, 162, 0.12)),
    rgba(8, 9, 7, 0.7);
  box-shadow: 0 0 0 1px rgba(216, 255, 98, 0.08), 0 24px 80px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.inventory-showcase span {
  color: #ebe8d7;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
}

.inventory-showcase strong {
  display: block;
  min-width: 3ch;
  margin-top: 10px;
  color: var(--green);
  font-size: 60px;
  line-height: 1;
  font-weight: 950;
  text-shadow: 0 0 28px rgba(216, 255, 98, 0.32);
}

.number-pop {
  animation: numberPop 700ms ease;
}

@keyframes numberPop {
  0% {
    transform: translateY(4px) scale(0.96);
    filter: blur(2px);
  }
  45% {
    transform: translateY(-2px) scale(1.04);
    filter: blur(0);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.redeem-form {
  padding: 44px 70px 48px;
}

label {
  display: block;
  margin-bottom: 10px;
  color: #dcd9cc;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(3, 4, 3, 0.68);
  padding: 0 16px;
  font-size: 14px;
  outline: none;
}

input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(216, 255, 98, 0.34);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  vertical-align: middle;
}

input[type="checkbox"]::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #11120e;
  border-bottom: 2px solid #11120e;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform 120ms ease;
}

input[type="checkbox"]:checked {
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 16px rgba(216, 255, 98, 0.22);
}

input[type="checkbox"]:checked::after {
  transform: rotate(-45deg) scale(1);
}

input[type="checkbox"]:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(216, 255, 98, 0.1);
}

.system-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.system-select-native {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
}

.system-select-button {
  position: relative;
  width: 100%;
  min-height: 48px;
  padding: 0 42px 0 16px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    rgba(3, 4, 3, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.system-select-button::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.72;
  transform: translateY(-68%) rotate(45deg);
  transition: transform 160ms ease, opacity 160ms ease;
}

.system-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-select-button:hover,
.system-select.open .system-select-button {
  border-color: rgba(216, 255, 98, 0.36);
  background:
    linear-gradient(180deg, rgba(216, 255, 98, 0.09), rgba(255, 255, 255, 0.025)),
    rgba(3, 4, 3, 0.72);
}

.system-select.open .system-select-button {
  box-shadow: 0 0 0 3px rgba(216, 255, 98, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.system-select.open .system-select-button::after {
  opacity: 1;
  transform: translateY(-25%) rotate(225deg);
}

.system-select-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  padding: 8px;
  border: 1px solid rgba(216, 255, 98, 0.26);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(216, 255, 98, 0.08), rgba(255, 255, 255, 0.025) 44%),
    rgba(15, 16, 13, 0.98);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.system-select.open .system-select-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.system-select-search {
  min-height: 38px;
  height: 38px;
  margin-bottom: 8px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(3, 4, 3, 0.64);
}

.system-select-options {
  max-height: 232px;
  display: grid;
  gap: 4px;
  overflow: auto;
  overscroll-behavior: contain;
}

.system-select-option {
  width: 100%;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #e9e6da;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.system-select-option:hover:not([aria-selected="true"]),
.system-select-option:focus:not([aria-selected="true"]) {
  border-color: rgba(216, 255, 98, 0.24);
  color: #f4ffd8;
  background: rgba(216, 255, 98, 0.14);
  outline: none;
}

.system-select-option[aria-selected="true"] {
  border-color: rgba(216, 255, 98, 0.24);
  color: #12140d;
  background: var(--green);
}

.system-select-option:disabled {
  color: rgba(240, 238, 229, 0.42);
  background: transparent;
  cursor: not-allowed;
}

.system-select-empty {
  padding: 10px 8px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.redeem-form > textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.7;
  padding-top: 16px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 18px;
}

.format-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

.format-row small,
.hint-line {
  color: var(--muted);
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}

.format-option {
  position: relative;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.format-option input {
  position: absolute;
  opacity: 0;
}

.format-option.selected {
  border-color: var(--line-strong);
  background: rgba(216, 255, 98, 0.12);
}

.format-option b {
  padding: 3px 9px;
  border-radius: 999px;
  color: #0b0d08;
  background: var(--green);
  font-size: 14px;
}

.format-option em {
  color: var(--danger);
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.format-option.disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.format-option.disabled * {
  cursor: not-allowed;
}

.format-option.disabled span {
  color: #bdb9ad;
}

.primary-action,
.secondary-action,
.danger-action {
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 900;
  font-size: 14px;
}

.primary-action {
  display: block;
  min-width: 120px;
  height: 60px;
  margin: 28px auto 0;
  color: #11120e;
  background: #f2f0ea;
}

.redeem-form .primary-action {
  font-size: 18px;
  letter-spacing: 1px;
}

.primary-action.is-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.primary-action.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(17, 18, 14, 0.28);
  border-top-color: #11120e;
  border-radius: 50%;
  animation: button-spin 700ms linear infinite;
}

.primary-action:hover {
  background: var(--green);
}

.primary-action:disabled {
  opacity: 0.7;
  cursor: wait;
}

.primary-action.full,
.primary-action.compact {
  width: 100%;
}

.primary-action.compact {
  height: 48px;
  margin: 0;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

.inline-message,
.notice {
  margin-top: 18px;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
}

.inline-message.error,
.notice.error {
  color: #ffd7d7;
  border-color: rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.12);
}

.inline-message.success,
.notice.success {
  color: #ddffe9;
  border-color: rgba(113, 225, 162, 0.35);
  background: rgba(113, 225, 162, 0.1);
}

.toast {
  position: fixed;
  top: 34px;
  left: 50%;
  z-index: 80;
  min-width: 260px;
  max-width: 420px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #f6f3e9;
  background: rgba(18, 19, 16, 0.94);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.36);
  opacity: 0;
  transform: translate(-50%, -10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  border-color: rgba(255, 107, 107, 0.46);
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.18), rgba(18, 19, 16, 0.94));
}

.toast.success {
  border-color: rgba(113, 225, 162, 0.46);
  background: linear-gradient(135deg, rgba(113, 225, 162, 0.14), rgba(18, 19, 16, 0.94));
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity 180ms ease;
}

.drawer-backdrop.open {
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 31;
  width: min(420px, calc(100vw - 28px));
  height: 100vh;
  padding: 26px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(216, 255, 98, 0.08), transparent 34%), rgba(14, 15, 12, 0.98);
  box-shadow: -28px 0 80px rgba(0, 0, 0, 0.42);
  transform: translateX(100%);
  transition: transform 220ms ease;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 26px;
}

.drawer-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.drawer-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.drawer-close {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #f0eee5;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.drawer-close:hover {
  border-color: rgba(216, 255, 98, 0.36);
  background: rgba(216, 255, 98, 0.12);
}

.drawer-form {
  display: grid;
  gap: 18px;
}

.drawer-form .primary-action.compact {
  margin-top: 8px;
}

.usage-drawer {
  width: min(520px, calc(100vw - 28px));
}

.usage-summary {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(216, 255, 98, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.usage-summary span,
.usage-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.usage-summary strong {
  display: block;
  margin-top: 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 16px;
}

.usage-list {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.usage-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.usage-item strong {
  display: block;
  margin-top: 7px;
  font-family: Consolas, "Courier New", monospace;
}

.usage-format {
  min-width: 82px;
  padding: 6px 10px;
  border: 1px solid rgba(216, 255, 98, 0.28);
  border-radius: 999px;
  color: #12140d;
  background: var(--green);
  text-align: center;
  font-size: 13px;
  font-weight: 900;
}

.public-footer {
  margin-top: auto;
  text-align: center;
  color: #bebcaf;
}

.public-footer a:hover {
  color: var(--green);
}

.login-shell {
  justify-content: flex-start;
}

.login-card {
  width: min(480px, calc(100vw - 48px));
  margin: auto;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 12px 0 28px;
  font-size: 34px;
}

.login-card input {
  margin-bottom: 18px;
}

.login-card .primary-action.full {
  height: 48px;
  font-size: 16px;
  background: var(--green);
}

.login-error {
  margin: -4px 0 14px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 800;
}

.admin-shell {
  position: relative;
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow: hidden;
}

.route-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 3px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.route-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--green), var(--ok), #f7f7f1);
  box-shadow: 0 0 18px rgba(216, 255, 98, 0.58);
}

body.is-route-loading {
  cursor: progress;
}

body.is-route-loading .route-progress {
  opacity: 1;
  transform: translateY(0);
}

body.is-route-loading .route-progress span {
  animation: route-progress 1.15s cubic-bezier(0.19, 1, 0.22, 1) forwards,
    route-progress-pulse 780ms ease-in-out infinite;
}

body.is-route-loading .admin-main {
  animation: route-fade 180ms ease forwards;
}

body.is-route-loading .nav-link,
body.is-route-loading .pager-links a,
body.is-route-loading .primary-action,
body.is-route-loading .secondary-action,
body.is-route-loading .danger-action,
body.is-route-loading .logout-button {
  pointer-events: none;
}

@keyframes route-progress {
  0% {
    transform: scaleX(0);
  }
  55% {
    transform: scaleX(0.68);
  }
  100% {
    transform: scaleX(0.92);
  }
}

@keyframes route-progress-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.22);
  }
}

@keyframes route-fade {
  to {
    opacity: 0.58;
  }
}

.admin-sidebar {
  min-height: 0;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(11, 12, 10, 0.92);
  overflow: hidden;
}

.admin-title {
  display: block;
  margin-bottom: 30px;
  color: var(--green);
  font-weight: 900;
}

.admin-sidebar nav {
  display: grid;
  gap: 10px;
}

.nav-link {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  color: #d4d1c5;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  font-size: 14px;
}

.nav-link:hover {
  color: #f4f0df;
  border-color: rgba(216, 255, 98, 0.28);
  background: rgba(216, 255, 98, 0.12);
}

.nav-link.active {
  color: #12140d;
  background: var(--green);
}

.admin-main {
  min-width: 0;
  min-height: 0;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 36px;
  margin-bottom: 0;
  font-size: 14px;
}

.user-actions {
  display: inline-flex;
  align-items: center;
  gap: 24px;
}

.logout-button {
  min-width: 76px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #f0eee5;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  font-weight: 800;
}

.logout-button:hover {
  color: #12140d;
  border-color: rgba(216, 255, 98, 0.5);
  background: var(--green);
}

.page-heading {
  margin-top: -36px;
  margin-bottom: 18px;
  padding-right: 320px;
}

.page-heading h1 {
  margin: 0;
  font-size: 32px;
  line-height: 36px;
}

.page-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-card,
.tool-panel,
.filters,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.2);
}

.stat-card {
  padding: 24px;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 12px;
  font-size: 36px;
}

.tool-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  padding: 18px;
  margin-bottom: 16px;
}

.tool-panel .field label {
  margin-bottom: 8px;
}

.upload-panel {
  width: min(760px, 100%);
  max-width: 100%;
  margin-bottom: 16px;
}

.upload-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(216, 255, 98, 0.08), transparent 40%),
    var(--panel-soft);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.2);
}

.upload-card-header,
.upload-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.upload-card-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.upload-card-header p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.upload-limit {
  flex: 0 0 112px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid rgba(216, 255, 98, 0.28);
  border-radius: 14px;
  background: rgba(3, 4, 3, 0.34);
  text-align: center;
}

.upload-limit strong,
.upload-limit span {
  display: block;
}

.upload-limit strong {
  color: var(--green);
  font-size: 24px;
  line-height: 1.1;
}

.upload-limit span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-file-box {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(3, 4, 3, 0.38);
}

.upload-file-box label {
  margin-bottom: 10px;
}

.system-file-input {
  min-height: 42px;
  padding: 8px 10px;
  color: #f0eee5;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.system-file-input::file-selector-button {
  min-height: 30px;
  margin-right: 12px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  color: #171913;
  background: #f2f0ea;
  cursor: pointer;
  font-weight: 800;
}

.system-file-input::file-selector-button:hover {
  background: #ffffff;
}

.upload-status {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.upload-status.error {
  color: #ffd7d7;
}

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

.upload-spec-grid div {
  min-height: 76px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.upload-spec-grid span,
.upload-spec-grid strong {
  display: block;
}

.upload-spec-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-spec-grid strong {
  margin-top: 10px;
  color: #f0eee5;
  font-size: 15px;
}

.upload-file-list {
  max-height: 188px;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  overflow: auto;
  list-style: none;
}

.upload-file-list li {
  min-height: 38px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.upload-file-list span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-file-list span:last-child {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.upload-footer {
  align-items: center;
  padding-top: 2px;
}

.upload-footer .hint-line {
  max-width: 500px;
  line-height: 1.6;
}

.upload-footer .primary-action.compact {
  width: 148px;
  flex: 0 0 148px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 120px 140px 140px 100px;
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.files-filters {
  grid-template-columns: 360px 300px 140px 150px 108px 96px;
  justify-content: start;
}

.cards-filters {
  grid-template-columns: 520px 130px 140px 140px 108px 96px;
  justify-content: start;
}

.filters .status-filter {
  min-width: 0;
}

.cards-filters .card-search-filter,
.files-filters .card-code-filter {
  min-width: 0;
}

.secondary-action {
  color: #12140d;
  background: var(--green);
}

.filter-action {
  font-size: 16px;
}

.filter-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.secondary-action.slim {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 900;
}

.secondary-action.mini {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
}

.secondary-action:disabled,
.secondary-action.slim:disabled,
.danger-action:disabled {
  color: rgba(240, 238, 229, 0.45);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  cursor: not-allowed;
  box-shadow: none;
}

.danger-action {
  min-height: 40px;
  padding: 0 14px;
  color: #fff;
  background: rgba(255, 107, 107, 0.85);
}

.ghost-action {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: #f0eee5;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  font-weight: 900;
}

.ghost-action:hover {
  border-color: rgba(216, 255, 98, 0.38);
  background: rgba(216, 255, 98, 0.12);
}

.ghost-action.slim {
  min-height: 40px;
}

.ghost-action.mini {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
}

.table-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.split-actions {
  justify-content: space-between;
  align-items: center;
}

.bulk-actions,
.create-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.selected-count {
  min-width: 82px;
  color: #dcd9cc;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.bulk-status-select {
  width: 150px;
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 14px;
}

.create-actions {
  min-height: 40px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.list-form {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.files-list-form,
.cards-list-form {
  height: auto;
}

.table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(27, 29, 24, 0.96);
  backdrop-filter: blur(10px);
}

th {
  color: #c8c6bb;
  font-size: 14px;
  font-weight: 800;
}

td {
  color: #f0eee5;
}

.files-list-form table {
  table-layout: auto;
}

.cards-list-form table {
  table-layout: fixed;
  min-width: 1280px;
}

.cards-select-col {
  width: 48px;
}

.cards-seq-col {
  width: 64px;
}

.cards-code-col {
  width: auto;
}

.cards-file-count-col {
  width: 116px;
}

.cards-status-col {
  width: 92px;
}

.cards-time-col {
  width: 168px;
}

.cards-operator-col {
  width: 112px;
}

.cards-action-col {
  width: 112px;
}

.cards-list-form .copy-cell {
  max-width: 100%;
}

.cards-list-form .copy-cell .mono {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cards-list-form th,
.files-list-form th {
  white-space: nowrap;
}

.files-list-form th:nth-child(4),
.files-list-form td:nth-child(4) {
  width: 78px;
  text-align: center;
}

.files-list-form th:nth-child(5),
.files-list-form td:nth-child(5),
.files-list-form th:nth-child(7),
.files-list-form td:nth-child(7),
.files-list-form th:nth-child(8),
.files-list-form td:nth-child(8) {
  width: 168px;
  text-align: center;
}

.files-list-form th:nth-child(6),
.files-list-form td:nth-child(6) {
  width: 310px;
  text-align: center;
}

.files-list-form th:nth-child(3),
.files-list-form td:nth-child(3) {
  width: auto;
  text-align: left;
}

.mono {
  font-family: Consolas, "Courier New", monospace;
}

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

.copy-button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(216, 255, 98, 0.28);
  border-radius: 999px;
  color: #f0eee5;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.copy-button:hover {
  color: #12140d;
  background: var(--green);
}

.copy-pending-button {
  padding: 0 12px;
  color: var(--green);
  white-space: nowrap;
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.48);
  opacity: 0;
  transition: opacity 160ms ease;
}

.confirm-backdrop.open {
  opacity: 1;
}

.confirm-dialog {
  position: fixed;
  top: 33vh;
  left: 50%;
  z-index: 71;
  width: min(420px, calc(100vw - 32px));
  padding: 24px 52px 24px 24px;
  border: 1px solid rgba(216, 255, 98, 0.28);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(216, 255, 98, 0.09), rgba(18, 19, 16, 0.98) 42%), rgba(18, 19, 16, 0.98);
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translate(-50%, calc(-50% + 10px)) scale(0.98);
  transition: opacity 160ms ease, transform 160ms ease;
}

.confirm-dialog.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.confirm-dialog h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.confirm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #f0eee5;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.confirm-close:hover {
  color: #12140d;
  border-color: rgba(216, 255, 98, 0.5);
  background: var(--green);
}

.confirm-close::before,
.confirm-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}

.confirm-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.confirm-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.confirm-dialog p {
  margin: 12px 0 22px;
  color: #d4d1c5;
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

th.center,
td.center {
  text-align: center;
}

td.center .switch-form {
  display: inline-flex;
  justify-content: center;
}

.time-col {
  text-align: center;
}

.status {
  padding: 4px 10px;
  font-size: 14px;
}

.status.available {
  color: #ffe4a8;
  border-color: rgba(255, 194, 87, 0.52);
  background: rgba(255, 194, 87, 0.12);
}

.status.pending {
  color: #d9ff62;
  border-color: rgba(216, 255, 98, 0.42);
  background: rgba(216, 255, 98, 0.1);
}

.status.sold {
  color: #dfffea;
  border-color: rgba(113, 225, 162, 0.35);
}

.status.locked {
  color: #fff0c9;
  border-color: rgba(255, 194, 87, 0.4);
}

.status.voided {
  color: #ffd7d7;
  border-color: rgba(255, 107, 107, 0.42);
}

.status.account-available {
  color: #dfffea;
  border-color: rgba(113, 225, 162, 0.42);
  background: rgba(113, 225, 162, 0.1);
}

.status.account-unavailable {
  color: #ffd7d7;
  border-color: rgba(255, 107, 107, 0.42);
  background: rgba(255, 107, 107, 0.1);
}

.switch-form {
  margin: 0;
}

.toggle-switch {
  min-width: 104px;
  height: 38px;
  display: inline-grid;
  grid-template-columns: 48px auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #f0eee5;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  font-weight: 800;
  transition: border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.switch-track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 107, 107, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 160ms ease, border-color 160ms ease;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 180ms ease, background 160ms ease, box-shadow 160ms ease;
}

.toggle-switch b {
  font-size: 14px;
  min-width: 28px;
  text-align: left;
}

.toggle-switch.on {
  border-color: rgba(216, 255, 98, 0.46);
  background: rgba(216, 255, 98, 0.12);
}

.toggle-switch.on .switch-track {
  background: rgba(216, 255, 98, 0.18);
  border-color: rgba(216, 255, 98, 0.34);
}

.toggle-switch.on .switch-thumb {
  transform: translateX(20px);
  background: var(--green);
  box-shadow: 0 0 16px rgba(216, 255, 98, 0.45);
}

.toggle-switch.off {
  color: #d1cec2;
}

.toggle-switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-switch:disabled .switch-track,
.toggle-switch:disabled .switch-thumb {
  cursor: not-allowed;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.pagination {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-height: 36px;
  margin-top: 6px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 13px;
  overflow: visible;
}

.pager-links {
  display: flex;
  gap: 8px;
}

.pager-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: max-content;
}

.page-summary {
  color: var(--muted);
  white-space: nowrap;
}

.page-size-form {
  margin: 0;
}

.page-size-form select {
  min-height: 32px;
  height: 32px;
  width: 106px;
  padding: 0 10px;
  border-radius: 999px;
  line-height: 1;
  font-size: 13px;
}

.page-size-form .system-select,
.system-select[data-select-name="page_size"] {
  width: 106px;
  z-index: 6;
}

.system-select[data-select-name="page_size"].open {
  z-index: 60;
}

.page-size-form .system-select-button,
.system-select[data-select-name="page_size"] .system-select-button {
  min-height: 30px;
  height: 30px;
  padding: 0 30px 0 12px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
}

.page-size-form .system-select-button::after,
.system-select[data-select-name="page_size"] .system-select-button::after {
  right: 12px;
  width: 7px;
  height: 7px;
}

.page-size-form .system-select-panel,
.system-select[data-select-name="page_size"] .system-select-panel {
  min-width: 148px;
  right: 0;
  left: auto;
  top: auto;
  bottom: calc(100% + 8px);
}

.bulk-actions .system-select {
  width: 150px;
}

.bulk-actions .system-select-button {
  min-height: 40px;
  height: 40px;
  border-radius: 14px;
}

.pager-links a,
.pager-links span {
  min-width: 64px;
  height: 30px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
}

.pager-links a {
  color: #f0eee5;
  background: rgba(255, 255, 255, 0.04);
}

.pager-links a:hover {
  border-color: rgba(216, 255, 98, 0.38);
  background: rgba(216, 255, 98, 0.12);
}

.pager-links span {
  opacity: 0.45;
}

@media (max-width: 900px) {
  .public-shell {
    padding: 22px 18px 46px;
  }

  .extract-panel,
  .login-card {
    width: 100%;
  }

  .hero-block,
  .redeem-form {
    padding-left: 24px;
    padding-right: 24px;
  }

  .hero-desc {
    white-space: normal;
  }

  .inventory-showcase {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    margin-top: 22px;
  }

  .format-grid,
  .stats-grid,
  .admin-shell,
  .tool-panel,
  .filters,
  .upload-spec-grid {
    grid-template-columns: 1fr;
  }

  .upload-card {
    padding: 16px;
  }

  .upload-card-header,
  .upload-footer {
    display: grid;
  }

  .upload-limit,
  .upload-footer .primary-action.compact {
    width: 100%;
    flex-basis: auto;
  }

  .admin-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .admin-main {
    padding: 18px;
    overflow: visible;
  }

  .admin-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .page-heading {
    margin-top: 20px;
    padding-right: 0;
  }

  .page-heading h1 {
    font-size: 30px;
    line-height: 1.2;
  }

  .page-heading p {
    line-height: 1.55;
  }

  .system-select.open .system-select-panel {
    position: static;
    margin-top: 8px;
  }
}
