:root {
  --brand:#316fe3;
  --ink:#202c3e;
  --muted:#8290a3;
  --bg:#f4f6fa;
  --line:#e7ecf3;
  --paper:#fff;
  --radius:12px;
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  color:var(--ink);
  background:var(--bg);
  font-synthesis:none
}

* {
  box-sizing:border-box
}

body {
  margin:0
}

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

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

button {
  cursor:pointer
}

button:disabled {
  opacity:.5;
  cursor:wait
}

[hidden] {
  display:none!important
}

.brand-mark {
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  background:var(--brand);
  color:white;
  border-radius:10px;
  font-size:23px;
  font-weight:700
}

.admin-layout {
  display:grid;
  grid-template-columns:226px 1fr;
  min-height:100vh
}

.sidebar {
  background:#fff;
  border-right:1px solid var(--line);
  padding:30px 17px;
  display:flex;
  flex-direction:column;
  position:sticky;
  top:0;
  height:100vh
}

.sidebar-brand {
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 12px;
  margin-bottom:44px;
  font-size:21px;
  letter-spacing:-.05em
}

.sidebar-section {
  font-size:10px;
  letter-spacing:.1em;
  color:var(--muted);
  padding:0 14px;
  margin-bottom:13px
}

.sidebar nav {
  display:grid;
  gap:5px;
  min-height:0;
  flex:1;
  overflow-y:auto;
  align-content:start
}

.sidebar nav button {
  display:flex;
  align-items:center;
  gap:14px;
  text-align:left;
  border:0;
  background:transparent;
  border-radius:8px;
  color:#69798c;
  padding:13px 14px;
  font-size:13px
}

.sidebar nav button.active {
  background:#edf3ff;
  color:var(--brand);
  font-weight:650
}

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

.sidebar-bottom {
  margin-top:auto;
  border-top:1px solid var(--line);
  padding:20px 12px 0;
  font-size:11px;
  color:#627185
}

.sidebar-bottom .muted {
  display:block;
  margin-top:9px;
  font-size:10px
}

.status-dot {
  display:inline-block;
  width:6px;
  height:6px;
  border-radius:50%;
  background:#3aa578;
  margin-right:6px
}

.workspace {
  min-width:0
}

.topbar {
  display:flex;
  justify-content:space-between;
  gap:20px;
  align-items:center;
  padding:20px 38px;
  background:rgba(255,255,255,.85);
  border-bottom:1px solid var(--line)
}

.tenant-switch {
  display:flex;
  align-items:center;
  gap:15px;
  font-size:12px
}

.tenant-switch label {
  color:var(--muted);
  white-space:nowrap
}

.tenant-switch select {
  width:210px;
  padding:9px 12px
}

.tenant-switch a {
  color:var(--brand);
  font-size:11px;
  white-space:nowrap
}

.staff-menu {
  display:flex;
  align-items:center;
  gap:20px;
  font-size:12px
}

.workspace main {
  max-width:1500px;
  margin:0 auto;
  padding:38px
}

.page-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-bottom:30px
}

.page-heading h1 {
  font-size:27px;
  font-weight:650;
  margin:0 0 11px;
  letter-spacing:-.035em
}

.eyebrow {
  color:var(--brand);
  font-size:9px;
  font-weight:750;
  letter-spacing:.17em;
  margin:0 0 12px
}

.muted {
  color:var(--muted);
  font-size:12px;
  line-height:1.8
}

.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  background:var(--brand);
  border:1px solid transparent;
  color:white;
  padding:11px 17px;
  border-radius:8px;
  font-size:12px;
  font-weight:600
}

.button.subtle {
  background:white;
  border-color:var(--line);
  color:var(--ink)
}

.button.danger {
  color:#b34949;
  background:#fff1f0;
  border-color:#f6dcda
}

.button.small {
  padding:7px 11px;
  font-size:11px
}

.button.wide {
  width:100%
}

.button:hover {
  filter:brightness(.97)
}

.text-button {
  border:0;
  background:transparent;
  color:var(--brand);
  padding:4px 0;
  font-size:12px
}

.text-button.danger {
  color:#b64b4b
}

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

.stats {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
  margin-bottom:25px
}

.stat {
  background:white;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:24px
}

.stat-label {
  display:flex;
  align-items:center;
  justify-content:space-between;
  color:#738297;
  font-size:12px
}

