:root {
  color-scheme: light;
  --bg: #f6f4fa;
  --surface: #ffffff;
  --surface-soft: #fbfafe;
  --ink: #251e31;
  --muted: #756f80;
  --line: #e8e3f0;
  --brand: #6d3cc2;
  --brand-dark: #4e2a91;
  --brand-soft: #f0eafb;
  --gold: #c89b3c;
  --gold-soft: #fff5df;
  --orange: #c89b3c;
  --orange-soft: #fff5df;
  --red: #c84848;
  --red-soft: #fcecec;
  --blue: #3d6cc9;
  --blue-soft: #eef3ff;
  --shadow: 0 18px 45px rgba(63, 39, 100, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 95% 5%, rgba(109, 60, 194, 0.09), transparent 24rem),
    var(--bg);
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 26px 18px 20px;
  color: #d8ebe8;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.04), transparent 48%),
    #21133e;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 28px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: #4e2a91;
  background: linear-gradient(145deg, #fff4d6, #d9ad4b);
  font-size: 23px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(9, 38, 35, 0.24);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  color: #fff;
  font-size: 18px;
  letter-spacing: 0.08em;
}

.brand span {
  margin-top: 3px;
  color: #8eb3ae;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  color: #c7bbda;
  background: transparent;
  text-align: left;
  transition: 160ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.active {
  color: #4e2a91;
  background: #f0eafb;
  font-weight: 700;
  box-shadow: inset 3px 0 #c89b3c;
}

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 16px;
}

.sidebar-footer {
  margin-top: auto;
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(3, 35, 31, 0.22);
}

.security-note strong,
.security-note span {
  display: block;
}

.security-note strong {
  color: #f4effb;
  font-size: 12px;
}

.security-note span {
  margin-top: 3px;
  color: #a79bb9;
  font-size: 10px;
}

.pulse-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 99px;
  background: #d9b15b;
  box-shadow: 0 0 0 5px rgba(217, 177, 91, 0.14);
}

.main {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 27px 36px 18px;
}

.topbar > div:first-child {
  min-width: 0;
}

.topbar h1 {
  margin: 3px 0 0;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.env-badge {
  padding: 7px 11px;
  border: 1px solid #ddd0f2;
  border-radius: 99px;
  color: var(--brand);
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
}

.env-badge.live {
  color: #9d4a20;
  border-color: #f1d4be;
  background: #fff7ef;
}

.avatar-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #2c184e;
  font-weight: 800;
}

.content {
  min-width: 0;
  padding: 8px 36px 44px;
}

.loading-panel,
.empty-state {
  display: grid;
  min-height: 300px;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--muted);
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #dce9e6;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

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

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 130px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card::after {
  position: absolute;
  right: -26px;
  bottom: -35px;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: var(--brand-soft);
  content: "";
}

.metric-card.accent {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #6d3cc2, #382064);
}

.metric-card.accent::after {
  background: rgba(255, 255, 255, 0.08);
}

.metric-label {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 12px;
}

.accent .metric-label {
  color: #d9c9f3;
}

