:root {
  color-scheme: light;
  --ink: #1d130d;
  --muted: #735f4a;
  --line: #dfc58e;
  --panel: #fff8e6;
  --surface: #fff0c9;
  --brand: #e00812;
  --brand-strong: #a90008;
  --accent: #f5bf24;
  --gold: #b87927;
  --danger: #8f1719;
  --charcoal: #15100c;
  --shadow: 0 16px 42px rgba(79, 24, 10, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(213, 0, 8, 0.96) 0 26%, rgba(255, 244, 215, 0.94) 26% 100%),
    linear-gradient(180deg, rgba(255, 251, 239, 0.52), rgba(255, 237, 191, 0.86)),
    url("/assets/jojo-menu.jpg");
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 247, 224, 0.2), rgba(94, 15, 8, 0.08)),
    url("/assets/dessert-pattern.svg");
  background-size: auto, 360px;
  mix-blend-mode: multiply;
  opacity: 0.38;
}

button,
input,
select {
  font: inherit;
}

button,
.file-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

button:hover,
.file-button:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
}

button.secondary,
.secondary {
  border: 1px solid var(--line);
  background: #fff5dc;
  color: var(--ink);
}

button.secondary:hover,
.secondary:hover {
  background: #ffe8aa;
}

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

.is-hidden {
  display: none !important;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fffdf4;
  color: var(--ink);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

code {
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 18px 0 22px;
  border: 2px solid rgba(29, 19, 13, 0.88);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 248, 230, 0.95);
  box-shadow: var(--shadow);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: clamp(118px, 17vw, 170px);
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(224, 8, 18, 0.16);
  background: #fffdf5;
  box-shadow: 0 10px 26px rgba(124, 13, 9, 0.12);
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}

p {
  margin: 0;
}

.brand-block p,
.muted,
.helper-text {
  color: var(--muted);
}

.warning-text {
  color: var(--danger);
}

.session-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 248, 230, 0.84);
}

.tab {
  background: transparent;
  color: var(--muted);
  min-height: 36px;
  padding: 0 14px;
}

.tab:hover,
.tab.is-active {
  color: #fff;
  background: var(--brand);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.login-layout {
  min-height: min(680px, calc(100vh - 136px));
  display: grid;
  grid-template-columns: minmax(320px, 1.08fr) minmax(320px, 0.92fr);
  gap: 18px;
  align-items: stretch;
}

.login-hero,
.login-panel {
  min-height: 430px;
}

.login-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  border: 2px solid var(--charcoal);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 42px);
  color: #fff;
  background:
    linear-gradient(180deg, rgba(224, 8, 18, 0.98), rgba(161, 0, 8, 0.95)),
    url("/assets/dessert-pattern.svg");
  background-size: auto, 300px;
  box-shadow: var(--shadow);
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 241, 184, 0.45);
  border-radius: 8px;
  pointer-events: none;
}

.login-hero .pill {
  align-self: flex-start;
  color: #3a210d;
  border-color: rgba(255, 226, 121, 0.75);
  background: #ffe08b;
}

.login-hero h2 {
  margin: 0;
  max-width: 650px;
  font-size: clamp(2.2rem, 5vw, 4.65rem);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 3px 0 rgba(21, 16, 12, 0.28);
}

.login-hero p {
  max-width: 620px;
  line-height: 1.65;
  color: rgba(255, 250, 232, 0.92);
}

.hero-menu-art {
  width: 100%;
  height: clamp(170px, 28vw, 310px);
  object-fit: cover;
  object-position: center;
  border: 2px solid rgba(255, 246, 216, 0.82);
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(21, 16, 12, 0.24);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.role-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffe9ad;
}

.role-option {
  min-width: 0;
  color: var(--muted);
  background: transparent;
}

.role-option:hover,
.role-option.is-active {
  color: #fff;
  background: var(--brand);
}

.login-form {
  display: none;
}

.login-form:not(.is-active) {
  display: none;
}

.login-form.is-active {
  display: grid;
}

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

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.panel-grid {
  display: grid;
  gap: 16px;
}

