:root {
  --ink: #111816;
  --ink-soft: #354039;
  --muted: #6c766f;
  --line: #d9d2c5;
  --paper: #f3efe6;
  --panel: #fffdf8;
  --charcoal: #13221b;
  --green: #166044;
  --green-2: #0f7a62;
  --amber: #c8892d;
  --amber-soft: #f4ddae;
  --red: #b42318;
  --blue: #245b78;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(19, 34, 27, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(19, 34, 27, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font: 15px/1.45 "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

.hidden {
  display: none !important;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(520px, 1.05fr);
  min-height: 100vh;
}

.auth-brand {
  position: relative;
  display: grid;
  align-content: space-between;
  padding: 42px;
  overflow: hidden;
  background: var(--charcoal);
  color: #fff8eb;
}

.auth-brand::after {
  content: "";
  position: absolute;
  inset: auto 34px 34px auto;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(244, 221, 174, 0.26);
  transform: rotate(18deg);
}

.brand-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--amber);
  color: #17241d;
  font-size: 22px;
  font-weight: 900;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.brand-name {
  display: grid;
  min-width: 0;
}

.brand-name strong {
  overflow-wrap: anywhere;
  font-size: 22px;
  letter-spacing: 0;
}

.brand-name span,
.auth-copy p,
.data-muted,
.topbar p,
.section-title p,
.metric small,
.form-foot,
.status,
.table-empty {
  color: var(--muted);
}

.auth-brand .brand-name span,
.auth-copy p,
.call-line span {
  color: rgba(255, 248, 235, 0.72);
}

.auth-copy {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.auth-copy h1 {
  margin: 0 0 18px;
  font-size: 54px;
  line-height: 1.02;
  letter-spacing: 0;
}

.auth-copy p {
  width: 82%;
  margin: 0;
  font-size: 18px;
}

.call-strip {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  max-width: 560px;
}

.call-line {
  display: grid;
  grid-template-columns: 120px 1fr 80px;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 248, 235, 0.14);
}

.call-line b {
  color: var(--amber-soft);
  font-size: 18px;
}

.call-line em {
  justify-self: end;
  border: 1px solid rgba(244, 221, 174, 0.3);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--amber-soft);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.auth-main {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 44px;
}

.auth-card,
.panel,
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
}

.auth-card {
  width: min(560px, 100%);
  margin-inline: auto;
  box-shadow: 0 24px 80px rgba(40, 35, 25, 0.12);
}

.card-head,
.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px 10px;
}

h1,
h2,
p {
  margin: 0;
}

h2 {
  font-size: 28px;
  line-height: 1.18;
}

.tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #efe8da;
}

.tab {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.tab.active {
  background: var(--green);
  color: white;
}

.form {
  display: grid;
  gap: 14px;
  padding: 20px 28px 28px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(22, 96, 68, 0.18);
  border-color: var(--green);
}

textarea {
  resize: vertical;
  min-height: 132px;
  line-height: 1.5;
}

.inline-grid {
  display: grid;
  grid-template-columns: 1fr 138px;
  gap: 10px;
  align-items: end;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.checkbox-row label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.checkbox-row input {
  width: auto;
}

.primary,
.secondary,
.icon-btn,
.action-link {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--green);
  color: white;
  font: 900 14px/1 "Avenir Next", "PingFang SC", sans-serif;
  text-decoration: none;
  cursor: pointer;
}

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

.secondary {
  border: 1px solid var(--line);
  background: #f7f0e1;
  color: var(--green);
}

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

.form-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}

.link-button,
.customer-name-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--green);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.status {
  min-height: 20px;
  padding: 0 28px 18px;
}

.sms-setup .status,
.panel .status {
  padding: 0;
}

.dash {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 24px;
  height: 100vh;
  padding: 22px 18px;
  overflow: hidden;
  background: var(--charcoal);
  color: #fff8eb;
}

.sidebar .brand-name span {
  color: rgba(255, 248, 235, 0.7);
}

.sidebar .brand-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.sidebar .brand-name strong {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .brand-name span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.nav {
  display: grid;
  grid-auto-rows: min-content;
  align-content: start;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 0 2px 18px 0;
  overscroll-behavior: contain;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border-radius: 6px;
  padding: 0 12px;
  color: rgba(255, 248, 235, 0.76);
  text-decoration: none;
  font-weight: 800;
}

.nav a.active {
  background: #223a2e;
  color: #fff8eb;
}

.nav span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.nav-group {
  display: grid;
  gap: 7px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 248, 235, 0.12);
}

