:root {
  color-scheme: dark;
  --topbar-height: 130px;
  --ink: #f4f6f8;
  --muted: #a8b0ba;
  --line: rgba(224, 166, 54, 0.28);
  --paper: #050506;
  --surface: #111214;
  --surface-strong: #18191c;
  --accent: #d89420;
  --accent-strong: #f4b540;
  --warm: #ff9f1c;
  --good: #55d68f;
  --danger: #ff6b5f;
  --gold-soft: rgba(216, 148, 32, 0.18);
  --gold-line: rgba(244, 181, 64, 0.42);
  --shadow: 0 22px 58px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-height) + 18px);
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  padding: var(--topbar-height) 0 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(216, 148, 32, 0.16), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(255, 159, 28, 0.09), transparent 28%),
    linear-gradient(180deg, #050506 0%, #0b0c0e 52%, #060607 100%);
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

body::before {
  display: none;
}

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

a {
  color: inherit;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid var(--gold-line);
  background: rgba(5, 5, 6, 0.9);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
}

.section,
.admin-block,
#products,
#order,
#myOrders,
#ordersPanel,
#productsPanel,
#shippingPanel,
#usersPanel {
  scroll-margin-top: calc(var(--topbar-height) + 18px);
}

.topbar h1,
.section h2,
.panel h2 {
  margin: 0;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar__logo {
  width: 54px;
  aspect-ratio: 0.74;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.3));
}

.topbar h1 {
  font-size: clamp(20px, 3vw, 30px);
  color: #f2f4f7;
  text-transform: uppercase;
  text-shadow: 0 0 22px rgba(244, 181, 64, 0.16);
}

.topbar__nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.language-control {
  min-width: 126px;
}

.language-control span {
  font-size: 12px;
}

.topbar__nav a {
  min-width: 68px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
}

.topbar__nav a:hover {
  border-color: var(--gold-line);
  color: var(--accent-strong);
  background: rgba(216, 148, 32, 0.12);
}

body:has(#appShell:not([hidden])) {
  --topbar-height: 0px;
  padding: 0 0 0 268px;
}

body:has(#appShell:not([hidden])) .topbar {
  inset: 0 auto 0 0;
  width: 268px;
  height: 100vh;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 18px;
  padding: 22px 18px;
  border-right: 1px solid var(--gold-line);
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(5, 5, 6, 0.98), rgba(14, 13, 12, 0.96));
}

body:has(#appShell:not([hidden])) .topbar__brand {
  align-items: flex-start;
}

body:has(#appShell:not([hidden])) .topbar__logo {
  width: 58px;
}

body:has(#appShell:not([hidden])) .topbar h1 {
  white-space: normal;
  font-size: 22px;
  line-height: 1.15;
}

body:has(#appShell:not([hidden])) .topbar__nav {
  display: grid;
  width: 100%;
  gap: 8px;
  align-items: stretch;
}

body:has(#appShell:not([hidden])) .topbar__nav a,
body:has(#appShell:not([hidden])) .topbar__nav .button {
  display: flex;
  min-height: 42px;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
}

body:has(#appShell:not([hidden])) .language-control {
  width: 100%;
  min-width: 0;
  margin-top: auto;
}

body:has(#appShell:not([hidden])) main {
  width: min(1440px, calc(100% - 32px));
}

body:has(#adminWorkspace:not([hidden])) {
  --topbar-height: 0px;
  padding: 0 0 0 268px;
}

body:has(#adminWorkspace:not([hidden])) .topbar {
  inset: 0 auto 0 0;
  width: 268px;
  height: 100vh;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 18px;
  padding: 22px 18px;
  border-right: 1px solid var(--gold-line);
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(5, 5, 6, 0.98), rgba(14, 13, 12, 0.96));
}

body:has(#adminWorkspace:not([hidden])) .topbar__nav {
  display: grid;
  width: 100%;
  gap: 8px;
  align-items: stretch;
}