.member-dashboard-grid {
  grid-template-columns: 1fr;
}

.admin-grid {
  grid-template-columns: minmax(250px, 0.8fr) minmax(300px, 1fr);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}

.admin-section {
  display: none;
}

.admin-section.is-active {
  display: block;
}

.management-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
}

.management-stats-panel,
.member-list-panel {
  grid-column: 1 / -1;
}

.management-create-panel,
.member-detail-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  border-radius: 0;
  padding: min(5vw, 36px);
  background: rgba(36, 24, 21, 0.48);
}

.management-create-panel.is-open,
.member-detail-panel.is-open {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
}

.management-create-panel:not(.is-open),
.member-detail-panel:not(.is-open) {
  display: none !important;
}

.management-create-panel > *,
.member-detail-panel > * {
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.management-create-panel > .section-title,
.member-detail-panel > .section-title,
.management-create-panel > form,
.member-detail-panel > .member-detail-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(36, 24, 21, 0.22);
}

.management-create-panel > .section-title,
.member-detail-panel > .section-title {
  margin-top: 32px;
  padding: 14px;
}

.management-create-panel > form {
  padding: 16px;
}

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

.stats-grid > div,
.member-detail-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.stats-grid strong {
  display: block;
  font-size: 1.35rem;
}

.stats-chart {
  min-height: 210px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.stats-chart svg {
  width: 100%;
  height: 210px;
  display: block;
}

.availability-mark {
  display: inline-block;
  margin-left: 8px;
  font-weight: 800;
}

.availability-mark.is-ok {
  color: #008d59;
}

.availability-mark.is-bad {
  color: var(--brand);
}

.management-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, auto) minmax(120px, auto) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.member-table {
  display: grid;
  gap: 6px;
}

.member-table-head,
.member-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) minmax(120px, 1fr) minmax(90px, 0.7fr) minmax(70px, 0.5fr) minmax(110px, 0.8fr);
  gap: 10px;
  align-items: center;
}

.member-table-head {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0 12px;
}

.member-row {
  width: 100%;
  text-align: left;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.member-row:hover {
  border-color: rgba(222, 41, 16, 0.34);
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.detail-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.detail-summary img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 3px solid #fff4d8;
}

.mini-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 14px;
}

.mini-list > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.52);
}

@media (max-width: 760px) {
  .management-grid,
  .management-filters,
  .stats-grid,
  .member-table-head,
  .member-row {
    grid-template-columns: 1fr;
  }

  .member-table-head {
    display: none;
  }

  .detail-summary {
    grid-template-columns: 1fr;
  }
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 248, 230, 0.96);
  box-shadow: var(--shadow);
  padding: 18px;
}

.ledger-panel,
.wide,
.member-status-panel {
  grid-column: 1 / -1;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  font-weight: 750;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #7c120c;
  background: #ffe7a3;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}

.form-stack {
  display: grid;
  gap: 12px;
}

#signupForm > label:not(:has(input)) {
  display: none;
}

.form-stack.compact {
  gap: 10px;
}

.helper-text {
  font-size: 0.88rem;
  line-height: 1.5;
}

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

.file-button input {
  display: none;
}

.member-card,
.member-status-panel {
  display: grid;
  gap: 18px;
}

.member-status-panel {
  padding: clamp(18px, 4vw, 32px);
}

.member-status-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(18px, 4vw, 34px);
  align-items: center;
}

.member-status-main > img {
  width: clamp(150px, 22vw, 220px);
  height: clamp(150px, 22vw, 220px);
  object-fit: cover;
  border-radius: 8px;
  border: 5px solid #fff4d8;
  box-shadow: var(--shadow);
}

.member-status-copy {
  display: grid;
  gap: 16px;
}

.member-status-copy h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: 0;
}

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

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

.member-facts > div,
.redeem-code-card,
.admin-code-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.member-visual {
  display: flex;
  align-items: center;
  gap: 16px;
}

.member-visual img {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 8px;
  border: 3px solid #fff4d8;
  box-shadow: var(--shadow);
}

