:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --nav: #08213e;
  --nav-active: #2563eb;
  --border: #d8dee8;
  --muted: #64748b;
  --text: #172033;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --primary: #2563eb;
  --fulfillment-top-gap: 20px;
}

* {
  box-sizing: border-box;
}

html,
body {
  overscroll-behavior-x: none;
}

body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

body:has(#productsView:not(.hidden)),
body:has(#amazonProductsView:not(.hidden)) {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

body:has(#productsView:not(.hidden)) .sidebar,
body:has(#amazonProductsView:not(.hidden)) .sidebar {
  height: 100dvh;
  min-height: 0;
}

body:has(#productsView:not(.hidden)) .main,
body:has(#amazonProductsView:not(.hidden)) .main {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body:has(.fulfillment-view:not(.hidden)) .main {
  padding-top: var(--fulfillment-top-gap);
}

body.auth-pending .sidebar,
body.auth-pending .main,
body.view-pending .sidebar,
body.view-pending .main {
  display: none;
}

.sidebar {
  width: 160px;
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: white;
  color: #172033;
  padding: 18px 12px;
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  white-space: nowrap;
  font-weight: 700;
  margin-bottom: 28px;
  color: #172033;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border: 2px solid #172033;
  display: grid;
  place-items: center;
  color: #172033;
}

nav {
  display: grid;
  gap: 10px;
}

.sidebar nav {
  align-content: start;
}

.nav-item {
  border: 0;
  border-radius: 7px;
  padding: 12px 12px;
  text-align: left;
  color: #172033;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: #eff6ff;
  color: #1d4ed8;
}

.sidebar-user-shell {
  width: 100%;
  min-width: 0;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-user-shell:empty {
  display: none;
}

.sidebar-user-shell .cotigo-user-button {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  justify-content: center;
  border-radius: 12px;
}

.sidebar-user-shell .cotigo-user-name {
  min-width: 0;
  font-size: 15px;
}

.sidebar-user-shell .cotigo-user-menu {
  left: 0;
  right: auto;
  bottom: calc(100% + 8px);
}

.main {
  min-width: 0;
  flex: 1;
  padding: 28px;
}

.topbar,
.page-titlebar {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.page-titlebar {
  min-height: 54px;
  border-bottom: 1px solid var(--border);
  margin: -28px -28px 18px;
  padding: 0 28px;
  background: white;
}

.page-titlebar h1 {
  flex: 1;
  margin: 0;
  font-size: 24px;
}

#productsView .page-titlebar {
  min-height: 44px;
  margin: -12px 0 10px;
  padding: 0;
  border-bottom: 0;
  background: transparent;
}

.menu-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 24px;
}

.mobile-nav-toggle {
  display: none;
}

h1 {
  margin: 0 0 8px;
  font-size: 32px;
}

p {
  margin: 0;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-workspace {
  display: grid;
  gap: 16px;
}

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

.home-upload-card {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 190px;
  padding: 18px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.source-head {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
}

.source-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 5px;
  color: #2563eb;
  font-weight: 900;
}

.replenishment-card .source-icon {
  color: #16a34a;
}

.manual-card .source-icon {
  color: #7c3aed;
}

.source-head h2 {
  margin: 0 0 5px;
  font-size: 17px;
}

.source-head p {
  font-size: 12px;
  line-height: 1.45;
}

.file-state {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--muted);
  background: #fafcff;
  font-weight: 700;
}

.file-state strong {
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-state span {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.file-state b {
  color: #16a34a;
  font-size: 18px;
}

.file-state.has-file {
  color: #0f172a;
  background: #f8fafc;
}

.upload-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 0 28px;
}

.upload-pick-btn,
.upload-delete-btn {
  height: 34px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0;
  padding: 0;
}

.upload-pick-btn {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

.upload-delete-btn {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.template-download {
  position: absolute;
  right: 18px;
  top: 18px;
  background: #dbeafe;
  color: #1d4ed8;
  text-decoration: none;
  font-size: 12px;
  font-weight: 400;
  padding: 5px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}

.home-rules-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  min-height: 210px;
  padding: 26px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.home-rule-block h2 {
  margin: 0 0 22px;
  font-size: 20px;
}

.home-rule-block h2 span {
  color: #334155;
  font-size: 16px;
  font-weight: 600;
}

.rule-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 56px;
  max-width: 820px;
}

.rule-fields label {
  display: grid;
  gap: 8px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 400;
}

.inline-input {
  display: grid;
  grid-template-columns: max-content 78px 28px;
  gap: 12px;
  align-items: center;
}

.inline-input b {
  height: 32px;
  display: grid;
  align-items: center;
  color: #0f172a;
  font-weight: 400;
}

.inline-input input {
  height: 32px;
  display: grid;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
  padding: 0 10px;
  font-weight: 600;
  width: 78px;
}

.inline-input em {
  font-style: normal;
}

.global-rule {
  padding-left: 36px;
}

.large-check {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 900;
}

.large-check input {
  width: 26px;
  height: 26px;
  accent-color: #2563eb;
}

.home-generate-row {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  pointer-events: none;
}

.generate-big {
  width: min(430px, 46vw);
  height: 48px;
  font-size: 17px;
  font-weight: 900;
  pointer-events: auto;
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.generate-big:not(:disabled):hover {
  background: #bfdbfe;
  border-color: #93c5fd;
  color: #1e40af;
}

.report-box {
  min-height: 34px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
}

button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  background: white;
  color: var(--text);
  font-size: 14px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

button:not(:disabled):hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

button.primary:not(:disabled):hover {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #1d4ed8;
}

button:disabled {
  cursor: not-allowed;
}

button.secondary:disabled {
  color: #94a3b8;
  background: #f8fafc;
}

.product-actions-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.product-controls-card {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.product-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  flex: 0 0 auto;
}

.product-actions button {
  min-width: 58px;
  height: 34px;
  padding: 6px 10px;
  font-weight: 400;
  font-size: 13px;
}

.product-actions .orange-action {
  min-width: 98px;
}

.product-actions .purple-action,
.product-actions .gray-action {
  min-width: 78px;
}

.upload-image-action {
  flex: 0 0 auto;
  height: 34px;
  padding: 6px 10px;
  font-weight: 400;
  font-size: 13px;
}

#productsView button,
#productsView .blue-action,
#productsView .blue-outline,
#productsView .green-action,
#productsView .red-action,
#productsView .purple-action,
#productsView .orange-action,
#productsView .gray-action {
  background: white;
  border-color: #cbd5e1;
  color: #172033;
  font-weight: 400;
}

#productsView button:not(:disabled):hover,
#productsView .blue-action:not(:disabled):hover,
#productsView .blue-outline:not(:disabled):hover,
#productsView .green-action:not(:disabled):hover,
#productsView .red-action:not(:disabled):hover,
#productsView .purple-action:not(:disabled):hover,
#productsView .orange-action:not(:disabled):hover,
#productsView .gray-action:not(:disabled):hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.blue-action {
  color: #1d4ed8;
  border-color: #93c5fd;
  background: #eff6ff;
}

.blue-outline {
  color: #1d4ed8;
  border-color: #93c5fd;
}

.green-action {
  color: #15803d;
  border-color: #86efac;
  background: #f0fdf4;
}

.red-action {
  color: #dc2626;
  border-color: #fecaca;
  background: #fef2f2;
}

.purple-action {
  color: #7c3aed;
  border-color: #ddd6fe;
  background: #faf5ff;
}

.orange-action {
  color: #ea580c;
  border-color: #fed7aa;
  background: #fff7ed;
}

.gray-action {
  color: #334155;
  border-color: #cbd5e1;
  background: #f8fafc;
}

.product-search {
  display: flex;
  width: 165px;
  flex: 0 0 165px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.product-search-field {
  flex: 0 0 150px;
  width: 150px;
  height: 34px;
  padding: 0 10px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: #172033;
  font-size: 13px;
  font-weight: 400;
  outline: none;
}

.product-search-field:hover,
.product-search-field:focus {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: none;
}

.product-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  position: relative;
  z-index: 5;
}

.product-category-filter,
.product-parent-filter {
  position: relative;
  flex: 0 0 auto;
}

.category-filter-toggle,
.parent-listing-filter-toggle {
  min-width: 85px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  color: #172033;
  font-size: 13px;
  font-weight: 300;
}

.category-filter-toggle strong,
.parent-listing-filter-toggle strong {
  color: #64748b;
  font-weight: 300;
}

.category-filter-menu,
.parent-listing-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 180px;
  max-height: min(540px, calc(100vh - 220px));
  overflow: auto;
  padding: 8px;
  border: 1px solid #d7dee9;
  border-radius: 8px;
  background: white;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
  z-index: 50;
}

.filter-menu-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 8px;
}

.filter-menu-head input,
.filter-menu-head button {
  height: 34px;
  border: 1px solid #d7dee9;
  border-radius: 8px;
  background: white;
  color: #172033;
  font-size: 13px;
  font-weight: 300;
}

.filter-menu-head input {
  min-width: 0;
  padding: 0 10px;
}

.filter-menu-head button {
  padding: 0 10px;
}

.product-search input,
.product-search button {
  border: 0;
  border-radius: 0;
  height: 100%;
}

.product-search input {
  flex: 1;
  padding: 0 8px;
}

.product-search button {
  width: 40px;
  font-size: 22px;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
  padding: 0;
}

#productsView .product-search button {
  border: 0;
}

.selection-inline {
  color: #94a3b8;
  font-weight: 300;
  white-space: nowrap;
  margin-left: 0;
  flex: 0 0 auto;
  font-size: 14px;
}

.product-workspace {
  display: block;
  min-height: calc(100vh - 150px);
}

.category-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.category-title {
  padding: 14px 16px;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
}

.category-list,
.parent-listing-list {
  display: grid;
  gap: 6px;
}

.category-item,
.parent-listing-item {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid #d7dee9;
  border-radius: 8px;
  padding: 9px 10px;
  text-align: left;
  font-weight: 300;
  font-size: 13px;
  background: white;
}

.category-item.active,
.parent-listing-item.active {
  color: #1d4ed8;
  background: #eaf3ff;
}

#productsView .category-item.active,
#productsView .parent-listing-item.active {
  color: #1d4ed8;
  border-color: #93c5fd;
  background: #eaf3ff;
}

.category-hint {
  margin-top: auto;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 12px;
}

.product-table-area {
  min-width: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.stat strong {
  display: block;
  font-size: 24px;
  margin-bottom: 4px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.task-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: start;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
}

.task-panel h2 {
  margin: 0 0 6px;
}

.task-summary {
  grid-column: 1 / -1;
}

.hidden {
  display: none !important;
}

.packaging-wrap {
  height: 420px;
  margin-bottom: 14px;
}

.work-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.work-actions-row button {
  height: 34px;
  min-width: auto;
  font-weight: 700;
  font-size: 13px;
  padding: 0 10px;
  white-space: nowrap;
}

#packagingSearchBtn {
  display: none;
}

.fulfillment-view {
  font-weight: 300;
}

.fulfillment-view:not(.hidden) {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 56px);
  min-height: 0;
  overflow: auto;
}