.stat-icon {
  font-size:17px;
  color:var(--brand);
  display:grid;
  place-items:center;
  width:32px;
  height:32px;
  border-radius:9px;
  background:#eef3ff
}

.stat-value {
  font-size:30px;
  letter-spacing:-.04em;
  font-weight:600;
  margin:18px 0 8px
}

.stat-note {
  color:var(--muted);
  font-size:11px
}

.card {
  background:white;
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden;
  margin-bottom:22px
}

.card-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  border-bottom:1px solid var(--line);
  padding:20px 24px
}

.card-heading h2 {
  font-size:15px;
  margin:0;
  font-weight:600
}

.card-body {
  padding:24px
}

.table-wrap {
  overflow:auto
}

table {
  width:100%;
  border-collapse:collapse;
  text-align:left;
  font-size:12px
}

thead {
  background:#fafbfd;
  color:#7b899a;
  font-size:11px;
  font-weight:400
}

th {
  font-weight:500;
  white-space:nowrap
}

th,td {
  padding:16px 22px;
  border-bottom:1px solid var(--line)
}

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

td {
  line-height:1.7
}

td .muted {
  font-size:11px
}

.cell-title {
  font-weight:600;
  max-width:270px;
  overflow-wrap:anywhere
}

.cell-description {
  font-size:11px;
  color:var(--muted);
  margin-top:3px;
  max-width:320px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}

.mono {
  font-family:ui-monospace,monospace;
  font-size:11px;
  overflow-wrap:anywhere
}

.badge {
  display:inline-block;
  padding:4px 8px;
  border-radius:5px;
  font-size:10px;
  white-space:nowrap;
  background:#eef1f5;
  color:#748294
}

.badge.active,.badge.paid,.badge.delivered,.badge.available {
  background:#eaf6ef;
  color:#358462
}

.badge.pending,.badge.reserved,.badge.exception {
  background:#fff5df;
  color:#a07b2b
}

.badge.expired,.badge.suspended,.badge.banned {
  background:#fbeeed;
  color:#b16a62
}

.empty,.loading {
  text-align:center;
  padding:65px 20px;
  color:var(--muted);
  background:white;
  border:1px dashed var(--line);
  border-radius:var(--radius);
  font-size:13px
}

.empty-icon {
  font-size:35px;
  color:#b8c8df
}

.empty p {
  line-height:1.9
}

.notice {
  padding:16px 19px;
  border:1px solid #dbe7fb;
  background:#eff5ff;
  border-radius:9px;
  color:#5d7697;
  font-size:12px;
  line-height:1.9;
  margin-bottom:22px;
  overflow-wrap:anywhere
}

.grid-two {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:22px
}

.field {
  display:grid;
  gap:8px;
  margin-bottom:18px;
  font-size:12px
}

.field label {
  font-weight:600
}

.field small {
  color:var(--muted);
  font-size:11px;
  line-height:1.8
}

input,textarea,select {
  width:100%;
  padding:11px 12px;
  border:1px solid #dfe6ef;
  border-radius:7px;
  color:var(--ink);
  background:white;
  outline:none
}

textarea {
  min-height:100px;
  resize:vertical
}

input:focus,textarea:focus,select:focus {
  border-color:#6393ed;
  box-shadow:0 0 0 3px #316fe310
}

input[type=checkbox] {
  width:15px;
  height:15px;
  accent-color:var(--brand)
}

.checkbox-field {
  display:flex;
  align-items:center;
  gap:9px;
  font-size:12px;
  margin:20px 0
}

.form-actions {
  display:flex;
  align-items:center;
  gap:13px;
  margin-top:23px
}

.theme-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));
  gap:24px
}

.theme-card {
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
  background:var(--paper)
}

.theme-card.active {
  border-color:var(--brand);
  background:#f8faff
}

.theme-cover {
  aspect-ratio:3 / 2;
  overflow:hidden;
  background:#f0f3f8;
  border-bottom:1px solid var(--line)
}

.theme-cover img {
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:top;
  display:block
}

.theme-placeholder {
  height:100%;
  display:grid;
  place-items:center;
  color:var(--muted)
}

.theme-details {
  padding:22px
}

.theme-title,.theme-actions {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap
}

.theme-title h2,.theme-toolbar h2 {
  font-size:16px;
  margin:0
}

.theme-details p {
  line-height:1.7;
  margin:12px 0 22px
}

.theme-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:20px;
  padding:24px
}

.theme-toolbar p,.theme-help {
  line-height:1.7
}