.admin-member-info {
  display: grid;
  gap: 14px;
}

.admin-member-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.admin-member-main img {
  width: clamp(170px, 18vw, 220px);
  height: clamp(170px, 18vw, 220px);
  object-fit: cover;
  border-radius: 8px;
  border: 4px solid #fff4d8;
  box-shadow: var(--shadow);
}

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

.admin-detail-grid > div {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.admin-detail-grid strong {
  display: block;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 12px 0 4px;
}

.status-text {
  font-size: 1.2rem;
  font-weight: 800;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-row > div,
.token-box,
.risk-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.metric-label,
.token-box span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.metric-row strong {
  font-size: 1.55rem;
}

.member-facts strong {
  display: block;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  overflow-wrap: anywhere;
}

.redeem-code-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.redeem-code-card code,
.admin-code-box code {
  display: block;
  margin-top: 4px;
  font-size: clamp(2rem, 6vw, 4.4rem);
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
  color: var(--brand);
}

.admin-code-box {
  display: grid;
  gap: 4px;
}

.admin-code-box.is-muted code {
  font-size: 1rem;
  color: var(--muted);
}

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

.check-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check-line input {
  width: 18px;
  min-height: 18px;
}

.overwrite-check-line {
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid rgba(221, 17, 17, 0.22);
  border-radius: 8px;
  background: rgba(255, 247, 243, 0.9);
}

.clover-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.clover-steps div {
  min-height: 96px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.clover-steps strong {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: var(--brand);
}

.clover-steps span {
  line-height: 1.45;
}

.ledger-list {
  display: grid;
  gap: 10px;
}

.ledger-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffdf4;
}

.ledger-item p {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.9rem;
}

.ledger-numbers {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--muted);
}

.ledger-numbers span {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 800;
}

.ledger-numbers .positive {
  color: var(--brand-strong);
}

.ledger-numbers .negative {
  color: var(--danger);
}

.empty-state {
  min-height: 96px;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 27, 0.42);
}

.modal {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  border-radius: 8px;
  padding: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.modal h2 {
  margin: 0;
  font-size: 1.35rem;
}

.modal p {
  color: var(--muted);
  line-height: 1.55;
}

.clover-payment-modal {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 28px));
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid rgba(0, 141, 89, 0.28);
  background: #f8fffb;
}

.clover-checkout-modal {
  width: min(460px, 100%);
  border: 1px solid rgba(0, 141, 89, 0.24);
  background: #f8fffb;
}

.checkout-progress {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9f5e7;
}

.checkout-progress::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: #008d59;
  animation: checkout-progress 1.1s ease-in-out infinite;
}

@keyframes checkout-progress {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(250%);
  }
}

.clover-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -20px -20px 0;
  padding: 14px 20px;
  color: #ffffff;
  background: linear-gradient(135deg, #008d59, #00b36b);
}

.clover-modal-header h2,
.clover-modal-header p {
  color: #ffffff;
}

.clover-secure-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  margin-bottom: 4px;
  color: #00422a;
  background: #c9f6df;
  font-size: 0.78rem;
  font-weight: 800;
}

.clover-lock {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  padding: 10px 12px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 850;
}

.clover-trust-box {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(0, 141, 89, 0.22);
  border-radius: 8px;
  padding: 9px 10px;
  color: #13412d;
  background: #eafff2;
}

.clover-trust-box strong {
  color: #00422a;
}

.clover-trust-box span {
  line-height: 1.45;
  font-size: 0.84rem;
}

.clover-payment-modal .form-stack {
  gap: 8px;
}

.clover-payment-modal label {
  gap: 4px;
}

.clover-payment-modal .check-line {
  align-items: flex-start;
  font-size: 0.84rem;
  line-height: 1.35;
}

.clover-subscription-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid rgba(0, 141, 89, 0.2);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.clover-subscription-summary > div {
  border: 1px solid rgba(0, 141, 89, 0.16);
  border-radius: 8px;
  padding: 9px;
  background: #f2fff8;
}

.clover-subscription-summary strong {
  display: block;
  overflow-wrap: anywhere;
}

