.content:has(.quick-stock-page:not([hidden])) {
  width: calc(100% - 12px);
  height: auto;
  min-height: 0;
  max-width: none;
  margin-inline: 6px;
  padding: 5px 0 6px;
  overflow: hidden;
}

.content:has(.quick-stock-page:not([hidden]))::before { display: none; }

body:has(.quick-stock-page:not([hidden])) { overflow: hidden; }

body:has(.quick-stock-page:not([hidden])) .app-shell {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body:has(.quick-stock-page:not([hidden])) .app-shell > main {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.quick-stock-page {
  position: relative;
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: block;
  animation: none;
}

.quick-stock-page[hidden] { display: none; }

.quick-stock-workspace {
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--erp-border);
  border-radius: 2px;
  background: var(--erp-surface);
  box-shadow: none;
}

.quick-stock-import-overlay {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgb(5 32 61 / 42%);
  backdrop-filter: blur(2px);
}

.quick-stock-import-overlay[hidden] { display: none; }

.quick-stock-import-card {
  width: min(480px, calc(100vw - 40px));
  display: grid;
  justify-items: center;
  padding: 24px 28px 22px;
  border: 1px solid color-mix(in srgb, var(--erp-accent) 42%, var(--erp-border));
  border-top: 4px solid var(--erp-accent);
  border-radius: 8px;
  color: var(--ink);
  background: linear-gradient(145deg, white 0%, color-mix(in srgb, var(--brand-turquoise-pale) 46%, white) 100%);
  box-shadow: 0 24px 62px rgb(3 26 51 / 38%), inset 0 0 0 1px rgb(255 255 255 / 78%);
  text-align: center;
}

.quick-stock-import-card .eyebrow { margin: 10px 0 3px; color: var(--erp-accent); font-size: 8px; font-weight: 950; letter-spacing: .16em; }
.quick-stock-import-card h2 { margin: 0; color: var(--brand-navy); font-size: 18px; line-height: 1.25; }
.quick-stock-import-card p:not(.eyebrow) { min-height: 18px; margin: 7px 0 14px; color: var(--muted); font-size: 10px; font-weight: 800; }
.quick-stock-import-card > strong { margin-top: 7px; color: var(--brand-navy); font-size: 13px; font-variant-numeric: tabular-nums; }
.quick-stock-import-card > small { margin-top: 9px; color: var(--muted); font-size: 8px; font-weight: 700; }

.quick-stock-import-animation {
  position: relative;
  width: 66px;
  height: 52px;
  display: grid;
  place-items: center;
}

.quick-stock-import-animation span {
  position: absolute;
  width: 42px;
  height: 32px;
  border: 2px solid color-mix(in srgb, var(--erp-accent) 72%, white);
  border-radius: 4px;
  background: color-mix(in srgb, var(--brand-turquoise-pale) 78%, white);
  box-shadow: 0 5px 12px rgb(7 62 88 / 14%);
  animation: quick-stock-import-sheet 1.65s ease-in-out infinite;
}
.quick-stock-import-animation span:nth-child(1) { transform: translate(-10px, 7px) rotate(-7deg); animation-delay: -.45s; }
.quick-stock-import-animation span:nth-child(2) { transform: translate(10px, 7px) rotate(7deg); animation-delay: -.22s; }
.quick-stock-import-animation span:nth-child(3) { border-color: var(--erp-accent); background: white; }
.quick-stock-import-animation i {
  position: relative;
  z-index: 2;
  color: var(--brand-navy);
  font: normal 950 22px/1 var(--ui-font);
  animation: quick-stock-import-icon 1.1s ease-in-out infinite;
}

.quick-stock-import-progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand-navy) 24%, var(--erp-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-navy) 7%, white);
  box-shadow: inset 0 1px 3px rgb(5 36 66 / 12%);
}

.quick-stock-import-progress > span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--erp-accent), color-mix(in srgb, var(--erp-accent) 56%, #7fe7df));
  box-shadow: 0 0 12px color-mix(in srgb, var(--erp-accent) 42%, transparent);
  transition: width .24s ease;
}

@keyframes quick-stock-import-sheet {
  0%, 100% { opacity: .62; translate: 0 0; }
  50% { opacity: 1; translate: 0 -5px; }
}