.theme-search {
  display:grid;
  gap:8px;
  flex:0 1 280px;
  max-width:100%
}

.theme-search label,.theme-search span {
  font-size:12px
}

.theme-help {
  margin:20px 0
}

.shop-settings-card {
  max-width:820px
}

.domain-card {
  padding:22px 24px;
  border-bottom:1px solid var(--line)
}

.domain-card:last-child {
  border:0
}

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

.domain-header strong {
  font-size:14px;
  overflow-wrap:anywhere
}

.domain-header .button-row {
  flex-shrink:0
}

.domain-dns {
  background:#f6f8fb;
  border:1px solid var(--line);
  padding:14px;
  border-radius:7px;
  margin-top:15px;
  line-height:1.8;
  font-size:12px
}

.domain-dns .mono {
  display:block;
  white-space:pre-wrap
}

.detail-row {
  display:flex;
  justify-content:space-between;
  gap:25px;
  padding:10px 0;
  border-bottom:1px solid var(--line);
  font-size:12px;
  line-height:1.8
}

.detail-row span:first-child {
  color:var(--muted);
  flex-shrink:0
}

.detail-row strong {
  text-align:right;
  overflow-wrap:anywhere
}

.code {
  font-family:ui-monospace,monospace;
  border:1px solid var(--line);
  background:#f7f9fc;
  padding:12px;
  margin-top:10px;
  border-radius:6px;
  font-size:11px;
  white-space:pre-wrap;
  overflow-wrap:anywhere
}

.pagination {
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:15px;
  padding:18px 22px;
  border-top:1px solid var(--line);
  font-size:12px;
  color:var(--muted)
}

.admin-footer {
  font-size:10px;
  color:#9ba6b4;
  padding:15px 38px 30px
}

.login-layout {
  min-height:100vh;
  display:grid;
  grid-template-columns:1fr 1fr
}

.login-story {
  background:#183332;
  color:#e4f0e8;
  padding:48px 12%;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:60px
}

.login-brand {
  display:flex;
  gap:12px;
  align-items:center;
  font-size:24px;
  font-weight:700;
  letter-spacing:-.05em
}

.login-brand .brand-mark {
  background:#91b6a1;
  color:#183332
}

.login-story .eyebrow {
  color:#9ec3aa
}

.login-story h1 {
  font-size:45px;
  letter-spacing:-.05em;
  line-height:1.5;
  margin:0 0 26px;
  font-weight:550
}

.login-story p:not(.eyebrow) {
  font-size:15px;
  color:#92b0a4;
  line-height:2
}

.login-footnote {
  font-size:11px;
  color:#789b8e;
  letter-spacing:.1em
}

.login-form-wrap {
  display:grid;
  place-items:center;
  background:#fafbfd;
  padding:35px
}

.login-form-wrap form {
  width:100%;
  max-width:360px
}

.login-form-wrap h2 {
  font-size:28px;
  margin:0 0 15px;
  letter-spacing:-.04em
}

.login-form-wrap .muted {
  margin-bottom:35px
}

.login-form-wrap .field {
  margin-bottom:22px
}

.login-form-wrap input {
  padding:14px;
  font-size:13px
}

.login-form-wrap .button {
  padding:14px
}

.login-help {
  font-size:11px;
  color:var(--muted);
  text-align:center;
  margin-top:22px
}

dialog {
  border:0;
  border-radius:16px;
  padding:0;
  width:min(600px,calc(100% - 32px));
  max-height:90vh;
  color:var(--ink);
  box-shadow:0 20px 100px #172a4d33
}

dialog::backdrop {
  background:#172a4d55;
  backdrop-filter:blur(3px)
}

.dialog-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:22px 25px;
  border-bottom:1px solid var(--line)
}

.dialog-header h2 {
  margin:0;
  font-size:18px
}

.dialog-content {
  padding:24px 25px
}

.dialog-notice {
  margin:0 0 20px;
  overflow-wrap:anywhere
}

.dialog-notice[data-type=error] {
  background:#fff1f0;
  border-color:#ebc4c1;
  color:#963b35
}

.icon-button {
  border:0;
  background:none;
  font-size:27px;
  color:var(--muted);
  padding:0 5px
}

#toast {
  position:fixed;
  bottom:25px;
  left:50%;
  transform:translateX(-50%);
  background:#263b58;
  color:white;
  padding:14px 22px;
  border-radius:9px;
  max-width:calc(100% - 32px);
  box-shadow:0 8px 25px #172a4d22;
  font-size:12px;
  z-index:100
}