#packagingView.fulfillment-view:not(.hidden) {
  overflow: hidden;
}

.fulfillment-view .page-titlebar {
  flex: 0 0 48px;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  margin: 0 0 10px;
  padding: 0;
  background: transparent;
  border-bottom: 0;
  overflow: visible;
}

.fulfillment-view .page-titlebar .menu-button {
  display: none;
}

.fulfillment-titlebar {
  justify-content: flex-start;
  gap: 18px;
}

.fulfillment-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.fulfillment-tab {
  height: 34px;
  min-width: 82px;
  padding: 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  color: #172033;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
}

.fulfillment-tab:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.fulfillment-tab.active {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #2563eb;
}

#packagingView .work-actions-row {
  flex: 0 0 auto;
  margin-bottom: 0;
  padding: 8px 12px 4px;
  background: white;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-sizing: border-box;
}

#deletePackagingBtn {
  margin-left: auto;
}

#packagingView #deletePackagingBtn {
  border-color: #fecaca;
  background: #fff7f7;
  color: #dc2626;
}

#packagingView #deletePackagingBtn:hover {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #b91c1c;
}

#packagingSection:not(.hidden) {
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr) 20px;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.fulfillment-view .page-titlebar h1 {
  flex: 0 0 auto;
  font-weight: 800;
  line-height: 48px;
}

#packagingView button,
#packagingView .blue-action,
#packagingView .green-action,
#packagingView .orange-action,
#packagingView .gray-action,
#packagingView .red-action,
#packagingView .small-bottom-btn,
#packagingView .red-bottom-btn,
#packagingView .row-delete-btn,
#packagingView .row-edit-btn,
#packagingView .row-add-btn,
#packagingView .draft-edit-btn,
#packagingView .caja-inline-btn,
#packagingView .caja-action-btn {
  background: white;
  border-color: #cbd5e1;
  color: #172033;
  cursor: pointer;
}

#packagingView button:hover,
#packagingView .blue-action:hover,
#packagingView .green-action:hover,
#packagingView .orange-action:hover,
#packagingView .gray-action:hover,
#packagingView .red-action:hover,
#packagingView .small-bottom-btn:hover,
#packagingView .red-bottom-btn:hover,
#packagingView .row-delete-btn:hover,
#packagingView .row-edit-btn:hover,
#packagingView .row-add-btn:hover,
#packagingView .draft-edit-btn:hover,
#packagingView .caja-inline-btn:hover,
#packagingView .caja-action-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.fulfillment-view .fulfillment-tab,
#packagingView .fulfillment-tab {
  height: 34px;
  min-width: 82px;
  padding: 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  color: #172033;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}

.fulfillment-view .fulfillment-tab:hover,
#packagingView .fulfillment-tab:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.fulfillment-view .fulfillment-tab.active,
#packagingView .fulfillment-tab.active {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #2563eb;
}

#packagingView .task-summary,
#packagingView .packaging-caja-totals div,
#packagingView .packaging-summary-row,
#packagingView .packaging-product-table th,
#packagingView .packaging-product-table td,
#packagingView .packaging-caja-table th,
#packagingView .packaging-caja-table td,
#packagingView .work-actions-row button,
#packagingView .row-delete-btn,
#packagingView .row-edit-btn,
#packagingView .row-add-btn,
#packagingView .draft-edit-btn,
#packagingView .caja-inline-btn,
#packagingView .caja-action-btn,
#packagingView .caja-input.qty-positive-input,
#packagingView .recommended-input,
#packagingView .draft-item-input {
  font-weight: 400;
}

.picking-workspace {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.picking-side-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}

.picking-action-stack {
  display: grid;
  gap: 8px;
}

.picking-action-stack button {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
}

.picking-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.picking-summary-grid div {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px 12px;
  border-right: 0;
  border-bottom: 1px solid #edf0f5;
}

.picking-summary-grid div:last-child {
  border-bottom: 0;
}

.picking-summary-grid span {
  color: #64748b;
  font-size: 10px;
  font-weight: 400;
}

.picking-summary-grid strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 400;
}

.picking-summary-grid #pickingSkuCount,
.picking-summary-grid #pickingProductTotal,
.picking-summary-grid #pickingAmount {
  color: #2563eb;
  font-size: 21px;
  font-weight: 400;
}

.picking-preview-panel {
  --picking-location-width: 208px;
  --picking-sku-width: 336px;
  --picking-ref-width: 235px;
  --picking-quantity-width: 267px;
  --picking-table-width: calc(
    var(--picking-location-width) +
    var(--picking-sku-width) +
    var(--picking-ref-width) +
    var(--picking-quantity-width)
  );
  width: var(--picking-table-width);
  max-width: 100%;
  justify-self: start;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.picking-table-wrap {
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.picking-table {
  width: var(--picking-table-width);
  min-width: var(--picking-table-width);
  border-collapse: collapse;
  table-layout: fixed;
}

.picking-preview-title {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: #172033;
  font-size: 18px;
  font-weight: 600;
  text-align: left;
}

.picking-table col.picking-location-col {
  width: var(--picking-location-width);
}

.picking-table col.picking-sku-col {
  width: var(--picking-sku-width);
}

.picking-table col.picking-ref-col {
  width: var(--picking-ref-width);
}

.picking-table col.picking-quantity-col {
  width: var(--picking-quantity-width);
}

.picking-table th,
.picking-table td {
  height: 28px;
  padding: 0 8px;
  border: 1px solid #edf0f5;
  text-align: center;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.picking-table th {
  height: 38px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  font-size: 14px;
  font-weight: 700;
}

.shipment-workspace {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 347px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.shipment-side-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

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

.shipment-template-upload input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  font-size: 14px;
  font-weight: 400;
  box-sizing: border-box;
}

#shipmentView .shipment-template-upload {
  grid-template-columns: 1fr;
  gap: 8px;
}

#shipmentView .shipment-template-upload input {
  height: 54px;
  padding: 6px 8px;
  font-size: 12px;
}

#shipmentView .shipment-file-button {
  width: 100%;
  height: 38px;
  min-width: 0;
  justify-content: flex-start;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: #172033;
  font-size: 13px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shipment-action-stack {
  display: grid;
  gap: 8px;
}

#shipmentView .shipment-template-upload button:not(.shipment-file-button),
.shipment-action-stack button {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
}

#shipmentView .shipment-delete-template-btn {
  border: 1px solid #fecaca;
  background: #fff7f7;
  color: #b91c1c;
}

#shipmentView .shipment-delete-template-btn:hover {
  background: #fee2e2;
}

.shipment-template-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: #475569;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

#shipmentView .shipment-template-status {
  min-height: 46px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 400;
}

.admin-shared-frame-shell {
  height: calc(100vh - 56px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

#orderManagementView,
#translationSettingsView {
  height: calc(100vh - 56px);
  min-height: 0;
}

#productsView {
  width: calc(100% + 36px);
  height: calc(100dvh - 16px);
  min-height: 0;
  margin: -22px -18px -28px;
  overflow: hidden;
}

#orderManagementView:not(.hidden),
#productsView:not(.hidden),
#amazonProductsView:not(.hidden),
#translationSettingsView:not(.hidden) {
  display: flex;
}

#amazonProductsView {
  width: calc(100% + 36px);
  height: calc(100dvh - 16px);
  min-width: 0;
  min-height: 0;
  margin: -22px -18px -28px;
  overflow: hidden;
}

#amazonProductsView .amazon-products-shell {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  background: #f5f7fa;
}

#amazonProductsView .amazon-products-head {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}

#amazonProductsView .amazon-products-title-tabs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

#amazonProductsView .amazon-products-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 38px;
  font-weight: 900;
}

#amazonProductsView .amazon-products-status {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#amazonProductsView .amazon-products-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

#amazonProductsView .amazon-products-tab {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

#amazonProductsView .amazon-products-tab.active {
  border-color: #60a5fa;
  background: #eff6ff;
  color: #0b63d1;
  box-shadow: inset 0 0 0 1px #60a5fa;
}

#amazonProductsView .amazon-products-panel {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

#amazonProductsView .amazon-products-panel[hidden] { display: none; }

#amazonProductsView .amazon-products-toolbar {
  flex-wrap: wrap;
  flex: 0 0 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
}

#amazonProductsView .amazon-products-actions,
#amazonProductsView .amazon-products-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

#amazonProductsView .amazon-products-batch-menu-wrap { position: relative; }

#amazonProductsView .amazon-products-batch-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 12;
  min-width: 128px;
  padding: 5px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 25px rgb(15 23 42 / 16%);
}

#amazonProductsView .amazon-products-batch-menu[hidden] { display: none; }
#amazonProductsView .amazon-products-toolbar .amazon-products-batch-menu button {width:100%;border:0;border-radius:0;background:transparent;text-align:left;box-shadow:none;margin:0}
#amazonProductsView .amazon-products-toolbar .amazon-products-batch-menu button + button {border-top:1px solid #dbe3ef}

#amazonProductsView .amazon-products-toolbar button,
#amazonProductsView .amazon-products-toolbar select,
#amazonProductsView .amazon-products-toolbar input,
#amazonProductsView .amazon-products-toolbar .amazon-products-search {
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 400;
}

#amazonProductsView .amazon-products-toolbar button {
  min-width: 58px;
  font-weight: 400;
}

#amazonProductsView .amazon-products-toolbar button:disabled {
  color: #94a3b8;
  background: #f8fafc;
  cursor: not-allowed;
}

#amazonProductsView .amazon-products-toolbar .amazon-products-delete-button,
.amazon-products-dialog .amazon-products-delete-button {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
}

#amazonProductsView .amazon-products-toolbar .amazon-products-delete-button:disabled,
.amazon-products-dialog .amazon-products-delete-button:disabled {
  color: #fff;
  background: #fca5a5;
  border-color: #fca5a5;
}

#amazonProductsView #amazonProductsFilterField {
  width: 150px;
  border-color: var(--border);
}

#amazonProductsView #amazonProductsOfficialToggle {
  min-width: 112px;
}

#amazonProductsView #amazonProductsSearch {
  flex: 0 0 165px;
  width: 165px;
  border-color: var(--border);
  line-height: 32px;
  white-space: nowrap;
  overflow: hidden;
}