.metric-value {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.metric-hint {
  position: relative;
  z-index: 1;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.accent .metric-hint {
  color: #d9c9f3;
}

.grid-2 {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.8fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
}

.panel-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.panel-body {
  padding: 0 22px 22px;
}

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

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

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid #edf1ef;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #80908c;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

td {
  color: #3f4d49;
  font-size: 12px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fbfcfc;
}

.money {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
}

.status::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status.paid,
.status.success {
  color: var(--brand);
  background: var(--brand-soft);
}

.status.paying {
  color: #ac682b;
  background: var(--orange-soft);
}

.status.failed {
  color: var(--red);
  background: var(--red-soft);
}

.status.unknown {
  color: var(--blue);
  background: var(--blue-soft);
}

.industry-card {
  position: relative;
  min-height: 250px;
  padding: 24px;
  overflow: hidden;
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.18), transparent 9rem),
    linear-gradient(145deg, #2b174c, #6d3cc2);
  box-shadow: var(--shadow);
}

.industry-card::before {
  position: absolute;
  right: -34px;
  bottom: -62px;
  width: 190px;
  height: 190px;
  border: 24px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.industry-card h2 {
  position: relative;
  margin: 0 0 10px;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.industry-card p {
  position: relative;
  max-width: 270px;
  margin: 0;
  color: #d9c9f3;
  line-height: 1.7;
}

.industry-tags {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 30px;
}

.industry-tags span {
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  color: #f4ecff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
}

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

.quick-actions .industry-card {
  grid-column: 1 / -1;
}

.quick-action {
  min-height: 98px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface-soft);
  text-align: left;
  transition: 150ms ease;
}

.quick-action:hover {
  border-color: #acd7d0;
  background: var(--brand-soft);
  transform: translateY(-1px);
}

.quick-action strong,
.quick-action span {
  display: block;
}

.quick-action strong {
  margin-top: 13px;
  font-size: 13px;
}

.quick-action span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  align-items: start;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #5d6d68;
  font-size: 11px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  height: 43px;
  padding: 0 13px;
  border: 1px solid #dce6e3;
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: #fbfcfc;
  transition: 140ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #7cc7bc;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

.field small {
  color: #8a9995;
  font-size: 10px;
  line-height: 1.5;
}

.input-action-row {
  display: flex;
  gap: 9px;
}

.input-action-row input {
  min-width: 0;
}

.action-fixed {
  flex: 0 0 auto;
  white-space: nowrap;
}

.segmented {
  display: flex;
  padding: 4px;
  border-radius: 12px;
  background: #edf2f0;
}

.segmented button {
  flex: 1;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  color: #65746f;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}

.segmented button.active {
  color: var(--brand-dark);
  background: #fff;
  box-shadow: 0 3px 10px rgba(36, 67, 61, 0.09);
}

.button-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.reconciliation-actions {
  justify-content: flex-end;
}

.compact-select,
.compact-date {
  height: 41px;
  padding: 0 11px;
  border: 1px solid #dce6e3;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 41px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 700;
  transition: 140ms ease;
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.button.secondary {
  color: #43534f;
  border-color: #dce6e3;
  background: #fff;
}

.button.secondary:hover {
  background: #f7faf9;
}

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

.button.wide {
  width: 100%;
}

.member-spotlight {
  padding: 20px;
  border: 1px solid #d7ebe7;
  border-radius: 15px;
  background:
    radial-gradient(circle at 100% 0, rgba(57, 186, 168, 0.16), transparent 9rem),
    #faf7ff;
}

.member-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.member-title h3 {
  margin: 0;
  font-size: 18px;
}

.member-title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.member-balance {
  margin-top: 20px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.member-balance small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.member-tags-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.member-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.member-tag-list span {
  padding: 5px 8px;
  border-radius: 99px;
  color: #65428e;
  background: #f0eafb;
  font-size: 9px;
}

.member-tag-list .muted-tag {
  color: #8e8796;
  background: #f4f1f7;
}

.member-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.member-stat-grid > div {
  padding: 11px 12px;
  border: 1px solid #eee9f5;
  border-radius: 11px;
  background: #fff;
}

.member-stat-grid span,
.member-stat-grid strong {
  display: block;
}

.member-stat-grid span {
  color: var(--muted);
  font-size: 9px;
}

.member-stat-grid strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 13px;
}

.member-coupon-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #eadff6;
  border-radius: 12px;
  background: #fffaf0;
}

.member-coupon-summary strong {
  color: var(--gold);
  font-size: 19px;
}

.member-coupon-summary span {
  margin-left: 5px;
  color: var(--muted);
  font-size: 9px;
}

.member-coupon-summary .button {
  min-height: 32px;
  padding: 0 11px;
  font-size: 9px;
}

.member-order-mini {
  display: grid;
  gap: 1px;
}

.member-order-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eeeaf4;
}

.member-order-mini-row:last-child {
  border-bottom: 0;
}

.member-order-mini-row strong,
.member-order-mini-row span {
  display: block;
}

.member-order-mini-row strong {
  max-width: 185px;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-order-mini-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.member-order-mini-row > div:last-child {
  flex: 0 0 auto;
  text-align: right;
}

.member-order-mini-row .status {
  margin-top: 5px;
}

.balance-split {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
}

.notice {
  padding: 13px 15px;
  border: 1px solid #f0dfcf;
  border-radius: 12px;
  color: #80532d;
  background: #fff9f3;
  font-size: 11px;
  line-height: 1.7;
}

.notice.green {
  color: #5a3b87;
  border-color: #ddd0f2;
  background: #faf7ff;
}

.result-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: #f7faf9;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.result-box strong {
  color: var(--ink);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.search-box {
  position: relative;
  width: min(360px, 100%);
}

.search-box input {
  width: 100%;
  height: 41px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fff;
}

.search-box span {
  position: absolute;
  top: 11px;
  left: 14px;
  color: #9eaaa7;
}

.member-list {
  display: grid;
  gap: 9px;
}

.member-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 135px 120px 110px 24px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  text-align: left;
  background: #fff;
}

.member-row:hover {
  border-color: #b4d9d3;
}

.member-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.member-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 800;
}

.member-name strong,
.member-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-name span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.cell-label {
  color: var(--muted);
  font-size: 10px;
}

.cell-value {
  margin-top: 4px;
  font-weight: 700;
}

.detail-drawer {
  position: sticky;
  top: 20px;
}

.ledger-list {
  display: grid;
  gap: 1px;
  max-height: 440px;
  overflow: auto;
}

.ledger-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid #edf1ef;
}