#toast[data-type=error] {
  background:#ae4c49
}

:focus-visible {
  outline:2px solid var(--brand);
  outline-offset:3px
}

@media(max-width:1100px) {
  .admin-layout {
    grid-template-columns:190px 1fr
  }
  .sidebar {
    padding:25px 10px
  }
  .sidebar-brand {
    font-size:19px
  }
  .topbar {
    padding:18px 25px
  }
  .workspace main {
    padding:28px 25px
  }
  .stats {
    grid-template-columns:repeat(2,1fr)
  }
  .grid-two {
    grid-template-columns:1fr
  }
  .staff-menu {
    gap:10px
  }
  .tenant-switch {
    gap:10px
  }
  .tenant-switch select {
    width:180px
  }
}

@media(max-width:750px) {
  .admin-layout {
    display:block
  }
  .sidebar {
    position:static;
    height:auto;
    padding:14px 18px;
    border-right:0;
    border-bottom:1px solid var(--line)
  }
  .sidebar-brand {
    margin-bottom:16px;
    font-size:18px;
    padding:0
  }
  .sidebar-section,.sidebar-bottom {
    display:none
  }
  .sidebar nav {
    display:flex;
    overflow-x:auto;
    overflow-y:hidden;
    gap:6px;
    padding-bottom:5px
  }
  .sidebar nav button {
    white-space:nowrap;
    padding:10px;
    font-size:11px;
    gap:7px
  }
  .sidebar nav .nav-icon {
    font-size:13px
  }
  .topbar {
    padding:16px 18px;
    align-items:flex-start;
    flex-wrap:wrap
  }
  .tenant-switch {
    flex-wrap:wrap
  }
  .tenant-switch select {
    width:180px
  }
  .staff-menu {
    margin-left:auto;
    font-size:11px
  }
  .workspace main {
    padding:25px 18px
  }
  .page-heading {
    align-items:flex-start
  }
  .page-heading h1 {
    font-size:24px
  }
  .page-heading .muted {
    max-width:250px;
    font-size:11px
  }
  .stats {
    gap:12px
  }
  .stat {
    padding:17px
  }
  .stat-value {
    font-size:26px
  }
  .stat-label {
    font-size:11px
  }
  .stat-icon {
    width:26px;
    height:26px;
    font-size:14px
  }
  .card-heading,.card-body {
    padding:18px
  }
  .theme-grid {
    grid-template-columns:1fr
  }
  .domain-header {
    align-items:flex-start;
    flex-direction:column;
    gap:12px
  }
  th,td {
    padding:13px 16px
  }
  .button {
    padding:10px 12px;
    font-size:11px
  }
  .login-layout {
    grid-template-columns:1fr
  }
  .login-story {
    padding:28px;
    gap:35px
  }
  .login-story h1 {
    font-size:30px;
    margin:0
  }
  .login-story p:not(.eyebrow),.login-footnote {
    display:none
  }
  .login-form-wrap {
    padding:40px 28px
  }
  .login-brand {
    font-size:21px
  }
  .login-form-wrap h2 {
    font-size:24px
  }
  .admin-footer {
    padding-left:18px;
    font-size:9px
  }
}

