.presale-workbench {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background:
    linear-gradient(120deg, rgba(230, 246, 252, 0.72), rgba(250, 239, 215, 0.42)),
    var(--bg);
}

.presale-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  color: #eef7fb;
  background:
    linear-gradient(180deg, rgba(12, 31, 42, 0.96), rgba(15, 49, 62, 0.94)),
    url("./assets/visuals/home-store-master.jpg") center / cover;
}

.presale-login-card,
.presale-user-card {
  display: grid;
  gap: 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  padding: 16px;
}

.presale-login-card[hidden],
.presale-user-card[hidden] {
  display: none;
}

.presale-login-card span,
.presale-user-card span {
  color: rgba(238, 247, 251, 0.66);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.presale-login-card h1 {
  margin: 0;
  font-size: 24px;
}

.presale-login-card p,
.presale-user-card p {
  margin: 0;
  color: rgba(238, 247, 251, 0.72);
  line-height: 1.65;
}

.presale-login-card form {
  display: grid;
  gap: 10px;
}

.presale-login-card label {
  display: grid;
  gap: 7px;
  color: rgba(238, 247, 251, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.presale-login-card input {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #102b37;
  color: #fff;
  padding: 8px 10px;
}

.demo-account-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.demo-account-list button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #eef7fb;
}

.presale-main {
  padding: 26px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.presale-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.presale-topbar h2 {
  margin: 4px 0 6px;
  font-size: 28px;
}

.presale-topbar span {
  color: var(--muted);
  font-weight: 700;
}

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

.report-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.presale-metrics article,
.presale-panel,
.presale-op-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 16px;
}

.presale-metrics article {
  display: grid;
  gap: 6px;
}

.presale-metrics span,
.presale-op-card span,
.presale-op-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.presale-metrics strong {
  color: var(--primary-dark);
  font-size: 26px;
}

.presale-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.presale-panel {
  display: none;
}

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

.sub-section-title {
  margin-top: 8px;
}

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

.presale-op-card {
  display: grid;
  gap: 12px;
}

.presale-op-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.presale-op-card h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.presale-op-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.presale-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
}

.presale-detail-grid b {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.presale-evidence-form,
.presale-action-row,
.presale-inline-form {
  display: grid;
  gap: 9px;
}

.presale-evidence-form label,
.presale-inline-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.presale-evidence-form input,
.presale-inline-form input,
.presale-inline-form select {
  min-height: 38px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

.presale-inline-form {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

.presale-inline-form .checkbox-line {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.presale-inline-form .checkbox-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
}

.booking-form {
  grid-template-columns: 1.4fr 1fr 1.3fr 0.7fr auto;
}

.customer-form {
  grid-template-columns: 1fr 1fr 1fr 0.8fr auto;
}

.product-form {
  grid-template-columns: 1.2fr 0.75fr 0.65fr 0.65fr 0.65fr 0.7fr;
}

.product-form .wide-field {
  grid-column: span 4;
}

.course-session-form {
  grid-template-columns: 1.3fr 1fr 1.1fr 1.2fr 0.6fr auto;
}

.course-template-form {
  grid-template-columns: 1.3fr 0.8fr 0.9fr 0.7fr 0.7fr 0.9fr;
}

.course-template-form .wide-field {
  grid-column: span 3;
}

.template-role-options {
  display: grid;
  grid-column: span 5;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.template-role-options label {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  color: var(--ink);
}

.template-role-options input {
  min-height: 16px;
  width: 16px;
  padding: 0;
}

.subscription-config-card textarea,
.subscription-config-card select,
.subscription-config-card input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

.subscription-config-card textarea {
  min-height: 72px;
  resize: vertical;
}

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

.subscription-config-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.subscription-config-card .wide-config-label,
.subscription-config-card .checkbox-line {
  grid-column: 1 / -1;
}

.subscription-config-card .checkbox-line {
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: start;
}

.subscription-config-card .checkbox-line input {
  width: 18px;
  min-height: 18px;
}

.presale-action-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.presale-action-row .wide-action {
  grid-column: span 3;
}

.ledger-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.ledger-columns h3 {
  margin: 0 0 10px;
  color: var(--primary-dark);
}

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

.ledger-card .presale-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1000px) {
  .presale-workbench {
    grid-template-columns: 1fr;
  }

  .presale-rail {
    position: static;
    height: auto;
  }

  .presale-card-grid,
  .presale-metrics,
  .presale-inline-form,
  .course-template-form,
  .template-role-options,
  .course-session-form,
  .booking-form,
  .customer-form,
  .ledger-columns {
    grid-template-columns: 1fr;
  }
}

/* Client-state aligned polish: keep the staff console dense, but make it feel like the same product as the final member screens. */
.presale-workbench {
  --staff-ink: #17251f;
  --staff-muted: #68736d;
  --staff-soft: #fffaf2;
  --staff-paper: rgba(255, 253, 248, 0.9);
  --staff-paper-strong: rgba(255, 255, 255, 0.96);
  --staff-line: rgba(202, 163, 91, 0.22);
  --staff-teal: #0f615d;
  --staff-teal-soft: rgba(236, 250, 246, 0.72);
  --staff-gold: #caa15b;
  --staff-shadow: 0 18px 44px rgba(66, 48, 19, 0.1);
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 246, 221, 0.88), transparent 28%),
    linear-gradient(115deg, rgba(255, 253, 248, 0.98), rgba(238, 250, 246, 0.86) 48%, rgba(255, 246, 226, 0.9)),
    #fffaf2;
  color: var(--staff-ink);
}

.presale-rail {
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(18, 43, 37, 0.96), rgba(13, 57, 55, 0.92)),
    linear-gradient(135deg, rgba(202, 163, 91, 0.22), transparent 42%),
    url("./assets/visuals/home-store-master.jpg") center / cover;
  box-shadow: 12px 0 34px rgba(23, 37, 31, 0.14);
}

.presale-rail::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(105deg, transparent 0 45%, rgba(255, 255, 255, 0.08) 46% 52%, transparent 53%),
    linear-gradient(180deg, transparent 0 74%, rgba(202, 163, 91, 0.12));
}