body:has(#adminWorkspace:not([hidden])) .topbar__nav a,
body:has(#adminWorkspace:not([hidden])) .topbar__nav .button {
  display: flex;
  min-height: 42px;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
}

body:has(#adminWorkspace:not([hidden])) main {
  width: min(1440px, calc(100% - 32px));
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 56px;
}

.hero {
  position: relative;
  min-height: 170px;
  display: grid;
  align-items: center;
  margin: 18px 0 24px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  background:
    linear-gradient(110deg, rgba(0, 0, 0, 0.96), rgba(12, 12, 14, 0.92) 56%, rgba(82, 51, 10, 0.36)),
    radial-gradient(circle at 90% 15%, rgba(244, 181, 64, 0.18), transparent 30%),
    #050506;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.38);
}

.hero::before {
  display: none;
}

.hero::after {
  display: none;
}

.auth-screen {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(610px, 1.22fr);
  gap: clamp(28px, 4vw, 54px);
  min-height: calc(100vh - 96px);
  align-items: center;
  padding: 34px 0;
}

.auth-hero {
  position: relative;
  max-width: 500px;
  padding: clamp(18px, 3vw, 34px) 0;
}

.auth-hero::before {
  display: none;
}

.brand-lockup {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  margin: 12px 0 22px;
}

.brand-lockup--auth {
  grid-template-columns: 150px minmax(0, 310px);
  max-width: 500px;
}

.brand-mark {
  width: 150px;
  aspect-ratio: 0.86;
  display: grid;
  place-items: center;
  background: transparent;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.32));
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-mark--compact {
  width: 96px;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.28));
}

.brand-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.brand-name {
  color: #f5f6f8;
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 0.98;
  font-weight: 900;
  text-transform: uppercase;
}

.brand-lockup--auth .brand-name {
  font-size: clamp(34px, 3vw, 44px);
}

.brand-lockup--auth .brand-tagline {
  font-size: clamp(14px, 1.1vw, 17px);
}

.brand-tagline {
  color: var(--accent-strong);
  font-size: clamp(14px, 1.25vw, 18px);
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
}

.brand-lockup--hero {
  gap: 14px;
  margin: 0;
  width: 320px;
  min-width: 0;
}

.brand-lockup--hero .brand-name {
  font-size: 20px;
  line-height: 1.05;
}

.brand-lockup--hero .brand-tagline {
  font-size: 11px;
  line-height: 1.4;
}

.auth-hero h2 {
  margin: 0 0 12px;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1.04;
  color: #f5f6f8;
  text-transform: uppercase;
}

.auth-hero h3 {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: clamp(22px, 3vw, 34px);
}

.auth-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.auth-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.auth-benefits span {
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(216, 148, 32, 0.1);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
  align-items: start;
  justify-self: stretch;
  max-width: none;
  width: 100%;
  margin-left: auto;
}

#loginForm {
  grid-column: 1;
  grid-row: 1;
}

#registerForm {
  grid-column: 2;
  grid-row: 1;
}

.auth-login-message {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 24px;
  margin: -2px 0;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
  width: 100%;
  padding: clamp(22px, 3.6vw, 34px);
  color: white;
}

.hero h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.12;
  text-shadow: 0 0 32px rgba(244, 181, 64, 0.14);
}

.hero__copy {
  min-width: 0;
}

.hero__copy .eyebrow {
  margin-bottom: 8px;
}

.hero p {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 0;
  min-width: 136px;
}

.section {
  padding: 32px 0;
}

.section__heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

.section__heading--compact {
  align-items: center;
}

.section h2 {
  font-size: clamp(24px, 3vw, 36px);
}

.products-workspace {
  scroll-margin-top: 92px;
}

.view-toggle {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.view-toggle__button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 7px 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.view-toggle__button.is-active {
  background: linear-gradient(180deg, #f4b540, #b66b10);
  color: var(--accent-strong);
  color: #111214;
  box-shadow: 0 6px 16px rgba(20, 38, 56, 0.08);
}

.product-pane {
  display: grid;
  gap: 14px;
}

.product-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 2px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.filter,
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.search-field {
  flex: 1 1 460px;
  max-width: 620px;
  min-width: min(360px, 100%);
}

.product-toolbar .filter:not(.search-field) {
  flex: 0 1 260px;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(244, 181, 64, 0.16);
  outline: none;
}

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

.button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  font-weight: 700;
}

.button--primary {
  background: linear-gradient(180deg, #f4b540, #c77712);
  color: #111214;
  box-shadow: 0 10px 24px rgba(216, 148, 32, 0.2);
}

.button--primary:hover {
  background: linear-gradient(180deg, #ffc85a, #d89420);
}

.button--ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent-strong);
}

.button--ghost:hover {
  border-color: var(--accent);
}

.button--compact {
  min-height: 36px;
  padding: 7px 12px;
  white-space: nowrap;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 22px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.quick-order-table-wrap,
.review-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.quick-order-table tbody tr,
.review-table tbody tr {
  background: rgba(255, 255, 255, 0.015);
}

.quick-order-table tbody tr:hover,
.review-table tbody tr:hover {
  background: rgba(216, 148, 32, 0.08);
}

.quick-order-table,
.review-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.quick-order-table th,
.quick-order-table td,
.review-table th,
.review-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}

.quick-order-table th,
.review-table th {
  color: var(--muted);
  font-size: 13px;
}

.quick-order-table td small,
.review-table td small {
  display: block;
  color: var(--muted);
}

.quick-order-table input {
  width: 108px;
}

.product-grid__empty {
  grid-column: 1 / -1;
}

.product-card,
.panel,
.order-card,
.invoice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(28, 29, 32, 0.96), rgba(13, 14, 16, 0.96));
  box-shadow: var(--shadow);
}