.nav-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.nav-group-title {
  padding: 0 12px;
  color: rgba(255, 248, 235, 0.58);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
}

.nav-group-links {
  display: grid;
  gap: 4px;
}

.nav-group .nav-group-links a {
  min-height: 36px;
  padding-left: 18px;
  font-size: 14px;
}

.workspace {
  padding: 24px 28px 30px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar h1 {
  font-size: 30px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.top-actions .icon-btn {
  width: auto;
  min-width: 58px;
  padding: 0 14px;
  white-space: nowrap;
}

.impersonation-banner {
  margin: -8px 0 16px;
  border: 1px solid #e1b654;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff4d0;
  color: #6f4b00;
  font-weight: 900;
}

.table-action {
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.secondary.danger {
  border-color: #f0c7bb;
  background: #fff1ed;
  color: #b23b22;
}

.icon-btn {
  width: 42px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--green);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  padding: 16px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 16px;
  margin-bottom: 16px;
}

.stack {
  display: grid;
  gap: 16px;
}

.panel {
  overflow: hidden;
}

.section-title {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.tenant-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 150px 92px;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 243, 232, 0.72);
}

.policy-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff6df;
  color: #5f4508;
}

.policy-note strong {
  flex: 0 0 auto;
  color: var(--amber);
  font-weight: 900;
}

.policy-note span {
  min-width: 0;
  font-weight: 800;
}

.seat-config-grid,
.seat-purchase-box {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fffaf0;
}

.payment-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fffaf0;
}

.payment-summary div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: #fff;
}

.payment-summary small {
  display: block;
  color: var(--muted);
  font-weight: 900;
}

.payment-summary strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.payment-config-form {
  padding: 18px;
}

.payment-config-form small {
  color: var(--muted);
  font-weight: 800;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
}

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

.seat-config-grid label,
.upgrade-choice-panel {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.seat-config-grid input,
.seat-config-grid select,
.seat-count-control input {
  min-height: 42px;
}

.upgrade-page-panel {
  background:
    linear-gradient(180deg, rgba(22, 163, 74, .05), rgba(255, 255, 255, 0) 220px),
    var(--panel);
}

.upgrade-page-title {
  align-items: start;
}

.secure-pay-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid #cce9d7;
  border-radius: 999px;
  background: #f1fbf5;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.upgrade-page-panel > .placeholder-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.upgrade-payment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.upgrade-checkout-panel {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.upgrade-step {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.upgrade-step:last-child {
  border-bottom: 0;
}

.upgrade-step-title,
.seat-quantity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.upgrade-step-title {
  margin-bottom: 16px;
}

.upgrade-step-title h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 18px;
}