.ledger-item:last-child {
  border-bottom: 0;
}

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

.ledger-item strong {
  font-size: 12px;
}

.ledger-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.ledger-value {
  text-align: right;
  font-size: 13px;
  font-weight: 800;
}

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

.ledger-value.negative {
  color: var(--red);
}

.ledger-value small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.industry-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.industry-option {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: left;
}

.industry-option.active {
  border-color: #8ccbc1;
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.06);
}

.industry-option strong,
.industry-option span {
  display: block;
}

.industry-option span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

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

.config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid #edf1ef;
}

.config-item:last-child {
  border-bottom: 0;
}

.config-item span {
  color: var(--muted);
  font-size: 11px;
}

.config-item code {
  overflow: hidden;
  max-width: 60%;
  color: #31524c;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(8, 28, 25, 0.52);
  backdrop-filter: blur(5px);
}

.modal {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 26px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 35px 80px rgba(10, 40, 35, 0.25);
}

.modal h2 {
  margin: 0 0 5px;
}

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

.modal-close {
  position: absolute;
  top: 15px;
  right: 17px;
  border: 0;
  color: #82908c;
  background: transparent;
  font-size: 24px;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 26px;
  bottom: 26px;
  max-width: 360px;
  padding: 13px 17px;
  border-radius: 12px;
  color: #fff;
  background: #173d39;
  box-shadow: 0 18px 45px rgba(7, 35, 31, 0.25);
  font-size: 12px;
  line-height: 1.6;
}

.toast.error {
  background: #8e3434;
}

.cashier-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.72fr);
  gap: 16px;
  align-items: start;
}

.cashier-side {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 20px;
}

.compact-form {
  margin-bottom: 2px;
}

.catalog-sale-block {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #e8e3f0;
  border-radius: 15px;
  background: #fbfafe;
}

.catalog-sale-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.catalog-sale-head strong,
.catalog-sale-head span {
  display: block;
}

.catalog-sale-head strong {
  font-size: 13px;
}

.catalog-sale-head span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.catalog-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin: 16px 0;
  padding-bottom: 2px;
}

.catalog-tab {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: #665d73;
  background: #fff;
  font-size: 10px;
}

.catalog-tab.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.catalog-tab small {
  opacity: 0.72;
}

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

