:root {
  --brand-red: #d50c1f;
  --text-dark: #333333;
  --text-body: #555555;
  --font-body: "IBM Plex Sans", "Arial", sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --bg-light: #f8f8f8;
  --border: #ececec;
  --white: #ffffff;
  --container: 1408px;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 6px 14px rgba(0, 0, 0, 0.08);
  --danger: #b3261e;
  --surface: #ffffff;
  --surface-muted: #f4f4f4;
  --surface-alt: #fbfbfb;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--text-body);
  background: var(--white);
}

body {
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

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

button,
input,
select {
  font: inherit;
}

input,
select {
  font-size: 16px;
}

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
}

.brand-header {
  background: var(--white);
}

.brand-header__inner {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 172px;
  height: auto;
  display: block;
}

.brand-copy .brand-title {
  margin: 0;
  font-family: var(--font-display);
  color: var(--text-dark);
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.brand-copy p {
  margin: 0.35rem 0 0;
  color: #777;
  font-size: 13px;
}

.page-shell {
  padding: 28px 0 48px;
}

.workspace-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

.workspace-section + .workspace-section {
  margin-top: 1.75rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.workspace-panel h2,
.product-copy h2,
.panel-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--text-dark);
  letter-spacing: 0.02em;
}

.workspace-panel h2 {
  font-size: clamp(19px, 2vw, 28px);
  line-height: 1.1;
}

.panel-copy,
.micro-copy {
  margin: 0;
  color: #777;
  font-size: 13px;
  line-height: 1.45;
  max-width: 42ch;
}

.panel-badge,
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.panel-badge {
  padding: 0 1rem;
  background: #fff5f6;
  border: 1px solid #f2c9ce;
  color: var(--brand-red);
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0 0.9rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.action-button,
.currency-switch button.is-active,
.vat-switch button.is-active {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
}

.action-button-secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--text-dark);
}

.action-button:disabled,
.action-button-secondary:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.action-button:hover,
.action-button:focus-visible,
.currency-switch button:hover,
.vat-switch button:hover {
  transform: translateY(-1px);
}