.upgrade-step-title h3 span {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #10231a;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.upgrade-step-title small,
.seat-quantity-row p,
.seat-pay-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.seat-quantity-row p {
  margin: 7px 0 0;
}

.seat-count-control {
  display: grid;
  gap: 7px;
  min-width: 170px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.seat-count-control input {
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
}

.upgrade-plan-choices,
.payment-choice-group {
  display: grid;
  gap: 16px;
}

.upgrade-plan-choices {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.upgrade-plan-option {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 170px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.upgrade-plan-option .upgrade-plan-selected {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.upgrade-plan-option strong {
  font-size: 17px;
}

.upgrade-plan-price {
  color: var(--ink);
  font-size: 30px;
  font-weight: 1000;
  line-height: 1;
}

.upgrade-plan-price small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.upgrade-plan-original {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: line-through;
}

.upgrade-plan-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.upgrade-plan-meta small {
  color: var(--muted);
  font-weight: 800;
}

.upgrade-plan-meta em {
  color: #d97706;
  font-style: normal;
  font-weight: 900;
}

.payment-choice {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.upgrade-step .payment-choice-group {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.payment-choice strong,
.payment-choice small {
  display: block;
}

.payment-choice strong {
  margin-bottom: 5px;
  font-size: 16px;
  font-weight: 900;
}

.payment-choice small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.payment-logo {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  color: #fff;
}

.payment-logo svg {
  width: 34px;
  height: 34px;
}

.wechat-logo {
  background: #07c160;
}

.alipay-logo {
  background: #1677ff;
}

.upgrade-plan-option.active,
.payment-choice.active {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .14);
  transform: translateY(-1px);
}

.upgrade-plan-option.active {
  background: linear-gradient(180deg, #fff, #f0fbf5);
}

.upgrade-plan-option.active .upgrade-plan-selected {
  display: inline-flex;
}

.payment-choice.active::after {
  content: "";
  position: absolute;
  top: 13px;
  right: 13px;
  width: 18px;
  height: 18px;
  border: 2px solid #16a34a;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: inset 0 0 0 5px #fff;
}

#payAlipay.active {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .14);
}

#payAlipay.active::after {
  border-color: #1677ff;
  background: #1677ff;
}

.seat-order-summary {
  position: sticky;
  top: 18px;
  margin: 22px 0 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 22px 46px rgba(15, 33, 24, .12);
}

.seat-order-total {
  padding: 22px;
  color: #fff;
  background: linear-gradient(135deg, #10231a, #108447);
}

.seat-order-total small {
  display: block;
  margin-bottom: 9px;
  color: rgba(255, 255, 255, .78);
  font-weight: 900;
}

.seat-order-total strong {
  display: block;
  font-size: 36px;
  line-height: 1;
}

.seat-order-lines {
  padding: 18px 22px 0;
}

.seat-order-lines div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.seat-order-lines strong {
  color: var(--ink);
}

.seat-pay-preview {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 18px 22px;
  padding: 18px;
  border: 1px dashed rgba(22, 163, 74, .48);
  border-radius: 8px;
  background: #f0fbf5;
  text-align: center;
}

.seat-pay-preview.alipay-preview {
  border-color: rgba(22, 119, 255, .38);
  background: #f1f7ff;
}

.fake-qr {
  display: grid;
  grid-template-columns: repeat(4, 10px);
  gap: 5px;
  padding: 16px;
  border: 8px solid #fff;
  background: #fff;
  box-shadow: 0 10px 24px rgba(9, 48, 29, .12);
}

.fake-qr i {
  width: 10px;
  height: 10px;
  background: #10231a;
}

.fake-qr i:nth-child(3n) {
  opacity: 0;
}

.seat-pay-qr {
  width: 180px;
  height: 180px;
  border: 8px solid #fff;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(9, 48, 29, .12);
}

.seat-pay-preview strong {
  font-size: 14px;
}

.seat-pay-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.seat-order-summary .primary {
  width: calc(100% - 44px);
  margin: 0 22px;
}

.seat-pay-note {
  margin: 12px 22px 20px;
  line-height: 1.6;
}

.member-seat-cell {
  display: grid;
  gap: 5px;
  min-width: 150px;
}

.member-seat-cell small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.wechat-pay-code {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 12px;
  color: var(--ink);
}

.wechat-pay-code img {
  width: 180px;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.wechat-pay-code code {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.seat-usage-card {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #f2fbf6;
  color: var(--green);
  font-weight: 900;
}

.seat-usage-card.over-limit {
  background: #fff1e8;
  color: #9a3d13;
}

.seat-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 0;
}

.seat-detail-head h3 {
  margin: 0;
  font-size: 16px;
}

.seat-detail-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 800;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e4efe7;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.badge.failed {
  background: #fde8e3;
  color: var(--red);
}

.muted-text {
  color: var(--muted);
  font-weight: 800;
}

.table-empty {
  padding: 18px;
}

.compact-form {
  padding: 18px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #fffaf0;
}

.pagination-info {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pagination-actions {
  display: flex;
  gap: 8px;
}

.pagination-actions .secondary {
  min-height: 36px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(19, 34, 27, 0.58);
}

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 32px 90px rgba(13, 22, 17, 0.28);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head p {
  color: var(--muted);
}

.tenant-modal-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-actions,
.tenant-modal-form .status {
  grid-column: 1 / -1;
}

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

.customer-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 25;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(1040px, calc(100vw - 260px));
  height: 100vh;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -24px 0 70px rgba(13, 22, 17, 0.18);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: #fffaf0;
}

.drawer-head small,
.drawer-fields small,
.drawer-section-head {
  color: var(--muted);
  font-weight: 900;
}

.drawer-head h2 {
  margin-top: 4px;
  font-size: 24px;
}

.drawer-body {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  align-content: start;
  gap: 16px;
  overflow: auto;
  padding: 18px;
}

.drawer-column {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.drawer-column-records {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.drawer-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.drawer-phone-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.drawer-phone-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-fields div,
.drawer-fields label {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.follow-upload-item {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.follow-upload-item img,
.follow-upload-item i {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  background: #efe8da;
  object-fit: cover;
}

.follow-upload-item b,
.follow-upload-item small,
.follow-upload-item em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.follow-upload-item small {
  color: var(--green-2);
  font-weight: 900;
}

.follow-upload-item em {
  grid-column: 2 / -1;
  color: var(--red);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.follow-upload-item button {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: #efe8da;
  color: var(--ink-soft);
  font-weight: 900;
}

.follow-upload-failed {
  border-color: rgba(180, 35, 24, 0.35);
  background: #fff7f5;
}

.drawer-fields label {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-weight: 900;
}

.drawer-fields strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.drawer-section {
  display: grid;
  gap: 10px;
}

.drawer-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-section-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.follow-list,
.follow-timeline {
  display: grid;
  gap: 10px;
}

.follow-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px dashed var(--line);
  padding: 12px 0;
  background: transparent;
}

.follow-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #4f8df7;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.follow-card {
  display: grid;
  gap: 10px;
}

.follow-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.follow-card-head span {
  color: var(--muted);
  font-weight: 800;
}

.follow-result-box {
  min-height: 52px;
  border-radius: 4px;
  padding: 14px 16px;
  background: #f4f4f4;
  color: var(--ink);
  white-space: pre-wrap;
}

.follow-item strong,
.follow-item span {
  display: block;
}

.follow-item small {
  color: var(--muted);
  font-weight: 800;
}

.follow-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.follow-actions button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.follow-attachment-grid,
.follow-attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.follow-attachment-grid img,
.follow-attachment-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.follow-attachment-preview span {
  display: grid;
  gap: 4px;
  max-width: 84px;
  color: var(--muted);
  font-size: 11px;
}

.follow-attachment-preview b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.follow-form {
  padding: 0;
}

.follow-form label,
.follow-form button,
.follow-form .status {
  grid-column: 1 / -1;
}

.customer-name-link {
  padding: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 900;
}

.icon-mini {
  min-height: 24px;
  margin-left: 6px;
  padding: 0 7px;
  border: 1px solid #b9d8ff;
  border-radius: 4px;
  background: #eef6ff;
  color: #2d7ff9;
  font-size: 12px;
}

.compact-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.compact-pagination button {
  min-width: 34px;
  min-height: 34px;
  padding: 0 8px;
}

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

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

.account-summary div,
.placeholder-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #f8f3e8;
}

.account-summary small,
.placeholder-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.account-summary strong,
.placeholder-grid strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 18px;
}

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

.placeholder-grid span {
  display: block;
  margin-top: 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 980px) {
  .auth-shell,
  .dash,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .auth-brand,
  .sidebar {
    position: static;
    height: auto;
    min-height: 360px;
  }

  .stats,
  .sms-grid,
  .qiniu-grid,
  .drawer-body,
  .tenant-toolbar,
  .placeholder-grid,
  .account-summary,
  .upgrade-payment-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .customer-drawer {
    width: 100vw;
  }

  .drawer-body {
    grid-template-columns: 1fr;
  }

  .drawer-column-records {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 16px;
  }

  .upgrade-page-panel > .placeholder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upgrade-checkout-panel {
    border-right: 0;
  }

  .upgrade-step {
    padding: 20px;
  }

  .seat-order-summary {
    position: static;
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .auth-copy h1 {
    font-size: 40px;
  }

  .auth-main,
  .workspace,
  .auth-brand {
    padding: 22px;
  }

  .card-head,
  .topbar,
  .inline-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stats,
  .sms-grid,
  .qiniu-grid,
  .drawer-body,
  .tenant-toolbar,
  .tenant-modal-form,
  .placeholder-grid,
  .account-summary,
  .upgrade-plan-choices,
  .payment-choice-group {
    grid-template-columns: 1fr;
  }

  .upgrade-page-title,
  .upgrade-step-title,
  .seat-quantity-row {
    align-items: stretch;
    flex-direction: column;
  }

  .secure-pay-pill {
    justify-content: center;
    white-space: normal;
  }

  .upgrade-page-panel > .placeholder-grid {
    grid-template-columns: 1fr;
  }

  .upgrade-step {
    padding: 16px;
  }

  .pagination,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
