:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #172026;
  --muted: #65717b;
  --line: #dde3e8;
  --primary: #176b87;
  --primary-dark: #0f5167;
  --accent: #d97706;
  --danger: #b42318;
  --ok: #138a43;
  --shadow: 0 8px 22px rgba(23, 32, 38, 0.07);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; }
button, input, select, textarea { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 198px 1fr; }
.sidebar { background: #14252d; color: white; padding: 16px 12px; position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 9px; align-items: center; margin-bottom: 18px; }
.brand-mark { position: relative; width: 34px; height: 34px; flex: 0 0 34px; background: #f2b84b; border: 2px solid #14252d; border-radius: 48% 48% 42% 42%; }
.cat-ear { position: absolute; top: -6px; width: 13px; height: 13px; background: #f2b84b; border-top: 2px solid #14252d; border-left: 2px solid #14252d; transform: rotate(45deg); }
.cat-ear.left { left: 3px; }
.cat-ear.right { right: 3px; }
.cat-eye { position: absolute; top: 14px; width: 4px; height: 6px; background: #14252d; border-radius: 999px; }
.cat-eye.left { left: 9px; }
.cat-eye.right { right: 9px; }
.cat-nose { position: absolute; left: 50%; bottom: 8px; width: 6px; height: 5px; background: #14252d; border-radius: 50% 50% 55% 55%; transform: translateX(-50%); }
.brand h1 { margin: 0; font-size: 17px; }
.brand p { margin: 1px 0 0; color: #b8c4ca; font-size: 12px; }
.nav { display: grid; gap: 5px; }
.nav-item { width: 100%; text-align: left; border: 0; color: #d8e3e8; background: transparent; padding: 9px 10px; border-radius: 5px; cursor: pointer; }
.nav-item.active, .nav-item:hover { background: rgba(255,255,255,0.12); color: white; }
.nav-group { display: grid; gap: 3px; margin: 2px 0; }
.nav-section { width: 100%; border: 0; background: transparent; text-align: left; color: #f2b84b; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 8px 10px 5px; }
.nav-section-link { border-radius: 5px; cursor: pointer; margin-bottom: 4px; }
.nav-section-link.active, .nav-section-link:hover { background: rgba(255,255,255,0.12); color: white; }
.nav-tree-toggle { display: flex; align-items: center; gap: 6px; border-radius: 5px; cursor: pointer; }
.nav-tree-toggle:hover, .nav-group.open > .nav-tree-toggle { background: rgba(255,255,255,0.08); color: white; }
.tree-caret { display: inline-block; width: 10px; color: #b8c4ca; font-size: 10px; transform: rotate(0deg); transition: transform .12s ease; }
.nav-group.open > .nav-tree-toggle .tree-caret { transform: rotate(90deg); color: #f2b84b; }
.nav-children { display: none; gap: 2px; padding: 1px 0 4px 13px; border-left: 1px solid rgba(255,255,255,0.12); margin-left: 14px; }
.nav-group.open > .nav-children { display: grid; }
.nav-sub { padding-left: 12px; }
.nav-subgroup { display: grid; gap: 2px; }
.nav-sub-toggle { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.nav-subgroup.open > .nav-sub-toggle .tree-caret { transform: rotate(90deg); color: #f2b84b; }
.nav-sub-children { display: none; gap: 2px; padding-left: 18px; }
.nav-subgroup.open > .nav-sub-children { display: grid; }
.nav-level-3 { font-size: 13px; padding-left: 18px; }
.main { padding: 16px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.topbar-actions { display: flex; align-items: end; gap: 8px; }
.language-select { width: auto; min-width: 70px; min-height: 34px; padding: 7px 8px; }
.mode-switch { min-width: 140px; }
.tabs-bar { display: flex; gap: 4px; overflow-x: auto; margin: -2px 0 12px; padding-bottom: 3px; }
.workspace-tab { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #edf1f4; color: var(--ink); border-radius: 5px 5px 0 0; padding: 6px 8px; cursor: pointer; white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.workspace-tab.active { background: var(--surface); border-bottom-color: var(--surface); color: var(--primary-dark); font-weight: 700; }
.tab-close { color: var(--muted); font-size: 15px; line-height: 1; padding-left: 2px; }
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
h2 { margin: 0; font-size: 24px; }
h3 { margin: 0; font-size: 16px; }
.primary, .secondary { border: 0; border-radius: 5px; padding: 8px 10px; cursor: pointer; min-height: 34px; }
.primary { background: var(--primary); color: white; }
.primary:hover { background: var(--primary-dark); }
.secondary { background: #edf1f4; color: var(--ink); }
.danger { color: var(--danger); }
.view { display: none; }
.view.active { display: block; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; box-shadow: var(--shadow); }
.stat span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.stat strong { font-size: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 12px 0 7px; }
.section-head span { color: var(--muted); font-size: 12px; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; min-width: 660px; }
#productsView table { min-width: 1040px; }
#purchasesView table { min-width: 980px; }
#receivingView table { min-width: 930px; }
th, td { padding: 8px 9px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #fbfcfd; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 7px; font-size: 11px; font-weight: 700; }
.badge.ok { background: #e8f7ee; color: var(--ok); }
.badge.low { background: #fff4e2; color: var(--accent); }
.badge.neutral { background: #edf1f4; color: var(--muted); }
.badge.stopped { background: #fde8e6; color: var(--danger); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.small-square-btn { width: 30px; height: 30px; min-width: 30px; min-height: 30px; border: 1px solid var(--line); border-radius: 5px; background: #edf1f4; color: var(--ink); cursor: pointer; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; padding: 0; position: relative; }
.small-square-btn:hover { border-color: var(--primary); color: var(--primary-dark); background: #f7fbff; }
.small-square-btn:disabled { cursor: default; opacity: .55; }
.print-mini-btn::before { content: ""; width: 15px; height: 10px; border: 2px solid currentColor; border-radius: 2px; box-sizing: border-box; }
.print-mini-btn::after { content: ""; position: absolute; width: 11px; height: 7px; border: 2px solid currentColor; border-bottom: 0; transform: translateY(-7px); box-sizing: border-box; }
.receiving-actions { justify-content: flex-start; }
.receiving-supplier-sku-input { max-width: 132px; min-width: 98px; }
.receiving-qty-input { max-width: 58px; min-width: 50px; text-align: right; }
.receiving-location-input { max-width: 92px; min-width: 78px; }
.receiving-row-done td { background: #f7faf8; color: var(--muted); }
.link-button { border: 0; background: transparent; color: var(--primary); cursor: pointer; padding: 0; font-weight: 700; text-align: left; }
.link-button:hover { color: var(--primary-dark); text-decoration: underline; }
.table-sort { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; font: inherit; font-weight: 800; text-transform: inherit; letter-spacing: inherit; }
.table-sort:hover { color: var(--primary-dark); }
.product-thumb { width: 42px; height: 42px; object-fit: cover; border: 1px solid var(--line); border-radius: 5px; background: #edf1f4; display: block; cursor: zoom-in; }
.product-thumb:hover { outline: 2px solid var(--primary); outline-offset: 2px; }
.product-thumb-placeholder { width: 42px; height: 42px; border: 1px dashed var(--line); border-radius: 5px; background: #fbfcfd; color: var(--muted); display: grid; place-items: center; font-size: 11px; }
.image-hover-preview { position: fixed; z-index: 3000; width: 240px; height: 240px; border: 1px solid var(--line); border-radius: 7px; background: white; box-shadow: 0 18px 45px rgba(23, 32, 38, 0.24); padding: 6px; pointer-events: none; }
.image-hover-preview.large-preview { width: min(720px, 90vw, 90vh); height: min(720px, 90vw, 90vh); z-index: 4500; }
.image-hover-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.icon-btn { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 18px; min-width: 30px; min-height: 30px; }
.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 190px 170px; gap: 8px; margin-bottom: 10px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 7px 8px; background: white; color: var(--ink); min-height: 33px; }
textarea { resize: vertical; }
#productsView.active { display: grid; grid-template-rows: auto minmax(0, 1fr); max-height: calc(100vh - 108px); overflow: hidden; }
#productsView .toolbar { position: sticky; top: 0; z-index: 20; grid-template-columns: minmax(180px, 1fr) 150px 170px; gap: 5px; margin-bottom: 6px; padding: 0 0 6px; background: var(--bg); }
#productsView .toolbar input,
#productsView .toolbar select { min-height: 28px; padding: 4px 6px; font-size: 12px; }
#productsView .table-wrap { max-height: calc(100vh - 158px); overflow: auto; }
#productsView table { min-width: 0; table-layout: fixed; font-size: 12px; }
#productsView th,
#productsView td { padding: 4px 5px; }
#productsView th { position: sticky; top: 0; z-index: 10; }
#productsView th:nth-child(1), #productsView td:nth-child(1) { width: 42px; }
#productsView th:nth-child(2), #productsView td:nth-child(2) { width: 74px; }
#productsView th:nth-child(4), #productsView td:nth-child(4) { width: 62px; }
#productsView th:nth-child(5), #productsView td:nth-child(5),
#productsView th:nth-child(6), #productsView td:nth-child(6),
#productsView th:nth-child(7), #productsView td:nth-child(7) { width: 46px; text-align: right; }
#productsView th:nth-child(8), #productsView td:nth-child(8) { width: 76px; }
#productsView th:nth-child(9), #productsView td:nth-child(9),
#productsView th:nth-child(10), #productsView td:nth-child(10) { width: 64px; text-align: right; }
#productsView th:nth-child(11), #productsView td:nth-child(11),
#productsView th:nth-child(12), #productsView td:nth-child(12) { width: 54px; }
#productsView .product-thumb,
#productsView .product-thumb-placeholder { width: 30px; height: 30px; font-size: 9px; }
#productsView .secondary { min-height: 26px; padding: 4px 6px; font-size: 12px; }
#productsView .badge { padding: 2px 5px; font-size: 10px; }
#productsView small { font-size: 10px; }
#productsView td:nth-child(3) { overflow: hidden; }
#productsView td:nth-child(3) strong,
#productsView td:nth-child(3) small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 12px; box-shadow: var(--shadow); }
.purchase-start { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
.purchase-start span { color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1.4fr .8fr .6fr 1.4fr auto; gap: 8px; align-items: end; margin-bottom: 12px; }
.purchase-form { display: grid; grid-template-columns: .8fr 1.1fr .75fr .75fr .75fr .75fr 1.2fr auto auto; gap: 8px; align-items: end; margin-bottom: 12px; }
.purchase-lines-panel { display: grid; gap: 8px; margin-bottom: 12px; }
.purchase-detail-form { display: grid; gap: 10px; }
.purchase-lines-panel > .secondary { justify-self: start; }
.purchase-line-form { display: grid; grid-template-columns: 1.4fr .5fr .6fr .5fr auto; gap: 8px; align-items: end; }
.batch-line-form { display: grid; grid-template-columns: .45fr .9fr 1fr .45fr auto; gap: 8px; align-items: end; margin-bottom: 12px; }
.batch-order-line-form { grid-template-columns: .9fr 1fr .45fr auto; }
.batch-controls { grid-template-columns: minmax(240px, 1fr) 180px; }
.receiving-panel { margin-bottom: 10px; }
.receiving-controls { display: grid; grid-template-columns: minmax(240px, 1fr) 180px auto; gap: 8px; align-items: end; }
.mobile-pick-toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px; align-items: end; }
.mobile-pick-start { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; margin: 10px 0; }
.mobile-pick-actions { display: grid; grid-template-columns: minmax(120px, .45fr) 1fr; gap: 8px; align-items: stretch; }
.missing-pick-list { display: grid; gap: 8px; text-align: left; }
.missing-pick-row { display: grid; grid-template-columns: 1fr 72px auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.missing-pick-row input { min-width: 0; }
.pick-progress { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.pick-product-head { display: flex; align-items: center; gap: 9px; justify-content: center; margin: 8px 0; }
.pick-product-head small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.pick-scan-label { margin-top: 10px; text-align: left; }
.inline-table { box-shadow: none; }
.purchase-line-summary { color: var(--muted); font-size: 12px; text-align: right; }
.mini-check { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.mini-check input { width: 15px; height: 15px; min-height: 15px; }
.suggested-qty, .suggested-unit-usd { min-width: 72px; }
.compact-input { max-width: 54px; min-width: 46px; text-align: center; }
.compact-action { min-height: 28px; padding: 4px 10px; }
label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.stock-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.readonly-value { display: flex; align-items: center; min-height: 33px; border: 1px solid var(--line); border-radius: 5px; padding: 7px 8px; background: #fbfcfd; color: var(--ink); font-weight: 700; }
.readonly-value.warning { background: #fff4b8; border-color: #e6ad19; color: #6b4600; }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.integration-panel { gap: 10px; }
.integration-status { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; padding: 10px; }
.integration-status p { margin: 0; color: var(--muted); font-size: 12px; }
.integration-status .error-text { color: var(--danger); }
.order-import-message { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px; }
.order-import-message p { margin: 0; color: var(--muted); font-size: 12px; }
.order-import-stats .stat strong { font-size: 16px; }
.manual-order-form { display: grid; gap: 10px; margin-bottom: 10px; }
.manual-order-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.manual-order-grid .wide-field { grid-column: span 2; }
.compact-head { margin: 0; }
.manual-order-form .inline-table input { min-height: 34px; }
.manual-order-form .row-actions { justify-content: flex-start; }
.pack-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 10px; align-items: start; }
.pack-work-panel { display: grid; gap: 10px; margin-bottom: 10px; }
.pack-work-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: 8px; align-items: end; }
.pack-work-card { display: grid; gap: 10px; }
.pack-order-head { display: grid; grid-template-columns: minmax(160px, .38fr) minmax(0, 1fr); gap: 12px; align-items: stretch; }
.pack-order-head h3, .pack-order-head p { margin: 0; }
.pack-scan-box { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 8px; align-items: end; }
.pack-scan-input { min-height: 48px; font-size: 20px; font-weight: 700; }
.pack-scan-message { border-radius: 7px; padding: 10px 12px; font-weight: 700; }
.pack-scan-message.ok { background: #e8f7ef; color: #0f7a41; }
.pack-scan-message.warning { background: #fff4bf; color: #7a4b00; }
.pack-scan-message.error, .pack-stop { background: #ffe7e0; color: #a12814; border: 1px solid #f3b4a7; }
.pack-stop { border-radius: 7px; padding: 10px 12px; font-weight: 800; }
.pack-item-list { display: grid; gap: 6px; }
.pack-item-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 72px; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 6px; background: #fff; }
.pack-item-row.partial { background: #fffbed; border-color: #e8c861; }
.pack-item-row.done { background: #ecf9f1; border-color: #96d7ae; }
.pack-item-row strong, .pack-item-row small { display: block; overflow-wrap: anywhere; }
.pack-item-row small { color: var(--muted); margin-top: 2px; }
.pack-item-thumb, .pack-item-thumb.product-thumb-placeholder { width: 48px; height: 48px; border-radius: 6px; }
.pack-item-thumb { object-fit: contain; border: 1px solid var(--line); background: white; }
.pack-item-count { text-align: right; font-weight: 800; }
.pack-item-count span { font-size: 20px; }
.pack-work-actions { display: grid; grid-template-columns: minmax(180px, .5fr) auto; gap: 8px; align-items: stretch; }
.pack-preview { position: sticky; top: 10px; display: grid; gap: 10px; }
.pack-preview p { margin: 0; }
.pack-label-preview { border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; padding: 12px; display: grid; gap: 8px; line-height: 1.45; }
.pack-label-preview.error { border-color: #f3b4a7; background: #fff7f5; }
.pack-label-preview h4 { margin: 0; font-size: 20px; }
.pack-label-preview hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 2px 0; }
.muted { color: var(--muted); }
.storage-recovery-panel { margin-top: 12px; }
.storage-recovery-panel table { min-width: 860px; }
.storage-recovery-panel small { color: var(--muted); }
.economy-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.economy-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 12px; box-shadow: var(--shadow); display: grid; gap: 7px; }
.economy-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.economy-card strong { font-size: 22px; }
.economy-card span { color: var(--muted); font-size: 12px; }
.edit-icon { border: 0; background: #edf1f4; color: var(--primary-dark); border-radius: 999px; width: 30px; height: 30px; cursor: pointer; font-weight: 800; }
.economy-result { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-left: 5px solid var(--ok); }
.economy-result.negative { border-left-color: var(--danger); }
.economy-result span { color: var(--muted); font-size: 14px; }
.economy-result strong { font-size: 28px; }
.economy-event-form, .cost-center-form { display: grid; gap: 10px; margin-bottom: 12px; }
.supplier-form { display: grid; gap: 10px; margin-bottom: 12px; }
.supplier-actions { justify-content: flex-start; }
.seo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 10px; }
.seo-current { display: grid; gap: 12px; }
.seo-meta { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.seo-meta div, .seo-field, .seo-error { background: #fbfcfd; border: 1px solid var(--line); border-radius: 6px; padding: 9px; }
.seo-meta span, .seo-field span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.seo-error { border-color: #f2b8b5; background: #fff7f6; color: var(--danger); }
.seo-field p { margin: 0; white-space: pre-wrap; line-height: 1.45; }
.seo-copy-actions, .seo-actions { flex-wrap: wrap; justify-content: flex-start; }
.seo-product-sheet { background: #fff; border: 1px solid #d4dde4; border-radius: 6px; padding: 20px; line-height: 1.62; display: grid; gap: 13px; }
.seo-product-sheet section { display: grid; gap: 5px; }
.seo-product-sheet h4, .seo-sheet-image-row h4 { margin: 0; font-size: 12px; color: var(--ink); font-weight: 800; }
.seo-product-sheet p { margin: 0; white-space: pre-wrap; }
.seo-sheet-title { font-size: 18px; font-weight: 700; }
.seo-sheet-text { white-space: pre-wrap; font-size: 15px; }
.seo-sheet-divider { border-top: 1px solid var(--line); height: 0; }
.seo-sheet-image-row { display: grid; gap: 6px; }
.seo-sheet-image { width: min(260px, 100%); min-height: 160px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfd; color: var(--muted); padding: 8px; }
.seo-sheet-image img { width: 100%; max-height: 240px; object-fit: contain; display: block; }
.seo-queue-status { display: grid; gap: 7px; margin-top: 8px; }
.seo-diagnostics { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; font-size: 12px; }
.seo-diagnostics dl { display: grid; grid-template-columns: 92px 1fr; gap: 5px 8px; margin: 0; }
.seo-diagnostics dt { color: var(--muted); }
.seo-diagnostics dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.seo-diagnostics pre { margin: 0; max-height: 180px; overflow: auto; white-space: pre-wrap; background: #fbfcfd; border: 1px solid var(--line); border-radius: 5px; padding: 8px; color: var(--danger); }
.seo-debug { background: #fbfcfd; border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.seo-debug summary { cursor: pointer; font-weight: 700; color: var(--primary-dark); }
.seo-debug-block { margin-top: 10px; }
.seo-debug-block span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.seo-debug-block pre, .seo-debug-block ul { margin: 0; max-height: 180px; overflow: auto; background: white; border: 1px solid var(--line); border-radius: 5px; padding: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.seo-debug-block li { margin-bottom: 6px; }
.seo-new-form { display: grid; gap: 10px; margin-bottom: 12px; }
.seo-rules-form { display: grid; gap: 10px; }
.seo-rules-form textarea { min-height: min(620px, calc(100vh - 260px)); font-family: Consolas, "Courier New", monospace; font-size: 12px; line-height: 1.45; white-space: pre; }
.seo-rules-meta { color: var(--muted); font-size: 12px; }
.seo-rules-status { display: grid; gap: 8px; }
.development-form { display: grid; gap: 10px; margin-bottom: 12px; }
.development-actions { align-self: end; justify-content: flex-start; }
.action-nav-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#actionsNavCount { color: inherit; font-weight: 900; }
#actionsNavCount.has-actions { color: #ffdf8a; }
.action-form { display: grid; gap: 10px; margin-bottom: 12px; }
.action-form-actions { justify-content: flex-start; }
.action-priority { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 900; }
.action-priority.critical { background: #fde8e6; color: #b42318; }
.action-priority.warning { background: #fff4b8; color: #7a4b00; }
.action-priority.info { background: #e7f0ff; color: #185abc; }
.action-row.critical { background: #fff7f6; }
.action-row.warning { background: #fffbea; }
.action-row.info { background: #f5f8ff; }
.action-row small { color: var(--muted); display: block; margin-top: 2px; }
.priority-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 800; }
.priority-badge.skitakut { background: #fde8e6; color: #b42318; }
.priority-badge.akut { background: #fff4b8; color: #7a4b00; }
.priority-badge.ska-goras { background: #e8f7ee; color: #138a43; }
.priority-badge.ideer { background: #e7f0ff; color: #185abc; }
.priority-row.skitakut { background: #fff7f6; }
.priority-row.akut { background: #fffbea; }
.priority-row.ska-goras { background: #f3fbf6; }
.priority-row.ideer { background: #f5f8ff; }
.economy-form-actions { justify-content: flex-start; }
.economy-event-detail { margin-top: 12px; }
.detail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.detail-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.detail-title img, .detail-title .product-thumb-placeholder { width: 58px; height: 58px; flex: 0 0 58px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.detail-stats { margin-bottom: 10px; }
.detail-list { display: grid; grid-template-columns: 125px 1fr; gap: 7px 10px; margin: 10px 0 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }
.status-text { font-size: 15px !important; }
.panel p { color: var(--muted); line-height: 1.45; }
dialog { border: 0; padding: 0; border-radius: 8px; box-shadow: 0 28px 80px rgba(0,0,0,.25); width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow: hidden; }
dialog::backdrop { background: rgba(20,37,45,.45); }
.dialog-card { padding: 14px; display: grid; gap: 9px; max-height: calc(100vh - 28px); overflow-y: auto; }
.dialog-card header, .dialog-card footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dialog-card footer { justify-content: flex-end; position: sticky; bottom: -14px; z-index: 5; margin: 2px -14px -14px; padding: 10px 14px 14px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 18px rgba(23, 32, 38, 0.08); }
.dialog-card h4 { margin: 0; font-size: 12px; color: var(--ink); font-weight: 800; }
.compact-dialog { min-width: min(320px, 92vw); }
#productForm.dialog-card { width: min(760px, calc(100vw - 28px)); height: min(760px, calc(100vh - 28px)); max-height: none; overflow: hidden; grid-template-rows: auto auto minmax(0, 1fr) auto; }
#productForm.dialog-card footer { position: static; margin: 0 -14px -14px; }
.product-dialog-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -2px 0 4px; min-height: 34px; align-items: end; overflow-x: auto; scrollbar-width: thin; }
.product-dialog-tabs .product-dialog-tab { flex: 0 0 auto; white-space: nowrap; }
.product-dialog-tab { border: 1px solid transparent; border-bottom: 0; border-radius: 5px 5px 0 0; background: transparent; color: var(--muted); padding: 7px 12px; font-weight: 800; cursor: pointer; }
.product-dialog-tab:hover { color: var(--primary-dark); background: #f6fafc; }
.product-dialog-tab.active { color: var(--primary-dark); background: #fff; border-color: var(--line); box-shadow: 0 -1px 0 #fff inset; }
.product-dialog-panel { display: grid; gap: 9px; min-height: 0; overflow-y: auto; padding-right: 4px; }
.product-dialog-panel[hidden] { display: none; }
.product-dialog-top { display: grid; grid-template-columns: minmax(0, .85fr) minmax(320px, 1.15fr); gap: 12px; align-items: stretch; }
.product-basics, .product-image-panel, .product-section, .quick-purchase-section, .supplier-compact-section { display: grid; gap: 8px; align-content: start; }
.product-info-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.product-info-summary > div { border: 1px solid var(--line); border-radius: 6px; background: #f8fafb; padding: 10px; }
.product-info-summary span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.product-info-summary strong { font-size: 18px; }
.stock-lots-overview { display: flex; flex-wrap: wrap; gap: 6px; }
.stock-lots-overview > span { display: inline-flex; gap: 7px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; background: #fff; font-size: 12px; }
.stock-lots-overview > span.empty { color: var(--muted); border-style: dashed; }
.stock-lots-detail { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stock-lots-head, .stock-lot-row { display: grid; grid-template-columns: minmax(120px, 1fr) 90px 110px; gap: 8px; align-items: center; padding: 8px 10px; }
.stock-lots-head { background: #eef3f6; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.stock-lot-row { border-top: 1px solid var(--line); font-size: 13px; }
.stock-lots-detail > .empty { padding: 12px; color: var(--muted); }
.seo-qb-fetch { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px; align-items: center; }
.seo-qb-status { min-height: 30px; border: 1px solid var(--line); border-radius: 5px; padding: 7px 9px; font-size: 12px; line-height: 1.35; color: var(--muted); background: #f8fafb; }
.seo-qb-status.ok { border-color: #bfe8cc; color: var(--ok); background: #f0fbf4; }
.seo-qb-status.error { border-color: #f2bbb5; color: var(--danger); background: #fff3f2; }
.product-seo-status-panel { border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; padding: 9px; display: grid; gap: 8px; }
.product-seo-status-title { font-weight: 800; color: var(--ink); font-size: 12px; }
.product-seo-status-rows { display: grid; gap: 5px; }
.product-seo-status-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; align-items: center; font-size: 12px; }
.product-seo-status-row span { color: var(--muted); }
.seo-status-pill { justify-self: start; border-radius: 999px; padding: 2px 8px; font-size: 11px; line-height: 1.5; border: 1px solid var(--line); background: #eef7ff; color: #155a8a; }
.seo-status-pill.ok { border-color: #bfe8cc; background: #f0fbf4; color: var(--ok); }
.seo-status-pill.info { border-color: #bcd8ef; background: #eef7ff; color: #155a8a; }
.seo-status-pill.warn { border-color: #f2d48b; background: #fff8e6; color: #9a6500; }
.seo-status-pill.error { border-color: #f2bbb5; background: #fff3f2; color: var(--danger); }
.product-seo-status-loading { color: var(--muted); font-size: 12px; }
.seo-prepare-actions { justify-content: flex-start; margin: 4px 0; }
.seo-prepare-status { display: grid; gap: 8px; }
.seo-prepare-summary { border: 1px solid var(--line); border-radius: 5px; padding: 8px 9px; font-size: 12px; line-height: 1.35; color: var(--muted); background: #f8fafb; }
.seo-prepare-summary.ok { border-color: #bfe8cc; color: var(--ok); background: #f0fbf4; }
.seo-prepare-summary.error { border-color: #f2bbb5; color: var(--danger); background: #fff3f2; }
.seo-prepare-table th, .seo-prepare-table td { font-size: 11px; padding: 5px 6px; }
.seo-workflow { display: grid; gap: 10px; max-width: 1380px; }
.seo-dashboard { display: grid; gap: 10px; }
.seo-dashboard-intro { display: grid; gap: 3px; }
.seo-dashboard-intro h3 { margin: 0; font-size: 16px; }
.seo-dashboard-intro p { margin: 0; max-width: 860px; }
.seo-flow-step { display: grid; gap: 9px; padding: 12px; }
.seo-flow-step > header { display: grid; grid-template-columns: 34px minmax(0, 1fr) max-content; gap: 10px; align-items: center; }
.seo-flow-step h3 { margin: 0 0 3px; font-size: 15px; color: var(--ink); }
.seo-flow-step p { margin: 0; max-width: 860px; font-size: 12px; }
.seo-flow-step button { white-space: nowrap; align-self: center; }
.seo-step-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.seo-step-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: white; font-weight: 800; font-size: 13px; }
.seo-step-result { display: grid; gap: 8px; margin-left: 44px; max-width: 1120px; }
.seo-step-result:empty { display: none; }
.seo-reserve { padding: 0; overflow: hidden; }
.seo-reserve > summary { cursor: pointer; padding: 10px 12px; font-weight: 800; color: var(--ink); background: #f8fafb; border-bottom: 1px solid var(--line); }
.seo-reserve-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px; }
.seo-reserve-grid section { display: grid; gap: 7px; align-content: start; }
.seo-reserve-grid h3 { margin: 0; font-size: 14px; }
.seo-reserve-grid p { margin: 0; font-size: 12px; }
.seo-classification-status { display: grid; gap: 9px; margin-top: 6px; }
.seo-classification-summary { display: grid; grid-template-columns: repeat(6, minmax(86px, 1fr)); gap: 6px; }
.seo-classification-summary div { border: 1px solid var(--line); border-radius: 5px; padding: 7px; background: #fbfcfd; }
.seo-classification-summary span { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.seo-classification-summary strong { display: block; font-size: 18px; color: var(--ink); }
.seo-classification-details { border: 1px solid var(--line); border-radius: 5px; background: #fff; overflow: hidden; }
.seo-classification-details > summary { cursor: pointer; padding: 8px 10px; font-weight: 800; color: var(--ink); background: #f8fafb; }
.seo-classification-grid { display: grid; gap: 8px; }
.seo-classification-details .seo-classification-grid { padding: 8px; }
.seo-classification-group { border: 1px solid var(--line); border-radius: 5px; background: #fff; overflow: hidden; }
.seo-classification-group h4 { display: flex; justify-content: space-between; align-items: center; padding: 7px 8px; border-bottom: 1px solid var(--line); background: #f8fafb; margin: 0; }
.seo-classification-row { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 2px 8px; padding: 6px 8px; border-top: 1px solid #eef2f4; font-size: 12px; }
.seo-classification-row:first-of-type { border-top: 0; }
.seo-classification-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-classification-row small { grid-column: 2; color: var(--muted); }
.seo-ready-card { display: grid; gap: 5px; padding: 8px; border-top: 1px solid #eef2f4; font-size: 12px; }
.seo-ready-card:first-of-type { border-top: 0; }
.seo-ready-card > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.seo-ready-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-ready-card dl, .seo-preview-facts dl { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 3px 8px; margin: 0; }
.seo-ready-card dt, .seo-preview-facts dt { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.seo-ready-card dd, .seo-preview-facts dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-ready-card small { color: var(--muted); line-height: 1.35; }
.seo-ready-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.seo-ready-actions .small { padding: 5px 7px; font-size: 11px; }
.seo-step1-review { display: grid; gap: 8px; margin-top: 8px; }
.seo-step1-panel { border: 1px solid var(--line); border-radius: 5px; background: #fff; overflow: hidden; }
.seo-step1-panel h4 { display: flex; justify-content: space-between; align-items: center; padding: 7px 8px; border-bottom: 1px solid var(--line); background: #f8fafb; margin: 0; }
.seo-step1-card { display: grid; gap: 10px; padding: 10px; border-top: 1px solid #eef2f4; }
.seo-step1-card header { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; font-size: 12px; }
.seo-step1-card header span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-step1-card header em { color: var(--muted); font-style: normal; font-size: 11px; }
.seo-step1-row-card { cursor: pointer; gap: 5px; padding: 8px; }
.seo-step1-row-card:hover { background: #f8fafb; }
.seo-step1-row-card .seo-step1-body { display: none; }
.seo-step1-row-card header { grid-template-columns: 74px minmax(0, 1fr); gap: 4px 7px; }
.seo-step1-row-card header em { grid-column: 1 / -1; justify-self: start; }
.danger-text { color: var(--danger); font-weight: 700; }
.seo-step1-body { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: start; }
.seo-step1-image { margin: 0; display: grid; gap: 4px; align-content: start; font-size: 10px; color: var(--muted); }
.seo-step1-image img { width: 86px; height: 86px; object-fit: contain; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.seo-review-image { cursor: zoom-in; }
.seo-review-image:hover { outline: 2px solid var(--primary); outline-offset: 2px; }
.seo-step1-text { display: grid; gap: 10px; margin: 8px 0; font-size: 13px; line-height: 1.5; }
.seo-step1-text section { display: grid; gap: 4px; border-top: 1px solid #eef2f4; padding-top: 8px; }
.seo-step1-text section:first-child { border-top: 0; padding-top: 0; }
.seo-step1-text h5 { margin: 0; color: var(--muted); text-transform: uppercase; font-size: 10px; font-weight: 800; }
.seo-step1-text p { margin: 0; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.seo-step1-title { font-weight: 800; font-size: 14px; }
.seo-step1-product-text { white-space: pre-wrap; color: var(--ink); background: #fbfcfd; border: 1px solid var(--line); border-radius: 5px; padding: 9px; line-height: 1.6; overflow-wrap: anywhere; }
.seo-step1-dialog { width: min(1180px, calc(100vw - 28px)); }
.seo-step1-dialog-card { width: min(1180px, calc(100vw - 28px)); }
.seo-step1-dialog-body { min-height: 360px; }
.seo-step1-dialog-layout { display: grid; grid-template-columns: 560px minmax(0, 1fr); gap: 14px; align-items: start; }
.seo-step1-dialog-layout aside { display: grid; gap: 10px; align-content: start; }
.seo-step1-dialog-image { margin: 0; display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.seo-step1-dialog-image img { width: 260px; height: 260px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.seo-image-review-block { display: grid; gap: 9px; }
.seo-image-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.seo-alt-field { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 700; }
.seo-alt-field textarea { min-height: 70px; resize: vertical; font-size: 13px; line-height: 1.4; color: var(--ink); font-weight: 400; }
.seo-step1-dialog-image.empty { min-height: 180px; border: 1px dashed var(--line); border-radius: 6px; display: grid; place-items: center; background: #fbfcfd; }
.seo-step1-dialog-meta { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; padding: 9px; }
.seo-step1-dialog-meta strong { font-size: 18px; color: var(--ink); }
.seo-step1-dialog-meta span, .seo-step1-dialog-meta small { color: var(--muted); }
.seo-step1-dialog-empty { border: 1px dashed var(--line); border-radius: 6px; padding: 12px; color: var(--muted); background: #fbfcfd; }
.seo-step1-dialog-text { margin-top: 0; font-size: 14px; }
.seo-step1-edit-form { display: grid; gap: 9px; }
.seo-step1-edit-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 700; }
.seo-step1-edit-form input, .seo-step1-edit-form textarea { font-size: 13px; line-height: 1.45; color: var(--ink); font-weight: 400; }
.seo-step1-edit-form textarea { resize: vertical; }
.seo-dialog-status { min-height: 0; margin-top: 8px; }
.seo-dialog-status:empty { display: none; }
.seo-quickbutik-preview { border: 1px solid #bfe8cc; border-radius: 6px; padding: 10px; background: #f0fbf4; color: var(--ink); display: grid; gap: 8px; font-size: 12px; }
.seo-quickbutik-preview h4 { margin: 0; font-size: 14px; }
.seo-quickbutik-preview p { margin: 0; color: var(--muted); }
.seo-quickbutik-preview dl { margin: 0; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 5px 10px; }
.seo-quickbutik-preview dt { color: var(--muted); font-weight: 800; }
.seo-quickbutik-preview dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.seo-image-publish-layout { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; align-items: start; }
.seo-image-publish-layout figure { margin: 0; display: grid; gap: 5px; color: var(--muted); }
.seo-image-publish-layout img { width: 150px; height: 150px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.seo-image-publish-layout dl { align-self: start; }
.seo-step1-dialog footer { gap: 8px; }
.ok-text { color: var(--ok); font-weight: 700; }
.seo-text-batch-export, .seo-text-batch-import { display: grid; gap: 7px; margin-top: 8px; }
.seo-jsonl-output, .seo-text-batch-import textarea { width: 100%; min-height: 120px; font-family: Consolas, "Courier New", monospace; font-size: 11px; line-height: 1.35; resize: vertical; }
.seo-preview-facts { border: 1px solid var(--line); border-radius: 5px; padding: 8px; background: #fbfcfd; display: grid; gap: 6px; margin: 8px 0; }
.seo-preview-facts h4 { margin: 0; font-size: 12px; }
.seo-preview-facts p { margin: 0; white-space: pre-wrap; line-height: 1.45; }
.seo-batch-preview-actions { justify-content: flex-start; margin: 4px 0; }
.seo-openai-batch-actions { justify-content: flex-start; flex-wrap: wrap; margin: 6px 0; }
.seo-openai-batch-status { display: grid; gap: 7px; margin-top: 6px; }
.seo-text-batch-preview { display: grid; gap: 8px; }
.seo-text-preview-item { border: 1px solid var(--line); border-radius: 5px; background: #fff; overflow: hidden; }
.seo-text-preview-item summary { cursor: pointer; display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 6px 8px; align-items: center; padding: 8px; background: #f8fafb; font-size: 12px; }
.seo-text-preview-item summary span { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.seo-text-preview-item dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 8px; margin: 8px; font-size: 12px; }
.seo-text-preview-item dt { color: var(--muted); }
.seo-text-preview-item dd { margin: 0; }
.seo-text-preview-item pre { margin: 8px; max-height: 260px; overflow: auto; white-space: pre-wrap; border: 1px solid var(--line); border-radius: 5px; padding: 8px; background: #fbfcfd; font-size: 11px; line-height: 1.45; }
.seo-v2-workspace { display: grid; gap: 12px; }
.seo-v2-start { display: grid; grid-template-columns: minmax(220px, auto) minmax(0, 1fr); gap: 12px; align-items: center; }
.seo-v2-start-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.seo-v2-start-copy { color: var(--muted); font-size: 13px; line-height: 1.45; }
.seo-v2-start-copy strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 2px; }
.seo-v2-list-panel { display: grid; gap: 10px; }
.seo-v2-toolbar { display: flex; gap: 10px; align-items: end; justify-content: space-between; flex-wrap: wrap; }
.seo-v2-toolbar label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.seo-v2-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.seo-v2-summary { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.seo-v2-summary strong { color: var(--ink); }
.seo-v2-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.seo-v2-table th, .seo-v2-table td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.seo-v2-table th:first-child, .seo-v2-table td:first-child { width: 46px; text-align: center; }
.seo-v2-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.seo-v2-error { color: var(--danger); font-weight: 700; }
.seo-reserve summary { cursor: pointer; font-weight: 800; color: var(--muted); }
.seo-v2-dialog-card { width: min(1180px, calc(100vw - 28px)); }
.seo-v2-dialog-body { display: grid; gap: 12px; max-height: calc(100vh - 190px); overflow: auto; padding-right: 2px; }
.seo-v2-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.seo-v2-form-grid label, .seo-v2-dialog-body > label, .seo-v2-result-fields label, .seo-v2-image-slot label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.seo-v2-form-grid input, .seo-v2-dialog-body textarea, .seo-v2-result-fields input, .seo-v2-result-fields textarea, .seo-v2-image-slot textarea, .seo-v2-image-slot select { color: var(--ink); font-size: 13px; font-weight: 400; }
.seo-v2-fetch-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.seo-v2-images { display: grid; grid-template-columns: repeat(6, minmax(118px, 1fr)); gap: 8px; align-items: start; }
.seo-v2-image-slot { border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; padding: 7px; display: grid; gap: 6px; min-width: 0; }
.seo-v2-image-box { aspect-ratio: 1 / 1; border: 1px dashed var(--line); border-radius: 5px; background: #fff; display: grid; place-items: center; color: var(--muted); font-size: 12px; overflow: hidden; }
.seo-v2-image-box img { width: 100%; height: 100%; object-fit: contain; display: block; }
.seo-v2-image-slot input[type="file"] { width: 100%; font-size: 11px; }
.seo-v2-image-slot textarea { resize: vertical; min-height: 54px; }
.seo-v2-result-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; border-top: 1px solid var(--line); padding-top: 10px; }
.seo-v2-result-fields h4 { grid-column: 1 / -1; margin: 0; font-size: 14px; }
.seo-v2-result-fields label:nth-of-type(3), .seo-v2-result-fields label:nth-of-type(4), .seo-v2-result-fields label:nth-of-type(6) { grid-column: 1 / -1; }
@media (max-width: 1100px) {
  .seo-classification-summary { grid-template-columns: repeat(3, minmax(86px, 1fr)); }
  .seo-reserve-grid { grid-template-columns: 1fr; }
  .seo-v2-images { grid-template-columns: repeat(3, minmax(118px, 1fr)); }
}
@media (max-width: 760px) {
  .seo-flow-step > header { grid-template-columns: 30px minmax(0, 1fr); }
  .seo-flow-step > header button, .seo-step-actions { grid-column: 2; justify-self: start; justify-content: flex-start; }
  .seo-step-result { margin-left: 40px; }
  .seo-classification-summary { grid-template-columns: repeat(2, minmax(86px, 1fr)); }
  .seo-v2-start, .seo-v2-form-grid, .seo-v2-result-fields { grid-template-columns: 1fr; }
  .seo-v2-images { grid-template-columns: repeat(2, minmax(118px, 1fr)); }
}
.sku-field input { min-height: 40px; font-size: 20px; font-weight: 800; color: var(--ink); }
.product-image-panel { grid-template-columns: 1fr 34px; margin-left: 18px; }
.product-image-panel h4, .product-image-panel .product-image-preview { grid-column: 1 / -1; }
.product-image-panel .camera-upload-btn { justify-self: end; }
.form-divider { border-top: 1px solid var(--line); height: 0; margin: 3px 0; }
.product-stock-grid { grid-template-columns: repeat(3, minmax(86px, 1fr)); }
.tradera-sku-cell { background: #fff6d8; box-shadow: inset 3px 0 0 #e6ad19; }
.thumbnail-editor { display: grid; grid-template-columns: 82px 34px 1fr; gap: 9px; align-items: end; }
.thumbnail-preview { width: 76px; height: 76px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 11px; text-align: center; }
.thumbnail-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbnail-preview.product-image-preview { width: 250px; height: 250px; min-width: 250px; max-width: 250px; min-height: 250px; max-height: 250px; aspect-ratio: 1 / 1; justify-self: start; }
.product-image-preview img { object-fit: contain; }
.thumbnail-preview.empty-thumb { border-style: dashed; padding: 6px; }
.visually-hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.square-icon-btn { width: 34px; height: 34px; min-width: 34px; min-height: 34px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; position: relative; }
.square-icon-btn:hover { border-color: var(--primary); color: var(--primary-dark); background: #f7fbff; }
.camera-upload-btn::before { content: ""; width: 17px; height: 12px; border: 2px solid currentColor; border-radius: 3px; position: relative; display: block; box-sizing: border-box; }
.camera-upload-btn::after { content: ""; width: 6px; height: 6px; border: 2px solid currentColor; border-radius: 50%; position: absolute; box-sizing: border-box; }
.product-image-panel .printer-label-btn { justify-self: end; }
.printer-label-btn::before { content: ""; width: 18px; height: 11px; border: 2px solid currentColor; border-radius: 3px; position: relative; display: block; box-sizing: border-box; }
.printer-label-btn::after { content: ""; width: 12px; height: 8px; border: 2px solid currentColor; border-top: 0; position: absolute; bottom: 5px; box-sizing: border-box; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.four-col { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.check-row { display: flex; align-items: center; gap: 7px; color: var(--ink); background: #fbfcfd; border: 1px solid var(--line); border-radius: 5px; padding: 8px; }
.check-row input { width: 16px; height: 16px; min-height: 16px; }
.price-panel, .quick-purchase-panel { border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: grid; gap: 9px; }
.price-panel legend, .quick-purchase-panel legend { color: var(--muted); font-size: 12px; padding: 0 5px; }
.quick-purchase-row { display: grid; grid-template-columns: .6fr .8fr auto; gap: 8px; align-items: end; }
.quick-purchase-feedback { min-height: 18px; margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.quick-purchase-feedback.show { border: 1px solid #d9b400; border-radius: 5px; background: #fff200; color: #172026; padding: 7px 8px; }
.quick-purchase-feedback.error { border-color: #f0a18d; background: #ffe1d8; color: var(--danger); }
#productNotes.has-notes { border-color: #d9b400; background: #fff200; color: var(--ink); }
.price-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.price-results output { background: #fbfcfd; border: 1px solid var(--line); border-radius: 5px; padding: 8px; }
.price-results span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.price-results strong { font-size: 15px; }
.mobile-pick-shell { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.mobile-pick-card { display: grid; gap: 14px; text-align: center; }
.work-mode-shell, .work-mode-card { width: min(760px, 100%); }
.work-card { display: grid; gap: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; padding: 16px; text-align: center; }
.work-product { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 14px; align-items: center; text-align: left; }
.work-product strong { display: block; font-size: 22px; line-height: 1.15; color: var(--ink); }
.work-product small { display: block; margin-top: 5px; color: var(--muted); font-size: 14px; }
.work-product-thumb, .work-product-thumb.product-thumb-placeholder { width: 118px; height: 118px; border-radius: 7px; flex: 0 0 118px; }
.work-product-thumb { object-fit: contain; border: 1px solid var(--line); background: white; display: block; cursor: zoom-in; }
.work-product-thumb.product-thumb-placeholder { display: grid; place-items: center; border: 1px dashed var(--line); background: white; color: var(--muted); font-size: 14px; }
.work-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(150px, .8fr); gap: 12px; align-items: stretch; }
.work-primary { display: grid; place-items: center; border: 2px solid var(--line); border-radius: 8px; background: white; min-height: 116px; padding: 10px; }
.work-primary span, .pick-sku span, .pick-qty span { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.work-primary strong { color: var(--primary-dark); font-size: clamp(44px, 9vw, 74px); line-height: .98; }
.pick-location { font-size: 40px; font-weight: 800; color: var(--primary-dark); }
.pick-sku { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 12px; font-size: 24px; font-weight: 700; }
.pick-sku strong { overflow-wrap: anywhere; font-size: clamp(30px, 7vw, 54px); line-height: 1; color: var(--ink); }
.pick-qty { min-width: 150px; min-height: 116px; display: grid; place-items: center; justify-self: stretch; border: 2px solid var(--line); border-radius: 8px; background: white; padding: 10px; font-weight: 800; }
.pick-qty strong { font-size: clamp(42px, 8vw, 64px); line-height: 1; }
.pick-qty.many { background: #fff4b8; border-color: #e6ad19; color: #7a4b00; }
.mobile-ok { min-height: 66px; font-size: 22px; font-weight: 800; }
.mobile-done { color: var(--ok); font-size: 18px; font-weight: 700; }
.inventory-start-panel { display: grid; grid-template-columns: minmax(180px, 260px) auto; gap: 8px; align-items: end; margin-bottom: 10px; }
.inventory-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.inventory-actions { justify-content: flex-start; margin: 0 0 10px; }
.inventory-card { width: min(520px, calc(100vw - 24px)); }
.inventory-card-body { display: grid; gap: 12px; }
.inventory-card-product { display: flex; align-items: center; gap: 12px; }
.inventory-card-product strong { display: block; font-size: 18px; }
.inventory-card-product span { display: block; color: var(--muted); margin-top: 3px; }
.inventory-thumb, .inventory-card-product .product-thumb-placeholder { width: 88px; height: 88px; flex: 0 0 88px; border-radius: 6px; }
.inventory-thumb { object-fit: contain; border: 1px solid var(--line); background: #fbfcfd; display: block; }
.inventory-expected { border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; padding: 12px; text-align: center; }
.inventory-expected span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.inventory-expected strong { display: block; font-size: 44px; line-height: 1.1; color: var(--primary-dark); margin: 4px 0; }
.inventory-expected small, .inventory-progress { color: var(--muted); }
.inventory-count-label input { min-height: 58px; text-align: center; font-size: 32px; font-weight: 800; }
.inventory-card footer { justify-content: space-between; }
.inventory-card .primary { min-width: 120px; min-height: 48px; font-size: 18px; font-weight: 800; }
.seo-image-choice { display: flex; align-items: center; gap: 6px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 6px; background: #f8fafb; color: var(--ink); font-size: 12px; font-weight: 800; }
.seo-image-choice input { width: auto; margin: 0; }
.sort-result { margin-bottom: 12px; }
.sort-result.work-mode-card { display: grid; gap: 12px; margin-inline: auto; }
.sort-confirm-form { grid-template-columns: minmax(220px, 1fr) minmax(160px, auto); max-width: 760px; margin-inline: auto; }
.sort-confirm-form input { min-height: 58px; font-size: 22px; font-weight: 800; text-align: center; }
.sort-confirm-form .primary { min-height: 58px; font-size: 18px; font-weight: 800; }
.sort-complete-panel { margin-bottom: 12px; border-color: #b7dfc6; background: #f2fbf5; }
.sort-complete-panel p { margin: 4px 0 10px; }
.batch-work-dialog { width: min(520px, calc(100vw - 20px)); }
.batch-work-dialog-card { width: min(520px, calc(100vw - 20px)); }
.batch-work-dialog-body { display: grid; gap: 10px; }
.batch-work-card { display: grid; gap: 10px; text-align: center; }
.batch-work-media { display: grid; place-items: center; }
.batch-work-image { width: 210px; height: 210px; border: 1px solid var(--line); border-radius: 7px; background: #fff; object-fit: contain; display: block; }
.batch-work-image.empty-thumb { display: grid; place-items: center; border-style: dashed; color: var(--muted); font-weight: 700; }
.batch-work-main strong { display: block; color: var(--ink); font-size: 19px; line-height: 1.18; }
.batch-work-main small { display: block; color: var(--muted); margin-top: 4px; }
.batch-work-card footer { display: flex; justify-content: center; gap: 8px; }
.batch-work-card .mobile-pause, .batch-work-card .mobile-ok { min-height: 54px; font-weight: 800; }

.lager-import-panel { align-content: start; }
.import-status { margin-top: 8px; font-size: 13px; color: var(--muted); }
.import-preview { margin-top: 10px; display: grid; gap: 10px; }
.import-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.import-summary-item { border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; padding: 8px; }
.import-summary-item span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.import-summary-item strong { display: block; margin-top: 2px; font-size: 18px; color: var(--primary-dark); }
.import-errors, .import-warnings, .import-sample { border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: #fff; overflow: auto; }
.import-errors { border-color: #f3b4a7; background: #fff7f5; }
.import-warnings { border-color: #f2d48b; background: #fff9ea; }
.import-errors h4, .import-warnings h4, .import-sample h4 { margin: 0 0 8px; font-size: 13px; }
.import-preview table { width: 100%; border-collapse: collapse; font-size: 12px; }
.import-preview th, .import-preview td { border-bottom: 1px solid var(--line); padding: 5px 6px; text-align: left; white-space: nowrap; }
[hidden] { display: none !important; }
.toast { position: fixed; right: 16px; bottom: 16px; z-index: 10000; background: #172026; color: white; border-radius: 5px; padding: 9px 12px; opacity: 0; transform: translateY(8px); transition: .2s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }
.empty { color: var(--muted); text-align: center; padding: 18px; }
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 168px 1fr; }
  .sidebar { padding: 12px 9px; }
  .brand h1 { font-size: 15px; }
  .brand p { display: none; }
  .nav-item { padding: 8px; }
  .main { padding: 12px; }
  .topbar { margin-bottom: 10px; }
  h2 { font-size: 21px; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .purchase-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .purchase-form button { align-self: end; }
  .receiving-controls { grid-template-columns: 1fr 160px auto; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; overflow: visible; }
  .nav { grid-template-columns: repeat(2, 1fr); }
  .stats-grid, .settings-grid, .economy-grid, .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seo-layout { grid-template-columns: 1fr; }
  .seo-step1-dialog-layout { grid-template-columns: 1fr; }
  .seo-step1-dialog-image img { width: min(260px, 100%); height: auto; aspect-ratio: 1 / 1; }
  .seo-meta { grid-template-columns: 1fr; }
  .product-dialog-top { grid-template-columns: 1fr; }
  .form-grid, .purchase-form, .purchase-line-form, .batch-line-form, .batch-order-line-form, .receiving-controls { grid-template-columns: 1fr 1fr; }
  .toolbar { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .main { padding: 18px; }
  .topbar, .purchase-start { align-items: flex-start; flex-direction: column; }
  .stats-grid, .settings-grid, .economy-grid, .detail-grid, .form-grid, .purchase-form, .purchase-line-form, .batch-line-form, .batch-order-line-form, .receiving-controls, .inventory-start-panel, .inventory-stats, .manual-order-grid, .two-col, .three-col, .four-col, .stock-grid, .product-stock-grid, .check-grid, .price-results, .quick-purchase-row, .product-info-summary { grid-template-columns: 1fr; }
  .stock-lots-head, .stock-lot-row { grid-template-columns: 1fr 64px 86px; }
  .mobile-pick-toolbar, .mobile-pick-start, .mobile-pick-actions, .missing-pick-row, .work-hero, .sort-confirm-form, .pack-work-toolbar, .pack-order-head, .pack-scan-box, .pack-work-actions { grid-template-columns: 1fr; }
  .work-card { padding: 12px; gap: 12px; }
  .work-product { grid-template-columns: 88px minmax(0, 1fr); gap: 10px; }
  .work-product strong { font-size: 18px; }
  .work-product small { font-size: 12px; }
  .work-product-thumb, .work-product-thumb.product-thumb-placeholder { width: 88px; height: 88px; flex-basis: 88px; }
  .work-primary, .pick-qty { min-height: 96px; }
  .work-primary strong { font-size: 46px; }
  .pick-sku { padding: 10px; }
  .pick-sku strong { font-size: 34px; }
  .pick-qty strong { font-size: 42px; }
  .batch-work-dialog, .batch-work-dialog-card { width: min(420px, calc(100vw - 12px)); }
  .batch-work-dialog { max-height: calc(100vh - 12px); }
  .batch-work-dialog-card { max-height: calc(100vh - 12px); padding: 10px; }
  .batch-work-dialog-body { max-height: calc(100vh - 86px); overflow: auto; }
  .batch-work-card { gap: 8px; }
  .batch-work-image { width: min(170px, 48vw); height: min(170px, 48vw); }
  .batch-work-card footer { display: grid; grid-template-columns: 1fr; gap: 7px; }
  .batch-work-card .mobile-pause, .batch-work-card .mobile-ok { width: 100%; min-height: 52px; font-size: 18px; }
  .inventory-card-product { align-items: flex-start; }
  .inventory-thumb, .inventory-card-product .product-thumb-placeholder { width: 72px; height: 72px; flex-basis: 72px; }
  .inventory-expected strong { font-size: 38px; }
  .detail-head { align-items: flex-start; flex-direction: column; }
  .detail-list { grid-template-columns: 1fr; }
  .nav { grid-template-columns: 1fr; }
}

/* SEO V2 compact dialog tuning for half-screen testing */
.seo-v2-dialog { width: min(860px, calc(100vw - 20px)); padding: 0; }
.seo-v2-dialog-card { width: min(860px, calc(100vw - 20px)); max-height: calc(100vh - 24px); }
.seo-v2-dialog-body { gap: 9px; max-height: calc(100vh - 170px); overflow-x: hidden; }
.seo-v2-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.seo-v2-form-grid label:first-child { grid-column: 1 / -1; }
.seo-v2-images { grid-template-columns: repeat(6, minmax(86px, 1fr)); gap: 8px; }
.seo-v2-image-slot { padding: 6px; gap: 5px; }
.seo-v2-image-box { aspect-ratio: 1 / 1; height: auto; min-height: 0; }
.seo-v2-image-file { display: none; }
.seo-v2-image-tools { display: grid; grid-template-columns: repeat(2, 28px); gap: 5px; justify-content: center; }
.seo-v2-image-tools button { width: 28px; min-width: 28px; height: 26px; min-height: 26px; padding: 0; font-weight: 800; line-height: 1; }
.seo-v2-image-slot textarea { min-height: 42px; }
.seo-v2-image-slot input[type=file] { max-width: 100%; font-size: 10px; }
.seo-v2-result-fields { grid-template-columns: 1fr; }
@media (max-width: 760px) {
  .seo-v2-dialog, .seo-v2-dialog-card { width: min(700px, calc(100vw - 16px)); }
  .seo-v2-form-grid, .check-grid { grid-template-columns: 1fr; }
  .seo-v2-images { grid-template-columns: repeat(6, minmax(72px, 1fr)); }
  .seo-v2-image-box { aspect-ratio: 1 / 1; height: auto; }
}
@media (max-width: 560px) {
  .seo-v2-images { grid-template-columns: repeat(3, minmax(72px, 1fr)); }
}

.seo-v2-row-check { width: 14px; height: 14px; min-height: 14px; margin: 0; }
.danger-text { color: var(--danger); }
.image-hover-preview { position: fixed; z-index: 20000; pointer-events: none; width: min(320px, calc(100vw - 24px)); height: min(320px, calc(100vw - 24px)); border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 14px 36px rgba(23,32,38,.22); padding: 8px; }
.image-hover-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
