html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f3f5f7;
  color: #1b1f24;
  padding-top: 44px;
}

.container {
  max-width: 1280px;
  margin: 20px auto 20px auto;
  padding: 0 16px;
}

h1 {
  margin: 12px 0 16px 0;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e6e8eb;
  margin-bottom: 24px;
}

.card > h2 {
  font-size: 1.5em;
  font-weight: 700;
  margin: 0 0 10px 0;
}

.actions {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.summary {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.summary span {
  background: #eef2ff;
  color: #1e3a8a;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
}

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

.links a {
  display: inline-block;
  background: #111827;
  color: #fff;
  text-decoration: none;
  padding: 12px 10px;
  border-radius: 8px;
}

.links a:hover {
  background: #1f2937;
}

.top-nav-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: #0f766e;
  border-bottom: 0;
}

.top-nav-inner {
  margin: 0 auto !important;
  padding: 12px 16px 0 16px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.top-nav {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.top-nav-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.top-nav-host-text {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.top-nav a {
  display: inline-block;
  padding: 8px 12px 8px 12px;
  border-radius: 4px;
  text-decoration: none;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  background: transparent;
}

.top-nav .top-nav-logout,
.top-nav-logout {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.top-nav-logout:hover {
  text-decoration: underline;
  background: transparent;
}

.top-nav a:hover {
  background: rgba(255, 255, 255, 0.16);
}

.top-nav a.active {
  background: #f3f5f7;
  color: #111111;
  font-weight: 700;
  border-radius: 6px 6px 0 0;
  margin-bottom: -1px;
}

@media (max-width: 1100px) {
  .top-nav-inner {
    align-items: flex-start;
    flex-direction: column;
  }
  .top-nav {
    width: 100%;
  }
  .top-nav-meta {
    align-self: flex-end;
  }
}

.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.page-title-row h1 {
  margin: 0;
}

.home-host-editor {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
}

.home-host-editor label {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
}

.home-host-editor input {
  width: 220px;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
  box-sizing: border-box;
  background: #fff;
  color: #111827;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

.grid-form label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  gap: 4px;
}

.grid-form input,
.grid-form select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
  line-height: 1.2;
  min-height: 36px;
  background: #fff;
}

.product-filter-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-filter-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr 1.25fr 1.45fr 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.product-filter-head div {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
}

.product-filter-form input,
.product-filter-form select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
  line-height: 1.2;
  min-height: 36px;
  background: #fff;
}

.product-filter-bottom {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 120px auto auto;
  gap: 10px;
  align-items: end;
  margin-top: 4px;
}

.product-filter-actions {
  display: flex;
  grid-column: 1 / -1;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  justify-content: flex-start;
}

.product-filter-keyword,
.product-filter-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #111827;
}

.product-filter-checks {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 36px;
  font-size: 12px;
}

.product-filter-checks label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.product-filter-checks input {
  width: auto;
  min-height: initial;
}

.bulk-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bulk-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 10px 14px;
  align-items: end;
}

.bulk-pair,
.bulk-single {
  display: grid;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.bulk-pair {
  grid-template-columns: 56px minmax(0, 1fr) auto minmax(0, 1fr);
}

.bulk-single {
  grid-template-columns: 56px minmax(0, 1fr);
}

.bulk-compact-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
}

.bulk-field-title {
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
}

.bulk-field-sep {
  font-weight: 700;
  color: #64748b;
}

.bulk-edit-form input,
.bulk-edit-form select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
  line-height: 1.2;
  min-height: 36px;
  background: #fff;
}

.bulk-edit-actions {
  display: flex;
  justify-content: flex-start;
}

.create-master-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.create-master-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 0.8fr 1fr 0.4fr 1.2fr 0.8fr 0.8fr 0.8fr 0.8fr;
  gap: 8px;
  align-items: center;
}

.create-master-head div {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
}

.create-master-form input,
.create-master-form select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
  line-height: 1.2;
  min-height: 36px;
  background: #fff;
}

.create-master-en .empty {
  min-height: 36px;
}

.create-master-actions {
  display: flex;
  justify-content: flex-start;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #0f766e;
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: #115e59;
}