.clover-subscription-summary p,
.clover-subscription-summary .form-actions {
  grid-column: 1 / -1;
}

.clover-card-grid {
  display: grid;
  gap: 6px;
}

.clover-card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.5fr);
  gap: 8px;
}

.clover-card-field {
  width: 100%;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #ffffff;
}

.clover-card-field:focus-within {
  border-color: #008d59;
  box-shadow: 0 0 0 3px rgba(0, 141, 89, 0.16);
}

.clover-card-field iframe {
  width: 100% !important;
  height: 42px !important;
  min-height: 42px !important;
  display: block;
}

.clover-payment-modal #cloverPaySubmitBtn {
  background: #008d59;
}

.clover-payment-modal #cloverPaySubmitBtn:hover {
  background: #007247;
}

.clover-payment-modal .secondary {
  border-color: rgba(0, 141, 89, 0.28);
  background: #eefbf4;
}

.input-errors {
  min-height: 14px;
  color: var(--danger);
  font-size: 0.78rem;
  line-height: 1.2;
}

.clover-payment-modal .input-errors:empty {
  min-height: 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  background: var(--brand);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: var(--danger);
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .topbar,
  .brand-block {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .tabs {
    width: 100%;
  }

  .session-actions {
    width: 100%;
    justify-content: space-between;
  }

  .tab {
    flex: 1;
  }

  .login-layout,
  .member-dashboard-grid,
  .admin-grid,
  .clover-steps,
  .triple,
  .metric-row,
  .member-status-main,
  .admin-member-main,
  .admin-detail-grid,
  .member-facts,
  .profile-grid,
  .redeem-code-card,
  .clover-card-row,
  .code-row {
    grid-template-columns: 1fr;
  }

  .login-layout {
    min-height: auto;
  }

  .login-hero,
  .login-panel {
    min-height: auto;
  }

  .member-status-main > img {
    width: 156px;
    height: 156px;
  }

  .admin-member-main img {
    width: 170px;
    height: 170px;
  }

  .redeem-code-card button,
  .code-row button {
    width: 100%;
  }

  .ledger-item {
    grid-template-columns: 1fr;
  }

  .ledger-numbers {
    justify-items: start;
  }
}

/* Premium red membership system theme */
:root {
  --ink: #211411;
  --muted: #8d7569;
  --line: rgba(194, 145, 86, 0.24);
  --panel: #fff7e8;
  --surface: #fff1d2;
  --brand: #c90614;
  --brand-strong: #8e030b;
  --accent: #d8a85b;
  --gold: #c99345;
  --danger: #9f1620;
  --charcoal: #120b0a;
  --shadow: 0 24px 70px rgba(32, 8, 7, 0.24);
  --soft-shadow: 0 12px 34px rgba(50, 13, 10, 0.16);
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(201, 6, 20, 0.38), transparent 34%),
    linear-gradient(105deg, rgba(18, 11, 10, 0.94) 0 42%, rgba(72, 7, 10, 0.82) 56%, rgba(18, 11, 10, 0.96) 100%),
    url("/assets/jojo-membership-hero.png");
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
}

body::before {
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 238, 202, 0.08), rgba(13, 7, 6, 0.38)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 92px);
  opacity: 1;
  mix-blend-mode: normal;
}

.app-shell {
  width: min(1240px, calc(100% - 40px));
  padding-top: 18px;
}