@keyframes quick-stock-import-icon {
  0%, 100% { scale: 1; }
  50% { scale: 1.12; }
}

@media (prefers-reduced-motion: reduce) {
  .quick-stock-import-animation span,
  .quick-stock-import-animation i { animation: none; }
  .quick-stock-import-progress > span { transition: none; }
}

.quick-stock-toolbar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(170px, auto) auto;
  align-items: center;
  gap: 6px;
  padding: 4px 5px;
  border-bottom: 1px solid var(--erp-border);
  background: var(--erp-surface-muted);
}

.quick-stock-toolbar-field {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--brand-navy);
  font-size: 8.5px;
  font-weight: 850;
}

.quick-stock-toolbar-field > span { flex: 0 0 auto; white-space: nowrap; }

.quick-stock-toolbar-field select,
.quick-stock-search input {
  width: 100%;
  height: 28px;
  min-height: 28px;
  border: 1px solid var(--erp-border);
  border-radius: 2px;
  color: var(--ink);
  background: var(--erp-surface);
  font-size: 9px;
  font-weight: 750;
}

.quick-stock-toolbar-field select { padding: 0 var(--erp-space-2); }

.quick-stock-search-shell {
  position: relative;
  z-index: 30;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 3px;
}

.quick-stock-search {
  position: relative;
  display: block;
}

.quick-stock-search span {
  position: absolute;
  top: 50%;
  left: 7px;
  z-index: 1;
  color: var(--muted);
  transform: translateY(-50%);
}

.quick-stock-search input { padding: 0 7px 0 23px; }

.quick-stock-selection-trigger {
  width: 30px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 4px;
  border: 1px solid var(--erp-border);
  border-radius: 2px;
  color: var(--brand-turquoise-dark);
  background: var(--erp-surface);
  cursor: pointer;
}

.quick-stock-selection-trigger:hover,
.quick-stock-selection-trigger:focus-visible {
  border-color: var(--erp-accent);
  background: var(--brand-turquoise-pale);
  outline: 2px solid color-mix(in srgb, var(--erp-accent) 24%, transparent);
  outline-offset: 1px;
}

.quick-stock-selection-trigger svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.quick-stock-search-popup {
  position: absolute;
  z-index: 50;
  top: calc(100% + 3px);
  left: 0;
  width: min(680px, calc(100vw - 42px));
  max-height: 242px;
  overflow: auto;
  border: 1px solid var(--erp-border-strong, var(--erp-border));
  border-radius: 2px;
  background: var(--erp-surface);
  box-shadow: 0 8px 20px rgb(15 42 74 / 18%);
}

.quick-stock-search-popup[hidden] { display: none; }
.quick-stock-search-popup table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.quick-stock-search-popup th,
.quick-stock-search-popup td {
  height: 26px;
  padding: 3px 7px;
  overflow: hidden;
  border-right: 1px solid var(--erp-border);
  border-bottom: 1px solid var(--erp-border);
  color: var(--ink);
  font-size: 9px;
  font-weight: 750;
  line-height: 1.15;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-stock-search-popup th {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 27px;
  color: var(--brand-navy);
  background: var(--erp-surface-muted);
  font-weight: 900;
}
.quick-stock-search-popup th:nth-child(1) { width: 34%; }
.quick-stock-search-popup th:nth-child(2) { width: 44%; }
.quick-stock-search-popup th:nth-child(3) { width: 22%; }

/* Shared lookup buttons use a filled surface; header captions must show the header behind them. */
#quickStockSearchPopup thead .list-sort-label {
  background: transparent !important;
  color: inherit !important;
}

.quick-stock-search-popup tr[data-quick-stock-search-index] { cursor: pointer; }
.quick-stock-search-popup tr[data-quick-stock-search-index]:hover td,
.quick-stock-search-popup tr.is-active td {
  color: var(--brand-navy);
  background: color-mix(in srgb, var(--brand-turquoise-pale) 88%, white);
}
.quick-stock-search-popup tr.is-active td {
  font-weight: 900;
  box-shadow: inset 0 1px 0 var(--erp-accent), inset 0 -1px 0 var(--erp-accent);
}
.quick-stock-search-popup tr.is-active td:first-child {
  box-shadow: inset 3px 0 0 var(--erp-accent), inset 0 1px 0 var(--erp-accent), inset 0 -1px 0 var(--erp-accent);
}
.quick-stock-search-popup tr.is-loading td,
.quick-stock-search-popup tr.is-empty td { color: var(--muted); text-align: center; font-style: italic; }