pre {
  background: #0b1020;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  min-height: 120px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

table.products-table {
  table-layout: auto;
}

th,
td {
  border-bottom: 1px solid #eceff3;
  padding: 8px clamp(4px, 0.8vw, 10px);
  font-size: 13px;
  text-align: left;
}

th {
  background: #f8fafc;
}

.field-head {
  line-height: 1.1;
}

.field-head .en {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.field-dual {
  line-height: 1.12;
}

.field-dual .en {
  margin-top: 2px;
  font-size: 12px;
  color: #64748b;
}

.table-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
  line-height: 1.2;
  min-height: 24px;
  background: #fff;
}

.table-input-en {
  color: #334155;
}

.table-input.w-half {
  width: 50%;
  min-width: 90px;
}

.table-input.w-quarter {
  width: 25%;
  min-width: 72px;
}

.table-input.w-two-thirds {
  width: 66.6667%;
  min-width: 96px;
}

.table-input.w-unit {
  width: 48px;
}

th.col-brand,
td.col-brand {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
}

th.col-sku,
td.col-sku {
  width: 90px;
  min-width: 90px;
  max-width: 90px;
  white-space: nowrap;
}

th.col-code,
td.col-code {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
}

.sku-copy-wrap {
  position: relative;
  width: 100%;
  min-height: 24px;
  display: flex;
  align-items: center;
}

.sku-copy-text {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-copy-quick {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid #0f766e;
  border-radius: 6px;
  background: #fff;
  color: #0f766e;
  font-size: 11px;
  line-height: 1;
  padding: 4px 6px;
  opacity: 0;
  pointer-events: none;
}

.action-more {
  display: block;
  position: relative;
  width: 30px;
  height: 30px;
}

.action-more > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #0f766e;
  border-radius: 6px;
  padding: 0;
  background: #0f766e;
  color: #fff;
  height: 30px;
  width: 30px;
  box-sizing: border-box;
}

.action-more > summary::-webkit-details-marker {
  display: none;
}

.action-more[open] .action-more-menu {
  position: fixed;
  left: var(--action-menu-left, 0);
  top: var(--action-menu-top, 0);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 1200;
  min-width: 238px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.product-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.product-action-grid {
  display: grid;
  grid-template-columns: repeat(3, 30px);
  grid-template-rows: repeat(2, 30px);
  gap: 5px;
  width: 100px;
  margin: 0 auto;
}

.product-action-slot {
  position: relative;
  width: 30px;
  height: 30px;
}

.product-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  margin: 0;
  padding: 0;
  border: 1px solid #0f766e;
  border-radius: 6px;
  background: #0f766e;
  color: #fff;
  box-sizing: border-box;
}

.product-action-icon svg,
.action-menu-item > svg,
.sku-inline-editor button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.product-action-icon:hover,
.product-action-icon:focus-visible {
  background: #115e59;
  border-color: #115e59;
}

.product-action-icon:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.product-action-slot::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 7px);
  z-index: 1300;
  width: max-content;
  max-width: 260px;
  padding: 6px 8px;
  border-radius: 5px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(3px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  pointer-events: none;
}

.product-action-slot:hover::after,
.product-action-slot:focus-within::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.action-menu-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 5px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #1f2937;
  text-align: left;
  white-space: normal;
}

.action-menu-item:hover,
.action-menu-item:focus-visible {
  background: #ecfdf5;
  color: #0f766e;
}

.action-menu-item:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.action-menu-item > svg {
  width: 18px;
  height: 18px;
}

.action-menu-item span,
.action-menu-item strong,
.action-menu-item small {
  display: block;
}

.action-menu-item strong {
  font-size: 12px;
  line-height: 1.25;
}

.action-menu-item small {
  margin-top: 2px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.25;
}

.action-menu-item.is-danger {
  color: #b91c1c;
}

.action-menu-item.is-danger:hover,
.action-menu-item.is-danger:focus-visible {
  background: #fef2f2;
  color: #991b1b;
}

.action-menu-form {
  display: block;
  margin: 0;
}