#amazonProductsView #amazonProductsSearch:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}

#amazonProductsView #amazonProductsSearch:focus {
  outline: none;
  border-color: #93c5fd;
  background: #eff6ff;
}

#amazonProductsView #amazonProductsSearch[aria-disabled="true"] {
  color: #94a3b8;
  background: #f8fafc;
}

#amazonProductsView .amazon-products-selection-count {
  min-width: 92px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

#amazonProductsView .amazon-products-table-container {
  position: relative;
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  outline: none;
}

#amazonProductsView .amazon-products-table-container:focus-visible {
  box-shadow: inset 0 0 0 2px #60a5fa;
}

#amazonProductsView .amazon-products-table {
  width: auto;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 13px;
}

#amazonProductsView .amazon-products-table th,
#amazonProductsView .amazon-products-table td {
  height: 54px;
  padding: 7px 10px;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  color: #263247;
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#amazonProductsView .amazon-products-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: auto;
  min-height: 44px;
  background: #eef3f9;
  color: #172033;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
  padding-right: 14px;
}

#amazonProductsView .amazon-products-table td {
  white-space: nowrap;
  text-overflow: ellipsis;
}

#amazonProductsView .amazon-products-table td a {
  color: #2563eb;
  text-decoration: none;
}

#amazonProductsView .amazon-products-table td a:hover { text-decoration: underline; }

#amazonProductsView .amazon-products-col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 9px;
  height: 100%;
  z-index: 5;
  cursor: col-resize;
  touch-action: none;
}

#amazonProductsView .amazon-products-col-resizer::after {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 4px;
  width: 1px;
  background: #cbd5e1;
}

body.amazon-products-resizing,
body.amazon-products-resizing * { cursor: col-resize !important; user-select: none !important; }

#amazonProductsView .amazon-products-table th[data-direction="asc"]::after { content: " ↑"; }
#amazonProductsView .amazon-products-table th[data-direction="desc"]::after { content: " ↓"; }

#amazonProductsView .amazon-products-table tbody tr {
  cursor: default;
  user-select: text;
}

#amazonProductsView .amazon-products-table tbody tr.amazon-products-virtual-spacer,
#amazonProductsView .amazon-products-table tbody tr.amazon-products-virtual-spacer:hover {
  cursor: default;
}

#amazonProductsView .amazon-products-table tbody tr.amazon-products-virtual-spacer > td {
  height: 0;
  padding: 0;
  border: 0;
  background: #fff;
}

#amazonProductsView .amazon-products-table tbody tr:hover > td { background: #f8fbff; }
#amazonProductsView .amazon-products-table tbody tr.is-official-marketplace-id > td { background: #fff6cc; }
#amazonProductsView .amazon-products-table tbody tr.is-official-marketplace-id:hover > td { background: #ffefad; }
#amazonProductsView .amazon-products-table tbody tr.is-selected > td { background: #dbeafe; }
#amazonProductsView .amazon-products-table tbody tr.is-selected:hover > td { background: #bfdbfe; }

#amazonProductsView .amazon-product-thumbnail {
  width: 42px;
  height: 42px;
  display: block;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
  cursor: zoom-in;
}

#amazonProductsView .amazon-products-empty {
  position: sticky;
  left: 0;
  width: min(100%, 640px);
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
}

