/* WorkLine 1.11.13 — Глобальный поиск поверх всего, Склад (быстрый вес, тёмная тема сегментов, вес бутылок, Посуда) */

/* ================================================================
   8) Глобальный поиск: поверх всего контента (портал в document.body)
   ================================================================ */
body > #global-search-results.global-search-results {
  position: fixed !important;
  left: 12px;
  right: auto;
  top: 64px;
  width: min(calc(100vw - 24px), 820px);
  z-index: 8950 !important;
  background: rgb(var(--card-rgb, 255, 255, 255)) !important;
  border: 1px solid var(--wl-line-strong, var(--border)) !important;
  border-radius: 16px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .24), 0 4px 12px rgba(0, 0, 0, .12) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-sizing: border-box;
}
html[data-theme="dark"] body > #global-search-results.global-search-results {
  background: rgb(var(--card-rgb, 24, 27, 34)) !important;
  border-color: rgba(255, 255, 255, .16) !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, .62), 0 4px 14px rgba(0, 0, 0, .35) !important;
}

/* ================================================================
   9.2) Вкладки «Инвентаризация» и «Посуда» на тёмной (и светлой) теме
   ================================================================ */
#app-root .inv-seg {
  position: relative;
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 12px;
  border-radius: 16px;
}
#app-root .inv-seg button {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14.5px;
  letter-spacing: -.01em;
}
html[data-theme="dark"] #app-root .inv-seg {
  background: rgba(255, 255, 255, .07) !important;
  border: 1.5px solid rgba(255, 255, 255, .18) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .28);
}
html[data-theme="dark"] #app-root .inv-seg button {
  color: rgba(255, 255, 255, .76) !important;
  opacity: 1 !important;
}
html[data-theme="dark"] #app-root .inv-seg button:not(.on):not(.seg-hot):hover {
  color: rgba(255, 255, 255, .94) !important;
}
html[data-theme="dark"] #app-root .inv-seg.has-seg-ind .wl-seg-ind,
html[data-theme="dark"] #app-root .inv-seg:not(.has-seg-ind) button.on {
  background: var(--primary) !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .42) !important;
}
html[data-theme="dark"] #app-root .inv-seg button.on,
html[data-theme="dark"] #app-root .inv-seg.has-seg-ind button.on,
html[data-theme="dark"] #app-root .inv-seg.has-seg-ind button.seg-hot {
  color: var(--on-primary, #111318) !important;
  opacity: 1 !important;
}
html[data-theme="dark"] #app-root .inv-seg.has-seg-ind button.on.seg-cold {
  color: rgba(255, 255, 255, .76) !important;
  opacity: 1 !important;
}

/* ================================================================
   9.1) Быстрый ввод веса бутылки прямо в карточке инвентаризации
   ================================================================ */