.catalog-sale-item {
  position: relative;
  display: flex;
  min-height: 132px;
  flex-direction: column;
  padding: 13px;
  border: 1px solid #e8e3f0;
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  transition: 140ms ease;
}

.catalog-sale-item:hover {
  border-color: #bca5e7;
  transform: translateY(-1px);
}

.catalog-sale-item.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(109, 60, 194, 0.08);
}

.catalog-sale-item:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.catalog-item-label {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 14px;
  font-weight: 800;
}

.catalog-item-name {
  margin-top: 12px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-item-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.catalog-item-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
  margin-top: auto;
  padding-top: 12px;
}

.catalog-item-bottom strong {
  color: var(--brand-dark);
  font-size: 13px;
}

.catalog-item-bottom small {
  color: #9a91a5;
  font-size: 8px;
}

.catalog-count {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--gold);
  font-size: 9px;
  font-weight: 800;
}

.checkout-options {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eeeaf4;
}

.cart-lines {
  display: grid;
  gap: 1px;
}

.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eeeaf4;
}

.cart-line:last-child {
  border-bottom: 0;
}

.cart-line strong,
.cart-line span {
  display: block;
}

.cart-line strong {
  font-size: 11px;
}

.cart-line span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.quantity-control {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.quantity-control button {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid #e1d9ed;
  border-radius: 8px;
  color: var(--brand);
  background: #fff;
}

.quantity-control span {
  width: 18px;
  margin: 0;
  color: var(--ink);
  text-align: center;
  font-size: 10px;
  font-weight: 700;
}

.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 15px;
  border-top: 1px solid #ddd0f2;
}

.cart-total span {
  color: var(--muted);
  font-size: 11px;
}

.cart-total strong {
  color: var(--brand-dark);
  font-size: 22px;
  letter-spacing: -0.04em;
}

.text-action {
  border: 0;
  color: #8e6abb;
  background: transparent;
  font-size: 10px;
}

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

.catalog-panel-head {
  padding-bottom: 6px;
}

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

.catalog-manage-card {
  position: relative;
  min-height: 190px;
  padding: 18px;
  border: 1px solid #e8e3f0;
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(109, 60, 194, 0.07), transparent 8rem),
    #fff;
}

.catalog-manage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.catalog-type {
  padding: 4px 8px;
  border-radius: 99px;
  color: #79551e;
  background: var(--gold-soft);
  font-size: 9px;
  font-weight: 700;
}

.catalog-manage-card h3 {
  margin: 18px 0 6px;
  font-size: 15px;
}

.catalog-manage-card p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-manage-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.catalog-manage-bottom strong {
  color: var(--brand-dark);
  font-size: 20px;
}

.catalog-manage-bottom span {
  color: var(--muted);
  font-size: 9px;
}

.catalog-edit-button {
  position: absolute;
  right: 14px;
  bottom: 12px;
  border: 0;
  color: #8e6abb;
  background: transparent;
  font-size: 9px;
}

.catalog-checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5a5265;
  font-size: 11px;
}

.catalog-checkbox input {
  width: auto;
  height: auto;
}

.recharge-plan-strip {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #eadff6;
  border-radius: 14px;
  background: #fbf8ff;
}

.recharge-plan-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 12px;
}

.recharge-plan {
  flex: 0 0 auto;
  min-width: 118px;
  padding: 11px 13px;
  border: 1px solid #e1d7ee;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.recharge-plan.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 2px rgba(109, 60, 194, 0.08);
}

.recharge-plan strong,
.recharge-plan span {
  display: block;
}

.recharge-plan strong {
  font-size: 12px;
}

.recharge-plan span {
  margin-top: 5px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
}

.stores-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
}

.store-list {
  display: grid;
  gap: 11px;
}

.store-card {
  position: relative;
  padding: 18px;
  border: 1px solid #e8e3f0;
  border-radius: 15px;
  background:
    radial-gradient(circle at 100% 0, rgba(109, 60, 194, 0.08), transparent 9rem),
    #fff;
}

.store-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.store-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  font-size: 15px;
  font-weight: 800;
}