.amazon-products-dialog-backdrop {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.amazon-products-dialog {
  width: min(1030px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 22px 60px rgb(15 23 42 / 28%);
}

.amazon-products-dialog h2 {
  margin: 0;
  padding: 18px 20px 10px;
  font-size: 20px;
}

.amazon-product-edit-head h2 { padding-bottom: 14px; }

.amazon-product-edit-dialog {
  width: min(1440px, calc(100vw - 48px));
  height: min(880px, calc(100dvh - 48px));
}

.amazon-product-edit-tabs {
  display: flex;
  gap: 8px;
  padding: 0 20px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.amazon-product-edit-tabs button {
  height: 38px;
  padding: 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-weight: 700;
}

.amazon-product-edit-tabs button.active {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
}

.amazon-product-edit-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px 20px;
}

.amazon-product-edit-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.amazon-product-edit-fields[hidden] { display: none; }

.amazon-product-edit-field {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.amazon-product-edit-field > span {
  color: #172033;
  font-weight: 800;
}

.amazon-product-edit-value {
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid #d6dfeb;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  overflow-wrap: anywhere;
  user-select: text;
}

.amazon-product-edit-value img {
  width: 64px;
  height: 64px;
  display: block;
  object-fit: contain;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
  background: #fff;
}

#amazonProductShouldShip { width: 100%; font: inherit; background: #fff; }
#amazonProductsParentFilter { width: 190px; max-width: 220px; }

.amazon-product-edit-image-button,
.amazon-pairing-thumb,
.amazon-pairing-context-image {
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.amazon-pairing-editor.active {
  height: 100%;
  grid-template-columns: minmax(560px, 1.15fr) minmax(360px, .85fr);
  gap: 14px;
  overflow: hidden;
}

.amazon-pairing-left,
.amazon-pairing-search {
  min-height: 0;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #f8fafc;
}

.amazon-pairing-left {
  overflow: auto;
  padding: 12px;
}

.amazon-pairing-context {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  background: #fff;
}

.amazon-pairing-context-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.amazon-pairing-context-main > strong {
  min-width: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.amazon-pairing-context-image img,
.amazon-pairing-thumb img {
  width: 48px;
  height: 48px;
  display: block;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
}

.amazon-pairing-context-name {
  display: block;
  margin-top: 9px;
  color: #2563eb;
  line-height: 1.4;
  text-decoration: none;
}

.amazon-pairing-context-name:hover { text-decoration: underline; }

.amazon-pairing-section {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  background: #fff;
}

.amazon-pairing-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.amazon-pairing-section h3 { margin: 0; font-size: 15px; }

.amazon-pairing-section > header button,
.amazon-pairing-remove,
.amazon-pairing-search-actions button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.amazon-pairing-lines { display: grid; gap: 8px; }

.amazon-pairing-line {
  display: grid;
  grid-template-columns: minmax(150px, .85fr) minmax(210px, 1.35fr) 74px 54px;
  align-items: end;
  gap: 8px;
  padding: 9px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.amazon-pairing-ref-field,
.amazon-pairing-quantity-field {
  display: grid;
  gap: 5px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.amazon-pairing-ref-field input,
.amazon-pairing-quantity-field input,
.amazon-pairing-search > input {
  height: 36px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #172033;
  font: inherit;
  outline: none;
}

.amazon-pairing-ref-field input:focus,
.amazon-pairing-quantity-field input:focus,
.amazon-pairing-search > input:focus { border-color: #2563eb; }

.amazon-pairing-line-details {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.amazon-pairing-line-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.amazon-pairing-line-meta strong,
.amazon-pairing-line-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amazon-pairing-line-meta span { color: #64748b; font-size: 12px; }
.amazon-pairing-quantity-suffix { color: #2563eb; }
.amazon-pairing-no-image {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 11px;
}

.amazon-pairing-remove { padding: 0 8px; color: #b91c1c; }
.amazon-pairing-remove:disabled,
.amazon-pairing-search-actions button:disabled { cursor: not-allowed; opacity: .45; }

.amazon-pairing-search {
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
  padding: 12px;
}

.amazon-pairing-search > input { flex: 0 0 auto; }
.amazon-pairing-search-status { flex: 0 0 auto; color: #64748b; font-size: 12px; }

.amazon-pairing-search-results {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow: auto;
}

.amazon-pairing-result-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  cursor: pointer;
}

.amazon-pairing-result-card:hover,
.amazon-pairing-result-card:focus,
.amazon-pairing-result-card.is-selected {
  border-color: #60a5fa;
  background: #eff6ff;
  outline: none;
}

.amazon-pairing-result-content {
  min-width: 0;
  display: grid;
  gap: 3px;
  text-align: left;
}

.amazon-pairing-result-content > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amazon-pairing-result-content small { color: #64748b; }

.amazon-pairing-search-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 9px;
  border-top: 1px solid #dbe3ee;
}

.amazon-product-edit-status {
  min-width: 0;
  align-self: center;
  color: #64748b;
  font-size: 13px;
}

.amazon-products-dialog-actions > div { display: flex; gap: 10px; }
.amazon-products-dialog-actions .amazon-product-edit-save { border-color: #2563eb; background: #2563eb; color: #fff; }

.amazon-products-column-mode {
  display: flex;
  gap: 26px;
  padding: 0 20px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.amazon-products-column-mode label,
.amazon-products-columns-grid label {
  display: flex;
  align-items: center;
  gap: 9px;
}

.amazon-products-columns-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
  min-height: 0;
  overflow: auto;
  padding: 14px 20px;
}

.amazon-products-columns-grid label {
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  color: #334155;
  background: #f8fafc;
}

.amazon-products-columns-grid input,
.amazon-products-column-mode input { width: 20px; height: 20px; }

.amazon-products-dialog-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
}

.amazon-products-dialog-actions button {
  min-width: 74px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-weight: 700;
}

.amazon-products-delete-notice { margin: 0; padding: 0 20px 12px; color: #475569; }
.amazon-products-delete-table-wrap { min-height: 0; overflow: auto; margin: 0 20px 14px; border: 1px solid #e2e8f0; }
.amazon-products-delete-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.amazon-products-delete-table th,
.amazon-products-delete-table td { padding: 9px; border-right: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; text-align: left; }
.amazon-products-delete-table th { position: sticky; top: 0; background: #f1f5f9; }
.amazon-products-delete-mfa { display: grid; gap: 6px; padding: 0 20px 14px; font-weight: 700; }
.amazon-products-delete-mfa input { width: 220px; height: 38px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; letter-spacing: .24em; }

@media (max-width: 900px) {
  .amazon-products-columns-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .amazon-pairing-editor.active { grid-template-columns: 1fr; overflow: auto; }
  .amazon-pairing-left,
  .amazon-pairing-search { overflow: visible; }
  .amazon-pairing-search-results { max-height: 360px; }
  .amazon-pairing-line { grid-template-columns: minmax(150px, 1fr) minmax(190px, 1.2fr) 72px 54px; }
}

#amazonProductImageModal { z-index: 1300; }
.amazon-inventory-sync-status { color: #64748b; font-size: 12px; padding: 0 4px 6px; }
.amazon-action-restock { color: #167348; }
.amazon-action-review { color: #9a5100; }

#amazonProductImageModal img {
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  object-fit: contain;
}

.amazon-product-batch-dialog { width: min(720px, calc(100vw - 48px)); }
.amazon-product-batch-selection { margin: 0; padding: 0 20px 12px; color: #64748b; }
.amazon-product-batch-fields { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 12px; padding: 0 20px 12px; }
.amazon-product-batch-fields label { display: grid; gap: 5px; color: #475569; font-size: 12px; font-weight: 700; }
.amazon-product-batch-fields input { height: 38px; min-width: 0; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; }
.amazon-product-batch-matches { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 12px; }
.amazon-product-batch-match { min-height: 34px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #334155; }
.amazon-product-batch-match.is-selected { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }
.amazon-product-batch-preview { margin: 0 20px 12px; padding: 12px; display: flex; align-items: center; gap: 12px; border: 1px solid #dbe3ee; border-radius: 9px; background: #f8fafc; }
.amazon-product-batch-preview[hidden] { display: none; }
.amazon-product-batch-preview > div { min-width: 0; display: grid; gap: 5px; }
.amazon-product-batch-preview strong,
.amazon-product-batch-preview span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amazon-product-batch-preview span { color: #64748b; font-size: 12px; }
.amazon-product-batch-dialog > .amazon-product-edit-status { min-height: 24px; padding: 0 20px 10px; }

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

@media (max-width: 900px) {
  #amazonProductsView .amazon-products-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  #amazonProductsView .amazon-products-filter {
    min-width: 0;
  }

  #amazonProductsView #amazonProductsSearch {
    flex: 1 1 auto;
    width: auto;
    min-width: 120px;
  }
}

#orderManagementView .admin-shared-frame-shell,
#translationSettingsView .admin-shared-frame-shell {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  gap: 0;
}

#orderManagementView .admin-shared-module-frame,
#translationSettingsView .admin-shared-module-frame {
  border: 0;
  border-radius: 8px;
}

.admin-shared-module-frame {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.fba-product-master-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f5f7fa;
}

.fba-product-master-head {
  flex: 0 0 48px;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px 4px;
  box-sizing: border-box;
}

.fba-product-master-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  color: var(--text);
}

.fba-product-master-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fba-product-master-tab {
  height: 34px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.fba-product-master-tab.active {
  border-color: #60a5fa;
  background: #eff6ff;
  color: #0b63d1;
  box-shadow: inset 0 0 0 1px #60a5fa;
}

.fba-product-master-tab:not(.active):hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: none;
}

.fba-product-master-panel {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  overflow: hidden;
}

.fba-product-master-panel[hidden] {
  display: none;
}

#productsView .product-amazon-panel {
  flex-direction: column;
  padding: 0 10px 10px;
  box-sizing: border-box;
}

#productsView .product-controls-card {
  flex: 0 0 auto;
  margin: 0 0 10px;
}

#productsView .product-workspace {
  flex: 1 1 0;
  min-height: 0;
  display: block;
  overflow: hidden;
}

#productsView .product-table-area {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#productsView .product-table-wrap {
  flex: 1 1 0;
  height: auto !important;
  min-height: 0;
  overflow: auto;
}

.fba-pairing-panel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0 10px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  padding-top: 8px;
  overflow: hidden;
}

.fba-pairing-toolbar {
  flex: 0 0 54px;
  height: 54px;
  min-height: 54px;
  max-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  overflow: visible;
  position: relative;
  z-index: 20;
}

.fba-pairing-actions,
.fba-pairing-operations {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.fba-pairing-actions {
  flex: 1 1 auto;
}

.fba-pairing-operations {
  flex: 0 0 auto;
}

.fba-pairing-dropdown {
  position: relative;
  flex: 0 0 auto;
}

.fba-pairing-panel .toolbar-item {
  height: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  box-sizing: border-box;
}

.fba-pairing-panel button.toolbar-item {
  width: auto;
  min-width: max-content;
  padding: 0 12px;
  cursor: pointer;
}

.fba-pairing-panel button.toolbar-item:hover,
.fba-pairing-filter-select:hover,
.fba-pairing-filter-select:focus,
.fba-pairing-filter-keyword:hover,
.fba-pairing-filter-keyword:focus {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: none;
}

.fba-pairing-filter-select,
.fba-pairing-filter-keyword {
  flex: 0 0 auto;
  height: 36px;
  min-width: 0;
  padding: 0 12px;
  outline: none;
}

.fba-pairing-filter-select {
  width: 128px;
  cursor: pointer;
  appearance: none;
  background-image: none;
}

.fba-pairing-filter-keyword {
  width: 110px;
}

.fba-pairing-filter-keyword::placeholder {
  color: #94a3b8;
}

.fba-pairing-result-count {
  min-width: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.fba-pairing-menu,
.fba-pairing-columns-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: 280px;
  max-height: 420px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}

.fba-pairing-menu.compact {
  width: 150px;
}

.fba-pairing-menu:not(.compact) {
  width: 240px;
  max-height: 560px;
}

.fba-pairing-menu button,
.fba-pairing-columns-menu label {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}

.fba-pairing-menu button:hover,
.fba-pairing-columns-menu label:hover {
  background: #eff6ff;
}

.fba-pairing-category-search {
  width: 100%;
  height: 42px;
  margin: 0 0 8px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  outline: none;
}

.fba-pairing-category-search:focus {
  border-color: #93c5fd;
  box-shadow: none;
}

.fba-pairing-menu .fba-pairing-category-top,
.fba-pairing-menu .fba-pairing-category-primary {
  min-height: 38px;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.fba-pairing-menu .fba-pairing-category-top.selected,
.fba-pairing-menu .fba-pairing-category-primary.selected,
.fba-pairing-menu .fba-pairing-category-child.selected {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.fba-pairing-menu .fba-pairing-category-top strong,
.fba-pairing-menu .fba-pairing-category-primary strong,
.fba-pairing-menu .fba-pairing-category-child strong {
  margin-left: auto;
  color: var(--muted);
  flex: 0 0 auto;
  font-weight: 500;
}

.fba-pairing-category-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
  white-space: nowrap;
  line-height: 1.15;
}

.fba-pairing-category-card {
  margin-bottom: 8px;
}

.fba-pairing-menu .fba-pairing-category-primary {
  margin-bottom: 0;
}

.fba-pairing-category-children {
  padding: 6px 0 0 18px;
}

.fba-pairing-menu .fba-pairing-category-child {
  min-height: 31px;
  justify-content: space-between;
  margin-bottom: 5px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-weight: 400;
}

.fba-pairing-category-empty {
  padding: 16px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  text-align: center;
}

.fba-pairing-table-wrap {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  overflow: auto;
  background: white;
}

.fba-pairing-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.fba-pairing-table th,
.fba-pairing-table td {
  height: 42px;
  padding: 0 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: white;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.fba-pairing-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 36px;
  background: #f1f5fb;
  color: var(--text);
  font-weight: 900;
}

.fba-pairing-table tbody tr {
  cursor: pointer;
}

.fba-pairing-table tr.selected td {
  background: #eaf2ff;
}

.fba-pairing-col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 8;
  width: 8px;
  height: 100%;
  cursor: col-resize;
}

.fba-pairing-col-resizer:hover {
  background: rgba(96, 165, 250, 0.22);
}

body.fba-pairing-resizing {
  cursor: col-resize;
  user-select: none;
}

.fba-pairing-sort {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding-right: 8px;
  color: inherit;
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

#amazonProductsView [data-product-management-panel="warehouse"] .fba-pairing-table th .fba-pairing-sort,
#amazonProductsView [data-product-management-panel="warehouse"] .fba-pairing-table th .fba-pairing-sort:not(:disabled):hover {
  min-width: 0;
  max-width: 100%;
  height: 100%;
  justify-content: flex-start;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: inherit;
  padding: 0 8px 0 0;
}

#amazonProductsView [data-product-management-panel="warehouse"] .fba-product-master-panel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

#amazonProductsView [data-product-management-panel="warehouse"] .fba-pairing-panel {
  margin: 0;
}

#amazonProductsView .amazon-owned-products-panel {
  margin: 0;
}

#amazonProductsView .amazon-owned-products-card {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding-top: 8px;
}

#amazonProductsView .amazon-owned-products-toolbar {
  flex: 0 0 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

#amazonProductsView .amazon-owned-products-filters,
#amazonProductsView .amazon-owned-products-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

#amazonProductsView .amazon-owned-products-toolbar button,
#amazonProductsView .amazon-owned-products-toolbar select,
#amazonProductsView .amazon-owned-products-toolbar input {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  color: #94a3b8;
  font: inherit;
  font-size: 13px;
}

#amazonProductsView .amazon-owned-products-table-wrap {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
}

#amazonProductsView .amazon-owned-products-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

#amazonProductsView .amazon-owned-products-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  min-width: 120px;
  height: 36px;
  padding: 0 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #f1f5fb;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
}

#amazonProductsView .amazon-owned-products-table td {
  height: 54px;
  max-width: 260px;
  padding: 6px 10px;
  overflow: hidden;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#amazonProductsView .amazon-owned-product-thumb {
  width: 42px;
  height: 42px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  cursor: zoom-in;
}

#amazonProductsView .amazon-owned-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#amazonProductsView .amazon-owned-products-empty {
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
}

.fba-pairing-sort span {
  color: #8aa2c0;
  font-size: 12px;
}

.fba-pairing-select-cell {
  text-align: center;
}

.fba-pairing-image-cell img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  display: block;
}

.fba-pairing-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.fba-pairing-pill.status-已配对 {
  background: #dcfce7;
  color: #166534;
}

.fba-pairing-pill.status-待确认 {
  background: #fef3c7;
  color: #92400e;
}

.fba-pairing-pill.status-停用 {
  background: #fee2e2;
  color: #991b1b;
}

.fba-pairing-dialog {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 18px;
  border-radius: 10px;
  background: white;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
}

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

.fba-pairing-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.fba-pairing-form input,
.fba-pairing-form select,
.fba-pairing-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  color: var(--text);
  background: white;
  box-sizing: border-box;
}

.fba-pairing-form textarea {
  resize: vertical;
}

.fba-pairing-form-wide,
.fba-pairing-form .dialog-actions {
  grid-column: 1 / -1;
}

.fba-pairing-sku-editor {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.fba-pairing-sku-editor-head,
.fba-pairing-sku-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fba-pairing-sku-editor-head {
  justify-content: space-between;
}

.fba-pairing-sku-editor button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  background: white;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.fba-pairing-sku-fields {
  display: grid;
  gap: 8px;
}

.fba-pairing-sku-field input {
  flex: 1;
}

.shipment-template-status.template-missing {
  color: #dc2626;
  border-color: #fecaca;
  background: #fff7f7;
}

#shipmentView .shipment-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

#shipmentView .shipment-summary-grid div {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px 12px;
  border-right: 0;
  border-bottom: 1px solid #edf0f5;
}

#shipmentView .shipment-summary-grid div:last-child {
  border-bottom: 0;
}

#shipmentView .shipment-summary-grid span {
  color: #64748b;
  font-size: 10px;
  font-weight: 400;
}

#shipmentView .shipment-summary-grid strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 400;
}