.presale-rail > * {
  position: relative;
  z-index: 1;
}

.brand-block {
  padding-bottom: 20px;
  border-color: rgba(255, 255, 255, 0.16);
}

.brand-mark {
  border-color: rgba(244, 202, 108, 0.5);
  background: rgba(255, 253, 248, 0.12);
  color: #f4ca6c;
  box-shadow: 0 0 0 6px rgba(244, 202, 108, 0.05);
}

.staff-light-guide {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(244, 202, 108, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.08);
}

.staff-light-guide > span,
.staff-light-guide b {
  color: rgba(238, 247, 251, 0.68);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.staff-light-guide strong {
  color: #fffaf2;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "PingFang SC", serif;
  font-size: 21px;
  font-weight: 400;
  line-height: 1.34;
}

.staff-light-guide div {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.staff-light-guide i {
  height: 1px;
  background: rgba(244, 202, 108, 0.26);
}

.presale-login-card,
.presale-user-card {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.1);
}

.presale-login-card h1 {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "PingFang SC", serif;
  font-weight: 400;
  letter-spacing: 0;
}

.presale-login-card input {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(11, 38, 36, 0.78);
}

.demo-account-list button:hover,
.presale-rail .ghost-button:hover {
  border-color: rgba(244, 202, 108, 0.38);
  background: rgba(255, 255, 255, 0.15);
}

.presale-main {
  padding: 28px;
  gap: 20px;
}

.presale-topbar {
  position: relative;
  overflow: hidden;
  align-items: stretch;
  border-color: rgba(202, 163, 91, 0.28);
  background:
    linear-gradient(105deg, transparent 0 45%, rgba(255, 255, 255, 0.74) 46% 55%, transparent 56%),
    radial-gradient(circle at 88% 10%, rgba(255, 243, 211, 0.76), transparent 24%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 239, 0.94) 62%, rgba(236, 250, 246, 0.78)),
    #fffefa;
  box-shadow: var(--staff-shadow);
}