.quick-stock-commands {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  gap: 3px;
}

.quick-stock-commands .standard-icon-command {
  min-width: 58px;
  min-height: 28px;
  height: 28px;
  gap: 3px;
  padding: 2px 5px 2px 3px;
  border-radius: 3px;
  box-shadow: none;
}

.quick-stock-commands .standard-icon-command:hover:not(:disabled) { transform: none; box-shadow: none; }
.quick-stock-commands .standard-icon-command b { font-size: 7.5px; font-weight: 900; }
.quick-stock-commands .command-icon {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  font-size: 10px;
}

.quick-stock-grid-scroll {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  outline: none;
  scrollbar-color: var(--brand-turquoise-dark) var(--erp-surface-muted);
  scrollbar-width: thin;
}

.quick-stock-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: var(--erp-surface);
  font-size: var(--erp-grid-font-size);
  font-weight: var(--erp-grid-font-weight);
}

/* Keep the header above row editors even when shared column controls make th relative. */
#quickStockGrid thead {
  position: sticky;
  top: 0;
  z-index: 12;
  background: var(--erp-surface, #fff);
}

#quickStockGrid thead th { position: relative; top: auto; }

.quick-stock-grid th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 30px;
  padding: 0 5px;
  border-right: 1px solid var(--erp-border);
  border-bottom: 1px solid var(--erp-border);
  color: var(--brand-navy);
  background: var(--erp-surface-muted);
  font-size: var(--erp-grid-header-font-size);
  font-weight: var(--erp-grid-header-font-weight);
  text-align: left;
  user-select: none;
  white-space: nowrap;
}

.quick-stock-grid th[data-quick-stock-column] { cursor: grab; }
.quick-stock-grid th.is-barcode-compass { cursor: default; }
.quick-stock-grid th.is-barcode-compass .quick-stock-header-grip { color: var(--brand-turquoise-dark); }
.quick-stock-grid th.is-dragging { opacity: .45; }
.quick-stock-grid th.is-drop-target { box-shadow: inset 3px 0 var(--erp-accent); }

.quick-stock-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--erp-space-1);
  padding-right: 3px;
}

.quick-stock-header-content > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-stock-header-grip {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
  letter-spacing: -2px;
}

.quick-stock-column-resizer {
  position: absolute;
  z-index: 7;
  top: 0;
  right: -4px;
  width: 9px;
  height: 100%;
  display: block;
  cursor: col-resize;
  touch-action: none;
  outline: 0;
}

.quick-stock-column-resizer::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 1px;
  background: color-mix(in srgb, var(--erp-border) 82%, var(--muted));
}

.quick-stock-column-resizer:hover::after,
.quick-stock-column-resizer:focus-visible::after {
  width: 2px;
  background: var(--erp-accent);
}

.quick-stock-column-resizer:focus-visible { box-shadow: inset 0 0 0 1px var(--erp-accent); }
body.quick-stock-resizing, body.quick-stock-resizing * { cursor: col-resize !important; user-select: none !important; }

.quick-stock-grid th.is-price-focus {
  color: var(--brand-turquoise-dark);
  background: color-mix(in srgb, var(--erp-accent) 8%, var(--erp-surface-muted));
  box-shadow: inset 0 -2px var(--erp-accent);
}

.quick-stock-grid td {
  height: 28px;
  padding: 0;
  border-right: 1px solid var(--erp-border);
  border-bottom: 1px solid var(--erp-border);
  color: var(--ink);
  background: var(--erp-surface);
}

.quick-stock-grid tr.is-active td {
  background: color-mix(in srgb, var(--erp-accent) 5%, var(--erp-surface));
}

.quick-stock-grid tr.is-active td:first-child { box-shadow: inset 3px 0 var(--erp-accent); }
.quick-stock-grid tr.is-saving td { background: color-mix(in srgb, var(--erp-info) 7%, var(--erp-surface)); }
.quick-stock-grid tr.is-committed td { background: color-mix(in srgb, var(--erp-success) 4%, var(--erp-surface)); }
.quick-stock-grid tr.has-error td { background: color-mix(in srgb, var(--erp-danger) 6%, var(--erp-surface)); }