#shipmentView .shipment-summary-grid #shipmentSkuCount,
#shipmentView .shipment-summary-grid #shipmentMerchandiseTotal {
  color: #2563eb;
  font-size: 21px;
  font-weight: 400;
}

.shipment-preview-panel {
  width: 460px;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  justify-self: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shipment-table-wrap {
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.shipment-preview-title {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: #172033;
  font-size: 18px;
  font-weight: 600;
  text-align: left;
}

.shipment-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  table-layout: fixed;
}

.shipment-table col.shipment-merchant-sku-col {
  width: 310px;
}

.shipment-table col.shipment-quantity-col {
  width: 150px;
}

.shipment-table th,
.shipment-table td {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #edf0f5;
  color: #172033;
  text-align: center;
  font-size: 14px;
  white-space: nowrap;
}

.shipment-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #e5e7eb;
  color: #334155;
  font-size: 16px;
  font-weight: 700;
}

.shipment-table th:nth-child(1),
.shipment-table td:nth-child(1) {
  width: 310px;
}

.shipment-table th:nth-child(2),
.shipment-table td:nth-child(2) {
  width: 150px;
}

.packing-workspace {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 347px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.packing-side-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

.packing-prepack-upload {
  display: grid;
  gap: 8px;
}

#packingListView .packing-file-button {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  justify-content: flex-start;
  padding: 0 14px;
  background: white;
  color: #172033;
  font-size: 13px;
  font-weight: 400;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.packing-prepack-upload button:not(.packing-file-button),
#packingListView #exportPackingBtn,
#packingListView #clearPackingBtn,
.packing-section-actions button {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
}

#pickingView button:not(.fulfillment-tab),
#shipmentView button:not(.fulfillment-tab),
#packingListView button:not(.fulfillment-tab) {
  background: white;
  border-color: #cbd5e1;
  color: #172033;
  cursor: pointer;
}

#pickingView button:not(.fulfillment-tab):not(:disabled):hover,
#shipmentView button:not(.fulfillment-tab):not(:disabled):hover,
#packingListView button:not(.fulfillment-tab):not(:disabled):hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  cursor: pointer;
}

#pickingView button:not(.fulfillment-tab):disabled,
#shipmentView button:not(.fulfillment-tab):disabled,
#packingListView button:not(.fulfillment-tab):disabled {
  background: #f8fafc;
  border-color: #d8dee8;
  color: #94a3b8;
  cursor: not-allowed;
}

.packing-side-label {
  margin-top: 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}

.packing-side-panel #packingStatus {
  min-height: 46px;
  margin: 0;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.25;
}

.packing-side-panel #exportPackingBtn,
.packing-side-panel #clearPackingBtn {
  margin-top: 2px;
}

.packing-tables-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(190px, auto) minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.packing-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.packing-summary-grid div {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px 12px;
  border-right: 0;
  border-bottom: 1px solid #edf0f5;
}

.packing-summary-grid div:last-child {
  border-bottom: 0;
}

.packing-summary-grid span {
  color: #64748b;
  font-size: 10px;
  font-weight: 400;
}

.packing-summary-grid strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 400;
}

.packing-summary-grid #packingSkuCount,
.packing-summary-grid #packingMerchandiseTotal,
.packing-summary-grid #packingTotalCajas {
  color: #2563eb;
  font-size: 21px;
  font-weight: 400;
}