.presale-topbar::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(202, 163, 91, 0.16);
  pointer-events: none;
}

.presale-topbar-copy,
.presale-topbar-actions {
  position: relative;
  z-index: 1;
}

.presale-topbar-copy {
  display: grid;
  gap: 8px;
  align-content: start;
}

.presale-topbar h2 {
  margin: 0;
  max-width: 720px;
  color: var(--staff-ink);
  font-family: "Songti SC", "STSong", "Noto Serif SC", "PingFang SC", serif;
  font-size: 34px;
  font-weight: 400;
  line-height: 1.2;
}

.presale-topbar span#apiStatus {
  color: var(--staff-muted);
}

.staff-flow-pills,
.presale-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.staff-flow-pills {
  margin-top: 8px;
}

.staff-flow-pills span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(10, 127, 124, 0.18);
  border-radius: 999px;
  background: var(--staff-teal-soft);
  color: var(--staff-teal);
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 800;
}

.presale-topbar-actions {
  justify-content: flex-end;
  align-content: flex-start;
  max-width: 420px;
}

.presale-workbench .primary-button {
  border-color: #0f615d;
  background: #0f615d;
  color: #fff;
  box-shadow: 0 12px 26px rgba(15, 97, 93, 0.18);
}

.presale-workbench .primary-button:hover {
  background: #174941;
}

.presale-workbench .ghost-button,
.presale-workbench .chip {
  border-color: rgba(32, 40, 35, 0.1);
  background: rgba(255, 253, 248, 0.84);
  color: var(--staff-ink);
}

.presale-workbench .top-client-link {
  min-height: 36px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--staff-teal);
  font-weight: 800;
}

.presale-workbench .chip {
  min-height: 34px;
  padding: 7px 12px;
  color: var(--staff-muted);
  font-weight: 800;
}

.presale-workbench .chip.active,
.presale-workbench .chip:hover {
  border-color: rgba(10, 127, 124, 0.28);
  background: var(--staff-teal-soft);
  color: var(--staff-teal);
}

.presale-metrics article,
.presale-panel,
.presale-op-card,
.presale-inline-form,
.staff-state-card {
  border-color: rgba(32, 40, 35, 0.09);
  background: var(--staff-paper);
  box-shadow: 0 10px 26px rgba(51, 48, 40, 0.055);
}

.presale-metrics article {
  position: relative;
  overflow: hidden;
  min-height: 104px;
  padding: 17px 18px;
}

.presale-metrics article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--staff-gold), rgba(15, 97, 93, 0.55));
}

.presale-metrics span,
.presale-op-card span,
.presale-op-card small {
  color: var(--staff-muted);
}

.presale-metrics strong {
  color: var(--staff-teal);
  font-size: 30px;
}

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

.staff-state-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 188px;
  overflow: hidden;
  padding: 18px;
  border-radius: 8px;
}

.staff-state-card::before {
  content: "";
  position: absolute;
  right: -42px;
  top: -48px;
  width: 156px;
  height: 156px;
  border: 1px solid rgba(202, 163, 91, 0.18);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.82) 0 34%, rgba(236, 250, 246, 0.62) 35% 56%, transparent 57%);
  pointer-events: none;
}

.staff-state-card > * {
  position: relative;
  z-index: 1;
}