#inv-list .inv-fact-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}
#inv-list .inv-fact-footer > .inv-fact-add {
  flex: 0 0 auto;
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
  gap: 5px;
  white-space: nowrap;
}
.inv-qw-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  width: 118px;
  height: 36px;
  border-radius: 12px;
  border: 1.5px solid rgba(var(--primary-rgb), .38);
  background: var(--bg);
  overflow: hidden;
  box-sizing: border-box;
  transition: border-color .15s ease, opacity .15s ease;
}
.inv-qw-group:focus-within {
  border-color: var(--primary);
}
.inv-qw-group.is-disabled {
  border-color: var(--border);
  opacity: .62;
  background: rgba(128, 128, 128, .08);
}
.inv-qw-in {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 0 4px 0 8px;
  box-sizing: border-box;
  outline: none;
  -moz-appearance: textfield;
}
.inv-qw-in::-webkit-outer-spin-button,
.inv-qw-in::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.inv-qw-in::placeholder {
  color: var(--text);
  opacity: .56;
  font-weight: 600;
  font-size: 11.5px;
}
.inv-qw-in:disabled {
  cursor: not-allowed;
}
.inv-qw-ok {
  flex: 0 0 34px;
  width: 34px;
  height: 100%;
  border: 0;
  border-left: 1px solid rgba(var(--primary-rgb), .24);
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 15px;
  font-weight: 800;
  transition: opacity .15s ease, transform .1s ease;
}
html[data-theme="dark"] .inv-qw-ok {
  color: var(--on-primary, #111318);
}
.inv-qw-ok:active:not(:disabled) {
  transform: scale(.94);
}
.inv-qw-ok:disabled {
  background: rgba(128, 128, 128, .12);
  color: var(--text);
  opacity: .55;
  border-left-color: var(--border);
  cursor: not-allowed;
}
.inv-qw-sub {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 0;
}
.inv-qw-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 1px 0;
}
.inv-qw-chips::-webkit-scrollbar {
  display: none;
}
.inv-qw-chip {
  flex: 0 0 auto;
  height: 27px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.inv-qw-chip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
html[data-theme="dark"] .inv-qw-chip.on {
  color: var(--on-primary, #111318);
}
.inv-qw-preview {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(var(--primary-rgb), .12);
}
.inv-qw-preview[hidden] {
  display: none;
}

/* ================================================================
   9.3) «Вес бутылок»: блокировка прокрутки фона + живой поиск-подсказка
   ================================================================ */
.inv-w-bg {
  overscroll-behavior: contain;
  touch-action: none;
}
.inv-w-bg .sch-sheet {
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.inv-bw .inv-bw-list {
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.inv-bw .inv-bw-add {
  position: relative;
}
.inv-bw-add-wrap {
  position: static;
  flex: 1 1 0;
  min-width: 0;
}
.inv-bw-add-wrap .sch-in {
  width: 100%;
  box-sizing: border-box;
}
.inv-bw-suggest {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 40;
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: rgb(var(--card-rgb, 255, 255, 255));
  border: 1.5px solid rgba(var(--primary-rgb), .42);
  border-radius: 14px;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, .24);
  padding: 4px;
}
.inv-bw-suggest[hidden] {
  display: none !important;
}
html[data-theme="dark"] .inv-bw-suggest {
  background: rgb(var(--card-rgb, 28, 32, 40));
  border-color: rgba(255, 255, 255, .2);
  box-shadow: 0 -10px 32px rgba(0, 0, 0, .6);
}
.inv-bw-sopt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.inv-bw-sopt:hover,
.inv-bw-sopt:active {
  background: rgba(var(--primary-rgb), .13);
}
.inv-bw-sopt-n {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inv-bw-sopt-c {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  opacity: .58;
  max-width: 34%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inv-bw-sempty {
  padding: 10px 12px;
  font-size: 13px;
  opacity: .62;
  text-align: center;
}

/* ================================================================
   9.5) Модальное окно «Список заказа» (Посуда) — профи-дизайн и центр
   ================================================================ */
#ware-order-overlay .overlay-box.ware-order-box {
  max-width: 440px;
  width: min(calc(100vw - 24px), 440px);
  padding: 0 !important;
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(86vh, 680px);
  max-height: min(86dvh, 680px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .34);
}
#ware-order-overlay .overlay-header.ware-order-hdr {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 13px 14px 12px 16px !important;
  margin: 0 !important;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
#ware-order-overlay .ware-order-title-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}
#ware-order-overlay .wo-hdr-ico {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(var(--primary-rgb), .12);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#ware-order-overlay .overlay-header.ware-order-hdr h3 {
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  flex: 0 1 auto !important;
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.2;
}
#ware-order-overlay .wo-hdr-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(var(--primary-rgb), .14);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}
#ware-order-overlay .wo-hdr-cnt[hidden] {
  display: none;
}
#ware-order-overlay .overlay-header.ware-order-hdr .overlay-x {
  flex: 0 0 32px !important;
  width: 32px !important;
  height: 32px !important;
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
  top: auto !important;
  right: auto !important;
  align-self: center !important;
  transform: none !important;
  border-radius: 10px;
  border: 1px solid var(--border) !important;
  background: var(--bg) !important;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#ware-order-overlay .overlay-body.ware-order-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  padding: 12px 14px 14px !important;
  gap: 10px;
}
#ware-order-overlay .ware-order-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 1px;
}
/* Сброс старого распорного хака ::before и margin:auto из wl-1988.css */
#ware-order-overlay .ware-orow::before {
  display: none !important;
  content: none !important;
}
#ware-order-overlay .ware-orow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 11px 12px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg);
  box-sizing: border-box;
}
#ware-order-overlay .ware-orow.is-auto {
  border-color: rgba(217, 119, 6, .35);
}
#ware-order-overlay .ware-orow:last-child {
  border-bottom: 1px solid var(--border);
}
#ware-order-overlay .ware-orow.is-auto:last-child {
  border-bottom-color: rgba(217, 119, 6, .35);
}
#ware-order-overlay .ware-orow-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
#ware-order-overlay .ware-orow .ware-main {
  order: 0;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#ware-order-overlay .ware-orow .ware-name {
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
#ware-order-overlay .ware-orow .ware-main small {
  font-size: 12px;
  opacity: .66;
  line-height: 1.3;
}
#ware-order-overlay .ware-orow-rm {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin: -2px -2px 0 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  opacity: .52;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: opacity .14s ease, color .14s ease, background .14s ease;
}
#ware-order-overlay .ware-orow-rm:hover,
#ware-order-overlay .ware-orow-rm:active {
  opacity: 1;
  color: #ef4444;
  background: rgba(239, 68, 68, .12);
}
#ware-order-overlay .ware-orow-auto {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 7px;
  color: #d97706;
  background: rgba(217, 119, 6, .14);
}
/* Переключатели [ − | число + ед. | + ] — строго по центру карточки */
#ware-order-overlay .ware-orow-ctrl {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
#ware-order-overlay .ware-stepper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
#ware-order-overlay .ware-stepper .ware-step {
  width: 42px;
  height: 100%;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background .12s ease;
}
#ware-order-overlay .ware-stepper .ware-step:active:not(:disabled) {
  background: rgba(var(--primary-rgb), .14) !important;
  transform: none;
}
#ware-order-overlay .ware-stepper-mid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
  padding: 0 10px 0 6px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  min-width: 86px;
  box-sizing: border-box;
}
#ware-order-overlay .ware-stepper .ware-qty-in {
  width: 40px;
  height: 100%;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--text);
  font-size: 15.5px;
  font-weight: 800;
  text-align: center;
  padding: 0;
  outline: none;
}
#ware-order-overlay .ware-stepper .ware-ounit {
  order: 0;
  margin: 0 !important;
  min-width: auto;
  font-size: 13px;
  font-weight: 700;
  opacity: .68;
  user-select: none;
}
/* Нижняя панель: итог + «Снять отметки» в одной строке и 2 ровные кнопки действий */
#ware-order-overlay .ware-order-foot {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
#ware-order-overlay .ware-order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  padding: 0 2px;
}
#ware-order-overlay .ware-order-summary[hidden] {
  display: none !important;
}
#ware-order-overlay #ware-order-sum-txt {
  opacity: .78;
}
#ware-order-overlay .wo-clear-link {
  border: 0;
  background: transparent;
  color: #ef4444;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 8px;
  margin: -4px -6px -4px 0;
  border-radius: 8px;
  cursor: pointer;
}
#ware-order-overlay .wo-clear-link[hidden] {
  display: none !important;
}
#ware-order-overlay .wo-clear-link:active {
  background: rgba(239, 68, 68, .12);
}
#ware-order-overlay .overlay-actions.ware-order-actions {
  flex: 0 0 auto;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
#ware-order-overlay .overlay-actions.ware-order-actions .btn-main {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  min-height: 43px;
  padding: 0 12px !important;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
}
#ware-order-overlay .overlay-actions.ware-order-actions .btn-main[hidden] {
  display: none !important;
}
#ware-order-overlay .overlay-actions.ware-order-actions:has(#wo-share[hidden]) #wo-copy {
  grid-column: 1 / -1;
}