.packing-box-card,
.packing-preview-card {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.packing-box-card {
  overflow: hidden;
}

.packing-preview-card {
  overflow: hidden;
}

.packing-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.packing-section-title h2 {
  margin: 0;
  font-size: 20px;
}

.packing-section-title span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.packing-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.packing-section-actions button {
  width: 86px;
  flex: 0 0 86px;
}

.packing-box-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.packing-box-table {
  min-width: 0;
  width: max-content;
  border-collapse: collapse;
}

.packing-box-table th,
.packing-box-table td {
  height: 38px;
  min-width: 128px;
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  text-align: center;
  background: white;
  font-size: 14px;
}

.packing-box-table th:first-child {
  min-width: 180px;
  text-align: left;
  background: #f3f4f6;
  font-weight: 900;
}

.packing-box-table thead th {
  background: #e5e7eb;
  text-align: center;
}

.packing-box-table input {
  width: 100px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
  font-weight: 800;
}

.packing-box-table input:disabled {
  background: #f1f5f9;
  color: #64748b;
}

.packing-preview-wrap {
  width: max-content;
  min-width: 520px;
  max-width: 100%;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  margin: 0;
  overflow: auto;
}

.packing-preview-table {
  min-width: 0;
  width: max-content;
  table-layout: auto;
}

.packing-preview-table th,
.packing-preview-table td {
  min-width: 130px;
  height: 34px;
  text-align: center;
}

.packing-preview-table th:first-child,
.packing-preview-table td:first-child {
  min-width: 220px;
}

.packing-preview-table th:nth-child(2),
.packing-preview-table td:nth-child(2) {
  min-width: 90px;
}

.work-search {
  display: flex;
  flex: 0 0 313px;
  min-width: 260px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.work-search input {
  flex: 1;
  border: 0;
  min-width: 0;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 400;
}

.work-search button {
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  min-width: 78px;
}

.search-action,
.green-big {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
}

.green-big {
  height: 56px;
  min-width: 150px;
  font-size: 20px;
  font-weight: 900;
}

.small-bottom-btn,
.red-bottom-btn {
  height: 30px;
  min-width: 142px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 400;
}

.red-bottom-btn {
  background: #ef4444;
  color: white;
  border: 1px solid #ef4444;
}

.packaging-board {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.packaging-summary-row,
.packaging-header-row,
.packaging-main-scroll,
.packaging-fixed-x-row {
  display: grid;
  grid-template-columns: minmax(420px, var(--packaging-product-width, 64%)) 6px minmax(260px, 1fr);
  gap: 0;
}

.packaging-summary-row {
  height: 34px;
  align-items: center;
  margin: 0 0 6px;
  padding: 0 calc(12px + var(--packaging-scrollbar-width, 0px)) 0 12px;
  box-sizing: border-box;
  background: white;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.packaging-product-summary {
  position: relative;
  height: 34px;
  min-width: 0;
}

.packaging-summary-row .task-summary {
  margin: 0;
  padding-right: 0;
  line-height: 34px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.packaging-prepared-total {
  display: none;
}

.packaging-summary-row .packaging-caja-total-clip {
  align-self: stretch;
}

.packaging-caja-total-clip {
  overflow: hidden;
  background: white;
}

.packaging-main-scroll {
  height: auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  align-items: start;
  scrollbar-gutter: stable;
}

.packaging-header-row {
  height: 34px;
  overflow: hidden;
  padding-right: var(--packaging-scrollbar-width, 0px);
  box-sizing: border-box;
}

.packaging-header-pane {
  border-bottom: 0;
}

.packaging-header-x {
  overflow: hidden;
}

.packaging-product-pane,
.packaging-caja-pane {
  border: 2px solid #d6d9d1;
  background: white;
  overflow: visible;
  min-width: 0;
}

.packaging-product-pane {
  border-right: 0;
}

.packaging-caja-pane {
  border-left: 0;
}

.packaging-main-scroll .packaging-product-pane,
.packaging-main-scroll .packaging-caja-pane {
  border-top: 0;
}

.packaging-divider {
  position: relative;
  z-index: 8;
  cursor: col-resize;
  background:
    linear-gradient(#d7dde8, #d7dde8) 0 33px / 100% 1px no-repeat,
    repeating-linear-gradient(to bottom, transparent 0 45px, #d7dde8 45px 46px) 0 34px / 100% 46px repeat-y,
    #bdbdbd;
  border-top: 2px solid #d6d9d1;
  border-bottom: 2px solid #d6d9d1;
  touch-action: none;
  user-select: none;
  min-height: 100%;
}

.packaging-divider:hover,
.packaging-main-scroll.dragging .packaging-divider {
  background: #9ca3af;
}

.packaging-x-scroll {
  overflow-x: auto;
  overflow-y: visible;
  width: 100%;
}

.packaging-main-scroll .packaging-x-scroll {
  overflow-x: hidden;
  scrollbar-width: none;
}

.packaging-main-scroll .packaging-x-scroll::-webkit-scrollbar:horizontal {
  height: 0;
}

.packaging-header-row .packaging-header-x {
  overflow-x: hidden;
  overflow-y: hidden;
  scrollbar-width: none;
}

.packaging-header-row .packaging-header-x::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.packaging-fixed-x-row {
  padding-right: var(--packaging-scrollbar-width, 0px);
  box-sizing: border-box;
  align-items: center;
  margin-top: 0;
  height: 20px;
  position: sticky;
  bottom: 0;
  z-index: 12;
  background: white;
}

.packaging-fixed-x-pane {
  min-width: 0;
  overflow: hidden;
}

.packaging-fixed-x-scroll {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #d6d9d1;
  border-radius: 4px;
  height: 20px;
  cursor: default;
  user-select: none;
  touch-action: auto;
}

.packaging-fixed-x-scroll > div {
  position: absolute;
  top: 5px;
  left: 0;
  height: 10px;
  min-width: 40px;
  width: 40px;
  background: #bdbdbd;
  border-radius: 999px;
  cursor: grab;
}

.packaging-fixed-x-scroll.is-dragging > div,
.packaging-fixed-x-scroll > div:hover {
  background: #9ca3af;
}

.packaging-fixed-x-scroll.is-dragging > div {
  cursor: grabbing;
}

.packaging-fixed-x-divider {
  height: 20px;
  background: #bdbdbd;
}

.packaging-product-table,
.packaging-caja-table {
  table-layout: fixed;
  min-width: auto;
  width: max-content;
}

.packaging-product-table th,
.packaging-product-table td,
.packaging-caja-table th,
.packaging-caja-table td {
  height: 46px;
  min-height: 46px;
  max-height: 46px;
  box-sizing: border-box;
  padding: 0 6px;
  font-size: 14px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.packaging-product-table tbody tr,
.packaging-caja-table tbody tr {
  height: 46px;
  min-height: 46px;
  max-height: 46px;
}

.packaging-product-table th {
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 0 6px;
  background: #eaf3ff;
  font-size: var(--pack-head-font, 13px);
  font-weight: 800;
  position: static;
  z-index: 1;
}

.packaging-product-table th[data-pack-col] {
  position: relative;
  user-select: none;
}

.pack-col-title {
  display: inline-block;
  max-width: calc(100% - 26px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.pack-font-adjust {
  position: absolute;
  right: 8px;
  top: 3px;
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 3;
}

.pack-font-adjust button {
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 10px;
  line-height: 9px;
  padding: 0;
  width: 11px;
  height: 10px;
  cursor: pointer;
}

.pack-col-resize {
  position: absolute;
  top: 0;
  right: -5px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  z-index: 4;
}

.packaging-adjust-mode .packaging-product-table th[data-pack-col] {
  cursor: move;
}

.packaging-product-table th.pack-col-drop-target {
  outline: 2px solid #60a5fa;
  outline-offset: -2px;
}

.packaging-product-table thead,
.packaging-caja-table thead {
  z-index: 2;
}

.packaging-caja-totals {
  display: grid;
  width: max-content;
  height: 34px;
  min-height: 34px;
  background: white;
  will-change: transform;
}

.packaging-caja-totals div {
  display: grid;
  place-items: center;
  color: #2563eb;
  font-size: 18px;
  font-weight: 900;
  border-right: 1px solid #edf0f5;
}

.packaging-caja-table th {
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 0 6px;
  background: #e6f4d7;
  font-size: 13px;
  font-weight: 800;
  position: static;
  z-index: 1;
  cursor: pointer;
}

.caja-head-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-width: 0;
}

.caja-head-label {
  display: inline-block;
  min-width: 0;
  max-width: 36px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caja-inline-btn {
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 4px;
  font-size: 11px;
  line-height: 12px;
}

.packaging-caja-table th.caja-action-head,
.packaging-caja-table td.caja-action-cell {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  padding: 0;
  text-align: center;
}

.packaging-caja-table th.caja-action-head {
  background: #e6f4d7;
  cursor: default;
}

.caja-action-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 20px;
  line-height: 34px;
  color: #172033;
}

#packagingView .caja-action-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  line-height: 34px;
}

.packaging-caja-table th.caja-closed {
  background: #ef4444;
  color: white;
}

.packaging-caja-table th.caja-disabled-head:not(.caja-closed) {
  color: #94a3b8;
}

.packaging-product-table .pack-col-nombre {
  text-align: left;
}

.packaging-caja-table th,
.packaging-caja-table td {
  width: 58px;
  min-width: 58px;
  max-width: 58px;
}

.row-delete-btn,
.row-edit-btn,
.row-add-btn,
.draft-edit-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
  font-weight: 900;
  font-size: 20px;
  line-height: 1;
}

.row-delete-btn {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.row-edit-btn {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.row-add-btn {
  color: #16a34a;
  border-color: #b7d7c3;
  background: #f7fef9;
}

.draft-edit-btn {
  color: #94a3b8;
  border-color: #d8dee8;
  background: #f8fafc;
}

#packagingView .row-add-btn {
  color: #16a34a;
  border-color: #b7d7c3;
  background: #f7fef9;
}

#packagingView .draft-edit-btn {
  color: #94a3b8;
  border-color: #d8dee8;
  background: #f8fafc;
}

.recommended-display {
  display: inline-flex;
  min-width: 30px;
  justify-content: center;
}

.recommended-input {
  width: 54px;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  text-align: center;
  font-size: inherit;
  font-weight: inherit;
}

.packaging-draft-row td {
  background: #f8fbff;
}

.draft-item-input {
  width: 92%;
  height: 28px;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  padding: 0 6px;
  font-size: inherit;
  font-weight: inherit;
  text-align: center;
  background: white;
}

.draft-item-input.input-error,
.recommended-input.input-error,
.caja-input.input-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.16);
}

.draft-recommended-input {
  width: 54px;
}

.print-label-btn {
  background: #08213e;
  color: white;
  border-color: #08213e;
  font-size: inherit;
  font-weight: inherit;
  min-width: 62px;
  height: 30px;
  padding: 4px 8px;
}

.print-label-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.label-print-frame {
  position: fixed;
  width: 1px;
  height: 1px;
  right: 0;
  bottom: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.packaging-product-table .thumb {
  width: 40px;
  height: 40px;
}

.packaging-product-table .cell-ellipsis {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.packaging-bottom-actions {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.box-action-group {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.packing-note {
  text-align: center;
  color: #ef4444;
  font-size: 20px;
  font-weight: 900;
}

.caja-input {
  width: 44px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}

.caja-input::-webkit-outer-spin-button,
.caja-input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.qty-positive,
.caja-input.qty-positive-input {
  color: #2563eb;
  font-weight: 900;
}

.caja-input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
}

.toolbar input,
.toolbar select {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  padding: 0 12px;
  font-size: 14px;
}

.toolbar input {
  width: min(460px, 50vw);
}

.table-wrap {
  height: calc(100vh - 245px);
  overflow: auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.product-table-wrap {
  height: calc(100vh - 198px);
  outline: none;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1800px;
  width: 100%;
}

.product-table {
  min-width: 1680px;
  table-layout: fixed;
}

th,
td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid #edf0f5;
  padding: 6px 10px;
  vertical-align: middle;
  font-size: 13px;
  background: white;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td {
  height: 64px;
  max-height: 64px;
}

th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td {
  overflow: hidden;
  text-overflow: ellipsis;
}

select,
input,
textarea {
  min-width: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  font-weight: 700;
  white-space: nowrap;
}

.group-amazon {
  background: #e7f2ff;
}

.group-combo {
  background: #eaf7df;
}

.group-warehouse {
  background: #fff1c7;
}

th.amazon-col {
  background: #f1f5f9;
  color: #172033;
}

th.warehouse-head {
  background: #e2e8f0;
  color: #172033;
}

th[data-sort] {
  cursor: pointer;
}

th[data-pack-sort] {
  cursor: pointer;
}

th.name-head,
td.name {
  width: 210px;
  min-width: 210px;
  max-width: 210px;
}

td.name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amazon-link-cell {
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  text-align: center;
}

th.qty-head,
td.qty-cell {
  width: 70px;
  min-width: 70px;
  max-width: 70px;
  text-align: center;
}

.product-table th:nth-child(1),
.product-table td:nth-child(1) {
  width: 150px;
}

.product-table th:nth-child(2),
.product-table td:nth-child(2) {
  width: 125px;
}

.product-table th:nth-child(3),
.product-table td:nth-child(3) {
  width: 130px;
}

.product-table th:nth-child(7),
.product-table td:nth-child(7) {
  width: 90px;
}

.product-table th:nth-child(8),
.product-table td:nth-child(8) {
  width: 60px;
  text-align: center;
}

.product-table th:nth-child(9),
.product-table td:nth-child(9) {
  width: 76px;
  text-align: center;
}

.product-table th:nth-child(10),
.product-table td:nth-child(10) {
  width: 84px;
}

.product-table th:nth-child(11),
.product-table td:nth-child(11) {
  width: 70px;
  text-align: center;
}

.product-table th:nth-child(12),
.product-table td:nth-child(12),
.product-table th:nth-child(13),
.product-table td:nth-child(13) {
  width: 72px;
  text-align: center;
}

.product-table th:nth-child(14),
.product-table td:nth-child(14) {
  width: 92px;
}

.product-table th:nth-child(16),
.product-table td:nth-child(16) {
  width: 100px;
}

.product-table th:nth-child(17),
.product-table td:nth-child(17) {
  width: 110px;
}


/* Product page column sizing is controlled by colgroup so users can resize and persist widths. */
.product-table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

.product-table col {
  width: auto;
}

.product-table th,
.product-table td {
  min-width: 0;
  max-width: none !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-table th {
  position: sticky;
  padding-right: 18px;
  user-select: none;
}

.product-header-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 4;
  width: 8px;
  height: 100%;
  cursor: col-resize;
}

.product-col-resizer:hover {
  background: rgba(96, 165, 250, 0.22);
}

body.product-col-resizing {
  cursor: col-resize;
  user-select: none;
}

.product-fixed-cell-text {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.status-ok {
  color: #047857;
  font-weight: 600;
}

.status-warn {
  color: #b45309;
  font-weight: 600;
}

.shrink-text {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  line-height: 1.1;
}


.thumb {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  cursor: zoom-in;
}

.product-table th:nth-child(6),
.product-table td:nth-child(6) {
  width: 64px;
  min-width: 64px;
  max-width: 64px;
  text-align: center;
}

.no-image {
  color: #dc2626;
  font-weight: 800;
  white-space: nowrap;
}

tr.selected td {
  background: #eff6ff;
}

tr.focused td {
  box-shadow: inset 0 1px 0 #93c5fd, inset 0 -1px 0 #93c5fd;
}

.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

#packagingView .pack-col-link .link {
  font-size: 12px;
  font-weight: 400;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.72);
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal img {
  max-width: 88vw;
  max-height: 88vh;
  background: white;
  border-radius: 8px;
}

.modal-close {
  position: fixed;
  top: 18px;
  right: 18px;
}

.product-form {
  width: min(700px, 92vw);
  height: min(780px, calc(100dvh - 56px));
  max-height: calc(100dvh - 56px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: white;
  border-radius: 8px;
  padding: 18px;
}

.category-form {
  width: min(720px, 90vw);
  max-height: 90vh;
  overflow: auto;
  background: white;
  border-radius: 8px;
  padding: 22px;
}

.product-import-dialog {
  width: min(1120px, 94vw);
  max-height: 90vh;
  overflow: auto;
  background: white;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.24);
}

.product-import-source {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.68fr);
  gap: 14px;
  margin-top: 14px;
}

.product-import-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
}

.product-import-card p {
  margin: 6px 0 14px;
  color: #64748b;
  font-weight: 400;
}

.product-import-card strong {
  font-weight: 700;
}

.import-upload-box,
.import-mode-box,
.selective-fields {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-top: 14px;
  background: #f8fafc;
}

.import-upload-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.import-upload-box p {
  margin: 6px 0 0;
  color: #64748b;
  font-weight: 600;
}

.import-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  background: #0f766e;
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.import-template-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #111827;
  background: transparent;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
}

.import-template-button:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #2563eb;
}

#productImportFileName {
  grid-column: 1 / -1;
}

.import-mode-box {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.import-choice-box h3 {
  min-width: 96px;
}

.import-mode-box h3,
.selective-fields h3 {
  margin: 0;
}

.import-mode-box label,
.selective-fields label {
  font-weight: 400;
  color: #1e293b;
}

.selective-fields label:has(input:disabled) {
  color: #94a3b8;
}

.field-hint {
  margin: 12px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 400;
}

.selective-fields-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px 14px;
  margin-top: 12px;
}

.import-report {
  margin-top: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 12px;
  min-height: 44px;
  background: white;
}

.packaging-dialog {
  width: min(620px, 92vw);
  max-height: 88vh;
  overflow: auto;
  background: white;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.24);
}

.packaging-open-dialog {
  width: min(820px, 92vw);
}

.export-document-dialog {
  width: min(560px, 92vw);
}

.export-location-hint {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}

#openPackagingModal .packaging-open-dialog,
#openPackagingModal .packaging-open-dialog * {
  font-weight: 400;
}

#openPackagingModal .form-head h2 {
  font-weight: 400;
}

#openPackagingModal .open-dialog-top-close {
  display: none;
}