/* Tint the selection over status/appearance colors without changing saved preferences. */
#quickStockGrid tbody tr.is-active > td {
  background-image: linear-gradient(
    color-mix(in srgb, var(--erp-accent) 20%, transparent),
    color-mix(in srgb, var(--erp-accent) 20%, transparent)) !important;
  border-color: color-mix(in srgb, var(--erp-accent) 65%, var(--erp-border));
}

#quickStockGrid tbody tr.is-active > td :is(input, select) {
  background-color: transparent !important;
}

@media (forced-colors: active) {
  #quickStockGrid tbody tr.is-active > td { outline: 1px solid Highlight; }
}

.quick-stock-grid td input,
.quick-stock-grid td select {
  width: 100%;
  height: 27px;
  min-height: 27px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: var(--erp-grid-font-weight);
  font-variant-numeric: tabular-nums;
}

.quick-stock-grid input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.quick-stock-grid input[type="number"]::-webkit-inner-spin-button,
.quick-stock-grid input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.quick-stock-grid td input:focus,
.quick-stock-grid td select:focus {
  position: relative;
  z-index: 2;
  box-shadow: inset 0 0 0 1px var(--erp-accent), inset 0 0 0 2px color-mix(in srgb, var(--erp-accent) 24%, transparent);
  background: var(--erp-surface);
}

.quick-stock-grid td input:disabled,
.quick-stock-grid td select:disabled {
  cursor: default;
  opacity: .68;
}

.quick-stock-grid td.quick-stock-price-cell input,
.quick-stock-grid td.quick-stock-number-cell input { text-align: right; }

.quick-stock-grid input[data-quick-stock-field="barcode"],
.quick-stock-grid input[data-quick-stock-field="name"] {
  direction: ltr;
  text-align: left !important;
}

.quick-stock-grid td.quick-stock-price-focus {
  background: color-mix(in srgb, var(--erp-accent) 4%, var(--erp-surface));
}

.quick-stock-footer {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto auto minmax(270px, 1fr) minmax(220px, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 25px;
  padding: 3px 6px;
  border-top: 1px solid var(--erp-border);
  color: var(--muted);
  background: var(--erp-surface);
  font-size: 8px;
  font-weight: 700;
}

.quick-stock-row-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.quick-stock-row-actions button {
  width: 23px;
  min-width: 23px;
  height: 21px;
  min-height: 21px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--erp-border);
  border-radius: 3px;
  color: var(--brand-navy);
  background: var(--erp-surface-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.quick-stock-row-actions button:hover:not(:disabled),
.quick-stock-row-actions button:focus-visible {
  color: #fff;
  border-color: var(--erp-accent);
  outline: 0;
  background: var(--erp-accent);
}

.quick-stock-row-actions button:disabled { cursor: not-allowed; opacity: .5; }

.quick-stock-footer strong { color: var(--brand-navy); }
.quick-stock-footer > span:last-child { text-align: right; }
.quick-stock-footer-counts { white-space: nowrap; }
.quick-stock-footer-counts b { color: var(--brand-navy); font-variant-numeric: tabular-nums; }
.quick-stock-footer kbd {
  padding: 1px 3px;
  border: 1px solid var(--erp-border);
  border-radius: 4px;
  color: var(--brand-navy);
  background: var(--erp-surface-muted);
  font: inherit;
}

.quick-stock-dialog {
  width: min(820px, calc(100vw - 28px));
  max-width: none;
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-lg);
  color: var(--ink);
  background: var(--erp-surface);
  box-shadow: 0 26px 80px rgba(6, 46, 91, .28);
}

.quick-stock-dialog::backdrop { background: rgba(6, 34, 70, .4); backdrop-filter: blur(2px); }
.quick-stock-dialog > form,
.quick-stock-dialog > div { max-height: inherit; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }

.quick-stock-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--erp-space-4);
  padding: var(--erp-space-4);
  border-bottom: 1px solid var(--erp-border);
  background: var(--erp-surface-muted);
}