.order-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.board-label {
  padding: 0.95rem 0.8rem;
  background: var(--brand-red);
  color: #fff;
  text-align: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.field-block {
  min-width: 0;
  padding: 0.95rem;
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.field-block:not(:nth-child(4n + 1)) {
  border-left: 1px solid var(--border);
}

.field-block-compact {
  min-height: 124px;
}

.display-currency-toolbar {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.toolbar-label,
.selector-card span,
.sku-form label,
.field-meta,
.stat-label,
.rate-caption {
  color: #9a9aa1;
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.currency-switch,
.vat-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.currency-switch button,
.vat-switch button {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0 0.85rem;
  background: #fff;
  color: var(--text-dark);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.control-bar {
  display: grid;
  grid-template-columns: minmax(300px, 1.15fr) minmax(420px, 0.85fr);
  gap: 18px;
}

.sku-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sku-form label {
  margin-bottom: 0.2rem;
  font-weight: 700;
}

.sku-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

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

.sku-input-row input,
.selector-card select,
.number-input,
.rate-input {
  width: 100%;
  border: 1px solid #d7d7d7;
  border-radius: 10px;
  background: #fff;
  color: var(--text-dark);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.sku-input-row input,
.selector-card select,
.number-input {
  min-height: 50px;
  padding: 0 0.9rem;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
}

.sku-input-row input,
.number-input {
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 1.6vw, 1.55rem);
  letter-spacing: 0.02em;
  text-align: center;
}

.selector-card select {
  font-size: 0.92rem;
}

.sku-input-row input:focus,
.selector-card select:focus,
.number-input:focus,
.rate-input:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 4px rgba(213, 12, 31, 0.1);
}

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

.selector-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
}

.tariff-picker summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.tariff-picker summary::-webkit-details-marker {
  display: none;
}

.picker-meta {
  color: var(--brand-red);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tariff-options {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.tariff-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  border-radius: 10px;
  background: var(--surface-muted);
  padding: 10px 12px;
}

.tariff-option small {
  color: var(--text-body);
}

.status-strip {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-strip.is-error {
  border-color: #f0d2ce;
  background: #fff7f6;
}

.status-chip {
  padding: 0 0.9rem;
  background: #fff5f6;
  border: 1px solid #f2c9ce;
  color: var(--brand-red);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

.status-copy {
  margin: 0;
  color: var(--text-body);
}

.dashboard {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 20px;
}

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

.order-metric-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-metric-label {
  color: #9a9aa1;
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.order-metric-value {
  color: var(--text-dark);
  font-family: var(--font-display);
  font-size: 1.28rem;
  letter-spacing: 0.01em;
}

.detail-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.product-card {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: stretch;
}

.product-card-primary {
  box-shadow: var(--shadow);
}

.panel-kicker {
  margin: 0 0 10px;
  color: var(--brand-red);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.product-copy h2 {
  margin: 0 0 12px;
  font-size: clamp(19px, 2vw, 28px);
  line-height: 1.08;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.product-meta span {
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--surface-muted);
  color: var(--text-body);
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.stat-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-box strong {
  font-family: var(--font-display);
  font-size: 1.42rem;
  letter-spacing: 0.01em;
  color: var(--text-dark);
}

.stat-box-gm {
  background: #fff5f6;
  border-color: #f2c9ce;
}

.product-image-frame {
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-muted);
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
}

.image-fallback {
  width: calc(100% - 36px);
  min-height: 240px;
  margin: 18px;
  border: 1px dashed #cfcfcf;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--text-body);
  background: var(--surface);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.detail-stack,
.tariff-stack {
  display: grid;
  gap: 12px;
}

.detail-row,
.tariff-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
}

.detail-row p,
.tariff-copy p {
  margin: 6px 0 0;
  color: var(--text-body);
  line-height: 1.45;
}

.detail-row strong,
.tariff-values strong {
  font-family: var(--font-display);
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  color: var(--text-dark);
}

.tariff-values {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.empty-line {
  margin: 0;
  color: var(--text-body);
  line-height: 1.5;
}

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

.order-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

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

.order-table th {
  color: #9a9aa1;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.order-table td {
  color: var(--text-body);
  font-size: 13px;
}

.order-table tbody tr:last-child td {
  border-bottom: none;
}

.line-qty-input {
  width: 84px;
  min-height: 38px;
  border: 1px solid #d7d7d7;
  border-radius: 10px;
  background: #fff;
  color: var(--text-dark);
  font-family: var(--font-display);
  font-size: 1rem;
  text-align: center;
}

.line-qty-input:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 4px rgba(213, 12, 31, 0.1);
}

.line-remove-button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 0.8rem;
  background: #fff;
  color: var(--text-dark);
  font-family: var(--font-display);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.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;
}

@media (max-width: 1120px) {
  .control-bar,
  .dashboard,
  .product-card {
    grid-template-columns: 1fr;
  }

  .order-summary-grid,
  .selectors,
  .order-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-block:not(:nth-child(4n + 1)) {
    border-left: none;
  }

  .field-block:not(:nth-child(2n + 1)) {
    border-left: 1px solid var(--border);
  }
}

@media (max-width: 760px) {
  .container {
    width: min(var(--container), calc(100% - 1rem));
  }

  .brand-header__inner {
    min-height: 88px;
    align-items: flex-start;
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .workspace-panel {
    padding: 1rem;
  }

  .order-board,
  .order-summary-grid,
  .selectors,
  .stats-grid,
  .sku-input-row,
  .control-bar,
  .dashboard {
    grid-template-columns: 1fr;
  }

  .sku-actions {
    flex-direction: column;
  }

  .field-block:not(:nth-child(2n + 1)) {
    border-left: none;
  }

  .currency-switch,
  .vat-switch {
    gap: 0.5rem;
  }

  .display-currency-toolbar,
  .panel-header,
  .panel-heading,
  .status-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}