#openPackagingModal button {
  background: white;
  border: 1px solid var(--border);
  color: #172033;
  cursor: pointer;
}

#openPackagingModal button.primary {
  background: white;
  border-color: var(--border);
  color: #172033;
}

#openPackagingModal button:hover,
#openPackagingModal button.primary:hover,
#openPackagingModal .saved-table-row:hover,
#openPackagingModal .saved-table-row.selected {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.dialog-label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-weight: 800;
}

.dialog-input,
.date-filter-row input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.three-actions {
  justify-content: space-between;
}

.danger-text {
  color: #dc2626;
  border-color: #fecaca;
  background: #fff7f7;
}

.delete-warning-text {
  color: #dc2626;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.45;
  margin: 14px 0 6px;
}

.date-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.date-filter-row label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-weight: 400;
}

.saved-table-head,
.saved-table-row {
  display: grid;
  grid-template-columns: 130px 120px minmax(260px, 1fr) 130px;
  gap: 12px;
  align-items: center;
}

.saved-table-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.saved-table-head {
  color: #475569;
  font-weight: 400;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: white;
}

.saved-table-list {
  max-height: 300px;
  overflow: auto;
}

.saved-table-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: white;
  padding: 12px;
  text-align: left;
  font: inherit;
  font-weight: 400;
  cursor: pointer;
}

.saved-table-row:last-child {
  border-bottom: 0;
}

.saved-table-row strong {
  color: #0f172a;
  font-weight: 400;
}

.saved-table-empty {
  padding: 26px 12px;
  text-align: center;
  color: var(--muted);
}

.category-editor-rows {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.category-editor-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 80px 64px 64px 64px;
  gap: 8px;
  align-items: center;
}

.category-editor-row input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
}

.category-editor-row input[readonly] {
  background: #f8fafc;
  color: #64748b;
  font-weight: 800;
}

.category-editor-row span {
  color: var(--muted);
}

.category-editor-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.form-head,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.form-head h2 {
  margin: 0;
}

.product-form .form-head {
  flex: 0 0 auto;
  margin-bottom: 10px;
}