.product-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.product-card h3 {
  margin: 0;
  font-size: 22px;
}

.product-meta {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.product-meta span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(224, 166, 54, 0.16);
  padding-bottom: 7px;
}

.product-card__variant {
  gap: 8px;
  border-bottom: 1px solid rgba(224, 166, 54, 0.16);
  padding-bottom: 7px;
}

.product-card__variant b {
  color: var(--ink);
}

.product-card__footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.price {
  color: var(--warm);
  font-size: 22px;
  font-weight: 800;
}

.price small,
.unit-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.section--split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

#order > .panel:first-child {
  position: static;
}

.panel {
  padding: 20px;
}

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

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

.form-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 22px;
}

.checkbox-field input {
  width: auto;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cart-list {
  display: grid;
  gap: 10px;
  min-height: 100px;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(220px, 1.05fr) minmax(300px, 0.95fr) minmax(360px, 1fr);
  gap: 14px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid rgba(224, 166, 54, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.cart-item strong {
  display: block;
}

.cart-item__main {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.cart-item small {
  color: var(--muted);
}

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

.cart-item__metrics span {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid rgba(224, 166, 54, 0.12);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.16);
}

.cart-item__metrics strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item__controls {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 96px 38px;
  gap: 8px;
  align-items: end;
}

.cart-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.cart-field span,
.cart-item__metrics small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cart-item input {
  padding: 8px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.totals {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.totals dt,
.totals dd {
  margin: 0;
}

.totals__grand {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 20px;
  font-weight: 800;
}

.message {
  min-height: 24px;
  color: var(--good);
  font-weight: 700;
}

.message--error {
  color: var(--danger);
}

.cart-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 30;
  width: max-content;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  padding: 16px 24px;
  background: linear-gradient(180deg, #f4b540, #b66b10);
  color: #111214;
  box-shadow: 0 22px 60px rgba(20, 38, 56, 0.24);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, calc(-50% + 10px)) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.cart-toast--visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.mini-cart {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 35;
  width: min(340px, calc(100vw - 36px));
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(28, 29, 32, 0.98), rgba(8, 8, 9, 0.98));
  box-shadow: 0 22px 60px rgba(20, 38, 56, 0.22);
}

.mini-cart:not(.mini-cart--expanded) {
  cursor: pointer;
}

.mini-cart--expanded {
  width: min(460px, calc(100vw - 36px));
  padding: 14px;
}

.mini-cart__head,
.mini-cart__foot,
.mini-cart__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-cart__head {
  margin-bottom: 8px;
}

.mini-cart__head .eyebrow {
  margin-bottom: 2px;
}

.mini-cart__badge {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.mini-cart__preview {
  display: grid;
  gap: 6px;
  border-top: 1px solid rgba(224, 166, 54, 0.18);
  border-bottom: 1px solid rgba(224, 166, 54, 0.18);
  padding: 8px 0;
  max-height: 165px;
  overflow: auto;
  overscroll-behavior: contain;
}

.mini-cart--expanded .mini-cart__preview {
  max-height: min(50vh, 430px);
  padding: 10px 0;
}

.mini-cart__preview p,
.mini-cart__preview small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.mini-cart__summary {
  color: var(--ink) !important;
  font-weight: 800;
}

.mini-cart__hint {
  color: var(--warm) !important;
}

.mini-cart__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px 0;
  border-top: 1px solid rgba(224, 166, 54, 0.12);
}

.mini-cart:not(.mini-cart--expanded) .mini-cart__item {
  padding: 6px 0;
}

.mini-cart:not(.mini-cart--expanded) .mini-cart__controls {
  display: none;
}

.mini-cart__preview p + .mini-cart__item {
  border-top: 0;
}

.mini-cart__item-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mini-cart__item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 700;
}

.mini-cart__item small {
  color: var(--warm);
  font-size: 13px;
}

.mini-cart__controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-cart__quantity {
  width: 64px;
  min-height: 34px;
  padding: 6px 8px;
}

.mini-cart__remove {
  width: 34px;
  height: 34px;
}

.mini-cart__foot {
  margin-top: 12px;
}

.mini-cart:not(.mini-cart--expanded) .mini-cart__foot {
  display: none;
}

.mini-cart__actions {
  display: flex;
  gap: 8px;
}

.mini-cart a,
.mini-cart button {
  cursor: pointer;
}

.mini-cart input {
  cursor: text;
}

.cart-back-link {
  margin: -4px 0 12px;
}

.order-review {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
}

body:has(.order-review:not([hidden])) .mini-cart {
  display: none;
}

.order-review__dialog {
  width: min(920px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(10, 20, 30, 0.24);
}

.order-review__content {
  display: grid;
  gap: 18px;
}

.order-review h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

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

.review-grid section {
  border: 1px solid rgba(224, 166, 54, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.review-grid p {
  margin: 4px 0;
}

.review-totals {
  width: min(360px, 100%);
  margin-left: auto;
}

.invoice-result[hidden],
[hidden] {
  display: none !important;
}

.invoice {
  padding: clamp(18px, 4vw, 34px);
}

.invoice__top,
.invoice__summary {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.invoice h3 {
  margin: 0 0 10px;
  font-size: 28px;
}

.invoice table,
.order-card table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
}

.order-table-wrap {
  width: 100%;
  margin-top: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.order-card .order-table {
  min-width: 980px;
  margin-top: 0;
  table-layout: fixed;
}

.order-card .order-table th:first-child,
.order-card .order-table td:first-child {
  width: 34%;
}

.invoice th,
.invoice td,
.order-card th,
.order-card td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.invoice th,
.order-card th {
  color: var(--muted);
  font-size: 13px;
}

.invoice__totals {
  width: min(320px, 100%);
  margin-left: auto;
}

.admin-login {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 24px;
}

.hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.orders-list {
  display: grid;
  gap: 14px;
}

.admin-block {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: linear-gradient(180deg, rgba(28, 29, 32, 0.96), rgba(13, 14, 16, 0.96));
  box-shadow: var(--shadow);
}

.stat-card span,
.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin: 4px 0;
  color: var(--accent-strong);
  font-size: 26px;
}

.stat-card--profit strong {
  color: var(--good);
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-edit-form {
  margin-bottom: 16px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(28, 29, 32, 0.96), rgba(13, 14, 16, 0.96));
  box-shadow: var(--shadow);
}

.admin-row h3,
.admin-row p {
  margin: 0 0 5px;
}

.admin-row__amount {
  color: var(--warm);
  font-size: 20px;
  font-weight: 800;
  text-align: right;
}

.admin-row__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-row--user {
  grid-template-columns: minmax(0, 1fr) 140px auto;
}

.account-password-form {
  max-width: 780px;
}

.variant-editor {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

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

.variant-editor__head h3 {
  margin: 0;
  font-size: 18px;
}

.variant-editor__rows {
  display: grid;
  gap: 10px;
}

.variant-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 180px) 36px;
  gap: 10px;
  align-items: center;
}

.admin-order-items {
  display: grid;
  gap: 10px;
}

.admin-order-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(170px, 1fr) 90px minmax(150px, 0.8fr) 36px;
  gap: 10px;
  align-items: end;
}

.admin-order-totals {
  max-width: 520px;
  margin-left: auto;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.order-card {
  padding: 18px;
}

.order-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.order-card h3 {
  margin: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid var(--gold-line);
  background: rgba(216, 148, 32, 0.12);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.order-card__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  color: var(--muted);
}

.order-assignment {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(240px, 360px);
  gap: 10px;
  align-items: center;
  margin: 14px 0 0;
  color: var(--muted);
}

.order-assignment span {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shipment-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(224, 166, 54, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.shipment-panel h4 {
  margin: 0;
  font-size: 16px;
}

.shipment-details {
  display: grid;
  gap: 8px;
  margin: 0;
}

.shipment-details div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
}

.shipment-details dt,
.shipment-details dd {
  margin: 0;
}

.shipment-details dt {
  color: var(--muted);
}

.shipment-details a {
  color: var(--accent-strong);
  overflow-wrap: anywhere;
}

.shipment-form {
  display: grid;
  gap: 10px;
}

.invoice-details {
  margin-top: 14px;
}

.invoice-details summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
}

.invoice-details .invoice {
  margin-top: 12px;
  box-shadow: none;
}

.order-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

body:has(#appShell:not([hidden])) {
  --topbar-height: 0px;
  padding: 0;
}

body:has(#adminWorkspace:not([hidden])) {
  --topbar-height: 0px;
  padding: 0;
}

body:has(#appShell:not([hidden])) > .topbar {
  display: none;
}

body:has(#appShell:not([hidden])) main {
  width: 100%;
  margin: 0;
}

body:has(#adminWorkspace:not([hidden])) main {
  width: 100%;
  margin: 0;
}

body:has(#adminWorkspace:not([hidden])) .section--admin {
  padding: 0;
}

#appShell[hidden] {
  display: none !important;
}

.portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background:
    radial-gradient(circle at 30% 0%, rgba(216, 148, 32, 0.13), transparent 30%),
    linear-gradient(180deg, #050506 0%, #0b0c0e 52%, #060607 100%);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--gold-line);
  padding: 22px 18px;
  background: linear-gradient(180deg, rgba(5, 5, 6, 0.98), rgba(14, 13, 12, 0.96));
  box-shadow: 18px 0 40px rgba(0, 0, 0, 0.22);
}

.sidebar__brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.sidebar__logo {
  width: 58px;
  aspect-ratio: 0.74;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.36));
}

.sidebar__brand strong {
  display: block;
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.12;
  text-transform: uppercase;
}

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

.nav__item {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}

.nav__item:hover,
.nav__item.active {
  border-color: var(--gold-line);
  background: rgba(216, 148, 32, 0.12);
  color: var(--accent-strong);
}

.nav__item--link {
  display: flex;
  align-items: center;
}

.sidebar__footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.language-control--sidebar {
  min-width: 0;
}

.app-main {
  min-width: 0;
  padding: 24px clamp(18px, 3vw, 42px) 56px;
}

@media (min-width: 801px) {
  body:has(#adminWorkspace:not([hidden])) {
    --topbar-height: 0px;
    padding: 0 0 0 268px;
  }

  body:has(#adminWorkspace:not([hidden])) main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body:has(#adminWorkspace:not([hidden])) .section--admin {
    padding: 24px clamp(18px, 3vw, 42px) 56px;
  }

  body:has(#adminWorkspace:not([hidden])) .topbar h1 {
    font-size: 22px;
    line-height: 1.18;
    overflow-wrap: anywhere;
  }
}

.workspace-header {
  position: sticky;
  top: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -24px calc(clamp(18px, 3vw, 42px) * -1) 22px;
  border-bottom: 1px solid rgba(224, 166, 54, 0.18);
  padding: 18px clamp(18px, 3vw, 42px);
  background: rgba(5, 5, 6, 0.9);
  backdrop-filter: blur(12px);
}

.workspace-header h2,
.workspace-header p {
  margin: 0;
}

.workspace-header__meta {
  color: var(--muted);
  font-size: 13px;
}

.workspace-menu {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view.section--split.active {
  display: grid;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 800px) {
  :root {
    --topbar-height: 124px;
  }

  body:has(#appShell:not([hidden])) {
    --topbar-height: 0px;
    padding: 0;
  }

  body:has(#appShell:not([hidden])) > .topbar {
    display: none;
  }

  .portal-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, calc(100vw - 56px));
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  .portal-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .portal-shell.sidebar-open .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    background: rgba(0, 0, 0, 0.55);
  }

  .app-main {
    padding: 0 14px 40px;
  }

  .workspace-header {
    margin: 0 -14px 18px;
    padding: 10px 14px;
  }

  .workspace-menu {
    display: inline-grid;
    flex: 0 0 auto;
  }

  main {
    width: 100%;
    margin-bottom: 40px;
    padding: 0 14px;
  }

  body:has(#adminWorkspace:not([hidden])) {
    --topbar-height: 0px;
    padding: 0;
  }

  body:has(#adminWorkspace:not([hidden])) main {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .topbar,
  .section__heading,
  .invoice__top,
  .invoice__summary,
  .order-card__head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand language"
      "nav nav";
    align-items: center;
    gap: 8px 10px;
    padding: 10px 12px;
  }

  .topbar__brand {
    grid-area: brand;
    gap: 9px;
  }

  .topbar__brand > div {
    min-width: 0;
  }

  .topbar__logo {
    width: 38px;
  }

  .topbar .eyebrow {
    font-size: 10px;
    margin-bottom: 0;
  }

  .topbar h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
    line-height: 1.1;
  }

  .topbar__nav {
    grid-area: nav;
    width: 100%;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .topbar__nav::-webkit-scrollbar {
    display: none;
  }

  .topbar__nav a {
    flex: 0 0 auto;
    min-width: auto;
    padding: 7px 10px;
    font-size: 14px;
    white-space: nowrap;
  }

  .topbar__nav .button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 7px 12px;
    white-space: nowrap;
  }

  .view-toggle {
    width: 100%;
  }

  .view-toggle__button {
    flex: 1;
  }

  .product-toolbar {
    justify-content: stretch;
  }

  .language-control {
    grid-area: language;
    width: 104px;
    min-width: 104px;
  }

  .language-control span {
    display: none;
  }

  .language-control select {
    min-height: 34px;
    padding: 6px 28px 6px 10px;
  }

  .auth-screen {
    grid-template-columns: 1fr;
    gap: 20px;
    min-height: auto;
    padding: 26px 0;
  }

  .auth-hero {
    padding-left: 0;
    padding-top: 0;
  }

  .auth-hero h2 {
    font-size: 38px;
  }

  .brand-lockup {
    gap: 14px;
  }

  .brand-mark {
    width: 118px;
  }

  .brand-name {
    font-size: clamp(28px, 10vw, 42px);
  }

  .hero {
    min-height: auto;
    margin: 16px 0;
  }

  .hero__content {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 28px 20px;
  }

  .brand-lockup--hero {
    min-width: 0;
  }

  .brand-lockup--hero .brand-mark {
    width: 84px;
  }

  .hero__actions {
    width: 100%;
  }

  .section--split,
  .auth-grid,
  .form-grid,
  .form-grid--three,
  .admin-login,
  .variant-row,
  .admin-order-row,
  .admin-row,
  .order-card__grid,
  .review-grid {
    grid-template-columns: 1fr;
  }

  #loginForm,
  #registerForm,
  .auth-login-message {
    grid-column: auto;
    grid-row: auto;
  }

  #order > .panel:first-child {
    position: static;
  }

  .panel,
  .product-card,
  .order-card {
    padding: 16px;
  }

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

  .admin-toolbar {
    justify-content: stretch;
  }

  .admin-row__amount,
  .admin-row__actions {
    justify-content: flex-start;
  text-align: left;
}