.price {
  margin: 14px 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.price small {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted, #667);
}

.price-matrix td button {
  white-space: nowrap;
}

.price-matrix .derived {
  color: var(--muted, #667);
  font-weight: 400;
}

/* Merchant onboarding review */
.filter-bar{display:flex;align-items:center;gap:16px;padding:18px 22px;margin-bottom:20px;flex-wrap:wrap;font-size:13px}
.filter-bar select{width:auto;min-width:150px;border:1px solid var(--line);padding:8px 12px;border-radius:6px;background:white;color:var(--ink);font:inherit}
.filter-bar>a{margin-left:auto}
.application-description{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.9;color:var(--muted)}
.login-help a{color:var(--brand);line-height:2}

.supply-toolbar{margin:18px 0;flex-wrap:wrap}
.supply-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:18px}
.supply-code{white-space:pre-wrap;overflow-wrap:anywhere;min-width:180px;max-width:520px}
.detail-row strong{overflow-wrap:anywhere;min-width:0}

/* Store level and supply pricing pages */
.pricing-nav{margin:0 0 20px;gap:10px}
.pricing-section-heading{margin:0 0 18px}
.pricing-section-heading h2,.pricing-context h2{margin:0;font-size:18px;line-height:1.5;overflow-wrap:anywhere}
.pricing-section-heading p{margin:6px 0 0;color:var(--muted);font-size:13px;line-height:1.7}
.pricing-context{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px 24px;margin-bottom:20px}
.pricing-context-info{min-width:0}
.pricing-context-label{display:block;color:var(--muted);font-size:11px;margin-bottom:5px}
.pricing-context p{margin:5px 0 0;color:var(--muted);font-size:12px;line-height:1.6}
.pricing-context-actions{flex-shrink:0;justify-content:flex-end}
.pricing-filter{display:flex;align-items:flex-end;flex-wrap:wrap;gap:14px;padding:18px 24px}
.pricing-filter .field{flex:1 1 160px;min-width:140px;margin:0}
.pricing-filter .field:first-child{flex-grow:2}
.pricing-filter .button-row{padding-bottom:3px}
.pricing-final-price{color:var(--brand);font-size:18px}
.pricing-breakdown{min-width:130px;font-size:12px}
.pricing-breakdown summary{color:var(--brand);cursor:pointer}
.pricing-breakdown dl{display:grid;grid-template-columns:auto auto;gap:8px 18px;margin:12px 0 0}
.pricing-breakdown dt{color:var(--muted)}
.pricing-breakdown dd{margin:0;text-align:right}
@media(max-width:1100px){.pricing-context{align-items:flex-start;flex-wrap:wrap}.pricing-context-actions{justify-content:flex-start}}
@media(max-width:600px){.pricing-context,.pricing-filter{padding:16px;gap:14px}.pricing-context h2{font-size:16px}.pricing-context-actions{gap:8px}.pricing-filter .field{flex-basis:100%}.pricing-filter .button-row{padding:0}.pricing-nav{gap:8px}}

.procurement-quantity{width:90px;min-width:72px;border:1px solid var(--line);border-radius:6px;padding:8px;background:#fff}
.procurement-quantity:disabled{background:var(--bg);color:var(--muted)}
.procurement-target{max-width:280px;min-width:170px;border:1px solid var(--line);border-radius:6px;padding:8px;background:#fff}
.procurement-summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;flex-wrap:wrap;font-size:14px}
.procurement-summary strong{color:var(--brand)}
.procurement-payment{max-width:440px;margin-top:24px}
@media(max-width:600px){.procurement-summary{padding:16px}.procurement-target{max-width:190px}}

.code-groups{margin-top:24px}
.code-groups>h2{font-size:17px;margin:0 0 16px}
.code-group{padding:20px 24px}
.code-group-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}
.code-group-heading h3{font-size:15px;margin:0;overflow-wrap:anywhere}
.code-group-heading p{font-size:12px;color:var(--muted);margin:5px 0 0;line-height:1.6}
.code-group-heading .button{flex-shrink:0;white-space:nowrap}
.code-group-content{margin:0;max-height:320px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.9}
.code-group-empty{margin:0;font-size:12px;color:var(--muted)}
@media(max-width:600px){.code-group{padding:16px}.code-group-heading{align-items:flex-start;flex-wrap:wrap;gap:12px}}

.order-customer{min-width:170px;max-width:260px;overflow-wrap:anywhere}

.procurement-nav{gap:8px;margin-bottom:16px}
.procurement-nav .button{white-space:nowrap}
.procurement-detail-heading{padding:18px 24px;margin-bottom:20px;gap:16px}
.procurement-detail-meta{display:flex;align-items:center;flex-wrap:wrap;gap:6px 16px;margin-top:6px;font-size:12px;line-height:1.6;color:var(--muted);overflow-wrap:anywhere}
.procurement-detail-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:12px;flex-shrink:0}
@media(max-width:600px){.procurement-detail-heading{padding:16px}.procurement-detail-actions{justify-content:flex-start;gap:10px}.procurement-detail-meta{font-size:11px;gap:4px 12px}}

.product-management-table table { min-width: 760px; }
.product-management-table .button { white-space: nowrap; }
.product-management-table td:first-child { min-width: 180px; }

.tenant-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 28px; }
.tenant-detail-grid .detail-row strong { overflow-wrap: anywhere; }
.tenant-detail-section { margin-top: 28px; }
.tenant-detail-section table { min-width: 680px; }
.tenant-detail-section .button { white-space: nowrap; }
@media (max-width: 760px) { .tenant-detail-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
