:root {
  --bg: #efe6d6;
  --surface: #fbf7ef;
  --surface-2: #f4ecdd;
  --btn: #e9dcc6;
  --btn-hover: #e0cfb3;
  --line: #cfbea3;
  --line-soft: #e8dfcf;
  --brown-900: #33231a;
  --brown-700: #4e3526;
  --brown-500: #7a5638;
  --accent: #a4733f;
  --accent-soft: #ecd5ae;
  --text: #33231a;
  --muted: #6e5a48;
  --danger: #a32a1e;
  --ok: #2f6b3e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.35 "Segoe UI", Tahoma, Arial, sans-serif; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; color: inherit; }
#app { height: 100%; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.danger { color: var(--danger); }
.ok { color: var(--ok); }
.icon { display: block; line-height: 0; }

/* Вхід і відкриття зміни */
.center-screen { height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; }
.panel { width: 400px; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; box-shadow: 0 6px 22px rgba(51, 35, 26, .16); }
.panel h1, .modal h2 { margin: 0; padding: 10px 14px; font-size: 15px; font-weight: 600; color: #fbf7ef; background: var(--brown-700); }
.panel-body { padding: 14px; display: grid; gap: 11px; }
label.field { display: grid; gap: 3px; font-size: 13px; color: var(--brown-700); }
.field input, .field select { width: 100%; height: 34px; padding: 4px 8px; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.field input:focus, .field select:focus, .quick-filter:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.hint { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 4px; padding: 7px 9px; }
.error-text { min-height: 18px; color: var(--danger); font-size: 13px; }
.btn { height: 34px; padding: 0 14px; background: var(--btn); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.btn:hover { background: var(--btn-hover); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn.primary { background: var(--brown-700); border-color: var(--brown-900); color: #fbf7ef; }
.btn.primary:hover { background: var(--brown-900); }
.btn[disabled] { opacity: .5; cursor: default; }
.row-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* Робоче місце: кнопки зліва, чек у центрі, товарні кнопки й фото справа */
.pos {
  height: 100%; display: grid; gap: 4px; padding: 4px 4px 0; background: var(--bg);
  grid-template-columns: var(--left-w, 128px) minmax(0, 1fr) var(--right-w, 240px);
  grid-template-rows: minmax(0, 1fr) auto;
  position: relative;
}
.side-actions { min-height: 0; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.action {
  flex: 1 1 0; min-height: 44px; max-height: var(--action-h, 96px); padding: 3px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--btn); border: 1px solid var(--line); border-radius: 5px; cursor: pointer; font-size: 12px; line-height: 1.15; color: var(--brown-900);
}
.action:hover { background: var(--btn-hover); }
.action:active { background: var(--accent-soft); }
.action-key { color: var(--muted); font-size: 11.5px; }
.center { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 4px; }
.head { display: flex; gap: 10px; align-items: flex-start; padding: 6px 8px; min-height: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
.tool-btn { flex: none; padding: 5px 7px; background: var(--btn); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; color: var(--brown-700); }
.tool-btn:hover { background: var(--btn-hover); }
.head-info { flex: 1; min-width: 0; font-size: 13px; }
.head-notes { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 3px; color: var(--brown-700); font-weight: 600; }
.message { padding: 4px 8px; font-weight: 600; border: 1px solid; border-radius: 4px; overflow-wrap: anywhere; }
.message.error { background: #f9e4df; border-color: #dfa79d; color: #84201a; }
.message.info { background: var(--surface-2); border-color: var(--line); color: var(--brown-700); }
.last-name { font-weight: 600; overflow-wrap: anywhere; }
.head-right { flex: none; width: min(46%, 300px); display: grid; justify-items: end; }
.client-row { width: 100%; display: flex; align-items: center; gap: 6px; font-size: 12px; }
.client-field { flex: 1; min-width: 0; height: 21px; padding: 0 5px; text-align: left; font-size: 12px; background: #fff; border: 1px solid var(--line); border-radius: 3px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.total-amount { font-size: 44px; font-weight: 700; line-height: 1.05; color: var(--brown-900); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qty-row { display: flex; gap: 20px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Права панель */
.quick { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 4px; }
.tabs { display: flex; flex-wrap: wrap; gap: 3px; max-height: 134px; overflow-y: auto; }
.tab { padding: 3px 8px; font-size: 12px; background: var(--btn); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.tab:hover { background: var(--btn-hover); }
.tab.active { background: var(--brown-700); border-color: var(--brown-900); color: #fbf7ef; }
.quick-filter { width: 100%; height: 28px; padding: 2px 8px; font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.tiles { display: grid; grid-template-columns: repeat(var(--tile-cols, 2), minmax(0, 1fr)); gap: 3px; align-content: start; overflow-y: auto; min-height: 0; }
.tile {
  min-height: var(--tile-h, 58px); padding: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 5px; cursor: pointer; font-size: var(--tile-font, 12px); line-height: 1.15; overflow-wrap: anywhere;
}
.tile:hover { background: var(--accent-soft); }
.tile-price { color: var(--brown-500); font-weight: 600; font-variant-numeric: tabular-nums; }
.tile-add { background: transparent; border-style: dashed; color: var(--brown-500); }
.tiles-empty { grid-column: 1 / -1; padding: 16px 6px; text-align: center; color: var(--muted); font-size: 13px; }
.photo-box { position: relative; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
.photo-frame { position: relative; height: var(--photo-h, 138px); display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.photo-img { width: 100%; height: 100%; object-fit: contain; }
.photo-empty { color: var(--muted); font-size: 12px; }
.photo-btn { position: absolute; right: 4px; bottom: 4px; padding: 1px 7px; font-size: 11px; background: var(--brown-700); color: #fbf7ef; border: 0; border-radius: 3px; cursor: pointer; }
.photo-name { min-height: 18px; margin-top: 4px; font-size: 12.5px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.photo-price { min-height: 18px; font-size: 13px; color: var(--brown-500); font-weight: 600; font-variant-numeric: tabular-nums; }

.statusbar { grid-column: 1 / -1; margin: 0 -4px; display: flex; flex-wrap: wrap; font-size: 12px; background: var(--brown-900); color: #e9dcc6; }
.status-cell { padding: 3px 10px; border-right: 1px solid var(--brown-500); white-space: nowrap; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; background: #7fc48f; }
.status-dot.down { background: #ec6a5d; }

/* Таблиці */
.table-wrap { min-height: 0; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { position: sticky; top: 0; z-index: 1; padding: 5px 8px; text-align: left; font-weight: 600; font-size: 13px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
table.grid th.num { text-align: right; }
table.grid td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover { background: var(--surface-2); }
table.grid tbody tr.selected, table.grid tbody tr.selected .muted, table.grid tbody tr.selected .danger { background: var(--brown-700); color: #fbf7ef; }
.empty-state { padding: 34px 16px; text-align: center; color: var(--muted); }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 10px 12px; }
.box-title { font-size: 12px; color: var(--muted); margin-bottom: 3px; }

.receipt-grid { table-layout: fixed; min-width: 0; }
.receipt-grid th { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.receipt-grid td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-grid .col-no { width: 38px; }
.receipt-grid .col-photo { width: 44px; }
.receipt-grid .col-stock { width: 74px; }
.receipt-grid .col-code { width: 72px; }
.receipt-grid .col-barcode { width: 118px; }
.receipt-grid .col-qty { width: 76px; }
.receipt-grid .col-unit { width: 70px; }
.receipt-grid .col-price { width: 84px; }
.receipt-grid .col-disc { width: 72px; }
.receipt-grid .col-sum { width: 94px; }
.receipt-grid .line-name { font-size: 16px; font-weight: 500; white-space: normal; }
.receipt-grid .sum { font-size: 17px; font-weight: 500; }
.receipt-grid th.num { text-align: right; }
.receipt-grid .editable { cursor: text; }
.receipt-grid .editable:hover { background: var(--accent-soft); }
.receipt-grid td.manual { color: var(--brown-700); font-weight: 700; }
.receipt-grid .cell-edit { width: 100%; box-sizing: border-box; padding: 3px 5px; font: inherit; text-align: right; background: #fff; border: 2px solid var(--brown-700); border-radius: 3px; }
.receipt-grid .c-stock { font-size: 14px; color: var(--muted); }
.receipt-grid .c-stock.own { color: var(--brown-900); font-weight: 600; background: rgba(122, 79, 43, .07); }
.receipt-grid .c-stock.zero { color: var(--danger); }
.thumb { display: block; width: 34px; height: 34px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); background: var(--surface-2); }
.thumb.empty { opacity: .45; }
.tile-photo { width: 100%; height: 54px; object-fit: contain; border-radius: 3px; background: var(--surface-2); }
/* Права панель: один компактний список товарів без штрихкоду */
.quick { grid-template-rows: auto minmax(0, 1fr); }
.quick-controls { display: flex; flex-direction: column; gap: 4px; }
.quick-selects { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; }
.quick-select { min-width: 0; height: 28px; padding: 2px 4px; font-size: 12.5px; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.plist { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; padding-right: 2px; }
.prow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; min-height: var(--tile-h, 48px); padding: 3px 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; cursor: pointer; text-align: left; font: inherit; font-size: var(--tile-font, 12px); color: inherit; }
.prow:hover { background: var(--accent-soft); }
.prow-main { display: flex; flex-direction: column; min-width: 0; }
.prow-name { font-weight: 600; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prow-sub { color: var(--muted); font-size: 0.92em; font-variant-numeric: tabular-nums; }
.prow-stock { min-width: 28px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brown-700); }
.check-menu-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 9px; }
.check-menu-btn .ic svg { width: 26px; height: 26px; }
.tool-btn-label { font-size: 11px; font-weight: 700; }
.menu-rows { display: flex; flex-direction: column; gap: 4px; min-width: 340px; }
.menu-row { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; cursor: pointer; font: inherit; text-align: left; }
.menu-row:hover, .menu-row:focus { background: var(--accent-soft); outline: none; }
.menu-row-title { font-weight: 600; }
.menu-row-hint { font-size: 12.5px; color: var(--muted); }
.comment-input { width: 100%; box-sizing: border-box; padding: 6px 8px; font: inherit; border: 1px solid var(--line); border-radius: 4px; resize: vertical; }
.input-row:hover { background: none !important; }
.input-row td { height: 32px; }
.input-cell { padding: 0 !important; background: var(--brown-500); }
#scan-input { display: block; width: 100%; height: 32px; padding: 2px 8px; font-size: 16px; color: #fff; caret-color: #fff; background: transparent; border: 0; outline: 0; }

/* Випадний список і підсумок продажу */
.suggest { position: fixed; z-index: 15; overflow-y: auto; background: var(--surface); border: 1px solid var(--brown-500); border-radius: 4px; box-shadow: 0 6px 18px rgba(51, 35, 26, .3); }
.suggest-row { display: grid; grid-template-columns: 62px 112px minmax(0, 1fr) 64px 84px; gap: 8px; padding: 5px 8px; cursor: pointer; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.suggest-row:hover { background: var(--surface-2); }
.suggest-head { position: sticky; top: 0; cursor: default; font-size: 12px; font-weight: 600; background: var(--surface-2) !important; }
.suggest-row.selected, .suggest-row.selected .danger { background: var(--brown-700); color: #fbf7ef; }
.suggest-name { overflow-wrap: anywhere; }
/* Лупа поверх поля товару справа: ширина таблиці від неї не змінюється. */
.scan-box { position: relative; min-width: 0; }
.scan-box #scan-input { padding-right: 34px; }
.scan-lens { position: absolute; top: 50%; right: 2px; transform: translateY(-50%); width: 30px; height: 26px; padding: 0; font-size: 14px; line-height: 1; background: var(--btn); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.scan-lens:hover { background: var(--yellow-soft, #fbe9a8); }
.search-wrap { max-height: 60vh; overflow-y: auto; }
.suggest-more { padding: 6px 10px; font-size: 12px; color: var(--muted); text-align: center; background: var(--surface-2); }
.sale-notice { padding: 3px 8px; background: #e6efdc; border: 1px solid #b4cba0; border-radius: 4px; color: #2b4a23; }
.sale-change { font-size: 24px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }

/* Налаштування вигляду */
.pos.no-left .side-actions { display: none; }
.pos.no-right .quick { display: none; }
.pos.no-left { grid-template-columns: minmax(0, 1fr) var(--right-w, 240px); }
.pos.no-right { grid-template-columns: var(--left-w, 128px) minmax(0, 1fr); }
.pos.no-left .split-left, .pos.no-right .split-right { display: none; }
/* Розсувні межі блоків каси: тягнути мишею */
.splitter { position: absolute; top: 4px; bottom: 4px; width: 8px; z-index: 5; cursor: col-resize; touch-action: none; border-radius: 4px; }
.splitter:hover, .splitter.dragging { background: rgba(122, 79, 43, .28); }
.split-left { left: calc(4px + var(--left-w, 128px) - 4px); }
.split-right { right: calc(4px + var(--right-w, 240px) - 4px); }
.splitter-h { position: absolute; left: 0; right: 0; top: -5px; height: 9px; cursor: row-resize; z-index: 5; touch-action: none; border-radius: 4px; }
.splitter-h:hover, .splitter-h.dragging { background: rgba(122, 79, 43, .28); }
.range-field { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
.range-field input[type=range] { grid-column: 1 / -1; accent-color: var(--brown-700); }
.pos.no-left.no-right { grid-template-columns: minmax(0, 1fr); }
.receipt-grid .cell-price.manual { color: var(--brown-700); font-weight: 700; }
.pos.hide-code .c-code, .pos.hide-barcode .c-barcode, .pos.hide-unit .c-unit, .pos.hide-disc .c-disc,
.pos.hide-stocks .c-stock, .pos.hide-photo .c-photo { display: none; }
.pos[data-rows="compact"] .receipt-grid td { padding-top: 1px; padding-bottom: 1px; font-size: 13px; }
.pos[data-rows="compact"] .receipt-grid .line-name { font-size: 13px; }
.pos[data-rows="compact"] .receipt-grid .sum { font-size: 13px; }
.pos[data-rows="large"] .receipt-grid td { padding-top: 11px; padding-bottom: 11px; font-size: 16px; }
.pos[data-rows="large"] .receipt-grid .line-name { font-size: 21px; }
.pos[data-rows="large"] .receipt-grid .sum { font-size: 22px; }
.check { display: flex; align-items: center; gap: 7px; padding: 2px 0; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--brown-700); }
.check-group { display: grid; gap: 1px; }
.service-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.service-btn { height: 46px; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.small-btn { height: 26px; min-width: 28px; padding: 0 6px; margin-left: 3px; }
.editor-list { max-height: 30vh !important; }
.editor-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.editor-form { display: grid; gap: 8px; align-content: start; }

.topbar { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; padding: 6px 12px; background: var(--brown-900); color: #fbf7ef; font-size: 13px; }
.topbar b { font-weight: 600; }
.topbar .spacer { flex: 1; }
.link-btn { background: none; border: 1px solid var(--brown-500); color: #fbf7ef; padding: 1px 9px; border-radius: 3px; cursor: pointer; text-decoration: none; font-size: 13px; }
.link-btn:hover { background: var(--brown-700); }

/* Діалоги */
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(51, 35, 26, .45); }
.modal { width: 460px; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--brown-500); border-radius: 6px; overflow: hidden; box-shadow: 0 10px 30px rgba(33, 22, 15, .4); }
.modal.wide { width: 860px; }
.modal-body { padding: 14px; display: grid; gap: 11px; overflow: auto; min-height: 0; }
.modal .table-wrap { max-height: 48vh; }
.summary-list { display: grid; grid-template-columns: 1fr auto; gap: 3px 16px; margin: 0; font-variant-numeric: tabular-nums; }
.summary-list dt { color: var(--brown-700); }
.summary-list dd { margin: 0; text-align: right; font-weight: 600; }
.due { font-size: 30px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.change { font-size: 24px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; color: var(--ok); }
.qty-input { width: 92px; height: 28px; padding: 2px 6px; text-align: right; border: 1px solid var(--line); border-radius: 3px; }
.code-btn { padding: 3px 7px; background: var(--btn); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; font-variant-numeric: tabular-nums; white-space: nowrap; }
.code-btn:hover { background: var(--btn-hover); }
.key-help { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; }
.key-help dt { font-weight: 600; color: var(--brown-700); white-space: nowrap; }
.key-help dd { margin: 0; }
.receipt-paper { width: 300px; max-width: 100%; justify-self: center; padding: 12px; background: #fffef8; border: 1px dashed var(--line); font: 12.5px/1.35 Consolas, "Courier New", monospace; }
.receipt-paper .center { text-align: center; }
.receipt-paper .line { display: flex; justify-content: space-between; gap: 8px; }
.receipt-paper hr { border: 0; border-top: 1px dashed #666; margin: 6px 0; }
.receipt-paper .big { font-size: 16px; font-weight: 700; }

#toast { position: fixed; left: 50%; bottom: 40px; z-index: 40; transform: translateX(-50%); padding: 8px 16px; background: var(--brown-900); color: #fbf7ef; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .15s; }
#toast.visible { opacity: 1; }
#print-area { display: none; }

/* Огляд мережі */
.network { min-height: 100%; }
.network-main { max-width: 1180px; margin: 0 auto; padding: 12px; display: grid; gap: 12px; }
.network-main h2 { margin: 0 0 8px; font-size: 15px; }
.price-input { width: 86px; height: 27px; padding: 2px 5px; text-align: right; border: 1px solid var(--line); border-radius: 3px; }
.table-scroll { overflow-x: auto; }

/* Бек-офіс */
.office { min-height: 100%; }
.office-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.office-nav .tab { background: transparent; color: #e9dcc6; border-color: var(--brown-500); }
.office-nav .tab:hover { background: var(--brown-700); }
.office-nav .tab.active { background: var(--bg); color: var(--brown-900); border-color: var(--bg); }
.office-main { max-width: 1500px; margin: 0 auto; padding: 12px; display: grid; gap: 10px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.office-main h2 { margin: 0; font-size: 18px; }
.office-main h3 { margin: 6px 0 0; font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
.filters .field { min-width: 150px; flex: 0 1 220px; }
.summary-bar { padding: 4px 2px; font-weight: 600; color: var(--brown-700); }
.office-grid td { padding: 4px 8px; font-size: 13px; }
.office-grid tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pager { align-items: center; margin-top: 8px; }
.doc-head { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 18px; margin: 0; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
.doc-head dt { font-size: 12px; color: var(--muted); }
.doc-head dd { margin: 0 0 4px; font-weight: 600; overflow-wrap: anywhere; }
.doc-actions { margin-top: 4px; }
.add-line { max-width: 720px; }
.picker { position: relative; }
.picker input { width: 100%; }
.picker-list { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--brown-500); border-radius: 4px; box-shadow: 0 6px 18px rgba(51, 35, 26, .3); }
.picker-row { display: flex; gap: 10px; justify-content: space-between; padding: 5px 8px; cursor: pointer; font-size: 13px; color: var(--text); }
.picker-row > .pk-name { flex: 1; min-width: 0; text-align: left; }
.picker-row > .num { flex: 0 0 62px; }
.picker-row:hover { background: var(--surface-2); }
.picker-row.selected, .picker-row.selected .muted { background: var(--brown-700); color: #fbf7ef; }

/* Меню бек-офісу */
.menu-bar { position: sticky; top: 0; z-index: 12; display: flex; align-items: center; gap: 2px; padding: 3px 10px; background: var(--brown-900); color: #fbf7ef; font-size: 13px; }
.menu-bar .spacer { flex: 1; }
/* Верхня панель значків */
.quick-bar { position: sticky; top: 33px; z-index: 11; display: flex; align-items: stretch; gap: 2px; padding: 4px 10px; overflow-x: auto; background: var(--brown-700); border-bottom: 1px solid var(--brown-900); }
.quick-btn { flex: none; min-width: 66px; max-width: 96px; padding: 4px 5px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; background: none; border: 1px solid transparent; border-radius: 5px; color: #fbf7ef; font-size: 11px; line-height: 1.1; text-align: center; text-decoration: none; cursor: pointer; }
.quick-btn:hover { background: rgba(251, 247, 239, .14); }
.quick-btn.active { background: #fbf7ef; border-color: var(--accent); color: var(--brown-900); }
.quick-btn .ic svg { width: 24px; height: 24px; }
.quick-sep { flex: none; width: 1px; margin: 4px 6px; background: rgba(251, 247, 239, .3); }
@media (max-width: 760px) { .quick-btn { min-width: 58px; } }
.menu-title { margin-right: 14px; }
.menu-user { margin-right: 10px; color: #e9dcc6; }
.menu-group { position: relative; }
.menu-btn { padding: 4px 10px; background: none; border: 0; border-radius: 3px; color: #fbf7ef; cursor: pointer; }
.menu-btn:hover { background: var(--brown-700); }
.menu-list { position: absolute; top: 100%; left: 0; min-width: 240px; padding: 4px 0; background: var(--surface); border: 1px solid var(--brown-500); border-radius: 4px; box-shadow: 0 6px 18px rgba(51, 35, 26, .3); }
.menu-item { display: block; width: 100%; padding: 5px 14px; background: none; border: 0; color: var(--text); text-align: left; text-decoration: none; cursor: pointer; font-size: 13px; }
.menu-item:hover { background: var(--accent-soft); }
.menu-sep { margin: 4px 0; border-top: 1px solid var(--line-soft); }

/* Панель кнопок і журнал */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 6px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
.toolbar select, .toolbar input { height: 30px; padding: 2px 6px; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.btn.tool { height: 30px; padding: 0 9px; font-size: 13px; }
.tool-key { color: var(--muted); font-size: 11.5px; }
.tool-sep { width: 1px; height: 22px; margin: 0 3px; background: var(--line); }
.tool-grow { flex: 1 1 180px; min-width: 150px; display: flex; }
.tool-grow input { flex: 1; min-width: 0; }
.inline-field { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.archive-note { padding: 0 8px; font-size: 13px; }
.journal-wrap { max-height: calc(100vh - 190px); }
.office-grid tbody tr.selected .status-posted, .office-grid tbody tr.selected .status-draft, .office-grid tbody tr.selected .status-cancelled, .office-grid tbody tr.selected .status-unposted { color: #fbf7ef; }
.status-posted { color: var(--ok); }
.status-draft { color: var(--brown-500); font-weight: 600; }
.status-cancelled, .status-unposted { color: var(--danger); }
.doc-status { padding: 2px 10px; border: 1px solid currentColor; border-radius: 12px; font-size: 13px; }

/* Форма документа */
.doc-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
.doc-form .field { flex: 0 1 210px; min-width: 150px; }
.doc-form .field.grow { flex: 1 1 240px; }
.doc-form input[disabled], .doc-form select[disabled] { background: var(--surface-2); color: var(--text); }
.picked { min-height: 18px; font-size: 12.5px; font-weight: 600; color: var(--brown-700); }
.doc-add { display: flex; gap: 8px; align-items: flex-start; position: sticky; top: 28px; z-index: 6; }
.doc-add .field.grow { flex: 1; max-width: 760px; }
.doc-lines { max-height: calc(100vh - 340px); }
.doc-lines .doc-name { min-width: 240px; }
.cell-input { width: 86px; height: 26px; padding: 1px 5px; text-align: right; background: #fff; border: 1px solid var(--line-soft); border-radius: 3px; font-variant-numeric: tabular-nums; }
.cell-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.cell-input[disabled] { background: transparent; border-color: transparent; color: var(--text); }
.cell-input.price-changed { background: #fbefd5; font-weight: 600; }
.cell-input.below-cost { background: #f9e4df; color: var(--danger); font-weight: 600; }
.ro-cell { background: var(--surface-2); }
.doc-bottom { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.doc-totals { display: grid; grid-template-columns: auto auto; gap: 1px 14px; margin: 0 0 0 auto; font-variant-numeric: tabular-nums; font-size: 13px; }
.doc-totals dt { color: var(--muted); text-align: right; }
.doc-totals dd { margin: 0; text-align: right; font-weight: 600; }
.doc-total { font-size: 18px; color: var(--brown-900); }
.pk-code { flex: 0 0 56px; }
.pk-bar { flex: 0 0 112px; }

/* Діалоги довідників */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; }
.form-grid .span-all { grid-column: 1 / -1; }
.form-grid .span-2 { grid-column: span 2; }
.check-row { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chip-x { padding: 0 3px; background: none; border: 0; color: var(--muted); cursor: pointer; }
.product-side { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.product-side .btn { margin: 0 6px 6px 0; }
.product-side .summary-list { flex: 1 1 220px; }
.product-photo { width: 120px; height: 120px; object-fit: contain; background: var(--surface-2); border-radius: 4px; }
.row-inline { display: flex; gap: 6px; }
.row-inline input { flex: 1; min-width: 0; }

/* Налаштування */
.settings-box { display: grid; gap: 10px; max-width: 460px; }
.settings-box h3 { margin: 0; }
.settings-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.settings-card { display: grid; gap: 2px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; color: var(--text); text-align: left; text-decoration: none; cursor: pointer; }
.settings-card:hover { background: var(--accent-soft); }

@media print {
  .no-print, .menu-bar, .doc-add { display: none !important; }
  .office-main { max-width: none; padding: 0; }
  .table-wrap, .doc-lines, .journal-wrap { max-height: none; overflow: visible; border: 0; }
  .cell-input { border: 0; background: none !important; font-weight: 400 !important; }
  .doc-form { border: 0; padding: 0; }
}

/* Оновлений вигляд бек-офісу: більше контрасту, чіткі таблиці, панелі зліва */
.ic { display: inline-flex; flex: none; line-height: 0; }
.ic svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic svg .f { fill: var(--accent-soft); }
.strong { font-weight: 600; }
.small-text { font-size: 13px; }

.office-main { max-width: none; }
.side-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 10px; align-items: start; }
.side-bar { position: sticky; top: 92px; max-height: calc(100vh - 104px); overflow-y: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.side-pane, .side-pane-inner { min-width: 0; display: grid; gap: 10px; align-content: start; }
.side-menu { display: grid; gap: 1px; }
.side-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 5px 8px; background: none; border: 0; border-radius: 5px; color: var(--text); font-size: 13.5px; text-align: left; text-decoration: none; cursor: pointer; }
.side-item:hover { background: var(--surface-2); }
.side-item.active { background: var(--brown-700); color: #fbf7ef; font-weight: 600; }
.side-item.active .ic svg .f { fill: var(--brown-500); }
.side-sep { margin: 5px 4px; border-top: 1px solid var(--line-soft); }
.side-title { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px 8px; font-weight: 600; }
.tree-add { width: 28px; height: 28px; background: var(--btn); border: 1px solid var(--line); border-radius: 4px; font-size: 17px; line-height: 1; cursor: pointer; }
.tree-row { display: flex; align-items: center; gap: 1px; min-height: 31px; padding-right: 4px; border-radius: 5px; }
.tree-row:hover { background: var(--surface-2); }
.tree-row.active { background: var(--brown-700); color: #fbf7ef; }
.tree-row.active .tree-count { color: #e9dcc6; }
.tree-caret { flex: none; width: 20px; height: 26px; padding: 0; background: none; border: 0; color: inherit; font-size: 12px; cursor: pointer; }
.tree-name { flex: 1; min-width: 0; padding: 4px 3px; background: none; border: 0; color: inherit; font-size: 13.5px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.tree-count { flex: none; padding: 0 3px; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tree-edit { flex: none; width: 24px; height: 24px; background: none; border: 0; color: inherit; cursor: pointer; }

.btn.tool { display: inline-flex; align-items: center; gap: 6px; height: 34px; }
.btn.tool .ic svg { width: 18px; height: 18px; }
.btn.tool.primary .ic svg .f { fill: var(--brown-500); }
.tool-key { padding: 0 4px; background: rgba(51, 35, 26, .08); border-radius: 3px; color: var(--muted); font-size: 11px; }
.btn.tool.primary .tool-key { background: rgba(255, 255, 255, .16); color: #e9dcc6; }
.toolbar select, .toolbar input { height: 34px; }

table.office-grid th { padding: 8px 10px; background: var(--brown-700); border-bottom: 0; color: #fbf7ef; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.office-grid td { padding: 8px 10px; font-size: 13.5px; }
.office-grid tbody tr:nth-child(even) { background: #fdfaf4; }
.office-grid tbody tr:nth-child(odd) { background: #fff; }
.office-grid tbody tr:hover { background: var(--accent-soft); }
.office-grid tbody tr.selected { background: var(--brown-700); }
.office-grid .col-start { border-left: 2px solid var(--line); }
.badge { display: inline-block; padding: 2px 9px; background: var(--surface-2); border-radius: 11px; font-size: 12px; font-weight: 600; }
.badge.status-posted { background: #e3efdf; color: var(--ok); }
.badge.status-draft { background: var(--accent-soft); color: var(--brown-700); }
.badge.status-cancelled, .badge.status-unposted { background: #f9e4df; color: var(--danger); }
.office-grid tbody tr.selected .badge { background: #fbf7ef; color: var(--brown-900); }
.error-text:empty { display: none; }
.office-main .doc-add { top: 92px; }
.doc-grid .doc-name { min-width: 200px; }
.doc-grid td, .doc-grid th { padding-left: 7px; padding-right: 7px; }
.doc-grid .cell-input { width: 76px; }
/* Вікно документа ближче до UniPro: підписи ліворуч, вкладка «Товари», сірі розрахункові колонки */
.uni-head { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 12px 24px; align-items: start; }
.uni-col { display: flex; flex-direction: column; gap: 6px; max-width: 760px; }
.uni-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; align-items: center; }
.uni-label { font-size: 13px; color: var(--brown-700); text-align: right; }
.uni-inline { display: flex; align-items: center; gap: 8px; }
.uni-inline input { flex: 0 1 220px; }
.uni-number { min-width: 76px; padding: 7px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; text-align: right; font-variant-numeric: tabular-nums; }
.uni-head .partner-field { display: grid; gap: 2px; }
.uni-head .picked { font-size: 12.5px; color: var(--brown-700); }
.uni-currency { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; }
.uni-currency .uni-label { text-align: left; }
.uni-currency-box { padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 4px; font-size: 16px; }
.uni-tabs { display: flex; gap: 2px; margin-top: 6px; border-bottom: 1px solid var(--line); }
.uni-tab { padding: 5px 16px; background: var(--surface-2); border: 1px solid var(--line); border-bottom: 0; border-radius: 5px 5px 0 0; font-size: 13px; }
.uni-tab.active { background: var(--surface); font-weight: 700; margin-bottom: -1px; }
.uni-grid-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 2px; }
.doc-grid td.calc, .doc-grid td.ro-cell { background: #ece4d4; }
.doc-grid tbody tr { cursor: default; }
.uni-user { display: flex; align-items: center; gap: 8px; }
@media (max-width: 900px) { .uni-head { grid-template-columns: 1fr; } .uni-row { grid-template-columns: 90px minmax(0, 1fr); } }

.doc-form { background: #fff; }
.doc-form .field { flex: 0 1 200px; font-size: 12.5px; font-weight: 600; }
.doc-form .partner-field { flex: 1 1 260px; }
.doc-form input, .doc-form select { height: 38px; font-weight: 400; }
.doc-add { padding: 8px 10px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 6px; align-items: center; }
.doc-add input { height: 40px; font-size: 15px; background: #fff; }
.doc-add .field.grow { max-width: none; }
.doc-add .btn.tool { height: 40px; }
.doc-grid td { padding: 6px 10px; vertical-align: middle; }
.doc-grid .doc-name { min-width: 280px; font-size: 14.5px; font-weight: 600; white-space: normal; }
.doc-grid .col-qty { background: #fbf3e4; }
.cell-input { width: 92px; height: 32px; padding: 2px 7px; border: 1px solid var(--line); font-size: 14px; }
.cell-input:focus { background: #fffdf6; }
.office-grid tbody tr .ro-cell { background: rgba(51, 35, 26, .045); color: var(--muted); }
.doc-lines { max-height: none; }
.doc-bottom { padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.doc-totals dd.doc-total { font-size: 20px; }
.doc-head { background: #fff; }
.form-box { display: grid; gap: 12px; max-width: 460px; }

.modal-head { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; background: var(--brown-700); }
.modal-head h2 { flex: 1; min-width: 140px; padding: 0; background: none; }
.modal-head .row-actions { margin: 0; }
.modal-head .btn { height: 32px; background: rgba(255, 255, 255, .12); border-color: var(--brown-500); color: #fbf7ef; }
.modal-head .btn:hover { background: rgba(255, 255, 255, .22); }
.modal-head .btn.primary { background: #fbf7ef; border-color: #fbf7ef; color: var(--brown-900); font-weight: 600; }
.modal-head .btn.primary:hover { background: var(--accent-soft); }

@media (max-width: 1000px) {
  .side-layout { grid-template-columns: 190px minmax(0, 1fr); }
}

/* Поділ чека у вікні оплати */
.split-box { display: grid; gap: 4px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; }
.split-row { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }

/* Налаштування обладнання й форми друку */
.fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; align-items: start; }
.field-wrap { display: grid; gap: 3px; }
.wide-box { max-width: 780px; }
.side-heading { margin: 12px 8px 3px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.side-heading:first-child { margin-top: 4px; }
/* ФОП і правила розподілу */
.fop-panel { display: flex; flex-direction: column; gap: 8px; max-width: 900px; }
.fop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.fop-head h3 { margin: 0; font-size: 15px; }
.fop-row { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 7px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; cursor: pointer; font: inherit; color: inherit; }
.fop-row:hover { background: var(--accent-soft); }
.fop-row-title { font-weight: 600; }
.fop-row-sub { font-size: 12.5px; color: var(--muted); }
.fop-row.fop-conflict { border-color: var(--danger); background: #fbeeea; }
.fop-row.fop-off { opacity: .6; }
.fop-store { display: flex; flex-direction: column; gap: 4px; }
.fop-store-name { font-weight: 700; margin-top: 6px; }
.fop-warnings { display: flex; flex-direction: column; gap: 4px; }
.fop-warn { padding: 7px 10px; border-radius: 5px; font-size: 13px; border: 1px solid var(--line); background: var(--surface-2); }
.fop-warn.fop-conflict { background: #f9e4df; border-color: var(--danger); }
.fop-warn.fop-gap { background: #fbf1d8; border-color: #d8b25a; }
.fop-ok { padding: 7px 10px; border-radius: 5px; font-size: 13px; background: #e3efdf; color: var(--ok); }
.fop-block { display: flex; flex-direction: column; gap: 4px; }
.fop-label { font-size: 13px; color: var(--muted); }
.fop-times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fop-groups { max-height: 170px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; padding: 4px 8px; background: var(--surface); }
.fop-report { display: flex; flex-direction: column; gap: 2px; }
.fop-report-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 8px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.fop-report-total { font-weight: 700; border-bottom: 0; }
.note { padding: 8px 10px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 5px; font-size: 13px; }
.device-section { display: grid; gap: 10px; }
.device-section h3 { margin: 0; font-size: 16px; }
.tpl-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 10px; align-items: start; }
.tpl-list { display: grid; gap: 1px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.tpl-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mini-badge { padding: 0 6px; background: var(--accent-soft); border-radius: 8px; color: var(--brown-700); font-size: 10.5px; }
.side-item.active .mini-badge { background: rgba(255, 255, 255, .22); color: #fbf7ef; }
.tpl-work { min-width: 0; display: grid; gap: 10px; }
.tpl-palette { display: grid; gap: 6px; max-height: 150px; overflow: auto; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.palette-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-btn { padding: 3px 9px; background: var(--btn); border: 1px solid var(--line); border-radius: 12px; font-size: 12px; cursor: pointer; }
.chip-btn:hover { background: var(--accent-soft); }
.tpl-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.tpl-editor { width: 100%; height: 560px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 6px; font: 12.5px/1.45 Consolas, 'Courier New', monospace; resize: vertical; tab-size: 2; white-space: pre; overflow: auto; }
.tpl-editor:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.tpl-preview iframe { display: block; width: 100%; height: 560px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.doc-grid.hide-code .c-code, .doc-grid.hide-barcode .c-bar, .doc-grid.hide-stock .c-stock { display: none; }
.doc-grid.density-compact td { padding-top: 2px; padding-bottom: 2px; font-size: 12.5px; }
.doc-grid.density-large td { padding-top: 11px; padding-bottom: 11px; font-size: 15px; }
@media (max-width: 1150px) {
  .tpl-columns, .tpl-layout { grid-template-columns: 1fr; }
  .fields-grid { grid-template-columns: 1fr; }
}

/* На малому екрані штрихкод поступається місцем назві товару. */
@media (max-width: 1250px) {
  .receipt-grid th.col-barcode, .receipt-grid td:nth-child(3) { display: none; }
  .receipt-grid .col-code { width: 62px; }
  .receipt-grid .col-qty { width: 66px; }
  .receipt-grid .col-price { width: 66px; }
  .receipt-grid .col-sum { width: 78px; }
  .receipt-grid { min-width: 0; }
}
@media (max-width: 1000px) {
  .pos { grid-template-columns: 100px minmax(0, 1fr) 170px; }
  .pos.no-left { grid-template-columns: minmax(0, 1fr) 170px; }
  .pos.no-right { grid-template-columns: 100px minmax(0, 1fr); }
  .total-amount { font-size: 34px; }
  .photo-frame { height: 96px; }
}
@media (max-width: 680px) {
  .pos { height: auto; min-height: 100%; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .side-actions { flex-direction: row; flex-wrap: wrap; order: 2; }
  .action { flex: 1 1 92px; }
  .center { order: 1; }
  .table-wrap { min-height: 240px; }
  .quick { order: 3; }
  .statusbar { order: 4; }
  .editor-columns { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff; }
  #app, #modal-root, #toast, .suggest { display: none !important; }
  #print-area { display: block; }
  #print-area .receipt-paper { width: 72mm; border: 0; padding: 0; background: #fff; }
}
@page { margin: 2mm; }

/* Черга чеків без зв'язку */
.queue-badge { padding: 0 2px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.queue-badge.queue-warn { color: #ffd68a; font-weight: 700; }
.queue-badge.queue-error { color: #ff9d92; font-weight: 700; }
.queue-list { display: flex; flex-direction: column; gap: 6px; min-width: 420px; }
.queue-meta { font-size: 13px; color: var(--muted); }
.queue-empty { padding: 12px 0; color: var(--muted); }
.queue-row { padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); display: flex; flex-direction: column; gap: 3px; }
.queue-row.queue-local, .queue-row.queue-sending { border-color: #d8b25a; background: #fbf1d8; }
.queue-row.queue-error { border-color: var(--danger); background: #f9e4df; }
.queue-row.queue-server { opacity: .8; }
.queue-status { font-size: 13px; font-weight: 600; }
.queue-error { font-size: 13px; color: var(--danger); }

/* Оплата на терміналі */
.terminal-box { padding: 8px 10px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 5px; font-weight: 600; }
/* Права панель не ширшає за свою колонку: довгі назви груп обрізаються */
.quick { grid-template-columns: minmax(0, 1fr); }
.quick .tabs, .quick .quick-filter, .quick .tiles { min-width: 0; max-width: 100%; box-sizing: border-box; }
.tab { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Сенсорний екран ---------- */
.numpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.numkey { min-height: 48px; font-size: 22px; font-weight: 600; background: var(--btn); border: 1px solid var(--line); border-radius: 8px; color: var(--brown-900); cursor: pointer; touch-action: manipulation; user-select: none; }
.numkey:active { background: var(--accent-soft); }
.numkey.erase, .numkey.clear { font-size: 19px; background: var(--surface-2); }
.numkey.ok { grid-column: 4; grid-row: 3 / span 2; background: var(--brown-700); color: #fbf7ef; border-color: var(--brown-900); font-size: 22px; }
.numkey.zero { grid-column: span 2; }
.numkey.zero.wide { grid-column: span 3; }
.touch-input { width: 100%; box-sizing: border-box; padding: 12px 14px; font-size: 30px; text-align: right; font-variant-numeric: tabular-nums; background: #fff; border: 2px solid var(--brown-700); border-radius: 8px; }
.touch-tender { min-width: 300px; }
/* Оплата на сенсорному екрані: поля ліворуч, цифри праворуч, щоб усе вміщалось без прокручування. */
.touch .modal-body:has(.touch-tender) { display: grid; grid-template-columns: minmax(210px, 1fr) 330px; column-gap: 16px; align-items: start; }
.touch .modal-body:has(.touch-tender) > * { grid-column: 1; }
.touch .modal-body:has(.touch-tender) > .touch-tender { grid-column: 2; grid-row: 1 / span 8; }
.touch .modal-body:has(.touch-tender) > .row-actions { grid-column: 1 / -1; }
.touch .modal:has(.touch-tender) { max-width: min(98vw, 720px); }
.bill-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bill-chips .btn { flex: 1 1 70px; min-height: 48px; font-size: 16px; }
.touch-check { margin-top: 6px; }

.touch body, .touch button, .touch .action, .touch .prow, .touch .numkey { touch-action: manipulation; }
.touch .btn { min-height: 48px; font-size: 16px; padding: 8px 16px; }
.touch .modal { max-width: min(96vw, 560px); }
.touch .field input, .touch .field select { min-height: 46px; font-size: 18px; }
.touch .action { font-size: 14px; min-height: 64px; }
.touch .side-actions { overflow-y: auto; }
.touch .check-menu-btn { padding: 8px 12px; }
.touch .menu-row { padding: 14px 14px; font-size: 16px; }
.touch .receipt-grid td { padding-top: 10px; padding-bottom: 10px; }
.touch .receipt-grid .line-name { font-size: 17px; }
.touch .receipt-grid .thumb { width: 44px; height: 44px; }
.touch .quick-select, .touch .quick-filter { height: 44px; font-size: 16px; }
.touch .prow { min-height: 64px; }
.touch .prow .thumb { width: 46px; height: 46px; }
.touch .touch-qty { white-space: nowrap; }
.touch .receipt-grid .col-qty { width: 160px; }
.touch .touch-qty .qty-value { display: inline-block; min-width: 46px; text-align: center; }
.step { width: 40px; height: 40px; margin: 0 2px; font-size: 24px; font-weight: 700; line-height: 1; background: var(--btn); border: 1px solid var(--line); border-radius: 8px; color: var(--brown-900); cursor: pointer; }
.step:active { background: var(--accent-soft); }
.touch .center-screen .panel { width: min(96vw, 460px); }
.touch .modal:has(.touch-tender) { width: min(98vw, 720px); }
.touch .touch-tender .numpad { margin-top: 0; }

.uni-pct { display: flex; align-items: center; gap: 12px; }
.uni-pct .uni-label { text-align: left; }

/* ---------- Бек-офіс: блоки швидкої панелі, фото, масова зміна, картка товару, точки, етикетки ---------- */
[hidden] { display: none !important; }
.quick-bar { gap: 8px; align-items: stretch; }
.quick-group { flex: none; display: flex; flex-direction: column; padding: 2px 4px 0; border: 1px solid rgba(251, 247, 239, .35); border-radius: 7px; background: rgba(251, 247, 239, .07); }
.quick-items { display: flex; gap: 2px; }
.quick-cap { text-align: center; padding: 1px 0 3px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #e9dcc6; }
.quick-rest { flex: none; display: flex; align-items: stretch; gap: 2px; margin-left: auto; padding-left: 10px; border-left: 2px solid rgba(251, 247, 239, .35); }
.quick-btn { min-width: 62px; }

.office-grid .thumb { width: 30px; height: 30px; }
.photo-cell { width: 40px; padding-left: 6px !important; padding-right: 2px !important; }
.chk { width: 34px; text-align: center; }
.picker-row { align-items: center; }
.picker-row .thumb { flex: none; width: 26px; height: 26px; }
.side-option { padding: 2px 8px 8px; font-size: 12.5px; }

.journal-page, .doc-page { max-width: 1280px; display: grid; gap: 10px; align-content: start; }
.doc-page .uni-head { grid-template-columns: minmax(0, 700px) 210px; }
.doc-page .uni-row { grid-template-columns: 120px minmax(0, 1fr); }
.doc-page .uni-row > select, .doc-page .uni-row > input, .doc-page .uni-row .partner-field { max-width: 460px; }
.doc-page .doc-lines { width: fit-content; max-width: 100%; }
.doc-page .doc-add { max-width: 760px; }
.doc-page .doc-bottom { max-width: 760px; }
.doc-sum { display: flex; justify-content: flex-end; }
.doc-sum .doc-totals { margin: 0; min-width: 300px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--brown-500); border-radius: 6px; font-size: 14px; }
.doc-sum .doc-totals dd.doc-total { font-size: 22px; }

.bulk-bar { background: var(--accent-soft); border-color: var(--accent); }
.bulk-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bulk-grid select { flex: 1 1 160px; }
.bulk-grid input { flex: 0 0 110px; }
.bulk-preview { display: grid; gap: 6px; }

.product-main { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 16px; align-items: start; }
.product-photo-box { display: grid; gap: 8px; justify-items: center; }
.product-photo-box .product-photo { width: 168px; height: 168px; }
.product-photo-actions { display: grid; gap: 6px; width: 100%; }
.product-tab { display: grid; gap: 10px; }
.product-fields { display: grid; gap: 10px; }
.excise-box { display: grid; gap: 6px; padding: 8px 10px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 6px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; }
.bc-table .cell-input { width: 80px; }

.point-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.point-group { padding: 8px 10px; max-height: 230px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }

.labels-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; align-items: start; }
.labels-pane { display: grid; gap: 8px; }
.label-add { display: flex; gap: 8px; align-items: center; }
.label-add .grow { flex: 1; }
.label-list { max-height: calc(100vh - 360px); }
.label-settings { display: grid; gap: 10px; position: sticky; top: 112px; }
.label-size { display: flex; gap: 8px; }
.label-preview { overflow: auto; max-height: 560px; }
.weight-form { display: grid; grid-template-columns: minmax(0, 1fr) 150px 110px; gap: 8px; align-items: end; }
.weight-pick { display: grid; gap: 2px; }
.weight-info { display: grid; gap: 2px; padding: 8px 10px; background: var(--surface-2); border-radius: 5px; min-height: 42px; }
.weight-check { display: grid; gap: 6px; max-width: 520px; }
@media (max-width: 1100px) { .labels-layout { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .product-main, .point-grid { grid-template-columns: 1fr; } }
@media print { .quick-bar { display: none !important; } .doc-sum .doc-totals { border: 0; } }
.product-photo.none { display: grid; place-items: center; color: var(--muted); font-size: 12.5px; border: 1px dashed var(--line); background: var(--surface-2); border-radius: 6px; }

/* ---------- Верхні вкладки (Товар / Оплати і чеки / Хаб / CRM), хаб, CRM, акції ---------- */
.quick-bar { flex-direction: column; gap: 0; padding: 0; overflow: visible; }
.tab-row { display: flex; gap: 3px; padding: 5px 10px 0; overflow-x: auto; background: var(--brown-900); }
.tab-btn { flex: none; padding: 7px 20px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: none; color: #e9dcc6; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.tab-btn:hover { background: rgba(251, 247, 239, .12); }
.tab-btn.active { background: var(--brown-700); color: #fff; }
.item-row { display: flex; align-items: stretch; gap: 8px; padding: 5px 10px; overflow-x: auto; background: var(--brown-700); border-bottom: 1px solid var(--brown-900); }
.item-row .quick-items { flex: 1 1 auto; display: flex; align-items: stretch; gap: 2px; }
.item-row .quick-rest { margin-left: 0; }
.pair-grid { display: grid; grid-template-columns: max-content 1fr max-content 1fr; gap: 3px 14px; margin: 0 0 10px; font-size: 13px; }
.pair-grid dt { color: var(--muted); }
.pair-grid dd { margin: 0; }
@media (max-width: 760px) { .pair-grid { grid-template-columns: max-content 1fr; } }
.row-return td { color: #8a3a2a; }
.row-warn td { background: #fbeadb; }
.badge-promo, .tag-plan { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 9px; font-size: 11px; background: var(--accent-soft); color: var(--brown-700); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 6px 0 10px; }
.hub-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; text-align: left; font: inherit; color: inherit; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
a.hub-card:hover, button.hub-card:hover { border-color: var(--accent); background: #fffaf0; }
.hub-card .ic svg { width: 28px; height: 28px; color: var(--brown-500); }
.hub-title { font-weight: 600; margin-bottom: 3px; }
.promo-card { cursor: default; }
.hub-status { margin: 2px 0 8px; font-size: 13px; }
.crm-detail { max-width: 640px; display: grid; gap: 8px; }
.form-narrow { max-width: 460px; display: grid; gap: 10px; }
.promo-box { display: grid; gap: 6px; padding: 10px 12px; margin: 8px 0; background: #fbeadb; border: 1px solid var(--accent); border-radius: 6px; }
.promo-pct { font-size: 22px; font-weight: 700; color: #8a3a2a; }

/* ---------- Без верхнього меню; блоки кнопок; документ як в UniPro ---------- */
.tab-row { align-items: flex-end; }
.tab-spacer { flex: 1; }
.tab-user { align-self: center; padding: 0 4px 5px; color: #fbf7ef; font-size: 12px; opacity: .85; white-space: nowrap; }
.quick-bar { top: 0; }
.item-row .quick-items { gap: 8px; flex-wrap: wrap; }
.quick-group { flex-direction: row; display: flex; gap: 2px; padding: 2px; border: 1px solid rgba(251, 247, 239, .28); border-radius: 7px; background: rgba(0, 0, 0, .1); }
.hub-group { margin: 6px 0 0; font-size: 14px; color: var(--brown-700); }
.uni-rate { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.uni-rate .uni-number { min-width: 0; font-size: 12.5px; color: var(--muted); }
.doc-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; align-items: start; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.doc-foot-left { display: grid; gap: 6px; max-width: 760px; }
.doc-foot-left .uni-row > input { max-width: 560px; }
.doc-foot-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-top: 4px; }
.doc-foot-right { display: grid; gap: 10px; justify-items: end; }
.doc-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.doc-buttons .btn { min-width: 96px; }
@media (max-width: 900px) { .doc-foot { grid-template-columns: 1fr; } .doc-foot-right { justify-items: stretch; } }
.journal-page.doc-page, .doc-page { max-width: 1600px; }
.doc-page .doc-lines { width: auto; }
/* Мініатюри фото: товар видно повністю, без обрізання. */
.thumb { object-fit: contain; background: #fff; }
.suggest-name { display: flex; align-items: center; gap: 6px; }
.thumb.mini { flex: none; width: 26px; height: 26px; display: inline-block; }
/* Назви колонок залишку («Шевченка», «Інтернет-магазин») у два рядки, а не обрізані. */
.receipt-grid th.col-stock { white-space: normal; line-height: 1.1; font-size: 12px; overflow-wrap: anywhere; }
.stamp-list { max-height: 160px; overflow-y: auto; margin: 6px 0; padding-left: 22px; font-family: 'Courier New', monospace; font-size: 13px; }

/* ---------- Палітра: бежевий, коричневий, жовтий, чорний ----------
   Чорні смуги згори й знизу, коричневі заголовки таблиць і вікон, жовтий — виділене, активне й головні кнопки.
   Великі темно-коричневі плями (виділений рядок, активні вкладки) стали жовтими: інтерфейс м'якший. */
:root {
  --black: #1d1b18;
  --black-2: #2c2924;
  --yellow: #f3c63f;
  --yellow-hover: #e9b824;
  --yellow-line: #c99a12;
  --yellow-soft: #fbe9a8;
  --accent-soft: #f7e4a6;
}
.statusbar, .topbar, .menu-bar, .tab-row, #toast { background: var(--black); }
.tab-row { border-bottom: 3px solid var(--yellow); }
.statusbar { border-top: 2px solid var(--yellow); }
.panel h1, .modal h2, .modal-head { border-bottom: 3px solid var(--yellow); }
.link-btn:hover, .menu-btn:hover, .office-nav .tab:hover { background: var(--black-2); }

.btn.primary, .numkey.ok { background: var(--yellow); border-color: var(--yellow-line); color: var(--black); font-weight: 600; }
.btn.primary:hover { background: var(--yellow-hover); }
.modal-head .btn.primary { background: var(--yellow); border-color: var(--yellow-line); color: var(--black); }
.modal-head .btn.primary:hover { background: var(--yellow-hover); }
.btn:hover, .tool-btn:hover { background: var(--yellow-soft); }

.tab.active, .tab-btn.active, .side-item.active, .tree-row.active { background: var(--yellow); border-color: var(--yellow-line); color: var(--black); }
.tree-row.active .tree-count { color: var(--black-2); }
.side-item.active .ic svg .f { fill: #fff3c4; }
.side-item.active .mini-badge { background: rgba(0, 0, 0, .12); color: var(--black); }
.quick-btn.active { background: var(--yellow); border-color: var(--yellow-line); color: var(--black); }

table.grid tbody tr.selected, table.grid tbody tr.selected .muted, table.grid tbody tr.selected .danger,
.suggest-row.selected, .suggest-row.selected .danger, .picker-row.selected, .picker-row.selected .muted,
.office-grid tbody tr.selected { background: var(--yellow); color: var(--black); }
table.grid tbody tr.selected td { box-shadow: inset 0 1px 0 var(--yellow-line), inset 0 -1px 0 var(--yellow-line); }
.receipt-grid tr.selected .c-stock.own { background: rgba(0, 0, 0, .06); }
.office-grid tbody tr.selected .status-posted, .office-grid tbody tr.selected .status-draft, .office-grid tbody tr.selected .status-cancelled, .office-grid tbody tr.selected .status-unposted { color: var(--black); }
.office-grid tbody tr.selected .badge { background: var(--black); color: var(--yellow); }
.check input, .range-field input[type=range] { accent-color: var(--black); }
.field input:focus, .field select:focus, .quick-filter:focus, .cell-input:focus, .tpl-editor:focus { outline-color: var(--yellow-line); }
.receipt-grid .cell-edit, .touch-input { border-color: var(--yellow-line); }
.photo-btn { background: var(--black); color: var(--yellow); }

/* Кнопка «Сенсор»: на вході — у правому верхньому кутку, на касі — праворуч у рядку стану. */
.touch-toggle { padding: 2px 8px; font-size: 12px; line-height: 1.4; background: transparent; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); cursor: pointer; }
.touch-toggle.on { background: var(--yellow); border-color: var(--yellow-line); color: var(--black); }
.corner-touch { position: fixed; top: 10px; right: 10px; z-index: 5; background: var(--surface); }
.status-touch { margin: 2px 6px 2px auto; border-color: #5a544a; color: #e9dcc6; }
.box-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.box-pane { display: grid; gap: 8px; min-width: 0; }
.box-ready, .box-form { display: grid; gap: 8px; }
.box-done { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 8px; }
.box-short { font-size: 56px; font-weight: 800; letter-spacing: 2px; color: var(--black); background: var(--yellow); border: 2px solid var(--yellow-line); border-radius: 12px; padding: 4px 28px; }
.box-barcode { width: 260px; height: 80px; }
.box-barcode svg { width: 100%; height: 100%; }
.box-found { display: grid; max-height: 220px; overflow-y: auto; }
.box-found:empty { display: none; }
.box-found-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) 80px; gap: 8px; padding: 5px 8px; text-align: left; background: var(--surface); border: 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.box-found-row:hover { background: var(--yellow-soft); }
.holds-btn { padding: 2px 10px; font: inherit; font-weight: 700; background: var(--yellow); border: 1px solid var(--yellow-line); border-radius: 12px; color: var(--black); cursor: pointer; }
.holds-btn:hover { background: var(--yellow-hover); }
.hold-goods { max-width: 360px; }
.status-office { margin: 2px 6px 2px 0; border-color: var(--yellow-line); color: var(--yellow); }
.status-office:hover { background: var(--yellow); color: var(--black); }
/* Бек-офіс: кнопка «Каса» в правому нижньому кутку */
.corner-cashier { position: fixed; right: 12px; bottom: 10px; z-index: 30; padding: 4px 12px; font-size: 13px; background: var(--black); border: 1px solid var(--yellow-line); border-radius: 12px; color: var(--yellow); text-decoration: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.corner-cashier:hover { background: var(--yellow); color: var(--black); }

/* Стрілка згорнути/розгорнути кнопки зліва */
.left-toggle { position: absolute; top: 50%; left: calc(var(--left-w, 128px) + 2px); z-index: 6; width: 14px; height: 54px; padding: 0; transform: translateY(-50%); font-size: 10px; line-height: 1; background: var(--black); border: 1px solid var(--yellow-line); border-left: 0; border-radius: 0 8px 8px 0; color: var(--yellow); cursor: pointer; opacity: .75; }
.left-toggle:hover { opacity: 1; }
.pos.no-left .left-toggle { left: 0; }

/* ---------- Вікно документа (надходження, повернення, переміщення…): на весь екран ---------- */
.doc-page.doc-full { position: fixed; inset: 0; z-index: 15; max-width: none; margin: 0; padding: 10px 14px; overflow: hidden; background: var(--bg);
  display: flex; flex-direction: column; gap: 8px; }
.doc-page.doc-full > * { flex: none; }
.doc-page.doc-full .doc-lines { flex: 1 1 auto; min-height: 120px; max-height: none; width: auto; overflow: auto; }
.doc-page.doc-full .uni-head { grid-template-columns: minmax(0, 700px); }
.doc-page.doc-full .doc-add { max-width: none; }
/* Підсумки: рядки й кількість дрібно, сума великою */
.doc-sum .doc-totals { display: grid; gap: 4px; min-width: 300px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--brown-500); border-radius: 6px; }
.doc-sum-small { display: flex; justify-content: flex-end; gap: 16px; font-size: 13px; color: var(--muted); }
.doc-sum-big { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; }
.doc-sum-big span { font-size: 14px; color: var(--brown-700); }
.doc-sum-big b { font-size: 26px; font-variant-numeric: tabular-nums; color: var(--black); }
/* Колонки, які касир сховав кнопкою «Колонки» */
.doc-grid.hide-col-photo .photo-cell, .doc-grid.hide-col-code .c-code, .doc-grid.hide-col-barcode .c-bar, .doc-grid.hide-col-stock .c-stock,
.doc-grid.hide-col-markup .c-markup, .doc-grid.hide-col-sale .c-sale, .doc-grid.hide-col-current .c-current, .doc-grid.hide-col-amount .c-amount { display: none; }
/* Перетягування рядків */
.doc-grid tr[draggable="true"] .drag-cell { cursor: grab; white-space: nowrap; }
.doc-grid tr.dragging { opacity: .45; }
.doc-grid tr.drop-target td { box-shadow: inset 0 3px 0 var(--yellow-line); }
.check-col { display: grid; gap: 6px; }
@media print { .doc-page.doc-full { position: static; overflow: visible; } }
/* Поки відкрите вікно документа, кнопка «Каса» в куті не заступає кнопки документа */
body:has(.doc-full) .corner-cashier { display: none; }

/* ---------- Навчання: затемнення, підсвічене місце й опис ---------- */
.tour-root { position: fixed; inset: 0; z-index: 60; }
.tour-shade { position: absolute; inset: 0; background: rgba(29, 27, 24, .55); }
.tour-spot { position: absolute; border: 3px solid #f3c63f; border-radius: 8px; box-shadow: 0 0 0 9999px rgba(29, 27, 24, .55); pointer-events: none; transition: all .2s ease; }
.tour-tip { position: absolute; max-width: calc(100vw - 24px); padding: 12px 14px; background: #fbf7ef; border: 2px solid #c99a12; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); color: #1d1b18; }
.tour-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.tour-title { font-size: 16px; }
.tour-count { font-size: 12px; color: #6e5a48; white-space: nowrap; }
.tour-text p { margin: 0 0 6px; font-size: 14px; line-height: 1.4; }
.tour-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }

/* ---------- Вікно оплати: способи зліва, сума праворуч ---------- */
.pay-layout { display: grid; grid-template-columns: 210px minmax(280px, 1fr); gap: 16px; align-items: start; }
.pay-side { display: grid; gap: 6px; }
.pay-side-title { font-size: 12px; color: var(--muted); }
.pay-method { display: flex; justify-content: space-between; align-items: center; padding: 12px; font-size: 16px; font-weight: 600; text-align: left; background: var(--btn); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.pay-method.active { background: var(--yellow); border-color: var(--yellow-line); color: var(--black); }
.pay-key { font-size: 11px; font-weight: 400; color: var(--muted); }
.pay-method.active .pay-key { color: var(--black-2); }
.pay-mixed { margin-top: 8px; padding: 8px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 6px; }
.pay-body { display: grid; gap: 8px; }
@media (max-width: 700px) { .pay-layout { grid-template-columns: 1fr; } }

/* ---------- Вікно документа: маленька шапка, велика таблиця, введення товару як на касі ---------- */
.doc-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 4px 8px; font-size: 12.5px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.doc-topbar .doc-title { font-size: 14px; margin-right: 4px; }
.doc-topbar .badge { font-size: 11px; }
.doc-top-field { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.doc-top-field select, .doc-top-field input { height: 26px; padding: 1px 6px; font-size: 12.5px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--text); }
.doc-top-field.partner-field { position: relative; }
.doc-top-field.partner-field .picker input { width: 200px; }
.doc-top-field.partner-field .picked { font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.doc-topbar .tool-btn, .doc-topbar .btn { height: 26px; padding: 0 8px; font-size: 12px; }
.doc-page.doc-full .uni-grid-tools { padding: 2px 0; }
.doc-page.doc-full .uni-grid-tools .tool-btn { padding: 2px 6px; font-size: 12px; }
.doc-input-row { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: var(--brown-700); border-radius: 0 0 6px 6px; }
.doc-input-no { min-width: 34px; color: #e9dcc6; font-size: 12px; text-align: center; }
.doc-input-field { flex: 1; min-width: 0; }
.doc-input-field .picker input { width: 100%; height: 32px; padding: 2px 10px; font-size: 15px; color: #fff; caret-color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .25); border-radius: 4px; }
.doc-input-field .picker input::placeholder { color: #cfbea3; }
.doc-input-field .picker-list { top: auto; bottom: 100%; max-height: 50vh; }
.doc-input-row .btn.tool { height: 32px; }
.doc-page.doc-full .doc-foot { padding: 6px 10px; gap: 6px 16px; }
.doc-page.doc-full .doc-foot-left { gap: 3px; }
.doc-page.doc-full .doc-sum .doc-totals { padding: 6px 12px; }
.doc-page.doc-full .doc-sum-big b { font-size: 22px; }
.all-products { max-height: 60vh; overflow-y: auto; }
.all-products tr.clickable { cursor: pointer; }
.all-products tr.clickable:hover { background: var(--yellow-soft); }
.update-prices { width: fit-content; }

/* Модуль хабу всередині ERP */
.hub-module { display: flex; flex-direction: column; gap: 6px; height: calc(100vh - 150px); }
.hub-module-bar { display: flex; align-items: center; gap: 8px; }
.hub-frame { flex: 1; width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

.source-switch { display: flex; flex-wrap: wrap; gap: 6px; }