body:has(#adminWorkspace:not([hidden])) .topbar__nav .admin-language-control {
  width: 100%;
  min-width: 0;
}

body:has(#adminWorkspace:not([hidden])) .topbar__nav .admin-language-control span {
  color: var(--muted);
}

  .shipment-details div {
    grid-template-columns: 1fr;
  }

  .order-assignment {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .cart-item__metrics,
  .cart-item__controls {
    grid-template-columns: 1fr;
  }

  .mini-cart {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-height: min(54vh, 360px);
    overflow: auto;
    overscroll-behavior: contain;
  }

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

  .mini-cart__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .order-review {
    padding: 10px;
  }

  .order-review__dialog {
    max-height: calc(100vh - 20px);
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .order-review__dialog > .form-actions {
    position: sticky;
    bottom: calc(-16px - env(safe-area-inset-bottom, 0px));
    z-index: 2;
    margin: 0 -16px calc(-16px - env(safe-area-inset-bottom, 0px));
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(28, 29, 32, 0.86), var(--surface) 34%);
    border-top: 1px solid var(--line);
  }

  body:has(#order.active) main {
    padding-bottom: calc(220px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 520px) {
  :root {
    --topbar-height: 112px;
  }

  .topbar {
    padding: 9px 10px;
  }

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

  .topbar__logo {
    width: 34px;
  }

  .topbar__nav a,
  .topbar__nav .button {
    font-size: 13px;
    padding: 6px 9px;
  }

  .language-control {
    width: 96px;
    min-width: 96px;
  }

  .auth-benefits {
    gap: 8px;
  }

  .auth-benefits span {
    flex: 1 1 130px;
    text-align: center;
  }

  .cart-item {
    grid-template-columns: 1fr;
  }

  .mini-cart__actions {
    grid-template-columns: 1fr;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: white;
  }

  .topbar,
  .hero,
  #products,
  #order,
  .section__heading button {
    display: none !important;
  }

  main {
    width: 100%;
    margin: 0;
  }

  .invoice {
    border: 0;
    box-shadow: none;
  }
}