.topbar {
  margin: 8px 0 22px;
  border: 1px solid rgba(226, 181, 112, 0.28);
  padding: 14px 16px;
  color: #fff7e8;
  background: rgba(18, 11, 10, 0.58);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.brand-block {
  min-width: 0;
}

.brand-mark {
  width: clamp(122px, 14vw, 156px);
  border: 1px solid rgba(255, 239, 205, 0.18);
  background: rgba(255, 248, 235, 0.96);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

h1 {
  color: inherit;
  font-size: clamp(1.35rem, 2.4vw, 2.05rem);
  font-weight: 850;
}

.brand-block p,
.topbar .muted {
  color: rgba(255, 238, 202, 0.72);
}

.topbar .secondary {
  border-color: rgba(255, 228, 175, 0.24);
  color: #fff7e8;
  background: rgba(255, 255, 255, 0.08);
}

button,
.file-button {
  min-height: 44px;
  border: 1px solid rgba(255, 214, 142, 0.16);
  border-radius: 8px;
  color: #fffaf1;
  background: linear-gradient(180deg, #e30a18, #a7040d);
  box-shadow: 0 12px 28px rgba(167, 4, 13, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

button:hover,
.file-button:hover {
  background: linear-gradient(180deg, #f01522, #92040c);
  box-shadow: 0 16px 34px rgba(167, 4, 13, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

button.secondary,
.secondary {
  border-color: rgba(153, 87, 45, 0.18);
  color: #3b2119;
  background: linear-gradient(180deg, #fff9ec, #f4dfb7);
  box-shadow: none;
}

button.secondary:hover,
.secondary:hover {
  background: linear-gradient(180deg, #fff4dc, #edcc91);
}

input,
select,
.clover-card-field {
  min-height: 46px;
  border-color: rgba(120, 58, 34, 0.18);
  background: rgba(255, 253, 247, 0.94);
  box-shadow: inset 0 1px 0 rgba(72, 28, 18, 0.04);
}

input:focus,
select:focus {
  outline: 0;
  border-color: rgba(201, 6, 20, 0.52);
  box-shadow: 0 0 0 4px rgba(201, 6, 20, 0.11);
}

label {
  color: #6f574d;
  font-weight: 650;
}

.login-layout {
  min-height: min(720px, calc(100vh - 132px));
  grid-template-columns: minmax(340px, 0.9fr) minmax(360px, 0.64fr);
  gap: clamp(18px, 3vw, 30px);
  align-items: stretch;
}

.login-hero {
  min-height: 590px;
  border: 1px solid rgba(226, 181, 112, 0.24);
  padding: clamp(28px, 5vw, 58px);
  justify-content: flex-end;
  color: #fff7e8;
  background:
    linear-gradient(90deg, rgba(18, 11, 10, 0.82) 0 38%, rgba(18, 11, 10, 0.28) 68%, rgba(18, 11, 10, 0.04) 100%),
    url("/assets/jojo-membership-hero.png");
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.login-hero::before {
  inset: 16px;
  border-color: rgba(226, 181, 112, 0.22);
}

.login-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(18, 11, 10, 0.72));
}

.hero-copy,
.hero-stat-grid {
  position: relative;
  z-index: 1;
}

.login-hero .pill,
.pill {
  border-color: rgba(216, 168, 91, 0.34);
  color: #7d140f;
  background: linear-gradient(180deg, #ffe9ae, #e5ba66);
}

.login-hero h2 {
  max-width: 640px;
  margin-top: 18px;
  font-size: clamp(2.5rem, 5vw, 4.45rem);
  font-weight: 900;
  line-height: 1.02;
  text-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
}

.login-hero p {
  max-width: 500px;
  margin-top: 18px;
  color: rgba(255, 244, 222, 0.82);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
}

.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 34px;
  max-width: 680px;
}

.hero-stat-grid div {
  min-height: 92px;
  border: 1px solid rgba(226, 181, 112, 0.22);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 247, 232, 0.09);
  backdrop-filter: blur(14px);
}

.hero-stat-grid span,
.eyebrow {
  display: block;
  color: rgba(255, 226, 174, 0.76);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-stat-grid strong {
  display: block;
  margin-top: 8px;
  color: #fff8eb;
  font-size: clamp(1.05rem, 2vw, 1.42rem);
}

.hero-menu-art {
  display: none;
}

.login-panel {
  justify-content: center;
  gap: 18px;
  border: 1px solid rgba(226, 181, 112, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 249, 237, 0.96), rgba(255, 239, 205, 0.92)),
    radial-gradient(circle at 100% 0, rgba(201, 6, 20, 0.1), transparent 30%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: clamp(22px, 3vw, 32px);
}

.login-panel-heading {
  display: grid;
  gap: 8px;
}

.login-panel-heading .eyebrow {
  color: #a8422b;
}

.login-panel-heading h2 {
  margin: 0;
  color: #2b1510;
  font-size: clamp(1.5rem, 3vw, 2.35rem);
  line-height: 1.04;
}

.login-panel-heading p {
  color: var(--muted);
  line-height: 1.55;
}

.role-switch {
  border: 1px solid rgba(102, 43, 25, 0.14);
  background: rgba(68, 23, 17, 0.08);
}

.role-option {
  color: #7b6258;
  box-shadow: none;
}

.role-option:hover,
.role-option.is-active {
  color: #fff8ec;
  background: linear-gradient(180deg, #d90815, #9e030b);
}

.panel {
  border-color: rgba(194, 145, 86, 0.25);
  background: rgba(255, 248, 232, 0.94);
  box-shadow: var(--soft-shadow);
}

.member-status-panel {
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0.95), rgba(255, 235, 192, 0.9)),
    radial-gradient(circle at 100% 0, rgba(201, 6, 20, 0.12), transparent 30%);
}

.member-facts > div,
.redeem-code-card,
.admin-code-box,
.admin-detail-grid > div,
.metric-row > div,
.token-box,
.risk-line,
.clover-steps div {
  border-color: rgba(194, 145, 86, 0.22);
  background: rgba(255, 245, 222, 0.82);
}

.redeem-code-card code,
.admin-code-box code {
  color: var(--brand-strong);
}

.ledger-item {
  border-color: rgba(194, 145, 86, 0.18);
  background: rgba(255, 253, 247, 0.88);
}

.modal-backdrop {
  background: rgba(18, 11, 10, 0.62);
  backdrop-filter: blur(8px);
}

.modal {
  border: 1px solid rgba(226, 181, 112, 0.28);
  background: #fff7e8;
}

.toast {
  background: linear-gradient(180deg, #d90815, #94030b);
}

@media (max-width: 920px) {
  .app-shell {
    width: min(100% - 24px, 1240px);
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: 560px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .brand-block {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .brand-block {
    gap: 12px;
  }

  .brand-mark {
    width: 118px;
  }

  .login-hero {
    min-height: 540px;
    padding: 24px;
    background-position: 58% center;
  }

  .login-hero h2 {
    font-size: clamp(2.5rem, 14vw, 4.2rem);
  }

  .hero-stat-grid {
    grid-template-columns: 1fr;
  }

  .hero-stat-grid div {
    min-height: 74px;
  }
}

/* Light minimalist China-red membership theme */
:root {
  --ink: #241815;
  --muted: #74645f;
  --line: rgba(222, 41, 16, 0.14);
  --panel: #ffffff;
  --surface: #fff8f3;
  --brand: #de2910;
  --brand-strong: #b81f0b;
  --accent: #ffde00;
  --gold: #d6a642;
  --danger: #a91512;
  --charcoal: #241815;
  --shadow: 0 22px 56px rgba(116, 32, 18, 0.12);
  --soft-shadow: 0 10px 32px rgba(116, 32, 18, 0.08);
}

body {
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(222, 41, 16, 0.08) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, #fffefd 0%, #fff6ef 48%, #ffffff 100%);
  background-size: 88px 100%, auto;
}

body::before {
  background:
    radial-gradient(circle at 12% 12%, rgba(222, 41, 16, 0.12), transparent 28%),
    radial-gradient(circle at 86% 4%, rgba(255, 222, 0, 0.16), transparent 18%);
  opacity: 1;
  mix-blend-mode: normal;
}

.app-shell {
  width: min(1180px, calc(100% - 44px));
  padding-top: 18px;
}

.topbar {
  margin: 6px 0 26px;
  border: 1px solid rgba(222, 41, 16, 0.1);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(16px);
}

.brand-mark {
  width: clamp(118px, 12vw, 150px);
  border: 0;
  background: #ffffff;
  box-shadow: none;
}

.brand-block p,
.topbar .muted,
.muted,
.helper-text {
  color: var(--muted);
}

.topbar .secondary {
  border-color: rgba(222, 41, 16, 0.14);
  color: var(--brand);
  background: #fff5f2;
}

button,
.file-button {
  min-height: 44px;
  border: 1px solid rgba(222, 41, 16, 0.08);
  color: #ffffff;
  background: var(--brand);
  box-shadow: 0 10px 24px rgba(222, 41, 16, 0.18);
}

button:hover,
.file-button:hover {
  background: var(--brand-strong);
  box-shadow: 0 14px 28px rgba(222, 41, 16, 0.22);
}

button.secondary,
.secondary {
  border-color: rgba(222, 41, 16, 0.14);
  color: var(--brand);
  background: #fff7f4;
  box-shadow: none;
}

button.secondary:hover,
.secondary:hover {
  background: #ffece6;
}

input,
select,
.clover-card-field {
  border-color: rgba(36, 24, 21, 0.12);
  background: #ffffff;
  box-shadow: none;
}

input:focus,
select:focus {
  border-color: rgba(222, 41, 16, 0.58);
  box-shadow: 0 0 0 4px rgba(222, 41, 16, 0.1);
}

label {
  color: #675752;
  font-weight: 650;
}

.login-layout {
  min-height: min(700px, calc(100vh - 132px));
  grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 0.72fr);
  gap: clamp(18px, 3vw, 32px);
}

.login-hero {
  min-height: 560px;
  border: 1px solid rgba(222, 41, 16, 0.1);
  color: var(--ink);
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 244, 0.92)),
    radial-gradient(circle at 90% 10%, rgba(222, 41, 16, 0.08), transparent 34%);
  box-shadow: var(--soft-shadow);
  isolation: isolate;
}

.login-hero::before {
  inset: auto -18% -34%;
  width: 72%;
  height: 72%;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  opacity: 0.08;
}

.login-hero::after {
  content: "就酱";
  position: absolute;
  right: clamp(18px, 5vw, 54px);
  bottom: clamp(18px, 5vw, 54px);
  height: auto;
  color: rgba(222, 41, 16, 0.045);
  background: none;
  font-size: clamp(5.5rem, 16vw, 13rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.82;
  pointer-events: none;
  z-index: -1;
}

.hero-copy,
.hero-stat-grid {
  z-index: 1;
}

.login-hero .pill,
.pill {
  border: 1px solid rgba(222, 41, 16, 0.12);
  color: var(--brand);
  background: #fff2ee;
}

.login-hero h2 {
  max-width: 620px;
  margin-top: 18px;
  color: var(--brand);
  font-size: clamp(2.7rem, 5.4vw, 5rem);
  font-weight: 900;
  line-height: 1.02;
  text-shadow: none;
}

.login-hero p {
  max-width: 540px;
  color: #5f4c45;
  font-size: clamp(1rem, 1.5vw, 1.1rem);
}

.hero-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 38px;
}

.hero-stat-grid div {
  min-height: 94px;
  border: 1px solid rgba(222, 41, 16, 0.1);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
  backdrop-filter: none;
}

.hero-stat-grid span,
.eyebrow {
  color: var(--brand);
  letter-spacing: 0.1em;
}

.hero-stat-grid strong {
  color: var(--ink);
}

.login-panel {
  border: 1px solid rgba(222, 41, 16, 0.1);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.login-panel-heading .eyebrow {
  color: var(--brand);
}

.login-panel-heading h2 {
  color: var(--ink);
}

.role-switch {
  border-color: rgba(222, 41, 16, 0.12);
  background: #fff6f3;
}

.role-option {
  color: #826b63;
}

.role-option:hover,
.role-option.is-active {
  color: #ffffff;
  background: var(--brand);
}

.panel {
  border-color: rgba(222, 41, 16, 0.1);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--soft-shadow);
}

.member-status-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 246, 241, 0.94)),
    radial-gradient(circle at 100% 0, rgba(222, 41, 16, 0.07), transparent 28%);
}

.member-facts > div,
.redeem-code-card,
.admin-code-box,
.admin-detail-grid > div,
.metric-row > div,
.token-box,
.risk-line,
.clover-steps div {
  border-color: rgba(222, 41, 16, 0.09);
  background: #fff8f5;
}

.redeem-code-card code,
.admin-code-box code,
.ledger-numbers .positive {
  color: var(--brand);
}

.ledger-item {
  border-color: rgba(222, 41, 16, 0.08);
  background: #ffffff;
}

.modal-backdrop {
  background: rgba(36, 24, 21, 0.18);
  backdrop-filter: blur(10px);
}

.modal {
  border-color: rgba(222, 41, 16, 0.12);
  background: #ffffff;
}

.toast {
  background: var(--brand);
}

.clover-payment-modal,
.clover-checkout-modal {
  background: #ffffff;
}

@media (max-width: 920px) {
  .login-layout {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .login-panel {
    min-height: auto;
  }

  .login-hero {
    min-height: 500px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
  }

  .login-hero {
    min-height: 500px;
    padding: 24px;
  }

  .login-hero h2 {
    font-size: clamp(2.6rem, 13vw, 4.15rem);
  }

  .hero-stat-grid {
    grid-template-columns: 1fr;
  }
}

.split-actions {
  justify-content: flex-start;
}

.link-button {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  box-shadow: none;
  font-weight: 700;
  text-align: left;
}

.link-button:hover {
  background: transparent;
  text-decoration: underline;
  transform: none;
  box-shadow: none;
}

#openSignupModalBtn {
  margin-left: auto;
}

.signup-modal {
  width: min(520px, 100%);
}

.availability-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.availability-field input {
  min-width: 0;
}

.availability-mark {
  display: inline-grid;
  place-items: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  margin-left: 0;
  border-radius: 999px;
  font-size: 0.88rem;
  line-height: 1;
  font-weight: 900;
}

.availability-mark:empty {
  visibility: hidden;
}

.availability-mark.is-ok {
  color: #008d59;
  background: rgba(0, 141, 89, 0.08);
}

.availability-mark.is-bad {
  color: var(--brand);
  background: rgba(222, 41, 16, 0.08);
}

.overwrite-phone-prompt {
  display: flex;
  width: 100%;
  min-height: auto;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(222, 41, 16, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--brand);
  background: rgba(255, 247, 243, 0.96);
  box-shadow: none;
  text-align: left;
}

.overwrite-phone-prompt::after {
  content: "验证";
  color: #8c241d;
  font-weight: 750;
}

.signup-modal .eyebrow {
  color: var(--brand);
}

.signup-modal h2 {
  margin: 6px 0 8px;
}

input:disabled {
  color: #7f706b;
  background: #f7f1ee;
  cursor: not-allowed;
}

.session-booting .view {
  display: none !important;
}

.staff-management-panel {
  grid-column: 1 / -1;
}

.panel.management-create-panel,
.panel.member-detail-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  border-radius: 0;
  padding: min(5vw, 36px);
  background: rgba(36, 24, 21, 0.48);
}

.panel.management-create-panel.is-open,
.panel.member-detail-panel.is-open {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
}

.panel.management-create-panel:not(.is-open),
.panel.member-detail-panel:not(.is-open) {
  display: none !important;
}

.panel.management-create-panel > *,
.panel.member-detail-panel > * {
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.panel.management-create-panel > .section-title,
.panel.member-detail-panel > .section-title,
.panel.management-create-panel > form,
.panel.member-detail-panel > .member-detail-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(36, 24, 21, 0.22);
}

.panel.management-create-panel > .section-title,
.panel.member-detail-panel > .section-title {
  margin-top: 32px;
  padding: 14px;
}

.panel.management-create-panel > form {
  padding: 16px;
}

#adminMemberActionModal,
#adminStaffModal,
#operationStatusModal {
  z-index: 80;
}

#operationStatusModal.is-error .modal {
  border-color: rgba(185, 28, 28, 0.28);
}

.status-modal {
  width: min(420px, 100%);
  text-align: center;
}

.status-modal h2 {
  margin: 0 0 8px;
}

[data-go-login] {
  display: none;
}