.staff-state-card span {
  color: var(--staff-teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.staff-state-card h3 {
  margin: 0;
  max-width: 310px;
  color: var(--staff-ink);
  font-family: "Songti SC", "STSong", "Noto Serif SC", "PingFang SC", serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.3;
}

.staff-state-card p {
  margin: 0;
  color: var(--staff-muted);
  line-height: 1.62;
}

.staff-state-card a {
  align-self: end;
  width: fit-content;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(10, 127, 124, 0.18);
  border-radius: 999px;
  background: rgba(236, 250, 246, 0.72);
  color: var(--staff-teal);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.staff-state-card.is-member {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 252, 244, 0.94)),
    #fffefa;
}

.staff-state-card.is-return {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(244, 236, 218, 0.78)),
    #fffefa;
}

.presale-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  border: 1px solid rgba(32, 40, 35, 0.08);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.88);
  padding: 10px;
  box-shadow: 0 10px 24px rgba(51, 48, 40, 0.06);
  backdrop-filter: blur(12px);
}

.presale-panel {
  padding: 18px;
}

.section-title {
  align-items: end;
  gap: 12px;
  border-bottom: 1px solid rgba(202, 163, 91, 0.18);
  padding-bottom: 12px;
}

.section-title h2 {
  color: var(--staff-ink);
  font-family: "Songti SC", "STSong", "Noto Serif SC", "PingFang SC", serif;
  font-size: 23px;
  font-weight: 400;
}

.section-title span {
  color: var(--staff-muted);
}

.presale-op-card {
  position: relative;
  overflow: hidden;
}

.presale-op-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(202, 163, 91, 0.055), transparent 34%);
}

.presale-op-card > * {
  position: relative;
  z-index: 1;
}

.presale-op-card h3 {
  color: var(--staff-ink);
  font-size: 19px;
  line-height: 1.34;
}

.presale-detail-grid {
  border-color: rgba(202, 163, 91, 0.16);
  background: rgba(255, 253, 248, 0.74);
}

.presale-detail-grid b {
  color: var(--staff-ink);
}

.presale-evidence-form input,
.presale-inline-form input,
.presale-inline-form select,
.subscription-config-card textarea,
.subscription-config-card select,
.subscription-config-card input {
  border-color: rgba(32, 40, 35, 0.11);
  background: rgba(255, 255, 255, 0.88);
}

.presale-evidence-form input:focus,
.presale-inline-form input:focus,
.presale-inline-form select:focus,
.subscription-config-card textarea:focus,
.subscription-config-card select:focus,
.subscription-config-card input:focus {
  outline: 2px solid rgba(15, 97, 93, 0.16);
  border-color: rgba(15, 97, 93, 0.36);
}

.template-role-options label {
  border-color: rgba(32, 40, 35, 0.1);
  background: rgba(255, 253, 248, 0.74);
}

.ledger-columns h3 {
  color: var(--staff-teal);
  font-family: "Songti SC", "STSong", "Noto Serif SC", "PingFang SC", serif;
  font-size: 21px;
  font-weight: 400;
}

.presale-workbench .site-compliance-footer {
  display: flex;
  justify-content: center;
  padding: 24px 12px 8px;
  color: var(--staff-muted);
  font-size: 12px;
  line-height: 1.6;
}

.presale-workbench .site-compliance-footer a {
  color: inherit;
  text-decoration: none;
}

.presale-workbench .site-compliance-footer a:hover {
  color: var(--staff-teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 1180px) {
  .presale-topbar {
    flex-direction: column;
  }

  .presale-topbar-actions {
    justify-content: flex-start;
    max-width: none;
  }

  .staff-client-state-board,
  .presale-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .presale-rail {
    position: relative;
    height: auto;
  }

  .presale-tabs {
    top: 0;
  }
}

@media (max-width: 720px) {
  .presale-main {
    padding: 18px;
  }

  .presale-topbar h2 {
    font-size: 28px;
  }

  .staff-client-state-board,
  .presale-metrics {
    grid-template-columns: 1fr;
  }

  .presale-topbar-actions .top-client-link {
    flex: 1 1 120px;
    justify-content: center;
  }
}