.product-form-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.product-form-tab {
  height: 36px;
  min-width: 118px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.product-form-tab.active {
  color: #1d4ed8;
  border-color: #60a5fa;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #60a5fa;
}

.product-form-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.product-form-panel {
  min-height: 100%;
}

.product-form-panel[hidden] {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: start;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  align-self: start;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  font-weight: 400;
  min-height: 38px;
}

.form-grid textarea {
  resize: vertical;
}

.product-form .form-grid.product-field-list {
  grid-template-columns: 1fr;
  gap: 10px;
}

.product-form .product-field-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.product-form .product-field-row > span,
.product-form .product-image-title {
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
}

.product-form .product-image-title {
  grid-column: auto;
  padding-top: 8px;
  line-height: 1.2;
}

.product-form .product-field-row input,
.product-form .product-field-row select,
.product-form .product-field-row textarea {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
  box-sizing: border-box;
}

.product-form .product-textarea-row {
  align-items: start;
}

.product-form .product-textarea-row > span {
  padding-top: 8px;
}

.product-form .product-textarea-row textarea {
  min-height: 72px;
  resize: vertical;
}

.product-image-editor {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px 12px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  align-self: start;
}

.product-image-editor.image-field {
  grid-column: span 2;
}

.product-form .product-image-editor.image-field {
  grid-column: auto;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 0;
  border: 0;
  background: transparent;
}

.product-image-input {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.product-image-title {
  grid-column: 1 / -1;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.product-image-preview {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  color: #dc2626;
  font-weight: 900;
}

.product-image-preview img {
  max-width: 62px;
  max-height: 62px;
  object-fit: contain;
}

.product-image-tools {
  display: grid;
  gap: 8px;
  align-content: start;
}

.image-button-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.image-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  color: #1d4ed8;
  background: #eff6ff;
  font-weight: 800;
  cursor: pointer;
}

#uploadProductImageBtn {
  min-height: 30px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.image-upload-status {
  min-height: 18px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.component-editor {
  display: grid;
  gap: 8px;
}

.product-form .component-editor {
  min-width: 0;
  gap: 10px;
}

.component-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.component-editor-head button {
  padding: 7px 10px;
}

.component-grid {
  display: grid;
  grid-template-columns: 1fr 90px 1fr 1fr 70px;
  gap: 8px;
  align-items: center;
}

.component-grid-head {
  color: var(--muted);
  font-weight: 800;
}

.component-row {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

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

.component-field {
  display: inline-grid;
  grid-template-columns: auto var(--component-input-width);
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
}

.component-field-short {
  --component-input-width: 120px;
}

.component-field-barcode {
  --component-input-width: 240px;
}

.component-field span {
  white-space: nowrap;
}

.component-row input {
  width: var(--component-input-width, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  box-sizing: border-box;
}

.remove-component-btn {
  color: #dc2626;
  min-width: 62px;
  height: 38px;
  margin-left: auto;
  padding: 0 12px;
}

.product-form-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  padding-top: 0;
}

.product-form-footer button {
  min-width: 88px;
  height: 38px;
  padding: 0 16px;
}

@media (max-width: 900px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    display: block;
    min-width: 0;
    min-height: 100dvh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 120;
    width: 100%;
    flex: none;
    display: grid;
    grid-template-columns: 38px auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 7px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  }

  .mobile-nav-toggle {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: #172033;
    font-size: 20px;
    cursor: pointer;
  }

  .mobile-nav-toggle:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
  }

  .brand {
    margin: 0;
    min-width: max-content;
    font-size: 14px;
  }

  .brand-icon {
    width: 24px;
    height: 24px;
  }

  .sidebar nav {
    position: absolute;
    left: 10px;
    top: calc(100% + 6px);
    width: min(260px, calc(100vw - 20px));
    display: none;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  }

  .sidebar.mobile-nav-open nav {
    display: grid;
  }

  .sidebar-user-shell {
    width: min(150px, 42vw);
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    justify-self: end;
  }

  .sidebar-user-shell .cotigo-user-button {
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    border-radius: 9px;
  }

  .sidebar-user-shell .cotigo-user-menu {
    left: auto;
    right: 0;
    bottom: auto;
    top: calc(100% + 8px);
  }

  .sidebar-user-shell .cotigo-user-submenu {
    left: auto;
    right: calc(100% + 8px);
    bottom: auto;
    top: 0;
  }

  .nav-item {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    white-space: nowrap;
  }

  .page-titlebar .menu-button {
    display: none;
  }

  .main {
    width: 100%;
    padding: 12px;
  }

  .topbar,
  .page-titlebar {
    gap: 10px;
    margin-bottom: 12px;
  }

  .page-titlebar {
    min-height: 46px;
    margin: -12px -12px 12px;
    padding: 0 12px;
  }

  .page-titlebar h1,
  .topbar h1 {
    font-size: 22px;
  }

  .topbar {
    display: block;
  }

  .home-upload-grid,
  .home-rules-panel,
  .rule-fields,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .admin-shared-frame-shell {
    height: calc(100vh - 24px);
    min-height: 460px;
  }

  #orderManagementView,
  #translationSettingsView {
    height: calc(100vh - 24px);
  }

  #productsView {
    width: calc(100% + 24px);
    height: calc(100dvh - 14px);
    margin: -8px -12px -12px;
  }

  #orderManagementView .admin-shared-frame-shell,
  #translationSettingsView .admin-shared-frame-shell {
    height: 100%;
    min-height: 0;
  }

  .home-upload-card,
  .home-rules-panel,
  .settings-card {
    padding: 14px;
  }

  .upload-buttons {
    gap: 10px;
    padding: 0;
  }

  .task-panel,
  .import-upload-box {
    grid-template-columns: 1fr;
  }

  .product-actions-row,
  .product-filter-row,
  .work-actions-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .product-actions-row > *,
  .product-filter-row > *,
  .work-actions-row > * {
    flex: 0 0 auto;
  }

  .work-search {
    width: min(78vw, 340px);
    flex-basis: min(78vw, 340px);
    min-width: 230px;
  }

  .product-search {
    width: 165px;
    flex-basis: 165px;
    min-width: 165px;
  }

  .product-search-field {
    width: 150px;
    flex-basis: 150px;
  }

  .product-workspace {
    min-height: 0;
  }

  .category-filter-menu,
  .parent-listing-filter-menu {
    width: min(86vw, 360px);
    max-height: min(520px, calc(100vh - 200px));
  }

  .category-list,
  .parent-listing-list {
    display: grid;
    overflow: visible;
  }

  .category-item,
  .parent-listing-item {
    flex: none;
    padding: 10px 12px;
    white-space: nowrap;
  }

  .table-wrap,
  .product-table-wrap,
  .picking-preview-panel,
  .picking-table-wrap,
  .shipment-preview-panel,
  .shipment-table-wrap,
  .packing-preview-wrap,
  .packing-box-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .picking-workspace,
  .shipment-workspace,
  .packing-workspace {
    grid-template-columns: 1fr;
  }

  .table-wrap,
  .product-table-wrap {
    height: calc(100dvh - 260px);
    min-height: 340px;
  }

  .shipment-summary-grid,
  .packing-summary-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    overflow-x: auto;
  }

  .picking-summary-grid {
    grid-template-columns: 1fr;
  }

  #shipmentView .shipment-summary-grid {
    grid-template-columns: 1fr;
    overflow-x: hidden;
  }

  .packing-summary-grid {
    grid-template-columns: 1fr;
    overflow-x: hidden;
  }

  .picking-table,
  .shipment-table,
  .packing-preview-table,
  .packing-box-table {
    width: max-content;
  }

  .fulfillment-view .page-titlebar h1 {
    font-size: 22px;
  }

  .fulfillment-titlebar {
    gap: 10px;
  }

  .fulfillment-tabs {
    gap: 6px;
  }

  .fulfillment-view .fulfillment-tab,
  #packagingView .fulfillment-tab {
    min-width: 74px;
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  #packagingView .work-actions-row button {
    height: 32px;
    font-size: 12px;
    padding: 0 9px;
  }

  .packaging-summary-row,
  .packaging-header-row,
  .packaging-main-scroll,
  .packaging-fixed-x-row,
  .packaging-bottom-actions {
    min-width: 900px;
  }

  .packaging-summary-row,
  .packaging-header-row,
  .packaging-main-scroll,
  .packaging-fixed-x-row {
    grid-template-columns: minmax(520px, var(--packaging-product-width, 64%)) 6px minmax(320px, 1fr);
  }

  .packaging-board {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .packaging-main-scroll {
    max-height: calc(100dvh - 265px);
    min-height: 380px;
  }

  .packaging-bottom-actions {
    grid-template-columns: 150px 1fr auto;
  }

  .box-action-group {
    gap: 8px;
  }

  .product-form,
  .category-form,
  .product-import-dialog,
  .packaging-dialog {
    width: calc(100vw - 20px);
    max-height: 92dvh;
    padding: 14px;
  }

  .form-head {
    gap: 10px;
  }

  .form-head h2 {
    font-size: 20px;
  }

  .product-import-source {
    grid-template-columns: 1fr;
  }

  .import-choice-box {
    align-items: flex-start;
  }

  .import-choice-box h3 {
    width: 100%;
  }

  .form-grid,
  .selective-fields-grid {
    grid-template-columns: 1fr;
  }

  .product-form .product-field-row,
  .product-form .product-image-editor.image-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .product-form .product-image-title {
    padding-top: 0;
  }

  .product-image-editor.image-field {
    grid-column: 1 / -1;
  }

  .product-image-editor {
    grid-template-columns: 64px 1fr;
  }

  .component-editor {
    overflow-x: visible;
  }

  .component-row-line {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .component-field {
    width: 100%;
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .component-field-short,
  .component-field-barcode {
    --component-input-width: 100%;
  }

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

  .saved-table-head,
  .saved-table-row {
    grid-template-columns: 92px 80px minmax(150px, 1fr) 92px;
    gap: 8px;
  }

  .saved-table-list {
    max-height: 45dvh;
  }

  .dialog-actions,
  .category-editor-actions {
    flex-wrap: wrap;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 960px) {
  body::before {
    content: "请将手机转为竖屏使用";
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 28px;
    background: #f8fbff;
    color: #172033;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
  }

  body::after {
    content: "FBA 目前仅支持手机竖屏显示";
    position: fixed;
    left: 24px;
    right: 24px;
    top: calc(50% + 42px);
    z-index: 5001;
    color: #64748b;
    font-size: 14px;
    font-weight: 400;
    text-align: center;
  }

  body > :not(script) {
    visibility: hidden;
  }
}
/* Only the owned catalogue reaches the viewport bottom; sibling tabs keep their layout. */
#amazonProductsView:has([data-product-management-panel="owned"]:not([hidden])) {height:calc(100dvh - 6px)}
#amazonProductsView:has([data-product-management-panel="owned"]:not([hidden])) .amazon-products-shell {padding-bottom:0}
.owned-card {background:#fff;border:1px solid #d6dfec;border-radius:10px;display:flex;flex-direction:column;flex:1 1 0;min-height:0;min-width:0;width:100%;overflow:hidden}
.owned-toolbar {display:flex;justify-content:space-between;gap:10px;padding:10px;flex-wrap:wrap}
.owned-toolbar>div {display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.owned-toolbar button,.owned-toolbar select,.owned-dialog button,.owned-dialog select {font-family:Arial,sans-serif;font-size:13px;border:1px solid #d0daea;background:white;border-radius:8px;padding:7px 12px;color:#253047;min-height:34px}
.owned-toolbar button:disabled {opacity:.45;cursor:default}
#ownedSearch {font-family:Arial,sans-serif;font-size:13px;min-width:180px;min-height:34px;border:1px solid #d0daea;border-radius:8px;padding:7px 12px;max-width:320px;white-space:nowrap;overflow:hidden}
#ownedSearch:empty:before {content:attr(data-placeholder);color:#94a3b8}
.owned-message {font-size:12px;color:#64748b;padding:0 12px 8px}
#ownedWrap {overflow:auto;flex:1 1 0;min-height:0;max-height:none}
#ownedTable {table-layout:fixed;border-collapse:separate;border-spacing:0;font-size:14px;min-width:0}
#ownedTable th {position:sticky;top:0;z-index:2;background:#eef3fb;white-space:normal;overflow-wrap:anywhere;text-align:left;padding:10px;cursor:pointer;border-right:1px solid #dbe3ef;border-bottom:1px solid #dbe3ef}
#ownedTable th i {position:absolute;right:0;top:0;width:7px;height:100%;cursor:col-resize;touch-action:none}
#ownedTable td {height:54px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:6px 10px;border-right:1px solid #e1e7f0;border-bottom:1px solid #e1e7f0;user-select:text}
#ownedTable td>span {display:block;overflow:hidden;text-overflow:ellipsis}
#ownedTable tr.selected td {background:#dbeafe}
#ownedTable td.external {color:#dc2626;font-weight:600}
#ownedTable td.internal {color:#c66a00;font-weight:600}
#ownedTable .owned-spacer td {padding:0;border:0}
.owned-thumb {border:1px solid #d8e1ef;border-radius:6px;background:white;padding:2px;width:42px;height:42px;cursor:zoom-in}
.owned-thumb img {width:100%;height:100%;object-fit:contain}
.owned-backdrop {position:fixed;inset:0;z-index:1800;background:#111827aa;display:flex;align-items:center;justify-content:center;padding:24px}
.owned-backdrop[hidden] {display:none!important}
.owned-dialog {background:white;border-radius:12px;padding:22px;width:min(960px,95vw);max-height:92vh;display:flex;flex-direction:column;color:#253047}
.owned-dialog h2 {margin:0 0 14px;font-size:22px}
.owned-dialog-body {overflow:auto;min-height:0;font-size:14px}
.owned-dialog-body>label {display:inline-flex;gap:8px;align-items:center;margin:8px}
.owned-dialog footer {display:flex;justify-content:flex-end;gap:10px;margin-top:12px}
.owned-dialog .owned-primary {background:#2563eb;color:white}
.owned-dialog-error {color:#dc2626;white-space:pre-wrap;font-size:14px;margin:8px 0}
.owned-edit-grid {display:grid;grid-template-columns:1fr 1fr;gap:12px}
.owned-edit-grid label {display:flex;flex-direction:column;gap:5px}
.owned-edit-grid [contenteditable] {border:1px solid #d5deeb;border-radius:7px;padding:8px;min-height:36px;overflow-wrap:anywhere;box-sizing:border-box}
.owned-column-grid {display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}
.owned-column-grid label {border:1px solid #e1e7f0;padding:9px;border-radius:7px}
.owned-preview-list {max-height:260px;overflow:auto;background:#f8fafc;padding:10px}
.owned-large-image {max-width:100%;max-height:68vh;object-fit:contain;display:block;margin:auto}
.amazon-product-batch-fields[hidden] {display:none}
.amazon-product-batch-lines {overflow:auto;max-height:55dvh;display:flex;flex-direction:column;gap:10px;margin:10px 0}
.amazon-batch-line {display:grid;grid-template-columns:minmax(150px,1fr) 110px 60px;gap:8px;padding:12px;border:1px solid #dbe3ef;border-radius:8px}
.amazon-batch-line label {display:flex;flex-direction:column;gap:5px;min-width:0}
.amazon-batch-line small,.amazon-batch-line-preview {grid-column:1/-1}
.amazon-batch-line-preview {display:flex;align-items:center;gap:10px}
.amazon-batch-sku,.amazon-batch-line input {box-sizing:border-box;border:1px solid #d0daea;border-radius:6px;min-height:34px;padding:7px;min-width:0;width:100%;white-space:nowrap;overflow:hidden}
@media(max-width:700px){.owned-edit-grid{grid-template-columns:1fr}.owned-column-grid{grid-template-columns:repeat(2,1fr)}}
.amazon-products-table th.amazon-pairing-header,
#amazonProductsTable th.amazon-pairing-header { background: #fff6cc; }
.amazon-pairing-error { color: #c62828 !important; font-weight: 600; }
.amazon-pairing-line-details,.amazon-batch-line-preview { flex-direction: column; align-items: stretch; }
.amazon-pairing-member { display:flex; align-items:center; gap:8px; min-width:0; padding:4px 0; }
.amazon-pairing-member + .amazon-pairing-member { border-top:1px solid #e2e8f0; }
.amazon-pairing-member > span { min-width:0; overflow-wrap:anywhere; font-size:13px; }
.amazon-pairing-line { align-items:start; }
.amazon-pairing-line-details { max-height:280px; overflow:auto; }
/* Admin-backed owned catalogue: synced identifiers and visible read-only fields. */
.owned-card .owned-synced { color: #2563eb; }
.owned-edit-grid .owned-readonly { background: #f1f5f9; color: #64748b; cursor: default; }

tr.pairing-sync-red > td, tr.pairing-sync-red > td input { background-color: #fee2e2 !important; }
tr.pairing-sync-yellow > td, tr.pairing-sync-yellow > td input { background-color: #fef3c7 !important; }

#generatePickingBtn:disabled { background:#f1f5f9; color:#94a3b8; border-color:#e2e8f0; cursor:not-allowed; opacity:1; }

/* Keep paired packaging rows mounted while filtering, including retained drafts. */
#packagingProductBody tr[hidden], #packagingCajaBody tr[hidden] { display: none !important; }
#packagingSaveStatus { margin-inline: 8px; font-size: 13px; }

/* Stronger grid contrast on older warehouse monitors; retain one-pixel geometry. */
#amazonProductsView #amazonMarketSyncStatus,
#amazonProductsView #amazonInventorySyncStatus,
#amazonProductsView #amazonAvailabilityStatus {
  display: none;
}

#amazonProductsView .amazon-products-table :is(th, td),
#amazonProductsView [data-product-management-panel="warehouse"] .fba-pairing-table :is(th, td),
#ownedTable :is(th, td),
#packagingView :is(.packaging-product-table, .packaging-caja-table) :is(th, td) {
  border-color: #b8c4d6;
}

#amazonProductsView .amazon-products-table-container,
#amazonProductsView [data-product-management-panel="warehouse"] .fba-pairing-table-wrap,
#ownedWrap,
#packagingView :is(.packaging-product-table, .packaging-caja-table),
#packagingView .packaging-caja-table input {
  border-color: #b8c4d6;
}