.store-card h3 {
  margin: 14px 0 5px;
  font-size: 15px;
}

.store-card p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.store-meta {
  display: flex;
  gap: 6px;
  margin-top: 13px;
}

.store-meta span {
  padding: 4px 7px;
  border-radius: 99px;
  color: #72657f;
  background: #f6f2fa;
  font-size: 8px;
}

.store-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.store-stats > div {
  padding: 10px;
  border-radius: 10px;
  background: #fbf9fd;
}

.store-stats span,
.store-stats strong {
  display: block;
}

.store-stats span {
  color: var(--muted);
  font-size: 8px;
}

.store-stats strong {
  margin-top: 5px;
  font-size: 12px;
}

.invite-result {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 17px;
  border: 1px solid #e2d4f5;
  border-radius: 14px;
  background: var(--brand-soft);
  text-align: center;
}

.invite-result span {
  color: var(--muted);
  font-size: 9px;
}

.invite-result strong {
  color: var(--brand-dark);
  font-family: monospace;
  font-size: 17px;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.invite-result small {
  color: var(--muted);
  font-size: 9px;
}

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

.recharge-plan-card {
  position: relative;
  padding: 20px;
  overflow: hidden;
  border: 1px solid #e8e3f0;
  border-radius: 17px;
  background:
    radial-gradient(circle at 100% 0, rgba(200, 155, 60, 0.14), transparent 9rem),
    linear-gradient(145deg, #fff, #fbf8ff);
  box-shadow: var(--shadow);
}

.recharge-plan-card.inactive {
  opacity: 0.58;
}

.plan-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.recharge-plan-card h3 {
  margin: 22px 0 18px;
  font-size: 15px;
}

.plan-amount span,
.plan-amount strong {
  display: block;
}

.plan-amount span {
  color: var(--muted);
  font-size: 9px;
}

.plan-amount strong {
  margin-top: 5px;
  color: var(--brand-dark);
  font-size: 27px;
  letter-spacing: -0.04em;
}

.plan-gift {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eee7f5;
  color: #7a6541;
  font-size: 10px;
}

.plan-gift strong {
  color: var(--gold);
}

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

.coupon-template-card {
  display: flex;
  min-height: 130px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #eadff6;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.coupon-template-card.inactive {
  opacity: 0.55;
}

.coupon-template-value {
  display: grid;
  flex: 0 0 124px;
  place-items: center;
  color: var(--brand-dark);
  background:
    radial-gradient(circle at 0 100%, rgba(200, 155, 60, 0.18), transparent 7rem),
    #f5efff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.coupon-template-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
}

.coupon-template-info strong {
  max-width: 180px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coupon-template-info > span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
}

@media (max-width: 1080px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2,
  .page-grid,
  .cashier-layout {
    grid-template-columns: 1fr;
  }

  .detail-drawer,
  .cashier-side {
    position: static;
  }

  .catalog-manage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    position: static;
    width: 100%;
    max-width: 100vw;
    height: auto;
    padding: 16px;
    overflow: hidden;
  }

  .brand {
    padding-bottom: 14px;
  }

  .nav {
    display: flex;
    width: 100%;
    padding-bottom: 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    width: 100%;
    max-width: 100%;
    gap: 8px;
    box-sizing: border-box;
    padding: 20px 18px 12px;
  }

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

  .topbar-actions {
    display: none;
  }

  .topbar-actions .env-badge {
    display: none;
  }

  .content {
    width: 100%;
    max-width: 100vw;
    padding: 6px 18px 30px;
    overflow: hidden;
  }

  .metric-grid,
  .form-grid,
  .industry-options,
  .catalog-metrics,
  .catalog-manage-grid,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .catalog-item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card,
  .panel,
  .industry-card {
    width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
    min-width: 0;
  }

  .member-row {
    grid-template-columns: minmax(150px, 1fr) 95px 20px;
  }

  .member-row > :nth-child(3),
  .member-row > :nth-child(4) {
    display: none;
  }

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