:root {
  --line: #c7d1dc;
  --ink: #17324d;
  --muted: #5f7286;
  --panel: #ffffff;
  --panel-alt: #e7eef5;
  --accent: #2c6ba0;
  --danger: #b23a3a;
  --bg: #f5f8fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #eff4f9 0%, #f8fbfe 100%);
}

a {
  color: var(--accent);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.8rem 1rem 1.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  backdrop-filter: saturate(160%) blur(8px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.site-header__brand {
  display: grid;
  gap: 0.15rem;
  color: inherit;
  text-decoration: none;
}

.site-header__brand strong {
  font-size: 1.3rem;
}

.site-header__brand span {
  color: var(--muted);
  font-size: 0.86rem;
}

.site-header__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-header__nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.site-header__nav a.site-header__sell-cta {
  background: #0b7a3b;
  border-color: #0b7a3b;
  color: #fff;
  font-weight: 600;
}

.site-header__nav a.site-header__sell-cta:hover,
.site-header__nav a.site-header__sell-cta:focus {
  background: #086130;
  border-color: #086130;
}

.site-header__user {
  display: inline-grid;
  align-content: center;
  gap: 0.08rem;
  min-height: 2.35rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.1;
}

.site-header__user-name {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
}

.site-header__user-role {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.site-header__tokens {
  display: inline-grid;
  align-content: center;
  gap: 0.05rem;
  min-height: 2.35rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid #ccd8b8;
  border-radius: 0.65rem;
  background: linear-gradient(180deg, #f3f7e5 0%, #e7efcf 100%);
  color: #3f4c1f;
  text-decoration: none;
  line-height: 1.1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.site-header__tokens:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(63, 76, 31, 0.16), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.site-header__tokens-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5a6b2d;
}

.site-header__tokens-count {
  font-size: 0.95rem;
  font-weight: 700;
}

.site-header__tokens-count small {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.site-header__tokens-value {
  font-size: 0.7rem;
  color: #5a6b2d;
}

.token-panel {
  margin-top: 0.9rem;
  padding: 1rem 1.1rem;
  border: 1px solid #ccd8b8;
  border-radius: 0.85rem;
  background: linear-gradient(180deg, #f6faeb 0%, #eaf1d4 100%);
  color: #3f4c1f;
}

.token-panel__amount {
  margin-top: 0.25rem;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.token-panel__symbol {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #5a6b2d;
}

.token-buy {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed rgba(90, 107, 45, 0.35);
}

.token-buy h3 {
  margin: 0 0 0.3rem 0;
  font-size: 1.05rem;
  color: #3f4c1f;
}

.token-bank {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 1rem;
  margin: 0.75rem 0;
  padding: 0.75rem 0.9rem;
  background: #ffffff;
  border: 1px solid #ccd8b8;
  border-radius: 0.6rem;
  font-size: 0.9rem;
}

.token-bank > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.token-bank__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5a6b2d;
  font-weight: 700;
}

.token-bank__value {
  font-family: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;
  color: #24301c;
  word-break: break-all;
}

.token-bank__reference {
  grid-column: 1 / -1;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(90, 107, 45, 0.35);
}

.token-bank__reference strong {
  font-family: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 1.05rem;
  color: #253016;
  letter-spacing: 0.04em;
}

@media (max-width: 640px) {
  .token-bank {
    grid-template-columns: 1fr;
  }
}

.token-admin-row-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.token-admin-row-form input[type="number"] {
  width: 8rem;
  padding: 0.35rem 0.55rem;
  font-family: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;
}

.token-source {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.token-source--db {
  background: #e0ebcf;
  color: #3f4c1f;
  border: 1px solid #b8c796;
}

.token-source--recovery {
  background: #fff4d4;
  color: #6b4a13;
  border: 1px solid #d9c078;
}

.token-role {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: #eef1f7;
  color: #3a4255;
  border: 1px solid #c8cfdd;
}

.token-role--merchant {
  background: #dceeff;
  color: #1d3f66;
  border-color: #9dc3e8;
}

.token-role--courier {
  background: #f0e3ff;
  color: #43226d;
  border-color: #c6a6e8;
}

.token-role--admin {
  background: #ffd8d8;
  color: #7a1f1f;
  border-color: #e89a9a;
}

.token-admin-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  padding: 0.75rem 1rem;
  border: 1px solid #dde2ec;
  border-radius: 0.75rem;
  background: #f7f8fb;
}

.token-admin-filter .field {
  flex: 1 1 14rem;
  min-width: 10rem;
}

.token-admin-filter select,
.token-admin-filter input[type="search"] {
  width: 100%;
}

.token-admin-filter .sales-history-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-runtime-badge {
  position: absolute;
  right: 1rem;
  bottom: 0.35rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(18, 38, 58, 0.12);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  pointer-events: none;
}

@media (max-width: 900px) {
  .site-header {
    padding-bottom: 0.8rem;
  }

  .site-runtime-badge {
    position: static;
    margin-left: auto;
    margin-top: 0.35rem;
    order: 3;
  }
}

.page-shell {
  padding: 0.8rem;
}

.page-shell > *:not(.admin-editor-shell):not(.admin-editor-panel):not(.admin-editor-stack) {
  width: min(100%, 1440px);
  margin-inline: auto;
}

.form-shell,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 12px 30px rgba(18, 38, 58, 0.06);
}

.stack {
  display: grid;
  gap: 1rem;
}

.storefront-shell {
  display: grid;
  gap: 1rem;
}

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

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.catalog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b58712;
}

.button,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.button-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.button-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.button-small {
  min-height: 1.45rem;
  padding: 0.08rem 0.45rem;
  font-size: 0.72rem;
}

.field-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.field {
  display: grid;
  gap: 0.3rem;
  align-content: start;
}

.field-row > .field > input,
.field-row > .field > select,
.field-row > .field > textarea {
  width: 100%;
  min-width: 0;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"],
input[type="week"],
select,
textarea,
.admin-grid-input {
  width: 100%;
  min-width: 0;
  padding: 0.28rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

.field-note {
  color: var(--muted);
  font-size: 0.77rem;
}

.notice {
  padding: 0.8rem 0.9rem;
  border: 1px solid #b9d7c1;
  border-radius: 0.9rem;
  background: #e7f7eb;
}

.notice--warning {
  border-color: #e2c37d;
  background: #fff6df;
}

.notice--danger {
  border-color: #e4a0a0;
  background: #fdecec;
}

.notice--info {
  border-color: #b6d3ea;
  background: #edf7ff;
}

.action-bar,
.toolbar,
.sales-history-toolbar,
.sales-history-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.action-bar,
.toolbar,
.sales-history-toolbar {
  justify-content: space-between;
}

.action-bar {
  padding: 0.35rem 0;
}

.storefront-shell {
  display: grid;
  gap: 1rem;
}

.storefront-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.catalog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 1.6rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: #edf4fb;
  color: #35506a;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
}

.metric-grid,
.merchant-sections {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metric-card {
  display: grid;
  gap: 0.4rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(180deg, #fff 0%, #f3f8fd 100%);
  box-shadow: 0 12px 24px rgba(18, 38, 58, 0.05);
}

.metric-card strong {
  font-size: 1.8rem;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.toolbar {
  margin-bottom: 0.75rem;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table,
.sku-sheet-table {
  border-collapse: collapse;
  background: #fff;
}

.admin-table th,
.admin-table td,
.sku-sheet-table th,
.sku-sheet-table td {
  padding: 0.12rem 0.22rem;
  border: 1px solid var(--line);
  vertical-align: middle;
  background: #fff;
}

.admin-table th,
.sku-sheet-table th {
  background: var(--panel-alt);
  color: #33475b;
  font-weight: 600;
}

.product-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.storefront-grid,
.store-grid,
.merchant-grid,
.catalog-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.product-card {
  display: grid;
  gap: 0.8rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  overflow: hidden;
}

.product-card__art {
  display: grid;
  place-items: center;
  min-height: 180px;
  background: radial-gradient(circle at 70% 30%, rgba(246, 224, 154, 0.7), transparent 40%), linear-gradient(135deg, #eff3f7 0%, #fbf7e6 100%);
}

.product-art-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-art-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.6);
  color: #fff;
  font-weight: 700;
}

.quantity-input {
  width: 5rem;
}

.product-card__body {
  display: grid;
  gap: 0.45rem;
  padding: 0 1rem 1rem;
}

.store-card,
.merchant-card,
.catalog-item {
  display: grid;
  gap: 0.7rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(18, 38, 58, 0.05);
}

.store-card__head,
.merchant-card__head,
.catalog-item__head {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1rem 0;
}

.store-card__body,
.merchant-card__body,
.catalog-item__body {
  display: grid;
  gap: 0.45rem;
  padding: 0 1rem 1rem;
}

.store-card__meta,
.merchant-card__meta,
.catalog-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.store-card__footer,
.merchant-card__footer,
.catalog-item__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0 1rem 1rem;
}

.badge,
.badge-pill,
.pill,
.store-badge,
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 1.6rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: #edf4fb;
  color: #35506a;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge--success,
.pill--success,
.stock-badge--success {
  background: #e8f6ec;
  color: #2d6b41;
}

.badge--warning,
.pill--warning,
.stock-badge--warning {
  background: #fff3d8;
  color: #8c6510;
}

.badge--danger,
.pill--danger,
.stock-badge--danger {
  background: #fde8e8;
  color: #a33b3b;
}

.product-price,
.line-total,
.cart-total,
.checkout-total {
  font-weight: 700;
}

.product-actions,
.catalog-actions,
.cart-actions,
.checkout-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.qty-control,
.quantity-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.18rem 0.35rem;
  background: #fff;
}

.qty-control input,
.quantity-control input {
  width: 4rem;
  text-align: center;
  border: 0;
  background: transparent;
  padding: 0;
}

.cart-table-wrap,
.order-table-wrap,
.checkout-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.cart-table,
.order-table,
.checkout-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #fff;
}

.cart-table th,
.cart-table td,
.order-table th,
.order-table td,
.checkout-table th,
.checkout-table td {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  vertical-align: middle;
}

.cart-table th,
.order-table th,
.checkout-table th {
  background: var(--panel-alt);
  color: #33475b;
  font-weight: 600;
  text-align: left;
}

.cart-summary,
.checkout-summary,
.order-summary {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(180deg, #fff 0%, #f7fbff 100%);
}

.cart-summary__row,
.checkout-summary__row,
.order-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.cart-summary__row strong,
.checkout-summary__row strong,
.order-summary__row strong {
  font-weight: 700;
}

.checkout-layout,
.cart-layout,
.order-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  align-items: start;
}

.checkout-panel,
.cart-panel,
.order-panel {
  display: grid;
  gap: 0.85rem;
}

.empty-state,
.cart-empty,
.checkout-empty {
  display: grid;
  gap: 0.35rem;
  place-items: start;
  padding: 1.2rem;
  border: 1px dashed var(--line);
  border-radius: 1rem;
  background: #fbfdff;
  color: var(--muted);
}

.product-grid .field-note,
.store-grid .field-note,
.merchant-grid .field-note {
  margin-top: 0;
}

.login-page-shell {
  display: grid;
  place-items: center;
}

.login-card {
  width: min(32rem, 100%);
}

.sku-admin-page .admin-editor-shell {
  width: calc(100vw - 0.1rem);
  max-width: none;
  margin-left: 0.05rem;
  margin-right: 0.05rem;
  gap: 0.18rem;
}

.sku-admin-page .admin-editor-panel,
.sku-admin-page .admin-editor-stack {
  width: 100%;
  max-width: none;
}

.sku-admin-page .form-shell,
.sku-admin-page .panel {
  padding: 0.14rem 0.18rem;
  border-radius: 0;
  box-shadow: none;
}

.sku-admin-page .sku-admin-toolbar {
  padding: 0.12rem 0.14rem;
}

.sku-admin-page h1,
.sku-admin-page h2,
.sku-admin-page h3,
.sku-admin-page p {
  margin: 0;
}

.sku-admin-page h1 {
  font-size: 1.05rem;
  line-height: 1.05;
}

.sku-admin-page .field-row {
  gap: 0.18rem;
}

.sku-admin-page .field {
  gap: 0.08rem;
}

.sku-admin-page .field label,
.sku-admin-page .eyebrow,
.sku-admin-page .field-note {
  font-size: 0.64rem;
  line-height: 1;
}

.sku-admin-page .sku-admin-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.18rem;
}

.sku-admin-page .sku-admin-toolbar .button,
.sku-admin-page .sku-admin-toolbar button {
  min-height: 1.05rem;
  padding: 0 0.35rem;
  font-size: 0.72rem;
  border-radius: 0.25rem;
}

.sku-admin-page .sku-sheet-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.sku-admin-page .sku-sheet-table th,
.sku-admin-page .sku-sheet-table td {
  white-space: nowrap;
  vertical-align: middle;
  padding: 0 0.03rem;
  line-height: 1;
  font-size: 0.76rem;
}

.sku-admin-page .sku-sheet-table th {
  font-size: 0.67rem;
  letter-spacing: 0.01em;
  font-weight: 700;
  padding-top: 0.02rem;
  padding-bottom: 0.02rem;
}

.sku-admin-page .sku-sheet-table .admin-grid-input {
  width: 100%;
  min-width: 0;
  padding: 0 0.08rem;
  font-size: 0.76rem;
  line-height: 1;
  min-height: 1.08rem;
  height: 1.08rem;
  border-radius: 0;
}

.sku-admin-page .sku-sheet-table th:nth-child(1),
.sku-admin-page .sku-sheet-table td:nth-child(1) {
  width: 4.2rem;
}

.sku-admin-page .sku-sheet-table th:nth-child(2),
.sku-admin-page .sku-sheet-table td:nth-child(2),
.sku-admin-page .sku-sheet-table th:nth-child(3),
.sku-admin-page .sku-sheet-table td:nth-child(3),
.sku-admin-page .sku-sheet-table th:nth-child(4),
.sku-admin-page .sku-sheet-table td:nth-child(4) {
  width: 5.6rem;
}

.sku-admin-page .sku-sheet-table th:nth-child(5),
.sku-admin-page .sku-sheet-table td:nth-child(5),
.sku-admin-page .sku-sheet-table th:nth-child(6),
.sku-admin-page .sku-sheet-table td:nth-child(6),
.sku-admin-page .sku-sheet-table th:nth-child(7),
.sku-admin-page .sku-sheet-table td:nth-child(7) {
  width: 7rem;
}

.sku-admin-page .sku-sheet-table th:nth-child(8),
.sku-admin-page .sku-sheet-table td:nth-child(8) {
  width: 2.6rem;
}

.sku-admin-page .sku-sheet-table th:nth-child(9),
.sku-admin-page .sku-sheet-table td:nth-child(9),
.sku-admin-page .sku-sheet-table th:nth-child(11),
.sku-admin-page .sku-sheet-table td:nth-child(11) {
  width: 2rem;
}

.sku-admin-page .sku-sheet-table th:nth-child(10),
.sku-admin-page .sku-sheet-table td:nth-child(10) {
  width: 3.7rem;
}

.sku-admin-page .sku-sheet-table th:nth-child(12),
.sku-admin-page .sku-sheet-table td:nth-child(12) {
  width: 6.8rem;
}

.sku-admin-page .sku-sheet-table th:nth-child(13),
.sku-admin-page .sku-sheet-table td:nth-child(13) {
  width: 6rem;
}

.sku-admin-page .sku-sheet-table th:nth-child(14),
.sku-admin-page .sku-sheet-table td:nth-child(14) {
  width: 6.6rem;
}

.sku-admin-page .sku-sheet-table th:nth-child(15),
.sku-admin-page .sku-sheet-table td:nth-child(15) {
  width: 2.65rem;
}

.sku-admin-page .sku-sheet-table .sku-admin-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.02rem;
  min-width: 2.3rem;
}

.sku-admin-page .sku-sheet-table .sku-admin-actions .button {
  width: 100%;
  min-height: 0.9rem;
  padding: 0 0.08rem;
  font-size: 0.61rem;
  line-height: 1;
  border-radius: 0;
}

.sku-admin-page .sku-admin-table .field-note {
  margin-top: 0;
  font-size: 0.62rem;
  line-height: 1;
}

.sku-admin-page .sku-image-cell {
  padding-top: 0.01rem;
  padding-bottom: 0.01rem;
}

.sku-admin-page .sku-image-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.08rem;
  margin-top: 0.02rem;
}

.sku-admin-page .sku-image-tools .button {
  min-height: 0.9rem;
  padding: 0 0.14rem;
  font-size: 0.61rem;
  border-radius: 0;
}

.sku-admin-page .sku-inline-link {
  display: inline-flex;
  align-items: center;
  min-height: 0.9rem;
  padding: 0 0.08rem;
  color: var(--accent);
  font-size: 0.61rem;
  line-height: 1;
  text-decoration: underline;
}

.sku-admin-page .admin-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
}

.sales-history-toolbar,
.sales-history-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.sales-history-toolbar {
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.sales-history-page .history-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.sales-history-page .history-table th,
.sales-history-page .history-table td {
  white-space: nowrap;
  padding: 0.18rem 0.32rem;
  font-size: 0.7rem;
  vertical-align: top;
}

.sales-history-page .history-table .history-cell--text {
  min-width: 12rem;
  max-width: 24rem;
  white-space: normal;
  line-height: 1.25;
}

.store-section,
.catalog-section,
.cart-section,
.checkout-section,
.order-section {
  display: grid;
  gap: 1rem;
}

.store-hero,
.catalog-hero,
.cart-hero,
.checkout-hero,
.order-hero {
  display: grid;
  gap: 0.4rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(231, 238, 245, 0.9));
}

@media (max-width: 900px) {
  .grid-2,
  .field-row,
  .checkout-layout,
  .cart-layout,
  .order-layout {
    grid-template-columns: 1fr;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.page-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #f8fafc;
  padding: 2.5rem 2rem;
  border-radius: 14px;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.page-hero h1 {
  margin: 0 0 0.75rem;
  font-size: 2.25rem;
  letter-spacing: -0.01em;
}

.page-hero__lede {
  font-size: 1.125rem;
  margin: 0 0 1rem;
  max-width: 56ch;
  color: #cbd5f5;
}

.page-hero__badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  margin: 0;
}

.page-block {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.page-block h2 {
  margin-top: 0;
  font-size: 1.25rem;
  color: #0f172a;
}

.page-block p {
  color: #334155;
  line-height: 1.55;
}

.page-block--highlight {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
  border-color: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}

.page-block--highlight h2 {
  color: #047857;
}

.feature-list,
.roadmap {
  margin: 0;
  padding-left: 1.25rem;
  color: #334155;
}

.feature-list li,
.roadmap li {
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

.feature-list strong,
.roadmap strong {
  color: #0f172a;
}

.catalogue-thumb {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.catalogue-sku {
  font-size: 0.75rem;
  color: #334155;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-top: 1rem;
}

.hm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.hm-table th,
.hm-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.hm-table thead th {
  background: #f8fafc;
  font-weight: 600;
  color: #0f172a;
  position: sticky;
  top: 0;
}

.hm-table--compact th,
.hm-table--compact td {
  padding: 0.45rem 0.6rem;
}

.hm-table tbody tr:hover {
  background: #f8fafc;
}

.hm-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.hm-alert--warning {
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fbbf24;
}

.muted {
  color: #94a3b8;
}

.catalogue-product--placeholder {
  font-style: italic;
}

.catalogues-upload {
  margin: 1rem 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.5rem 1rem;
}

.catalogues-upload summary {
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0;
  color: #0f172a;
}

.catalogues-upload__form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.6rem;
  padding-top: 0.5rem;
}

.catalogues-upload__form label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
  color: #334155;
}

.catalogues-upload__form input {
  padding: 0.4rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.9rem;
}

.catalogues-upload__url {
  grid-column: 1 / -1;
}

.catalogues-upload__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.hm-alert--success {
  background: #dcfce7;
  color: #14532d;
  border: 1px solid #86efac;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.hm-alert--info {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #7dd3fc;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.hm-alert__list {
  margin: 0.3rem 0 0 1.2rem;
  padding: 0;
}

.catalogue-edit-cell {
  min-width: 14rem;
}

.catalogue-edit-cell--narrow {
  min-width: 6rem;
}

.catalogue-edit-input {
  width: 100%;
  padding: 0.3rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.88rem;
  background: transparent;
  color: #0f172a;
}

.catalogue-edit-input:hover,
.catalogue-edit-input:focus {
  border-color: #cbd5e1;
  background: #fff;
  outline: none;
}

.catalogue-edit-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.catalogue-edit-input--placeholder {
  font-style: italic;
  color: #94a3b8;
}

.catalogue-edit-input--price {
  max-width: 5.5rem;
}

.catalogue-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  white-space: nowrap;
}

.btn--xs {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  border-radius: 4px;
}

.catalogue-row--edited {
  background: #fffbeb;
}

.catalogue-edited-flag {
  color: #16a34a;
  font-weight: 700;
}

.catalogue-row--rescan {
  background: #fff7ed;
}

.catalogue-rescan-flag {
  color: #c2410c;
  font-weight: 700;
}

.catalogue-btn--rescan {
  border-color: #f97316;
  color: #c2410c;
}

.catalogue-btn--rescan:hover {
  background: #fff7ed;
}

.catalogue-btn--rescan-clear {
  border-color: #94a3b8;
  color: #475569;
}

.token-admin-meta {
  color: #475569;
  font-size: 0.875rem;
  margin: 0.25rem 0 1rem;
}

.token-admin-filter__check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.token-admin-filter__check span {
  margin: 0;
}

/* Skip-to-content link for keyboard + screen-reader users.
   Hidden off-screen until it receives focus, at which point it slides
   into view and can be activated to jump past the header/nav into
   #main-content. */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  padding: 0.5rem 0.9rem;
  background: #17324d;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 0.5rem 0;
  z-index: 1000;
  transition: top 0.1s;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid #fff;
  outline-offset: -2px;
}

#main-content:focus {
  outline: none;
}

.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 1rem 2rem;
  border-top: 1px solid var(--line);
  background: #fafaf7;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.site-footer__nav a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-footer__nav a:hover,
.site-footer__nav a:focus {
  border-bottom-color: var(--ink);
}

.site-footer__meta {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}
