.admin-app .dialog[data-key="product-batch"] { --paper-50: #fff; --paper-100: #f6f7f8; --line-200: #e7e9ec; --line-300: #d5d8dc; --ink-900: #232528; --ink-700: #45484d; --ink-600: #686c72; --ink-500: #686c72; position: fixed; inset: 0 0 0 auto; width: min(640px, 100vw); height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 20px 0 0 20px; box-shadow: -12px 0 48px rgb(20 24 28 / 14%); background: var(--paper-50); }
html:has(.dialog[data-key="product-batch"]:modal) { scrollbar-gutter: auto; }
.dialog[data-key="product-batch"]::backdrop { background: rgb(20 24 28 / 34%); }
.dialog[data-key="product-batch"][open] { animation: slide-in .2s var(--ease); }
.dialog[data-key="product-batch"] > .dialog-head { min-height: 72px; padding: 12px 16px 12px 24px; border: 0; }
.dialog[data-key="product-batch"] > .dialog-head h2 { font-size: 20px; }
.dialog[data-key="product-batch"] > .dialog-head .close { border-radius: 50%; background: var(--paper-100); }
.dialog[data-key="product-batch"] > .dialog-body { display: flex; padding: 0; overflow: hidden; }
.product-batch { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; }
.batch-scroll { display: grid; align-content: start; grid-auto-rows: max-content; gap: 16px; flex: 1; min-height: 0; min-width: 0; padding: 20px 24px 24px; overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: 16px; scrollbar-width: thin; }
.product-batch p { margin: 0; }
.product-batch [hidden] { display: none; }
.product-batch :is(input, select, button, a, [tabindex]) { scroll-margin-block: 16px; }
.product-batch :focus-visible { outline: 2px solid var(--brand-700, #a43128); outline-offset: 3px; }
.product-batch > .batch-steps { display: grid; flex: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; list-style: none; padding: 0 24px 16px; margin: 0; border-bottom: 1px solid var(--line-200); }
.batch-steps li { display: flex; align-items: center; gap: 8px; color: var(--ink-500); font-size: var(--text-sm); overflow-wrap: anywhere; }
.batch-steps li > span { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border: 1px solid var(--line-200); border-radius: 50%; font-weight: 700; }
.batch-steps [aria-current="step"] { color: var(--ink-900); font-weight: 700; }
.batch-steps [aria-current="step"] > span { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.batch-action-card { display: grid; gap: 12px; padding: 0 0 16px; border-bottom: 1px solid var(--line-200); }
.batch-operation-field { display: block; min-width: 0; }
.batch-operation-field legend { margin-bottom: 10px; font-size: 14px; }
.batch-operation-options { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.batch-operation-choice { display: flex; align-items: center; justify-content: center; grid-column: span 2; gap: 8px; min-height: 46px; min-width: 0; padding: 10px 8px; border: 1px solid var(--line-200); border-radius: 10px; background: var(--paper-50); color: var(--ink-700); cursor: pointer; font-size: 14px; line-height: 1.4; }
.batch-operation-visibility { grid-column: span 3; }
.batch-operation-choice input { flex: 0 0 16px; width: 16px; height: 16px; }
.batch-operation-choice span { min-width: 0; overflow-wrap: anywhere; }
.batch-operation-choice:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.batch-operation-choice:has(input:focus-visible) { outline: 2px solid var(--brand-700); outline-offset: 2px; }
.batch-operation-choice input:focus-visible { outline: none; box-shadow: none; }
.batch-amount-field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.batch-amount-field input { max-width: 240px; }
.batch-action-card .hint, .batch-scroll > .hint { font-size: 13px; line-height: 1.6; }
.batch-example { padding-top: 8px; border-top: 1px solid var(--line-200); font-size: var(--text-sm); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.batch-field-error { color: #873b17; font-weight: 500; overflow-wrap: anywhere; }
.product-batch [aria-invalid="true"] { border-color: #873b17; }
.batch-scope { display: grid; gap: 4px; }
.batch-scope > button { justify-self: start; text-align: left; }
.batch-scope .batch-summary { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 0; border: 0; border-radius: 0; font-size: 14px; }
.batch-scope .batch-summary > span { color: var(--ink-600); font-size: 12px; font-weight: 400; }
.batch-preview-label { font-weight: 600; color: var(--ink-500); }
.batch-filters { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; }
.batch-filters label { display: grid; align-content: start; gap: 6px; font-size: 13px; font-weight: 600; min-width: 0; }
.batch-filters :is(input, select), .batch-amount-field input { border-radius: 10px; background-color: var(--paper-100); border-color: transparent; }
.batch-filters [hidden], .batch-error[hidden] { display: none; }
.batch-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.batch-toolbar label, .batch-category-head { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.batch-list { min-width: 0; border: 1px solid var(--line-200); border-radius: 12px; }
.batch-list > .hint { padding: 20px 16px; }
.batch-category:first-child .batch-category-head { border-radius: 12px 12px 0 0; }
.batch-category:last-child .batch-product:last-child { border-radius: 0 0 12px 12px; }
.batch-category-head { padding: 8px 14px; background: var(--paper-100); font-size: 13px; }
.batch-category-head span { display: grid; place-items: center; min-width: 24px; height: 24px; margin-left: auto; border-radius: 6px; background: var(--paper-50); color: var(--ink-600); font-size: 12px; font-variant-numeric: tabular-nums; }
.batch-product { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 14px; cursor: pointer; border-top: 1px solid var(--line-200); }
.batch-product:has(input:checked) { background: var(--brand-50, #fff4ee); }
.batch-product-name { display: grid; flex: 1; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.batch-product-name small, .batch-preview small { display: block; color: var(--ink-500); font-weight: 400; }
.batch-stock { display: grid; gap: 2px; text-align: right; font-size: var(--text-sm); flex: 0 0 auto; }
.batch-stock b { color: var(--ink-900); font-size: 16px; }
.batch-stock, .batch-product-name small { color: var(--ink-600); font-size: 12px; }
.batch-product-name strong { font-size: 14px; }
.batch-summary { padding: 16px; border: 1px solid var(--line-200); border-radius: 12px; font-weight: 600; overflow-wrap: anywhere; }
.batch-preview { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line-200); border-radius: var(--radius); }
.batch-preview li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px; border-bottom: 1px solid var(--line-200); overflow-wrap: anywhere; }
.batch-preview li:last-child { border-bottom: 0; }
.batch-preview li > span { min-width: 0; }
.batch-preview li > strong { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.batch-error, .batch-recovery { padding: 12px; border-radius: var(--radius); background: #fff0e7; color: #873b17; overflow-wrap: anywhere; }
.batch-error ul { padding-left: 20px; margin-bottom: 0; }
.batch-error a { display: block; width: fit-content; min-height: 44px; padding-top: 8px; text-decoration: underline; color: inherit; }
.product-batch > .dialog-foot { position: static; flex: none; display: grid; gap: 12px; margin: 0; padding: 16px 24px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-200); background: var(--paper-50); }
.product-batch .form-actions { align-items: stretch; gap: 12px; }
.product-batch .form-actions > .button { min-width: 132px; border-radius: 10px; font-size: 14px; }
.product-batch .button:disabled { background: var(--paper-100); color: var(--ink-600); border-color: var(--line-200); opacity: 1; }
.product-batch button { min-height: 44px; white-space: normal; }
.product-batch input:not([type="checkbox"], [type="radio"]), .product-batch select { min-height: 44px; font-size: 16px; }
.batch-product, .batch-category-head, .batch-toolbar label { touch-action: manipulation; }
@media (hover: hover) { .batch-operation-choice:hover:not(:has(input:checked)), .batch-product:hover:not(:has(input:checked)) { background: var(--paper-100); } }
@media (max-width: 600px) {
  .admin-app .dialog[data-key="product-batch"] { inset: var(--staff-visible-top, 0px) 0 auto; width: 100vw; height: var(--staff-visible-height, 100dvh); max-height: var(--staff-visible-height, 100dvh); border-radius: 0; }
  .dialog[data-key="product-batch"] > .dialog-head { min-height: 60px; padding: max(8px, env(safe-area-inset-top)) 12px 8px 16px; }
  .batch-scroll { padding: 16px; gap: 14px; }
  .product-batch > .batch-steps { padding: 0 16px 12px; }
  .product-batch > .dialog-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); gap: 10px; }
  .batch-operation-choice { gap: 6px; padding-inline: 6px; font-size: 13px; }
  .batch-filters { gap: 8px; }
  .batch-steps li { align-items: flex-start; gap: 6px; font-size: 12px; }
  .batch-preview li { flex-wrap: wrap; gap: 6px 12px; }
  .product-batch .form-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product-batch .form-actions > button { min-width: 0; width: 100%; }
  .product-batch .form-actions > button:only-child { grid-column: 1 / -1; }
}
