:root {
  --bg: #07111f;
  --bg-soft: #0d1728;
  --panel: rgba(13, 23, 40, 0.9);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e5eefb;
  --muted: #95a6c6;
  --accent: #3b82f6;
  --danger: #f87171;
  --success: #34d399;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --sticky-label-width: 220px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.24), transparent 32%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.16), transparent 22%),
    linear-gradient(180deg, #07111f 0%, #09101b 100%);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 120px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #7dd3fc;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 3.4vw, 3.25rem);
  line-height: 1;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.5rem, 2.3vw, 2rem);
}

.stepper {
  display: flex;
  gap: 12px;
}

.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(10, 18, 31, 0.75);
  font-weight: 700;
}

.step-active,
.step-complete {
  color: white;
  border-color: rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(14, 165, 233, 0.72));
}

.screen {
  display: none;
}

.screen-active {
  display: block;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.seller-panel,
.confirmation-panel {
  padding: 32px;
}

.grid-panel {
  overflow: hidden;
}

.panel-header {
  margin-bottom: 24px;
}

.panel-header p:last-child {
  color: var(--muted);
  margin-bottom: 0;
}

.panel-header-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 28px 28px 20px;
}

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

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

.field span {
  font-size: 0.95rem;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(8, 14, 24, 0.88);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(59, 130, 246, 0.8);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16);
}

.field input[readonly] {
  color: #c8d8f5;
  background: rgba(15, 23, 42, 0.96);
  cursor: not-allowed;
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.dimension-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 10px;
}

.dimension-part {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dimension-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.field-error input,
.field-error select,
.field-error textarea,
.product-cell-error input,
.product-cell-error select,
.product-cell-error textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.error-text {
  color: var(--danger);
  min-height: 18px;
  font-size: 0.84rem;
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  color: white;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.secondary-button {
  color: white;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.ghost-button,
.icon-button {
  color: var(--text);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--line);
}

.grid-container {
  padding: 0 20px 20px;
}

.catalog-grid {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(7, 17, 31, 0.76);
}

.grid-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.grid-table th,
.grid-table td {
  min-width: 250px;
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.grid-table tr:last-child td,
.grid-table tr:last-child th {
  border-bottom: 0;
}

.grid-table tr > *:last-child {
  border-right: 0;
}

.sticky-label,
.sticky-top {
  position: sticky;
  z-index: 3;
}

.sticky-top {
  top: 0;
  background: rgba(10, 18, 31, 0.98);
  backdrop-filter: blur(12px);
}

.sticky-label {
  left: 0;
  z-index: 4;
  min-width: var(--sticky-label-width);
  width: var(--sticky-label-width);
  background: rgba(10, 18, 31, 0.98);
}

.corner-cell {
  z-index: 5;
}

.field-label-cell {
  min-width: var(--sticky-label-width);
  width: var(--sticky-label-width);
}

.field-title {
  margin: 0 0 4px;
  font-size: 0.96rem;
}

.field-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

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

.product-heading strong {
  font-size: 1rem;
}

.remove-product {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
}

.product-cell {
  background: rgba(6, 11, 20, 0.56);
}

.empty-cell {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  background: rgba(148, 163, 184, 0.05);
}

.footer-bar {
  position: sticky;
  bottom: 16px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(8, 14, 24, 0.88);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.feedback {
  min-height: 24px;
  padding: 0 28px 24px;
  color: var(--danger);
  font-weight: 500;
}

.feedback-success {
  color: var(--success);
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: white;
  display: none;
  animation: spin 0.8s linear infinite;
}

.is-loading .spinner {
  display: inline-block;
}

.is-loading .button-label {
  opacity: 0.82;
}

.is-loading {
  pointer-events: none;
  opacity: 0.9;
}

.mobile-nav {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px 18px;
}

.mobile-nav-label {
  text-align: center;
  font-weight: 700;
}

.confirmation-seller {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.confirmation-seller .seller-summary-item,
.confirmation-card {
  background: rgba(8, 14, 24, 0.82);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.confirmation-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.confirmation-card h3 {
  margin-bottom: 12px;
}

.confirmation-card p {
  margin-bottom: 10px;
  color: var(--muted);
}

.confirmation-card strong {
  color: var(--text);
}

.variation-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.variation-list li + li {
  margin-top: 4px;
}

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

@media (max-width: 900px) {
  .seller-form,
  .confirmation-seller {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 767px) {
  .app-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 20px;
  }

  .seller-panel,
  .confirmation-panel {
    padding: 22px;
  }

  .seller-form {
    grid-template-columns: 1fr;
  }

  .panel-header-grid {
    flex-direction: column;
    align-items: stretch;
    padding: 22px 20px 18px;
  }

  .grid-container {
    padding: 0 12px 12px;
  }

  .mobile-nav {
    display: flex;
  }

  .catalog-grid {
    overflow: hidden;
  }

  .grid-table {
    min-width: 100%;
    width: 100%;
  }

  .grid-table th,
  .grid-table td {
    min-width: 0;
    width: auto;
    padding: 14px;
  }

  .field-label-cell,
  .sticky-label,
  .corner-cell {
    min-width: 146px;
    width: 146px;
  }

  .mobile-hidden {
    display: none;
  }

  .footer-bar {
    bottom: 10px;
    flex-direction: column-reverse;
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .dimension-row {
    grid-template-columns: 1fr;
  }
}
