﻿: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; }
.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; }
.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; }
tr.search-hit td { background: #fff4b8; box-shadow: inset 0 1px 0 #e6ad19, inset 0 -1px 0 #e6ad19; }
.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 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; }
.test-mode #productsView { display: none; }
.test-mode #productsView.active { display: grid; grid-template-rows: auto minmax(0, 1fr); max-height: calc(100vh - 108px); overflow: hidden; }
.test-mode #productsView .toolbar { position: sticky; top: 0; z-index: 20; grid-template-columns: minmax(180px, 1fr) 150px 142px; gap: 5px; margin-bottom: 6px; padding: 0 0 6px; background: var(--bg); }
.test-mode #productsView .toolbar input,
.test-mode #productsView .toolbar select { min-height: 28px; padding: 4px 6px; font-size: 12px; }
.test-mode #productsView .table-wrap { max-height: calc(100vh - 158px); overflow: auto; }
.test-mode #productsView table { min-width: 0; table-layout: fixed; font-size: 12px; }
.test-mode #productsView th,
.test-mode #productsView td { padding: 4px 5px; }
.test-mode #productsView th { position: sticky; top: 0; z-index: 10; }
.test-mode #productsView th:nth-child(1), .test-mode #productsView td:nth-child(1) { width: 42px; }
.test-mode #productsView th:nth-child(2), .test-mode #productsView td:nth-child(2) { width: 74px; }
.test-mode #productsView th:nth-child(4), .test-mode #productsView td:nth-child(4) { width: 62px; }
.test-mode #productsView th:nth-child(5), .test-mode #productsView td:nth-child(5),
.test-mode #productsView th:nth-child(6), .test-mode #productsView td:nth-child(6) { width: 46px; text-align: right; }
.test-mode #productsView th:nth-child(7), .test-mode #productsView td:nth-child(7) { width: 76px; }
.test-mode #productsView th:nth-child(8), .test-mode #productsView td:nth-child(8) { width: 48px; }
.test-mode #productsView th:nth-child(9), .test-mode #productsView td:nth-child(9),
.test-mode #productsView th:nth-child(10), .test-mode #productsView td:nth-child(10) { width: 64px; text-align: right; }
.test-mode #productsView th:nth-child(11), .test-mode #productsView td:nth-child(11),
.test-mode #productsView th:nth-child(12), .test-mode #productsView td:nth-child(12) { width: 54px; }
.test-mode #productsView .product-thumb,
.test-mode #productsView .product-thumb-placeholder { width: 30px; height: 30px; font-size: 9px; }
.test-mode #productsView .secondary { min-height: 26px; padding: 4px 6px; font-size: 12px; }
.test-mode #productsView .badge { padding: 2px 5px; font-size: 10px; }
.test-mode #productsView small { font-size: 10px; }
.test-mode #productsView td:nth-child(3) { overflow: hidden; }
.test-mode #productsView td:nth-child(3) strong,
.test-mode #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-start { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; margin: 10px 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; }
.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) 260px; 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; }
.development-form { display: grid; gap: 10px; margin-bottom: 12px; }
.development-actions { align-self: end; justify-content: flex-start; }
.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); }
.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; }
.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(5, minmax(0, 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; }
.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; }
.check-grid { display: grid; grid-template-columns: 1fr 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; }
.price-results { display: grid; grid-template-columns: repeat(3, 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: 520px; margin: 0 auto; display: grid; gap: 14px; }
.mobile-pick-card { display: grid; gap: 14px; text-align: center; }
.pick-location { font-size: 40px; font-weight: 800; color: var(--primary-dark); }
.pick-sku { font-size: 24px; font-weight: 700; }
.pick-qty { width: 150px; height: 112px; display: grid; place-items: center; justify-self: center; border: 2px solid var(--line); border-radius: 8px; background: white; font-size: 52px; font-weight: 800; }
.pick-qty.many { background: #fff4b8; border-color: #e6ad19; color: #7a4b00; }
.mobile-ok { min-height: 56px; font-size: 20px; font-weight: 700; }
.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; }
.sort-result { margin-bottom: 12px; }
.sort-complete-panel { margin-bottom: 12px; border-color: #b7dfc6; background: #f2fbf5; }
.sort-complete-panel p { margin: 4px 0 10px; }
[hidden] { display: none !important; }
.toast { position: fixed; right: 16px; bottom: 16px; 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; }
  .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-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, .two-col, .three-col, .stock-grid, .product-stock-grid, .check-grid, .price-results, .quick-purchase-row { grid-template-columns: 1fr; }
  .pick-location { font-size: 34px; }
  .pick-sku { font-size: 20px; }
  .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; }
}