.sku-copy-wrap:hover .sku-copy-quick,
.sku-copy-wrap:focus-within .sku-copy-quick {
  opacity: 1;
  pointer-events: auto;
}

th.col-check,
td.col-check {
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}

th.col-year,
td.col-year {
  width: 50px;
  min-width: 50px;
  max-width: 50px;
}

th.col-model,
td.col-model {
  width: auto;
  min-width: 120px;
  max-width: none;
}

th.col-product,
td.col-product {
  width: 1%;
  min-width: 72px;
  max-width: 160px;
}

th.col-attribute,
td.col-attribute {
  width: 1%;
  min-width: 52px;
  max-width: 90px;
}

th.col-weight,
td.col-weight {
  width: 55px;
  min-width: 55px;
  max-width: 55px;
}

th.col-cost,
td.col-cost {
  width: 55px;
  min-width: 55px;
  max-width: 55px;
}

th.col-category,
td.col-category {
  width: 90px;
  min-width: 90px;
  max-width: 90px;
}

th.col-ozon-category,
td.col-ozon-category {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

th.col-unit,
td.col-unit {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
}

th.col-time-created,
td.col-time-created {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  white-space: nowrap;
}

th.col-time-updated,
td.col-time-updated {
  width: 10ch;
  min-width: 10ch;
  max-width: 10ch;
  white-space: normal;
}

.time-cell-updated {
  line-height: 1.15;
  white-space: normal;
}

.time-cell-updated div:last-child {
  color: #334155;
}

.time-cell {
  line-height: 1.15;
  white-space: normal;
}

.time-cell div:last-child {
  color: #334155;
}

th.col-actions,
td.col-actions {
  width: 108px;
  min-width: 108px;
  max-width: 108px;
  white-space: normal;
  text-align: center;
}

table.products-table td.col-brand .table-input,
table.products-table td.col-category .table-input,
table.products-table td.col-attribute .table-input,
table.products-table td.col-code .table-input,
table.products-table td.col-ozon-category .table-input,
table.products-table td.col-product .table-input,
table.products-table td.col-model .table-input,
table.products-table td.col-weight .table-input,
table.products-table td.col-cost .table-input,
table.products-table td.col-unit .table-input.w-unit,
table.products-table td.col-unit .table-input {
  width: 100%;
  min-width: 0;
}

.product-remark-row td {
  border-top: 0;
  border-bottom: 1px solid #eceff3;
  padding-top: 0;
  padding-bottom: 6px;
}

.products-table tbody tr:has(+ .product-remark-row) td {
  border-bottom: 0;
  padding-bottom: 3px;
}

.product-remark-label {
  color: #6b7280;
  font-weight: 700;
  vertical-align: middle;
  padding-right: 2px;
}

.product-remark-cell {
  padding-left: 2px;
}

.product-remark-text {
  display: block;
  width: 100%;
  min-height: 22px;
  padding: 1px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #4b5563;
  text-align: left;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-remark-text:hover {
  background: transparent;
  color: #111827;
}

.product-remark-text.is-empty {
  color: #9ca3af;
}

.product-remark-input {
  width: 100%;
  min-height: 22px;
  height: 22px;
  border-color: #cbd5e1;
  background: #fff;
  color: #4b5563;
  padding-top: 1px;
  padding-bottom: 1px;
}

td.col-ozon-category .row-ozon-category-picker {
  margin-top: 4px;
}

.sku-inline-editor {
  display: grid;
  grid-template-columns: minmax(74px, 1fr) 24px 24px;
  align-items: center;
  gap: 3px;
  width: 100%;
}

.sku-inline-editor[hidden] {
  display: none;
}

.sku-inline-input {
  min-width: 0;
  height: 28px;
}

.sku-inline-editor button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  border-radius: 5px;
}

.sku-inline-editor button svg {
  width: 14px;
  height: 14px;
}

.sku-inline-cancel {
  background: #fff;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.detail-row td {
  background: #f8fafc;
  color: #334155;
}

.alert {
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
}

.alert.success {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

.alert.error {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

.alert.info {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e40af;
}