.quick-stock-dialog header h2 { margin: 2px 0 4px; color: var(--brand-navy); font-size: 18px; }
.quick-stock-dialog header p:last-child { margin: 0; color: var(--muted); font-size: 9px; }
.quick-stock-dialog-body { min-height: 0; overflow: auto; padding: var(--erp-space-4); }

.quick-stock-dialog textarea {
  width: 100%;
  min-height: 240px;
  padding: var(--erp-space-3);
  resize: vertical;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-sm);
  color: var(--ink);
  background: var(--erp-surface-muted);
  font: 11px Consolas, monospace;
}

#quickStockPasteSummary { margin: var(--erp-space-2) 0 0; color: var(--muted); font-size: 9px; }

.quick-stock-paste-dialog { width: min(1120px, calc(100vw - 28px)); }
.quick-stock-paste-dialog > form { grid-template-rows: auto minmax(0, 1fr) auto; }
.quick-stock-paste-body {
  display: grid;
  grid-template-rows: auto minmax(240px, 1fr);
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

.quick-stock-paste-source { gap: 5px; color: var(--ink); font-size: 9px; font-weight: 900; }
.quick-stock-paste-source textarea {
  min-height: 82px;
  max-height: 120px;
  padding: 7px 8px;
  border-radius: 2px;
  background: var(--erp-surface);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.quick-stock-paste-preview {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--erp-border);
  background: var(--erp-surface);
}

.quick-stock-paste-preview > header {
  min-height: 38px;
  align-items: center;
  padding: 5px 8px;
  border-bottom: 1px solid var(--erp-border);
  background: var(--erp-surface-muted);
}

.quick-stock-paste-preview > header strong,
.quick-stock-paste-preview > header small { display: block; }
.quick-stock-paste-preview > header strong { color: var(--brand-navy); font-size: 10px; font-weight: 900; }
.quick-stock-paste-preview > header small { margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 700; }
.quick-stock-paste-preview > header :is(#quickStockPasteSummary, .quick-stock-paste-summary) { margin: 0; text-align: right; white-space: nowrap; }
.quick-stock-paste-preview-scroll { min-height: 0; overflow: auto; }

:is(#quickStockPastePreviewTable, .quick-stock-paste-preview-table) {
  width: max-content;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: var(--ink);
  background: var(--erp-surface);
  font-size: 10px;
  font-weight: 700;
}

:is(#quickStockPastePreviewTable, .quick-stock-paste-preview-table) th,
:is(#quickStockPastePreviewTable, .quick-stock-paste-preview-table) td {
  min-width: 110px;
  height: 27px;
  padding: 3px 6px;
  overflow: hidden;
  border-right: 1px solid var(--erp-border);
  border-bottom: 1px solid var(--erp-border);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(#quickStockPastePreviewTable, .quick-stock-paste-preview-table) thead th {
  position: sticky;
  z-index: 3;
  top: 0;
  color: var(--brand-navy);
  background: var(--erp-surface-muted);
  font-weight: 900;
}

:is(#quickStockPastePreviewTable, .quick-stock-paste-preview-table) th:first-child {
  left: 0;
  z-index: 4;
  min-width: 30px;
  width: 30px;
  max-width: 30px;
  padding-inline: 4px;
  position: sticky;
  color: var(--muted);
  background: var(--erp-surface-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

:is(#quickStockPastePreviewTable, .quick-stock-paste-preview-table) th.is-unmatched { color: var(--erp-danger); background: color-mix(in srgb, var(--erp-danger) 8%, var(--erp-surface-muted)); }
:is(#quickStockPastePreviewTable, .quick-stock-paste-preview-table) td.is-unmatched { background: color-mix(in srgb, var(--erp-danger) 5%, var(--erp-surface)); }
:is(#quickStockPastePreviewTable, .quick-stock-paste-preview-table) td.is-preview-empty { color: var(--muted); font-weight: 600; }
:is(#quickStockPastePreviewTable, .quick-stock-paste-preview-table) td.is-auto-barcode { color: var(--brand-turquoise-dark); font-style: italic; }

.quick-stock-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--erp-space-2);
  padding: var(--erp-space-3) var(--erp-space-4);
  border-top: 1px solid var(--erp-border);
}

.quick-stock-view-dialog {
  width: min(820px, calc(100vw - 28px));
  max-height: min(640px, calc(100vh - 28px));
}

.quick-stock-view-dialog header {
  align-items: center;
  padding: 10px 12px;
}

.quick-stock-view-dialog header h2 {
  margin-block: 1px 2px;
  font-size: 16px;
}

.quick-stock-view-dialog .dialog-close {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  font-size: 20px;
}

.quick-stock-view-dialog .quick-stock-dialog-body {
  padding: 8px;
  background: var(--erp-surface);
}

.quick-stock-view-dialog footer {
  gap: 6px;
  padding: 7px 8px;
  background: var(--erp-surface-muted);
}

.quick-stock-view-dialog footer .button {
  min-height: 31px;
  padding: 0 12px;
  border-radius: 4px;
  font-size: 9px;
}

.quick-stock-column-editor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.quick-stock-column-option {
  min-width: 0;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border: 1px solid var(--erp-border);
  border-radius: 3px;
  background: var(--erp-surface);
  color: var(--brand-navy);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.quick-stock-column-option:hover {
  border-color: color-mix(in srgb, var(--erp-accent) 55%, var(--erp-border));
  background: color-mix(in srgb, var(--erp-accent) 5%, var(--erp-surface));
}

.quick-stock-column-option:has(input:checked) {
  background: color-mix(in srgb, var(--erp-accent) 7%, var(--erp-surface));
}

.quick-stock-column-option input[type="checkbox"] {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px;
  min-height: 0 !important;
  flex: 0 0 15px;
  margin: 0;
  padding: 0;
  accent-color: var(--erp-accent);
  box-shadow: none;
}

.quick-stock-column-option input[type="checkbox"]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--erp-accent) 35%, transparent);
  outline-offset: 2px;
}

.quick-stock-column-option:has(input:disabled) {
  cursor: default;
  background: var(--erp-surface-muted);
}

.quick-stock-column-option-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-stock-column-option-width { margin-left: auto; color: var(--muted); font-size: 8px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.quick-stock-transfer-dialog { width: min(650px, calc(100vw - 28px)); }
.quick-stock-transfer-options { display: flex; flex-wrap: wrap; gap: var(--erp-space-3); padding: var(--erp-space-4); }

@media (max-width: 1500px) {
  .quick-stock-toolbar { grid-template-columns: minmax(220px, 1fr) minmax(165px, auto) auto; }
  .quick-stock-commands .standard-icon-command { min-width: 54px; }
}

@media (max-width: 1180px) {
  .quick-stock-toolbar { grid-template-columns: minmax(190px, 1fr) minmax(155px, auto) auto; }
  .quick-stock-commands .standard-icon-command b { display: none; }
  .quick-stock-commands .standard-icon-command { min-width: 28px; width: 28px; padding: 2px 3px; }
}

@media (max-width: 760px) {
  .quick-stock-toolbar { grid-template-columns: 1fr; }
  .quick-stock-commands { grid-column: auto; justify-content: flex-start; flex-wrap: wrap; }
  .quick-stock-commands .standard-icon-command { width: auto; min-width: 28px; }
  .quick-stock-footer { grid-template-columns: 1fr; }
  .quick-stock-footer > span:last-child { text-align: left; }
  .quick-stock-column-editor,
  .quick-stock-transfer-options { grid-template-columns: 1fr; }
  .quick-stock-paste-body { grid-template-rows: auto minmax(210px, 1fr); }
}

@media print {
  #quickStockGrid thead { position: static; }
  body:has(.quick-stock-page:not([hidden])) .sidebar,
  body:has(.quick-stock-page:not([hidden])) .topbar,
  body:has(.quick-stock-page:not([hidden])) .workspace-tabs,
  body:has(.quick-stock-page:not([hidden])) .quick-stock-toolbar,
  body:has(.quick-stock-page:not([hidden])) .quick-stock-footer,
  body:has(.quick-stock-page:not([hidden])) .ai-assistant-launcher { display: none !important; }
  body:has(.quick-stock-page:not([hidden])) .quick-stock-workspace { border: 0; box-shadow: none; }
  body:has(.quick-stock-page:not([hidden])) .quick-stock-grid-scroll { overflow: visible; }
}
