/* Stage 34: compact high-volume receiving workspace and stable desktop navigation. */
@media (min-width: 821px) and (hover: hover) and (pointer: fine) {
  .control-layout .control-content { transition: none; }
  .control-layout .control-nav { min-width: 0; transition: none; }
  .control-layout .workspace { min-width: 0; transition: none; }
  .control-layout .nav-group {
    position: relative;
    width: 100%;
    min-width: 0;
    max-height: none;
  }
  .control-layout .nav-group::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    z-index: 0;
    width: 42px;
    height: 42px;
    border: 1px solid #2d323a;
    border-radius: 8px;
    background: #13161b;
    opacity: 0;
    pointer-events: none;
    transition: none;
  }
  .control-layout .nav-group-toggle {
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
    transition: none;
  }
  .control-layout .nav-group-title { flex: 1 1 auto; min-width: 0; }
  .control-layout .nav-group-title > svg { align-self: center; }
  .control-layout .nav-group-text,
  .control-layout .nav-group-chevron {
    opacity: 1;
    visibility: visible;
    transition: none;
  }
  .control-layout .nav-group-text,
  .control-layout .nav-item > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

body:has(.inventory-bulk-editor) .modal-card { width: min(1280px, calc(100vw - 28px)); height: min(900px, calc(100dvh - 28px)); overflow: hidden; }
body:has(.inventory-bulk-editor) .modal-form { padding: 0; overflow: hidden; background: #090b0f; }
.inventory-bulk-editor { min-height: 0; height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; color: #eef0f3; background: #090b0f; }
.inventory-bulk-meta { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(420px, 1.4fr); align-items: center; gap: 18px; padding: 14px 18px; border-bottom: 1px solid #292d34; background: #0d1015; }
.inventory-bulk-title { min-width: 0; display: flex; align-items: center; gap: 11px; }
.inventory-bulk-title > div { min-width: 0; display: grid; gap: 3px; }
.inventory-bulk-title strong { color: #f5f6f7; font-size: 14px; }
.inventory-bulk-title small { color: #9ba1aa; line-height: 1.35; }
.inventory-bulk-title-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border: 1px solid #343942; border-radius: 8px; background: #171a20; color: #d9dde2; }
.inventory-bulk-title-icon svg { width: 19px; height: 19px; }
.inventory-bulk-meta-fields { min-width: 0; display: grid; grid-template-columns: minmax(150px, .65fr) minmax(220px, 1fr) minmax(180px, .75fr); gap: 10px; }
.inventory-bulk-meta-fields label { min-width: 0; display: grid; gap: 5px; color: #aeb3bb; font-size: 10px; font-weight: 750; }
.inventory-bulk-meta-fields .inventory-bulk-comment { min-width: 0; }
.inventory-bulk-meta-fields :is(input, select, textarea) { width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border-color: #30353e; border-radius: 7px; background: #12151a; color: #f0f2f4; }
.inventory-bulk-toolbar { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 9px 12px; border-bottom: 1px solid #292d34; background: #0b0e12; }
.inventory-bulk-toolbar .button { min-height: 36px; gap: 7px; border-color: #30353e; background: #15181d; color: #e2e5e9; white-space: nowrap; }
.inventory-bulk-toolbar .button:hover { border-color: #515761; background: #1b1f25; }
.inventory-bulk-toolbar .button svg { width: 16px; height: 16px; }
.inventory-bulk-toolbar [data-inventory-bulk-errors] { display: inline-grid; grid-template-columns: 16px auto 20px; align-items: center; justify-content: center; min-width: 104px; padding-inline: 10px; }
.inventory-bulk-toolbar .button b { min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 5px; border-radius: 99px; background: #282d35; color: #f3f4f6; font-size: 10px; }
.inventory-bulk-toolbar .button[aria-pressed="true"] { border-color: #666d78; background: #252a31; }
.inventory-bulk-search { min-width: 210px; flex: 1 1 300px; position: relative; }
.inventory-bulk-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; z-index: 2; transform: translateY(-50%); color: #949aa3; pointer-events: none; }
.inventory-bulk-search input { width: 100%; min-height: 36px; padding: 8px 11px 8px 38px !important; border: 1px solid #30353e; border-radius: 7px; background: #111419; color: #f4f5f6; line-height: 1.2; }
.inventory-save-state { min-width: 158px; margin-left: auto; display: inline-flex; align-items: center; justify-content: flex-end; gap: 7px; color: #aeb4bc; font-size: 11px; white-space: nowrap; }
.inventory-save-state svg { width: 15px; height: 15px; }
.inventory-bulk-workspace { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; background: #090b0f; }
.inventory-bulk-list { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border-right: 1px solid #292d34; overflow: hidden; }
.inventory-bulk-list-head,
.inventory-bulk-row { display: grid; grid-template-columns: 30px 32px 38px minmax(200px, 1.6fr) 92px 98px 112px 118px 34px; align-items: center; gap: 7px; }
.inventory-bulk-list-head { min-height: 36px; padding: 0 9px; border-bottom: 1px solid #292d34; background: #111419; color: #858b95; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.inventory-document-lines { min-height: 0; display: block; overflow: auto; scrollbar-width: none; }
.inventory-document-lines::-webkit-scrollbar,
.inventory-inspector::-webkit-scrollbar { display: none; width: 0; height: 0; }
.inventory-bulk-row { min-height: 62px; padding: 7px 9px; border: 0; border-bottom: 1px solid #242830; border-radius: 0; background: #0d1014; transition: background 140ms ease, box-shadow 140ms ease; cursor: default; }
.inventory-bulk-row:hover { background: #12161b; }
.inventory-bulk-row.is-active { background: #171b21; box-shadow: inset 3px 0 0 #8e949d; }
.inventory-bulk-row.has-error .inventory-row-status { color: #f2a8b1; }
.inventory-bulk-row.inventory-row-filtered { display: none; }
.inventory-row-check { display: grid; place-items: center; }
.inventory-row-check input { width: 16px; height: 16px; accent-color: #8c929c; }
.inventory-row-number { color: #8f959e; font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.inventory-row-thumb,
.inventory-inspector-thumb { display: grid; place-items: center; overflow: hidden; border: 1px solid #333842; background: #1a1e24; color: #b8bdc5; }
.inventory-row-thumb { width: 34px; height: 34px; border-radius: 7px; }
.inventory-row-thumb :is(svg, img) { width: 21px; height: 21px; object-fit: cover; }
.inventory-row-product { min-width: 0; display: grid; gap: 3px; }
.inventory-row-product select,
.inventory-row-quantity input,
.inventory-row-cost input { width: 100%; min-width: 0; min-height: 34px; padding: 6px 8px; border: 1px solid #30353e; border-radius: 6px; background: #12151a; color: #eceef1; font-size: 11px; }
.inventory-row-product small { min-width: 0; overflow: hidden; color: #8d939d; font-size: 9px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.inventory-row-sum { color: #f1f2f4; font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.inventory-row-status { color: #aeb4bc; font-size: 10px; line-height: 1.25; }
.inventory-row-remove { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #8e949d; }
.inventory-row-remove:hover { border-color: #5a3a40; background: #24171a; color: #f0a0ab; }
.inventory-row-remove svg { width: 15px; height: 15px; }
.inventory-bulk-add-row { min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-top: 1px solid #292d34; background: #101318; color: #b8bdc5; font-size: 11px; }
.inventory-bulk-add-row:hover { background: #171b21; color: #f0f1f3; }
.inventory-bulk-add-row svg { width: 15px; height: 15px; }
.inventory-inspector { min-width: 0; min-height: 0; overflow: auto; padding: 14px; background: #0d1014; scrollbar-width: none; }
.inventory-inspector > header { padding-bottom: 13px; border-bottom: 1px solid #292d34; }
.inventory-inspector > header > div { min-width: 0; display: flex; align-items: center; gap: 11px; }
.inventory-inspector > header > div > div { min-width: 0; display: grid; gap: 2px; }
.inventory-inspector > header small,
.inventory-inspector > header span { color: #9298a1; font-size: 10px; }
.inventory-inspector > header strong { overflow: hidden; color: #f4f5f6; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.inventory-inspector-thumb { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 9px; }
.inventory-inspector-thumb :is(svg, img) { width: 28px; height: 28px; object-fit: cover; }
.inventory-inspector-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 0; }
.inventory-inspector-fields label { min-width: 0; display: grid; gap: 5px; color: #a9afb8; font-size: 9px; font-weight: 800; }
.inventory-inspector-fields .inventory-inspector-wide { grid-column: 1 / -1; }
.inventory-inspector-fields :is(input, select) { width: 100%; min-width: 0; min-height: 35px; padding: 7px 9px; border: 1px solid #30353e; border-radius: 6px; background: #12151a; color: #f0f1f3; font-size: 11px; }
.inventory-inspector-fields label small { color: #858c96; font-size: 9px; font-weight: 500; line-height: 1.35; }
.inventory-inspector-image { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border: 1px solid #30353e; border-radius: 7px; background: #12151a; }
.inventory-inspector-image > div { min-width: 0; display: grid; gap: 3px; }
.inventory-inspector-image strong { color: #eef0f3; font-size: 10px; }
.inventory-inspector-image small { overflow: hidden; color: #8f96a0; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.inventory-inspector-image .button { flex: 0 0 auto; position: relative; min-height: 34px; }
.inventory-inspector-image input,
.catalog-product-image input { position: absolute; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.inventory-inspector-hint { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px; border: 1px solid #2c3139; border-radius: 7px; background: #13161b; color: #9fa5ae; font-size: 10px; line-height: 1.4; }
.inventory-inspector-hint svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 1px; }
.inventory-bulk-footer { min-width: 0; position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 14px; border-top: 1px solid #30353e; background: #111419; }
.inventory-bulk-summary { min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.inventory-bulk-summary span { min-width: 108px; display: grid; gap: 2px; padding: 7px 10px; border: 1px solid #2d323a; border-radius: 7px; background: #171a20; color: #969ca5; font-size: 9px; }
.inventory-bulk-summary strong { color: #f1f2f4; font-size: 12px; font-variant-numeric: tabular-nums; }
.inventory-bulk-footer .form-actions { flex: 0 0 auto; padding: 0; }
.inventory-documents-table .table-link,
.inventory-product-link { min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #eef0f3; text-align: left; }
.inventory-documents-table .table-link:hover,
.inventory-product-link:hover { background: transparent; color: #ffffff; text-decoration: underline; text-underline-offset: 3px; }
.catalog-product-image { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 14px; padding: 13px; border: 1px solid #30353e; border-radius: 8px; background: #111419; }
.catalog-product-image > span { width: 84px; height: 84px; display: grid; place-items: center; overflow: hidden; border: 1px solid #373c45; border-radius: 8px; background: #191d23; color: #aab0b8; }
.catalog-product-image > span :is(img, svg) { width: 100%; height: 100%; object-fit: cover; }
.catalog-product-image > div { min-width: 0; display: grid; justify-items: start; gap: 6px; }
.catalog-product-image strong { color: #f2f3f5; }
.catalog-product-image small { color: #969da6; line-height: 1.4; }
.catalog-product-image .button { position: relative; }
.catalog-product-actions { position: sticky; bottom: -20px; z-index: 4; margin-inline: -20px; padding: 12px 20px !important; border-top: 1px solid #30353e; background: #111419; }

@media (max-width: 980px) {
  body:has(.inventory-bulk-editor) .modal-card { width: min(760px, calc(100vw - 16px)); height: calc(100dvh - 16px); }
  body:has(.inventory-bulk-editor) .modal-form { overflow-y: auto; }
  .inventory-bulk-editor { height: auto; min-height: 100%; grid-template-rows: auto auto auto auto; }
  .inventory-bulk-meta { grid-template-columns: 1fr; }
  .inventory-bulk-meta-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-bulk-toolbar { flex-wrap: wrap; }
  .inventory-save-state { margin-left: 0; }
  .inventory-bulk-workspace { min-height: auto; grid-template-columns: 1fr; }
  .inventory-bulk-list { border-right: 0; }
  .inventory-bulk-list-head { display: none; }
  .inventory-document-lines { max-height: 45dvh; }
  .inventory-bulk-row { grid-template-columns: 26px 26px 34px minmax(0, 1fr) 32px; grid-template-areas: "check number thumb product remove" "check number thumb quantity remove" "status status status sum sum"; gap: 5px 7px; }
  .inventory-row-check { grid-area: check; }
  .inventory-row-number { grid-area: number; }
  .inventory-row-thumb { grid-area: thumb; }
  .inventory-row-product { grid-area: product; }
  .inventory-row-quantity { grid-area: quantity; }
  .inventory-row-cost { display: none; }
  .inventory-row-sum { grid-area: sum; }
  .inventory-row-status { grid-area: status; }
  .inventory-row-remove { grid-area: remove; }
  .inventory-inspector { min-height: auto; overflow: visible; border-top: 1px solid #292d34; }
  .inventory-bulk-footer { align-items: stretch; flex-direction: column; }
  .inventory-bulk-footer { position: relative; bottom: auto; padding-bottom: max(11px, env(safe-area-inset-bottom)); }
  .inventory-bulk-footer .form-actions { width: 100%; }
  .inventory-bulk-footer .form-actions .button { flex: 1 1 0; }
}

@media (max-width: 560px) {
  .inventory-bulk-meta, .inventory-inspector { padding: 12px; }
  .inventory-bulk-meta-fields, .inventory-inspector-fields { grid-template-columns: 1fr; }
  .inventory-bulk-meta-fields .inventory-bulk-comment,
  .inventory-inspector-fields .inventory-inspector-wide { grid-column: auto; }
  .inventory-bulk-search { flex-basis: 100%; }
  .inventory-bulk-toolbar .button span { display: none; }
  .inventory-bulk-toolbar .button { width: 38px; padding: 0; justify-content: center; }
  .inventory-bulk-toolbar [data-inventory-bulk-remove-selected] { width: 38px; }
  .inventory-bulk-toolbar [data-inventory-bulk-errors] { width: auto; min-width: 66px; grid-template-columns: 16px 20px; }
  .inventory-bulk-toolbar [data-inventory-bulk-errors] span { display: none; }
  .inventory-save-state { min-width: 0; flex: 1 1 auto; justify-content: flex-end; }
  .inventory-bulk-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-bulk-summary span { min-width: 0; }
  .inventory-inspector-image { align-items: stretch; flex-direction: column; }
  .inventory-inspector-image .button { width: 100%; justify-content: center; }
  .catalog-product-image { grid-template-columns: 64px minmax(0, 1fr); }
  .catalog-product-image > span { width: 64px; height: 64px; }
}
