/* ЦарьСклад · новая система · компьютер и айфон офиса. Палитра старого сервиса, текст 16, кнопки и поля не ниже 40. */

:root {
  --paper: #fbfbf9;
  --card: #ffffff;
  --ink: #1c1f26;
  --ink-soft: #666c78;
  --line: #e3e5e9;
  --line-hard: #c7cbd3;
  --acc: #2f62d9;
  --acc-dark: #2954be;
  --rail: #20242c;
  --rail-txt: #a8b0bc;
  --rail-dim: #7b838f;

  --blue: #2f62d9;
  --blue-dark: #2954be;
  --blue-bg: #eaf0fd;
  --blue-ink: #28448f;
  --green: #1e7a54;
  --green-bg: #edf6f1;
  --yellow: #7a5b00;
  --yellow-bg: #fff3c4;
  --red: #b3261e;
  --red-bg: #fdeeec;
  --gray: #5a6270;
  --gray-bg: #eef0f3;
  --purple: #6b3fa0;
  --purple-bg: #efe6fa;
  --bg: var(--paper);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.modal-open { overflow: hidden; }

[hidden] { display: none !important; }

a { color: var(--acc); }
h1 { font-size: 24px; line-height: 1.2; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 20px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 16px; margin: 18px 0 8px; font-weight: 650; }
p { margin: 0 0 10px; }

.boot { padding: 24px; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.err { color: var(--red); margin: 8px 0 0; min-height: 0; font-weight: 600; }
.err:empty { display: none; }
.ok-text { color: var(--green); font-weight: 600; }
.warn-text { color: var(--yellow); font-weight: 600; }
.danger-text { color: var(--red); }

/* ---------- кнопки и поля ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line-hard);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.btn:hover { border-color: #9aa1ac; background: #f8f9fb; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.primary:hover { background: var(--acc-dark); border-color: var(--acc-dark); }
.btn.ghost { background: #f1f2f5; border-color: #f1f2f5; }
.btn.ghost:hover { background: #e6e8ec; border-color: #e6e8ec; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { background: #8f1d17; border-color: #8f1d17; }
.btn.small { font-size: 15px; padding: 6px 12px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.busy { opacity: .7; }

input[type=text], input[type=password], input[type=search], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-hard);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible { outline: 3px solid rgba(47, 98, 217, .28); outline-offset: 1px; }
textarea { resize: vertical; }
input[type=number] { max-width: 160px; }

.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; }
.field .lab, .lab { font-weight: 600; }
.field .hint { color: var(--ink-soft); font-size: 14.5px; }
select.bad, input.bad { border-color: var(--red); background: #fff5f4; }
.field-err { color: var(--red); font-size: 14.5px; font-weight: 600; }
.field-err:empty { display: none; }

.check { display: flex; align-items: center; gap: 10px; min-height: 40px; margin: 0 0 6px; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; }

.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input { flex: 1 1 200px; width: auto; }
/* поля формы в одной строке — сеткой: не растягиваются вверх (flex-basis считался по высоте) */
.inline > .field { flex: 1 1 100px; min-width: 0; margin: 0 0 12px; }
.inline .field input, .inline .field select, .inline .field textarea { flex: none; width: 100%; }
.inline .field input[type=number] { max-width: none; }
.inline:has(> .field) { align-items: flex-start; }
/* выбор из списка внутри поля: у него в стиле flex 1 1 260px — в столбце это высота 260 точек (пустой блок под полем) */
.field > .picker { flex: 0 0 auto !important; min-width: 0; }

.btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.btns.center { justify-content: center; }

/* ---------- полосы сверху ---------- */

.bars { position: sticky; top: 0; z-index: 30; }
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 15px;
}
.bar.stand { background: var(--red); color: #fff; justify-content: center; text-align: center; }
.bar.view { background: var(--purple-bg); color: var(--purple); border-bottom: 1px solid #d5c4ee; }
.bar.work { background: var(--yellow-bg); color: var(--yellow); border-bottom: 1px solid #ecd98a; }
.bar-btns { display: flex; gap: 8px; }

/* ---------- каркас: тёмное меню слева ---------- */

.frame { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .15s; }
.topbar { display: none; }

.side {
  position: sticky;
  top: var(--bars-h, 0px);
  z-index: 40;
  align-self: start;
  height: calc(100vh - var(--bars-h, 0px));
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px 0 8px;
  background: var(--rail);
  color: var(--rail-txt);
}

.ico {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 16px 12px; color: #fff; }
.brand-logo { width: 34px; height: 34px; flex: none; border-radius: 8px; display: block; }
.brand-txt { min-width: 0; }
.brand-txt b { display: block; font-size: 16px; line-height: 1.2; }
.brand-sub { display: block; font-size: 12px; color: var(--rail-dim); white-space: nowrap; }
.stand-tag { display: inline-block; background: var(--red); color: #fff; border-radius: 5px; padding: 0 6px; font-weight: 700; font-style: normal; }

.rail-search { position: relative; margin: 0 12px 8px; }
.side input.rail-q {
  width: 100%;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid #3a414d;
  border-radius: 7px;
  background: #2a2f38;
  color: #e6e9ee;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}
.side input.rail-q::placeholder { color: #8c94a0; }
.side input.rail-q::-webkit-search-cancel-button { -webkit-appearance: none; }
.side input.rail-q:focus { outline: 2px solid rgba(110, 148, 240, .6); outline-offset: 0; border-color: #4a78e0; }
.rail-q-ico {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rail-txt);
  cursor: pointer;
}
.rail-q-ico:hover { color: #e6e9ee; background: rgba(255, 255, 255, .05); }

.menu-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #4b5563 transparent;
}
.menu-nav::-webkit-scrollbar { width: 8px; }
.menu-nav::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 4px; }

.item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 6px 16px;
  color: var(--rail-txt);
  font-size: 14.5px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
a.item:hover { background: rgba(255, 255, 255, .05); color: #e6e9ee; }
a.item.active { background: rgba(255, 255, 255, .09); color: #fff; box-shadow: inset 3px 0 0 var(--acc); }
.item.off { color: #565e6a; cursor: default; }
.item small { margin-left: auto; font-size: 12px; color: #565e6a; white-space: nowrap; }
.item.top { margin-top: 0; }

.sec .item { padding-left: 44px; }
.sec-title {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 16px 3px;
  border: 0;
  background: transparent;
  color: var(--rail-dim);
  font: inherit;
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.sec-title:hover { color: #c9cfd8; }
.sec-title:focus-visible { outline: 2px solid rgba(110, 148, 240, .7); outline-offset: -2px; }
.sec-chev { margin-left: auto; font-size: 11px; }
.sec.shut .sec-items { display: none; }
.sec.dim .sec-title { color: #565e6a; }
.sec.dim .sec-title:hover { color: #8c94a0; }
.soon { padding: 3px 16px 6px 44px; font-size: 12.5px; color: #6f7783; white-space: nowrap; }
.menu-nav.later-on .soon { display: none; }
.menu-nav:not(.later-on) .item.fut { display: none; }

.later-all {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 16px 4px;
  border: 0;
  border-top: 1px solid #2e333c;
  background: transparent;
  color: #6f7783;
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.later-all:hover { color: #9aa2ae; }

.me-block { border-top: 1px solid #2e333c; padding: 8px 0 0; }
.me-block .pop { display: block; }
.rail-me {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 6px 16px;
  border: 0;
  background: transparent;
  color: #d5dae2;
  font: inherit;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.rail-me:hover { background: rgba(255, 255, 255, .05); }
.rail-me .txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rail-me .txt small { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; color: #f2c46b; }
.ava {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: #3a414d;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.fold {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 6px 16px;
  border: 0;
  background: transparent;
  color: var(--rail-dim);
  font: inherit;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.fold:hover { color: #e6e9ee; }
.fold .g { display: inline-block; width: 18px; text-align: center; flex: none; font-size: 15px; }

.me-btn { width: 100%; justify-content: flex-start; text-align: left; font-size: 15px; background: #f1f2f5; }
.scrim { display: none; }

/* выезжающий список раздела в свёрнутом меню */
.rail-fly {
  position: fixed;
  left: 62px;
  width: 220px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 8px 0;
  background: #2a2f38;
  border: 1px solid #3a414d;
  border-radius: 0 10px 10px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  z-index: 65;
}
.rail-fly .t { padding: 4px 16px 6px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--rail-dim); }
.rail-fly .item { padding-left: 16px; }
.rail-fly .soon { padding-left: 16px; }

/* выпадающий результат поиска */
.sr-pop {
  position: fixed;
  max-height: 70vh;
  overflow-y: auto;
  padding: 6px 0;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-hard);
  border-radius: 10px;
  box-shadow: 0 12px 34px rgba(20, 30, 50, .28);
  z-index: 70;
}
.sr-group { padding: 8px 14px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.sr-item { display: block; padding: 8px 14px; color: var(--ink); text-decoration: none; }
.sr-item b { display: block; font-weight: 650; overflow-wrap: anywhere; }
.sr-sub { display: block; color: var(--ink-soft); font-size: 14px; overflow-wrap: anywhere; }
.sr-item.on { background: var(--blue-bg); }
.sr-none { padding: 12px 14px; color: var(--ink-soft); }
.sr-none.sr-err { color: var(--red); }

.main { padding: 20px 28px 60px; min-width: 0; max-width: none; }

/* свёрнутое меню — только на широком экране */
@media (min-width: 901px) {
  .frame.rail-mini { grid-template-columns: 62px minmax(0, 1fr); }
  .side.is-mini .brand-txt,
  .side.is-mini .rail-q,
  .side.is-mini .txt,
  .side.is-mini .sec-chev,
  .side.is-mini .sec-items,
  .side.is-mini .soon,
  .side.is-mini .later-all,
  .side.is-mini .item small { display: none; }
  .side.is-mini .brand { justify-content: center; padding: 0 0 12px; }
  .side.is-mini .rail-search { margin: 0 0 8px; }
  .side.is-mini .rail-q-ico { display: flex; }
  .side.is-mini .item,
  .side.is-mini .sec-title,
  .side.is-mini .rail-me,
  .side.is-mini .fold { justify-content: center; padding-left: 0; padding-right: 0; }
  .side.is-mini .sec-title { padding-top: 11px; padding-bottom: 11px; color: var(--rail-txt); font-size: 0; }
  .side.is-mini .sec.dim .sec-title { color: #6f7783; }
  .side.is-mini .sec.cur .sec-title { color: #fff; background: rgba(255, 255, 255, .09); box-shadow: inset 3px 0 0 var(--acc); }
  .side.is-mini .item.top { padding-top: 11px; padding-bottom: 11px; }
}

/* ---------- заголовок экрана ---------- */

.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.head-main { min-width: 0; }
.head .back { display: inline-block; margin-bottom: 4px; font-size: 15px; text-decoration: none; font-weight: 600; }
.head .sub { margin: 4px 0 0; color: var(--ink-soft); font-size: 15px; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.help-link { min-width: 40px; padding: 8px 12px; }

/* ---------- всплывающие меню ---------- */

.pop { position: relative; display: inline-block; }
.menu {
  position: absolute;
  top: calc(100% + 4px);
  min-width: 220px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line-hard);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 30, 50, .18);
  z-index: 50;
}
.menu.right { right: 0; }
.menu.left { left: 0; }
.menu.up { top: auto; bottom: calc(100% + 4px); }
.menu-item {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.menu-item:hover { background: #f1f2f5; }
.menu-item.danger { color: var(--red); }
.menu-item[disabled] { opacity: .5; cursor: default; }

/* ---------- карточки, блоки, чипы ---------- */

.card { background: var(--card); border: 1px solid var(--line-hard); border-radius: 8px; padding: 14px 18px; margin: 0 0 14px; }
.card.done { background: var(--green-bg); border-color: #bfdccd; color: var(--green); font-weight: 700; font-size: 18px; }
.card.row-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.card.err-card { border-color: #e9c4c0; background: var(--red-bg); }
.card-title { font-weight: 700; margin-bottom: 6px; }
.build-line { color: var(--ink-soft); margin-top: 18px; }

.block { background: var(--card); border: 1px solid var(--line-hard); border-radius: 8px; margin: 0 0 12px; }
.block > summary { padding: 12px 18px; font-weight: 650; cursor: pointer; list-style: none; }
.block > summary::-webkit-details-marker { display: none; }
.block > summary::before { content: "▸"; display: inline-block; width: 18px; color: var(--ink-soft); }
.block[open] > summary::before { content: "▾"; }
.block .n { color: var(--ink-soft); font-weight: 600; }
.block-body { padding: 4px 18px 16px; }

.pill {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.blue { background: var(--blue-bg); color: var(--blue-ink); }
.pill.yellow { background: var(--yellow-bg); color: var(--yellow); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.gray { background: var(--gray-bg); color: var(--gray); }
.pill.purple { background: var(--purple-bg); color: var(--purple); }

.strip { padding: 10px 16px; border-radius: 8px; margin: 0 0 14px; font-size: 16px; }
.strip.red { background: var(--red-bg); color: var(--red); }
.strip.blue { background: var(--blue-bg); color: var(--blue-ink); }
.strip.yellow { background: var(--yellow-bg); color: var(--yellow); }
.strip.green { background: var(--green-bg); color: var(--green); }
.strip.gray { background: var(--gray-bg); color: var(--gray); }
.strip.purple { background: var(--purple-bg); color: var(--purple); }

.note { padding: 12px 14px; border-radius: 8px; margin: 0 0 14px; font-weight: 600; }
.note.warn { background: var(--yellow-bg); color: var(--yellow); }

.empty { padding: 28px 16px; text-align: center; color: var(--ink-soft); background: var(--card); border: 1px dashed var(--line-hard); border-radius: 8px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.chip {
  min-height: 40px;
  padding: 4px 14px;
  border: 1px solid var(--line-hard);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.chip:hover { border-color: #9aa1ac; }
.chip.on { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 700; }
.chip.reset { border-style: dashed; color: var(--ink-soft); }

.search { margin: 0 0 12px; max-width: 520px; }

ul.plain { margin: 6px 0 10px; padding-left: 20px; }
ul.plain li { margin: 3px 0; }

.dl { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 6px 16px; margin: 4px 0 12px; }
.dl dt { color: var(--ink-soft); }
.dl dd { margin: 0; font-weight: 600; }

/* ---------- списки ---------- */

.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line-hard);
  border-radius: 8px;
  cursor: pointer;
}
.row:hover { border-color: var(--acc); }
.row.static { cursor: default; }
.row.static:hover { border-color: var(--line-hard); }
.row.fired { background: #fafafa; }
.row.on-shift { border-left: 4px solid var(--green); background: var(--green-bg); }
.row.fired .row-name b { color: var(--ink-soft); }
.row-main { min-width: 0; flex: 1; }
.row-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-name b { font-weight: 650; }
.row-bits { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; font-size: 14.5px; color: var(--ink-soft); }

/* ---------- окна ---------- */

.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 12px;
  overflow: hidden;
  background: rgba(20, 23, 28, .45);
}
/* окно сверху по центру, не выше экрана: тело прокручивается, заголовок и кнопки на месте */
.modal { display: flex; flex-direction: column; width: 100%; max-width: 480px; max-height: 92vh; padding: 22px; background: #fff; border-radius: 10px; box-shadow: 0 16px 48px rgba(0, 0, 0, .3); }
.modal > h2 { flex: none; margin-top: 0; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; }
.modal > .err { flex: none; }
.modal-actions { flex: none; }
.modal.wide { max-width: 640px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.bigcode { font-size: 46px; font-weight: 800; letter-spacing: .08em; text-align: center; margin: 4px 0 14px; color: var(--acc-dark); font-variant-numeric: tabular-nums; }

.toasts { position: fixed; left: 0; right: 0; bottom: 18px; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { pointer-events: auto; max-width: 560px; padding: 12px 18px; border-radius: 8px; background: var(--rail); color: #fff; font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); cursor: pointer; }
.toast.error { background: var(--red); }

/* ---------- вход ---------- */

.login-wrap { display: flex; flex-direction: column; align-items: center; padding: 8vh 16px 24px; background: var(--paper); }
.login-card { width: 100%; max-width: 400px; padding: 24px; background: #fff; border: 1px solid var(--line-hard); border-radius: 12px; box-shadow: 0 8px 28px rgba(20, 30, 50, .07); }
.login-top { display: flex; justify-content: flex-end; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 0 6px; }
.login-icon { width: 64px; height: 64px; display: block; border-radius: 14px; }
.logo { font-size: 26px; font-weight: 700; color: var(--ink); text-align: center; margin: 0 0 4px; }
.login-sub { text-align: center; color: var(--ink-soft); font-size: 18px; font-weight: 600; margin: 0 0 18px; }
.login-form .btn { margin-top: 4px; }

.form { max-width: 560px; }
.form.narrow { max-width: 420px; }

/* ---------- права человека ---------- */

.pgroup h3 { border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.prow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.pname { flex: 1 1 260px; }
.segs { display: inline-flex; border: 1px solid var(--line-hard); border-radius: 6px; overflow: hidden; }
.seg { min-height: 36px; padding: 4px 12px; border: 0; border-right: 1px solid var(--line-hard); background: #fff; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.seg:last-child { border-right: 0; }
.seg.on { background: var(--acc); color: #fff; font-weight: 700; }

/* ---------- журнал ---------- */

.log-row { border-bottom: 1px solid var(--line); }
.log-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  width: 100%;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.log-line:hover { background: #f4f5f8; }
.log-line .when { color: var(--ink-soft); min-width: 92px; }
.log-line .who { font-weight: 700; }
.log-line .what { color: var(--blue-ink); }
.log-line .why { flex-basis: 100%; }
.log-detail { padding: 4px 8px 12px; font-size: 15px; }
.chgs .chg { margin: 2px 0; }
.chg .was { color: var(--red); }
.chg .now { color: var(--green); font-weight: 600; }
pre.json { margin: 6px 0; padding: 10px; background: #f4f5f8; border-radius: 6px; overflow-x: auto; font-size: 14px; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; margin-bottom: 8px; }

/* ---------- настройки ---------- */

.groups { display: flex; flex-direction: column; gap: 8px; }
.group { background: var(--card); border: 1px solid var(--line-hard); border-radius: 8px; }
.group.open { border-color: var(--acc); }
.ghead {
  display: flex;
  align-items: baseline;
  gap: 4px;
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ghead.later { color: var(--ink-soft); }
.gtitle { font-weight: 650; }
.gsum { color: var(--ink-soft); }
.chev { margin-left: auto; color: var(--ink-soft); }
.gbody { padding: 4px 18px 18px; }
.frow { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.frow .field { margin: 0 0 6px; }
.fbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.ranges .range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.ranges .range input { width: 90px; }

/* ---------- таблицы ---------- */

.tbl { width: 100%; border-collapse: collapse; font-size: 16px; }
.tbl th, .tbl td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: #f6f7f9; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line-hard); border-radius: 8px; }
.matrix { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 15px; }
.matrix th, .matrix td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.matrix thead th { position: sticky; top: 0; background: #f6f7f9; font-size: 14px; }
.matrix .perm-col { text-align: left; min-width: 260px; font-weight: 400; }
.matrix tr.grp th { background: #f6f7f9; text-align: left; font-size: 14px; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft); }
.tick { min-width: 56px; min-height: 34px; padding: 2px 8px; border: 1px solid var(--line-hard); border-radius: 6px; background: #fff; color: #9aa3ae; font: inherit; font-size: 14px; cursor: pointer; }
.tick.on { background: var(--green-bg); border-color: #bfdccd; color: var(--green); font-weight: 700; }
.tick[disabled] { cursor: default; opacity: .8; }

/* ---------- общие классы экранов 1.2 ---------- */

.tabs { display: flex; gap: 2px; margin: 0 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.tabs > button, .tabs > a {
  flex: none;
  min-height: 40px;
  padding: 8px 14px;
  margin-bottom: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.tabs > button:hover, .tabs > a:hover { color: var(--ink); }
.tabs > .on, .tabs > .active, .tabs > [aria-selected="true"], .tabs > [aria-current] { color: var(--ink); border-bottom-color: var(--acc); font-weight: 600; }
.tabs .n { color: var(--ink-soft); font-weight: 400; }

.tbl.dense { font-size: 15px; }
.tbl.dense th, .tbl.dense td { height: 34px; padding: 4px 10px; vertical-align: middle; }
.tbl.dense thead th { position: sticky; top: 0; z-index: 2; white-space: nowrap; box-shadow: inset 0 -1px 0 var(--line-hard); border-bottom: 0; }
.tbl.dense tbody tr:hover td { background: #fafbfd; }
.tbl.dense tbody tr[data-click], .tbl.dense tbody tr.click { cursor: pointer; }
.tbl-wrap:has(> .tbl.dense) { max-height: 78vh; overflow: auto; }
/* ширина колонок: числа узкие по содержимому, названия шире, длинный текст — не больше 2 строк */
.tbl th { position: relative; }
.tbl.dense th.num, .tbl.dense td.num { width: 1%; }
.tbl.dense th.wide, .tbl.dense td.wide { min-width: 220px; }
.tbl.dense td .cell { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; line-height: 1.3; }
.tbl.dense td:not(.num):not(.wide) .cell { min-width: 110px; }
/* справочник товаров: 9 колонок должны уместиться в окно 1366 */
.refs-products .tbl.dense th, .refs-products .tbl.dense td { padding: 4px 6px; overflow-wrap: anywhere; }
.refs-products .tbl.dense th.wide, .refs-products .tbl.dense td.wide { min-width: 130px; }
.refs-products .tbl.dense td:not(.num):not(.wide) .cell { min-width: 0; }
.tbl[style*="table-layout"] th { overflow: hidden; text-overflow: ellipsis; }
.tbl[style*="table-layout"] th.num, .tbl[style*="table-layout"] td.num, .tbl[style*="table-layout"] th.wide, .tbl[style*="table-layout"] td.wide { width: auto; min-width: 0; }
.tbl[style*="table-layout"] td { overflow: hidden; overflow-wrap: anywhere; }
.tbl[style*="table-layout"] td .cell { min-width: 0; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
.th-arrow { color: var(--acc); }
.col-grip { position: absolute; top: 0; right: -4px; bottom: 0; z-index: 3; width: 9px; cursor: col-resize; touch-action: none; }
.tbl th:last-child > .col-grip { right: 0; }
.col-grip::after { content: ""; position: absolute; top: 25%; bottom: 25%; left: 4px; width: 1px; background: var(--line-hard); }
.col-grip:hover::after, .col-grip.on::after { left: 3px; width: 3px; border-radius: 2px; background: var(--acc); }

.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.num, td.num { text-align: right; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
th.money, td.money { text-align: right; }

.thumb { display: block; width: 48px; height: 48px; flex: none; border-radius: 6px; object-fit: cover; background: var(--gray-bg); border: 1px solid var(--line); }
div.thumb, span.thumb { display: inline-flex; align-items: center; justify-content: center; color: #aeb4bf; font-size: 12px; }

.bar-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 22px; font-weight: 600; letter-spacing: .04em; overflow-wrap: anywhere; }

.kv { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kv > :first-child { flex: 0 0 200px; color: var(--ink-soft); }
.kv > :nth-child(2) { flex: 1 1 200px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.kv:last-child { border-bottom: 0; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.toolbar .search { flex: 1 1 260px; max-width: 420px; margin: 0; }
.toolbar .chips { margin: 0; }
.toolbar .push, .toolbar .right { margin-left: auto; }
.toolbar .right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- сборки ---------- */

.stack { display: flex; flex-direction: column; gap: 10px; }
.build.cur { border-color: var(--acc); background: #f6f9ff; }
.bnum { font-size: 18px; }
.build .row-name .btn { margin-left: auto; }
.mini { margin-top: 8px; }
.mini summary { cursor: pointer; font-weight: 600; color: var(--blue-ink); }

/* ---------- узкий экран и айфон ---------- */

@media (max-width: 900px) {
  .frame { display: block; }
  .topbar {
    position: sticky;
    top: var(--bars-h, 0px);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }
  .brand-top { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: var(--ink); }
  .brand-top-ico { width: 28px; height: 28px; border-radius: 7px; display: block; }
  .side {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 60;
    align-self: auto;
    width: 280px;
    max-width: 86vw;
    height: auto;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    transform: translateX(-102%);
    transition: transform .18s ease;
    box-shadow: 0 0 30px rgba(0, 0, 0, .35);
  }
  .frame.open .side { transform: none; }
  .frame.open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(20, 23, 28, .45); }
  .fold, .rail-q-ico { display: none; }
  .item { min-height: 44px; padding: 10px 18px; font-size: 16px; }
  .sec .item { padding-left: 46px; }
  .sec-title { padding: 12px 18px 4px; font-size: 12px; }
  .side input.rail-q { min-height: 40px; font-size: 16px; }
  .rail-me { min-height: 44px; }
  .main { padding: 14px 14px 48px; }
  h1 { font-size: 22px; }
  .dl { grid-template-columns: 1fr; gap: 0; }
  .dl dt { margin-top: 8px; font-size: 15px; }
  .kv > :first-child { flex-basis: 100%; font-size: 14.5px; }
  .row { align-items: flex-start; }
  .modal { padding: 18px; }
  .bigcode { font-size: 38px; }
  .menu { max-width: 86vw; }
  .toolbar .search { max-width: none; }
}

@media (max-width: 480px) {
  .bar { font-size: 14px; }
  .head-actions { width: 100%; }
}

/* ---------- «Сегодня»: дело с кнопкой «Открыть» ---------- */

.card.row-card .card-main { flex: 1 1 260px; min-width: 0; }
.card.row-card .card-main p { margin: 0; }

/* ---------- карта склада (классы с приставкой map-) ---------- */

.main:has(.map-screen) { max-width: none; }
.main:has(.map-stage), .main:has(.map-body) { padding-bottom: 12px; }
.main:has(.map-screen) .head { margin-bottom: 8px; }
.main:has(.map-screen) .tabs { margin-bottom: 8px; }

.map-toolbar { gap: 8px 10px; margin: 0 0 8px; }
.map-toolbar .search { flex: 0 1 260px; max-width: 260px; }
.map-toolbar .chips { margin: 0; gap: 6px; }
.map-zoom { display: flex; flex-wrap: wrap; gap: 6px; }
.map-zoom .btn { min-width: 40px; }
.map-zoom .btn.on { background: var(--blue-bg); border-color: var(--acc); color: var(--blue-ink); }

.map-stage { position: relative; min-height: 420px; overflow: hidden; background: #14171c; border: 1px solid #2a303b; border-radius: 8px; }
.map-canvas { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #14171c; border: 1px solid #2a303b; border-radius: 8px; }
.map-stage > .map-canvas { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border: 0; border-radius: 0; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.map-svg.panning { cursor: grabbing; }
.map-svg text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }

.map-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 12px;
  height: 640px;
  min-height: 420px;
}

/* легенда и «Сегодня на складе» — тёмные карточки поверх карты */
.map-legend, .map-today { position: absolute; z-index: 6; top: 10px; display: flex; flex-direction: column; box-sizing: border-box; background: rgba(20, 23, 28, .92); color: #e5e7eb; border: 1px solid #2a303b; border-radius: 8px; font-size: 14px; line-height: 1.3; }
.map-legend { left: 10px; max-height: calc(100% - 60px); }
.map-legend.open { width: 232px; }
.map-today { right: 10px; max-width: calc(100% - 20px); }
.map-today.open { width: 380px; }
.map-lg-head { display: block; width: 100%; padding: 7px 12px; background: none; border: 0; color: #e5e7eb; font: inherit; font-weight: 650; text-align: left; white-space: nowrap; cursor: pointer; }
.map-lg-body, .map-td-body { padding: 0 12px 10px; overflow-y: auto; min-height: 0; }
.map-lg-body h4 { margin: 9px 0 3px; color: #9aa3ae; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.map-lg-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.map-lg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-lg-n { flex: none; color: #9aa3ae; font-variant-numeric: tabular-nums; }
.map-lg-sw { display: inline-block; flex: none; width: 16px; height: 14px; box-sizing: border-box; background: #1f242d; border: 1px solid #4b5563; border-radius: 3px; }
.map-lg-sw-empty { border-color: #1E9E5A; }
.map-lg-sw-hatch { border-color: transparent; background: repeating-linear-gradient(45deg, #4F8EF7 0 3px, #F28C28 3px 6px); }
.map-lg-sw-over { border: 2px solid #ef4444; }
.map-lg-sw-warn { border: 2px solid #facc15; }
.map-lg-sw-bad { border: 2px dashed #ef4444; }
.map-lg-sw-find { border: 2px solid #22d3ee; box-shadow: 0 0 0 2px rgba(34, 211, 238, .3); }
.map-lg-tag { display: inline-block; flex: none; min-width: 30px; padding: 1px 4px; box-sizing: border-box; border-radius: 4px; font-size: 11px; font-weight: 700; line-height: 1.3; text-align: center; }
.map-lg-btn { display: block; width: 100%; margin: 0 0 4px; padding: 6px 8px; background: #232831; border: 1px solid #3a414d; border-radius: 6px; color: #e5e7eb; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.map-lg-btn:hover { border-color: #4F8EF7; }

.map-td-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 10px; padding: 3px 0; }
.map-td-k { color: #9aa3ae; }
.map-td-v { margin-left: auto; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.map-td-bad { color: #ff7a7a; }

.map-what { position: absolute; z-index: 6; left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 10px 16px; background: rgba(20, 23, 28, .92); color: #fff; border: 1px solid #2a303b; border-radius: 8px; font-size: 22px; font-weight: 700; line-height: 1.25; }
.map-what:empty { display: none; }

.map-tip { position: absolute; z-index: 8; max-width: 300px; padding: 7px 10px; background: rgba(12, 14, 18, .96); color: #e5e7eb; border: 1px solid #3a414d; border-radius: 6px; box-shadow: 0 4px 16px rgba(0, 0, 0, .5); font-size: 13.5px; line-height: 1.35; pointer-events: none; }
.map-tip[hidden] { display: none; }
.map-tip-h { margin-bottom: 2px; font-weight: 700; }
.map-tip-m { color: #9aa3ae; }
.map-tip-bad { color: #ff7a7a; }
.map-tip-r { display: flex; align-items: center; gap: 6px; }
.map-tip-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 3px; }

/* панель «что лежит» и списки: выезжает справа поверх карты */
.map-side { display: flex; flex-direction: column; min-height: 0; overflow: auto; background: var(--card); border: 1px solid var(--line-hard); border-radius: 8px; }
.map-stage > .map-side { position: absolute; top: 0; right: 0; bottom: 0; z-index: 20; width: 360px; max-width: 94%; border-width: 0 0 0 1px; border-radius: 0; box-shadow: -10px 0 28px rgba(0, 0, 0, .5); transform: translateX(104%); visibility: hidden; transition: transform .18s ease, visibility 0s linear .18s; }
.map-stage > .map-side.open { transform: none; visibility: visible; transition: transform .18s ease; }
.map-side-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.map-side-title { flex: 1; min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
.map-side-body { padding: 10px 14px 16px; }
.map-side-body h3 { margin: 14px 0 6px; font-size: 15px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.map-side.edit .map-side-body h3 { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 16px; }

.map-list-btn { display: block; width: 100%; min-height: 40px; margin: 0 0 6px; padding: 8px 12px; border: 1px solid var(--line-hard); border-radius: 6px; background: #fff; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.map-list-btn:hover { border-color: var(--acc); background: #f6f9ff; }
.map-rows { display: flex; flex-direction: column; }
.map-group { margin: 0 0 12px; }
.map-group-t { margin-bottom: 4px; }
.map-box-line { display: block; padding: 4px 0 4px 8px; border-left: 3px solid var(--line); color: var(--ink); font-size: 15px; text-decoration: none; }
a.map-box-line:hover { border-left-color: var(--acc); color: var(--acc); }
.map-box { display: block; margin: 0 0 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none; }
.map-box:hover { border-color: var(--acc); background: #f6f9ff; }
.map-box-items { margin-top: 2px; font-size: 14px; color: var(--ink-soft); }
.map-over { color: var(--red); font-weight: 700; }
.map-place-kv .kv > :first-child { flex-basis: 90px; }
.map-moves .map-move { padding: 3px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.map-checks { max-height: 220px; margin: 8px 0 12px; overflow: auto; }

.map-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 0 0 12px; }
.map-card { padding: 16px 20px; background: #fff; border: 1px solid var(--line-hard); border-radius: 10px; }
.map-card.bad { background: var(--red-bg); border-color: #e9c4c0; color: var(--red); }
.map-card-t { font-size: 18px; }
.map-card-t b { display: inline-block; margin: 0 4px; font-size: 36px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.map-card-s { margin-top: 4px; font-size: 15px; }
.map-card.bad .map-card-s { color: var(--red); }
.map-brak { margin: 4px 0 18px; font-size: 17px; font-weight: 650; }
.map-note { margin-top: 14px; }

.map-check { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 8px; padding: 10px 14px; background: #fff; border: 1px solid var(--line-hard); border-radius: 8px; }
.map-check-t { flex: 1 1 320px; min-width: 0; }
.map-check-b { display: flex; gap: 6px; }

.map-editbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.map-editbar .btn.on { background: var(--blue-bg); border-color: var(--acc); color: var(--blue-ink); }
.map-edit-note { margin-bottom: 8px; }
.map-sep { width: 1px; height: 24px; margin: 0 4px; background: var(--line-hard); }
.map-grow { flex: 1; }
.map-hint { margin: 0 0 6px; color: var(--blue-ink); font-weight: 600; }
.map-hint:empty { display: none; }
.map-linkbtn { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.map-props h3 { margin-top: 0; }
.map-pk { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px; }
.map-color { width: 64px; min-height: 40px; padding: 2px; }
.map-unpl { margin-top: 14px; }
.map-unpl-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.map-bind { margin-top: 10px; }

@media (max-width: 900px) {
  .map-toolbar .search { flex: 1 1 180px; max-width: none; }
  .map-body { display: block; height: auto; min-height: 0; }
  .map-body > .map-canvas { min-height: 360px; }
  .map-legend.open { width: 190px; max-height: 55%; }
  .map-today.open { width: auto; max-width: calc(100% - 20px); }
  .map-stage > .map-side { position: fixed; top: auto; right: 0; bottom: 0; left: 0; width: auto; max-width: none; max-height: 62vh; padding-bottom: env(safe-area-inset-bottom); border-width: 1px 0 0; border-radius: 14px 14px 0 0; box-shadow: 0 -8px 28px rgba(20, 30, 50, .25); transform: translateY(105%); }
  .map-stage > .map-side.open { transform: none; }
  .map-side.edit { margin-top: 12px; }
}

/* Приёмка (часть 2.2) */
.lnk { padding: 0; border: 0; background: none; color: var(--blue-ink); font: inherit; cursor: pointer; text-decoration: underline; }
.lnk.strong { font-weight: 700; color: var(--ink); }
.lnk.right { float: right; }
.rcv-list .tbl-wrap:has(> .tbl.dense) { max-height: none; overflow-x: auto; overflow-y: visible; }
.rcv-list .tbl.dense thead th { position: relative; white-space: normal; vertical-align: bottom; }
.rcv-list .tbl.dense th, .rcv-list .tbl.dense td { padding-left: 6px; padding-right: 6px; }
.rcv-list .tbl.dense th.num, .rcv-list .tbl.dense td.num { text-align: right; }
.rcv-list .tbl.dense td:nth-child(3), .rcv-list .tbl.dense td:nth-child(5) { white-space: nowrap; }
.rcv-list .rcv-title { max-width: 190px; }
.nw { white-space: nowrap; }
.modal.xwide { max-width: min(1100px, 96vw); }
.modal .tbl-wrap:has(> .tbl.dense) { max-height: 52vh; }
@media (max-height: 800px) { .modal .tbl-wrap:has(> .tbl.dense) { max-height: 40vh; } }
.main:has(.rcv-doc) { max-width: none; }
.rcv-doc .head { margin-bottom: 6px; }
.rcv-doc .head h1 { font-size: 22px; }
.rcv-doc .back-link { text-decoration: none; }
.rcv-sub { margin: 0 0 8px; font-size: 15px; }
.rcv-details { margin: 0 0 10px; padding: 6px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.rcv-top { margin: 0 0 8px; }
.rcv-grid { display: flex; flex-wrap: wrap; gap: 4px 28px; align-items: flex-end; margin: 0 0 10px; }
.rcv-grid .rcv-cell { min-width: 90px; }
.rcv-strow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 8px; }
.rcv-cancel-btn { color: var(--red); border-color: #e3b8b4; }
.rcv-return { margin: -2px 0 8px; font-size: 14px; }
.rcv-st { align-items: center; margin: 0; }
.rcv-st .chip[disabled] { cursor: default; opacity: 1; }
.rcv-st .chip[disabled]:hover { border-color: var(--line-hard); }
.rcv-st .chip.on, .rcv-st .chip.on[disabled] { background: var(--rail); border-color: var(--rail); color: #fff; font-weight: 700; }
.rcv-act { display: inline-flex; align-items: center; gap: 8px; }
.rcv-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.rcv-btns .btn { padding: 0 12px; }
.rcv-works { padding: 0; margin: 0 0 12px; background: none; line-height: 2; }
.rcv-works.open { padding: 8px 12px; background: #f4f6f8; border-radius: 8px; }
.rcv-works .wk { white-space: nowrap; }
.rcv-works .num-in { width: 72px; min-height: 32px; padding: 2px 8px; text-align: right; }
.rcv-works select { width: auto; display: inline-block; min-height: 32px; padding: 2px 8px; }
.rcv-hint { margin: 0 0 8px; }
.rcv-doc .toolbar .push { margin-left: auto; }
.rcv-doc .pencil { text-decoration: none; font-size: 18px; margin-left: 4px; }
.rcv-doc .cam { text-decoration: none; margin-left: 4px; }
.rcv-doc .ph-cell { display: inline-flex; align-items: center; gap: 2px; }
.rcv-doc .op-wrap { display: inline-flex; align-items: center; gap: 2px; }
.rcv-doc .hint-dot { border-bottom: 1px dotted var(--ink-soft); cursor: help; }
.rcv-doc .box-group { margin: 18px 0 6px; font-size: 16px; }
.rcv-doc .box-legend { margin: 0 0 6px; }
.rcv-photo-groups { max-height: 60vh; overflow-y: auto; }
.rcv-photo-group { margin: 0 0 14px; }
.rcv-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.rcv-photos img { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid #d5dbe3; }
.rcv-photos .video-tile { display: inline-flex; align-items: center; justify-content: center; width: 120px; height: 120px; border-radius: 6px; background: #eef1f5; }
.pack-warn { margin: 8px 0 0; padding-left: 20px; }
.line-manual { margin: 0 0 10px; }
.line-manual summary { cursor: pointer; color: var(--blue-ink); }
.thumb.sm { width: 34px; height: 34px; }
.ops { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pill.op { border: 0; font: inherit; font-size: 14px; }
.rcv-doc .tbl.dense th, .rcv-doc .tbl.dense td { padding-left: 6px; padding-right: 6px; }
.rcv-doc .tbl.dense th.wide, .rcv-doc .tbl.dense td.wide { min-width: 140px; }
.rcv-doc .pill.op { white-space: normal; text-align: left; border-radius: 10px; padding: 2px 8px; line-height: 1.3; max-width: 200px; }
.pill.op .op-n { display: block; font-weight: 700; }
.pill.op .op-d { display: block; font-weight: 400; font-size: 12.5px; }
.rcv-doc .fact-cell { line-height: 1.25; white-space: nowrap; }
.rcv-doc .fact-more { display: block; font-size: 12.5px; }
button.pill.op { cursor: pointer; }
.ops .plus { min-width: 28px; min-height: 28px; padding: 0 6px; border: 1px dashed var(--line-hard); border-radius: 14px; background: #fff; color: var(--ink-soft); font: inherit; cursor: pointer; }
.cell-in { width: 150px; min-height: 32px; padding: 2px 8px; }

/* 41-W6 · «Возвраты и брак», «Ждём клиента», плитка на «Сегодня» */
.ret-thumb { cursor: zoom-in; width: 40px; height: 40px; }
.ret-items { min-width: 200px; }
.ret-item { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.ret-actions { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 150px; }
.ret-dec b { margin-right: 4px; }
.ret-over { color: var(--red); font-weight: 600; }
.ret-sub { padding: 3px 0; }
.ret-more td { background: #fafbfc; }
.ret-opt { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; cursor: pointer; }
.ret-opt input { margin-top: 5px; }
.ret-opt.off { opacity: .55; cursor: default; }
.ret-fields { margin: 8px 0 8px 26px; max-width: 460px; }
.ret-fields input, .ret-fields select { width: 100%; }
.ret-part { margin: 6px 0 6px 26px; }
.ret-partwrap { margin: 10px 0; }
.ret-crow { margin: 0 0 8px; align-items: center; }
.ret-crow .ret-who { flex: 1 1 260px; }
.ret-ident-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.ret-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.wait-group { margin: 0 0 22px; }
.today-nums { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 6px 0 0; }
.today-num b { font-size: 20px; }
/* 41-W2 «Задания» блоками */
.tk-blocks { margin-top: 8px; }
.tk-block { margin: 0 0 22px; }
.tk-h { font-size: 20px; margin: 18px 0 10px; font-weight: 700; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.tk-h .tk-sub { font-size: 15px; font-weight: 400; }
.tk-grp > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; }
.tk-grp > summary::before { flex: none; }
.tk-grp > summary .tk-name { flex: 1 1 260px; min-width: 0; }
.tk-grp > summary .tk-name .muted { font-weight: 400; }
.tk-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; font-weight: 400; }
.tk-sum { color: var(--ink-soft); }
.tk-pill { font-weight: 600; }
.tk-who { white-space: nowrap; }
.tk-late { border-color: #e9c4c0; }
.tk-over { font-weight: 600; }
.tk-grp .tbl-wrap { border: 0; border-radius: 0; background: transparent; }

/* 41-W6 · таблицы «Возвратов и брака» без прокрутки на 1366 */
.ret-tbl .tbl-wrap:has(> .tbl.dense), .tbl-wrap.ret-tbl:has(> .tbl.dense) { max-height: none; overflow-x: auto; overflow-y: visible; }
.ret-tbl .tbl.dense th, .ret-tbl .tbl.dense td { padding: 4px 6px; }
.ret-tbl .tbl.dense thead th { position: relative; white-space: normal; vertical-align: bottom; }
.ret-tbl .tbl.dense th.wide, .ret-tbl .tbl.dense td.wide { min-width: 0; }
.ret-tbl .tbl.dense td:not(.num):not(.wide) .cell { min-width: 0; }
.ret-tbl .tbl.dense td { vertical-align: top; }
.ret-base .tbl.dense th:nth-child(1) { min-width: 120px; }
.ret-base .tbl.dense td:nth-child(2) { white-space: nowrap; }
.ret-base .tbl.dense th:nth-child(3) { min-width: 190px; }
.ret-base .tbl.dense th:nth-child(4) { min-width: 100px; }
.ret-base .tbl.dense th:nth-child(5) { min-width: 76px; }
.ret-base .tbl.dense th:nth-child(6), .ret-base .tbl.dense th:nth-child(7) { min-width: 160px; }
.ret-items { min-width: 0; }
.ret-item span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; line-height: 1.25; }
.ret-item .ret-thumb { width: 32px; height: 32px; }
.ret-dec .ret-actions { margin-top: 4px; min-width: 0; }
/* ===== Сборка 45: плашки операций, задание поставщика, перемещение и подготовка (С7) ===== */
.ops .pill.plate { border: 1px solid transparent; border-radius: 14px; padding: 2px 10px; max-width: none; white-space: nowrap; font-size: 14px; line-height: 1.35; }
.ops .pill.plate.dashed { background: #fff; border: 1px dashed var(--ink-soft); color: var(--ink); }
.ops .pill.plate.diff { border: 2px solid #d9a400; background: var(--yellow-bg); color: var(--yellow); }
.ops .pill.plate .plate-fact { font-weight: 700; }
.wk-row .ops { display: inline-flex; vertical-align: middle; }
.rcv-tz { margin: 0 0 10px; }
.tz-block { background: var(--yellow-bg); border-left: 4px solid #e0a400; border-radius: 6px; padding: 10px 14px; max-width: 1100px; }
.tz-title { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: var(--yellow); margin: 0 0 4px; }
.tz-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.tz-text.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.tz-links { margin-top: 4px; display: flex; gap: 14px; }
.sim-pick { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: 14px; }
.sim-opt { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.prep-kinds { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.tz-help { margin: 4px 0; }
.tz-mark { font-weight: 700; font-size: 16px; }
.tz-mark.ok { color: var(--green); }
.tz-mark.warn { color: var(--yellow); }
.tz-mark.bad { color: var(--red); }
.tbl.dense tbody tr.tz-ok td { background: var(--green-bg); }
.tbl.dense tbody tr.tz-warn td { background: var(--yellow-bg); }
.tbl.dense tbody tr.tz-bad td { background: var(--red-bg); }
.ops-diff { max-width: 1100px; margin: 0 0 10px; font-weight: 400; }
.ops-diff .inline { margin-top: 6px; }
.move-doc .short-box { margin-top: 4px; }
.move-doc .short-box .inline { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.move-doc .tbl.dense tbody tr.row-short td { background: var(--red-bg); }
.move-doc .tbl.dense th, .move-doc .tbl.dense td { padding-left: 6px; padding-right: 6px; }
.moves-list .tbl.dense td { vertical-align: top; }
/* ===== Отгрузка ФБО (сборка 46): список, карточка, окна ===== */
.note.bad { background: var(--red-bg); color: var(--red); }
.ship-list .tbl.dense td { vertical-align: top; }
.ship-doc .tbl-wrap:has(> .tbl.dense) { max-height: none; overflow-x: auto; overflow-y: visible; }
.ship-doc .tbl.dense { font-size: 13px; }
.ship-doc .tbl.dense thead th { position: relative; white-space: normal; vertical-align: bottom; font-size: 12.5px; }
.ship-doc .tbl.dense th, .ship-doc .tbl.dense td { height: auto; padding: 4px 5px; vertical-align: top; }
.ship-doc .tbl.dense th.wide, .ship-doc .tbl.dense td.wide { min-width: 100px; }
.ship-doc .tbl.dense td .cell, .ship-preview .tbl.dense td .cell, .ship-diff .tbl.dense td .cell { min-width: 0; }
.ship-doc .tbl.dense td small { display: block; font-size: 11.5px; }
.ship-doc .tbl.dense tr.gh td { background: #eaf1fd; font-weight: 600; border-top: 2px solid var(--acc); font-size: 13px; }
.ship-doc .tbl.dense tr.gh td small { display: inline; font-weight: 400; }
.ship-doc .tbl.dense tr.sel td { background: #f3f7fe; }
.ship-doc .tbl.dense tbody tr.row-short td { background: var(--red-bg); }
.ship-diff .tbl.dense, .ship-preview .tbl.dense { font-size: 13px; }
.ship-diff .tbl.dense th, .ship-diff .tbl.dense td, .ship-preview .tbl.dense th, .ship-preview .tbl.dense td { height: auto; padding: 4px 5px; vertical-align: top; }
.ship-diff .tbl.dense tbody tr.row-short td { background: var(--red-bg); }
.ship-diff .tbl-wrap:has(> .tbl.dense), .ship-preview .tbl-wrap:has(> .tbl.dense) { max-height: 46vh; }
.ship-diff .tbl.dense thead th, .ship-preview .tbl.dense thead th { white-space: normal; position: relative; }
.ship-diff .tbl.dense th.num, .ship-diff .tbl.dense td.num { width: auto; min-width: 70px; }
.ship-diff .tbl.dense td:nth-child(2) { min-width: 220px; }
.ship-diff .tbl.dense td:last-child { min-width: 170px; }
.ship-fixed { table-layout: fixed; width: 100%; }
.ship-fixed td { overflow-wrap: anywhere; }
.ship-fixed th { overflow-wrap: normal; }
.ship-wrap { overflow-wrap: anywhere; }
.ship-doc .ship-num { white-space: normal; }
.ship-doc .ops .pill.plate { white-space: normal; max-width: 100%; text-align: left; }
.ship-doc .tbl.dense td.num { width: auto; }
.ship-bc { letter-spacing: 0; }
.ship-num { white-space: nowrap; }
.ship-num small { display: block; }
.own { background: var(--yellow-bg); border-radius: 4px; padding: 1px 4px; color: var(--yellow); }
.cm { color: var(--ink-soft); text-decoration: underline dotted; }
.chp { display: inline-block; border: 1px solid var(--line-hard); background: #fff; border-radius: 8px; padding: 1px 9px; margin: 0 5px 4px 0; font: inherit; font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--ink); }
button.chp { cursor: pointer; }
.chp.blue, .chp.on { border-color: var(--acc); background: var(--blue-bg); color: var(--blue-ink); }
.chp.warn { background: #fdf0d5; border-color: #e8c98a; color: #7a4b00; }
.chp .lnk { font-size: 13px; }
.ship-chips { margin: 2px 0 4px; }
.ship-sub { margin: 4px 0 8px; font-size: 14px; color: var(--ink-soft); }
.ship-sub b { color: var(--ink); }
.ship-sub .btn.small { padding: 2px 10px; font-size: 13px; }
.ship-more { margin: 0 0 8px; max-width: 640px; }
.ship-main { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0 0 8px; }
.ship-main .btn.primary { font-size: 16px; padding: 8px 22px; }
.ship-main .btn.ship-off { background: #e7ebf0; color: #8a939e; border-color: #e7ebf0; font-size: 16px; padding: 8px 22px; cursor: default; }
.ship-main .why { font-size: 14px; }
.ship-diffbar { max-width: 1100px; margin: 0 0 8px; font-weight: 400; }
.ship-dirs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; }
.ship-dirs .chp { margin-bottom: 0; }
.ship-sel { min-height: 28px; padding: 0 6px; font-weight: 700; }
.ship-doc .tbl.dense .ship-sel, .ship-doc .tbl.dense .btn.small { font-size: 13px; padding: 0 6px; min-height: 26px; }
.ship-doc .cm { white-space: nowrap; }
.ship-ok { color: var(--green); }
.ship-bad { color: var(--red); }
.ship-tools { flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.ship-tools .search { width: 300px; }
.ship-boxbtns { margin-left: auto; display: inline-flex; flex-wrap: wrap; justify-content: flex-end; white-space: nowrap; gap: 6px; }
/* сб.110 (р.212): таблица раскладки «Руками» как в старом — номер короба, размер, палета в ячейках */
.ship-doc .tbl.dense.lay2 td { padding: 5px 6px; vertical-align: middle; border-top: 1px solid var(--line); font-size: 14px; }
.ship-doc .tbl.dense.lay2 th.c, .ship-doc .tbl.dense.lay2 td.c { text-align: center; }
.ship-doc .tbl.dense.lay2 tr.lay-free > td { background: #fff7e6; }
.ship-doc .tbl.dense.lay2 tr.lay-freehead > td { background: #ffeccc; border-top: 2px solid #e8c98a; }
.ship-doc .tbl.dense.lay2 tr.lay-head > td { background: #eaf0f8; border-top: 2px solid var(--line-hard); }
.ship-doc .tbl.dense.lay2 tr.sel > td { background: #dfeaff; }
.lay2 input.lay-in { width: 100%; max-width: 64px; min-height: 30px; padding: 0 4px; text-align: center; font-size: 16px; font-weight: 800; }
.lay2 input.lay-in:disabled { background: transparent; border-color: transparent; color: var(--ink); opacity: 1; }
.lay2 input.lay-ren { max-width: 56px; font-size: 14px; font-weight: 700; }
.lay2 select.lay-sz { width: 100%; min-height: 30px; padding: 0 0 0 6px; font-size: 14px; }
.lay2 select.lay-sz.unset { color: var(--ink); }
.lay2 .lay-btns { display: flex; flex-wrap: nowrap; gap: 4px; }
.ship-doc .tbl.dense.lay2 td { overflow-wrap: anywhere; }
.lay2 .lay-btns .btn.small { font-size: 13px; padding: 0 7px; min-height: 28px; white-space: nowrap; }
.lay2 .bx-no { font-size: 17px; font-weight: 800; }
.lay2 .bx-mp { font-weight: 800; overflow-wrap: anywhere; }
.lay-bar { margin-top: 0; }
.lay-bar .btn { font-size: 14px; }
.lay-sum .lay-weights { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 14px; }
.lay-sum .lay-w { white-space: nowrap; }
.lay-sum input.lay-kg { width: 76px; min-height: 28px; text-align: right; padding: 0 6px; font-size: 14px; }
.ship-boxbtns .btn { white-space: nowrap; }
.ship-lay .bx-draft { color: #a15c00; }
.ship-res.bad ul { font-size: 14px; line-height: 1.5; }
.ship-total { font-size: 15px; margin: 4px 0 8px; }
.ship-total b { font-weight: 800; }
.ship-doc .tbl.dense.ship-lay td { padding-top: 5px; padding-bottom: 5px; border-top: 1px solid var(--line); }
.ship-doc .tbl.dense.ship-lay tr.bx-first > td { border-top: 2px solid var(--line-hard); }
.ship-doc .tbl.dense.ship-lay tr.pal-first > td { border-top: 3px solid var(--acc); }
.ship-doc .tbl.dense.ship-lay td.bx-cell { background: #f7f9fc; border-left: 1px solid var(--line-hard); font-size: 13px; line-height: 1.45; }
.ship-doc .tbl.dense.ship-lay td.pal-cell { background: #e6efff; border-left: 4px solid var(--acc); font-size: 13px; line-height: 1.45; }
.ship-doc .tbl.dense.ship-lay td.pal-none { background: #fbfbfb; border-left: 1px solid var(--line-hard); }
.ship-doc .tbl.dense.ship-lay tr.on-pal > td:not(.pal-cell):first-child { box-shadow: inset 4px 0 0 var(--acc); }
.ship-doc .tbl.dense.ship-lay td.nl-cell { background: #fff7e6; }
.ship-lay .bx-no { font-size: 18px; font-weight: 800; letter-spacing: 0; }
.ship-lay .bx-mp { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.ship-lay .bx-lbl { display: inline-block; min-width: 82px; margin-right: 4px; font-size: 11.5px; color: var(--ink-soft); }
.ship-lay .bx-state { font-size: 12.5px; font-weight: 600; }
.ship-lay .bx-row { margin: 3px 0; }
.ship-lay .bx-all { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 12.5px; }
.ship-doc .tbl.dense.ship-lay td.bx-cell .ship-sel, .ship-doc .tbl.dense.ship-lay td.pal-none .ship-sel { min-height: 26px; }
.ship-dirstrip { display: flex; flex-wrap: wrap; margin: 0 0 6px; }
.ship-dirstrip .ship-dirwh { flex: 0 0 100%; font-size: 13px; margin: 0 0 4px; }
.ship-dirstrip .chp { white-space: nowrap; }
.ship-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--blue-bg); padding: 6px 8px; border-radius: 8px; margin: 0 0 8px; }
.ship-note { margin: 8px 0; font-size: 14px; }
.ship-count { margin: 6px 0; }
.ship-newdirs { display: flex; flex-direction: column; gap: 6px; }
.ship-newdir { display: flex; gap: 8px; align-items: center; }
.ship-newdir .picker { flex: 1 1 auto; }
.ship-multi { border: 1px solid var(--line-hard); border-radius: 8px; padding: 6px 10px; margin: 6px 0; background: var(--blue-bg); }
.ship-multi-dirs { margin: 4px 0 0; }
ul.ship-multi-dirs { padding-left: 18px; margin: 2px 0; font-size: 13px; }
.ship-tzdirs { margin: 0 0 12px; }
.ship-tzdir { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 6px 0; }
.ship-tzdir .picker { min-width: 0; }
.ship-date { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ship-date input { width: 150px; }
.ship-preview .pill, .ship-diff .pill { white-space: normal; text-align: left; }
.ship-res ul { margin: 4px 0 10px 18px; padding: 0; }
.ship-res.bad b { color: var(--red); }
.ship-res.ok b { color: var(--green); }
.ship-reason-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.ship-reason-panel input { min-width: 220px; }
.ship-acts { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.ship-lay-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ship-lay-row input { width: 90px; }
.rcv-st .chip.done, .rcv-st .chip.done[disabled] { color: var(--green); background: var(--green-bg); border-color: #bfe0cf; }
.transit-box .transit-dir { margin-top: 6px; font-weight: 400; }
.transit-box .transit-dir select { width: auto; min-width: 220px; display: inline-block; }

/* окно «понял так»: таблица с переносом, в окно по ширине (С7) */
.modal.xwide.tz-prev { max-width: min(1240px, 96vw); }
.tz-prev .tbl.dense th, .tz-prev .tbl.dense td { height: auto; padding: 4px 5px; vertical-align: top; overflow-wrap: anywhere; }
.tz-prev .tbl.dense thead th { white-space: normal; position: relative; }
.tz-prev .tbl.dense th.wide, .tz-prev .tbl.dense td.wide { min-width: 110px; }
.tz-prev .tbl.dense td .cell { min-width: 0; }
.tz-prev .modal-body { overflow-x: hidden; }
.tz-prev .tz-nb { white-space: nowrap; }
.tz-prev .tz-word { overflow-wrap: normal; word-break: normal; hyphens: manual; }
.tz-prev .tbl-wrap:has(> .tbl.dense) { max-height: 46vh; }
.transit-box .transit-cab { margin-top: 8px; }
.rcv-doc .pill.transit { margin-left: 6px; }
.rcv-doc .rcv-cell a { font-weight: 700; }

.tz-prev .tbl.dense th.num, .tz-prev .tbl.dense td.num { white-space: nowrap; min-width: 64px; width: 1%; }
.tz-prev .tbl.dense thead th.num { overflow-wrap: normal; word-break: normal; }
.tz-prev .tbl.dense th.wide, .tz-prev .tbl.dense td.wide { min-width: 90px; max-width: 280px; }
.tz-prev .tbl.dense thead th { overflow-wrap: normal; word-break: normal; }

/* ===== Сборка 55: стол в перемещении, подготовка «на месте», комплект ===== */
.desk-strip { background: var(--blue-bg); border-radius: 8px; padding: 8px 12px; margin: 0 0 10px; }
.desk-strip .desk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.desk-strip .desk-sum { margin-right: auto; color: var(--blue-ink); }
.desk-strip .desk-sub { margin-top: 6px; text-align: right; }
.move-doc .zone-chip { display: inline-block; border: 1px solid var(--line-hard); border-radius: 6px; padding: 0 6px; font-size: 13px; color: var(--ink-soft); }
.move-doc .grid-head { display: flex; align-items: center; gap: 12px; margin: 14px 0 2px; }
.kit-box { margin-top: 6px; }
.kit-text { color: var(--blue-ink); }
.kit-box .inline { margin-top: 4px; gap: 6px; }
.kit-box .inline input.kit-per { flex: none; width: 70px; }
.kit-box .inline input.kit-code { flex: 1 1 160px; max-width: 240px; }
.tk-wait { color: var(--yellow); font-weight: 600; }

/* ===== docui · единый каркас карточки документа и списка (сборка 56, web/js/docui.js); ширина 1366 без горизонтальной прокрутки ===== */
.dui-card { margin: 0 0 6px; }
.dui-title { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; flex-wrap: wrap; }
.dui-title h1 { font-size: 22px; margin: 0; }
.dui-title .back-link { text-decoration: none; font-weight: 600; font-size: 16px; white-space: nowrap; }
.dui-title .pencil { margin-left: -4px; font-size: 16px; text-decoration: none; }
.dui-pill { display: inline-block; background: var(--rail); color: #fff; border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.dui-pill.cancelled { background: var(--red); }
.dui-cancel { color: var(--red); font-size: 14px; background: none; border: 0; padding: 4px 2px; cursor: pointer; font-family: inherit; text-decoration: none; }
.dui-cancel:hover { text-decoration: underline; }
.dui-fields { display: grid; margin: 12px 0 0; background: #f6f7f9; border-radius: 10px; overflow: hidden; }
.dui-cell { padding: 9px 14px; min-width: 0; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
.dui-cell small { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 2px; white-space: nowrap; }
.dui-cell > b, .dui-cell .dui-v { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.dui-cell .dui-sub { display: block; font-size: 13px; color: var(--ink-soft); font-weight: 400; overflow-wrap: anywhere; }
.dui-cell .dui-sub .lnk { font-size: 13px; }
.dui-cell .dui-sub .btn.small { font-size: 12px; padding: 1px 8px; min-height: 22px; }
.dui-cell .chp { white-space: nowrap; max-width: 100%; }
.dui-cell .ship-sel { text-align: left; white-space: normal; height: auto; padding: 3px 8px; font-size: 13px; max-width: 100%; }
@media (max-width: 1000px) { .dui-fields { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important; } }
.dui-resp { font: inherit; font-size: 14px; font-weight: 600; padding: 2px 6px; border: 1px solid var(--line-hard); border-radius: 6px; background: #fff; max-width: 100%; }
.dui-stepwrap { margin: 14px 0 0; }
.dui-steprow { display: flex; align-items: flex-start; gap: 10px; }
.dui-steps { display: flex; align-items: flex-start; flex-wrap: wrap; row-gap: 8px; min-width: 0; }
.dui-st { display: flex; align-items: flex-start; }
.dui-step { display: inline-flex; align-items: flex-start; gap: 6px; color: #8d95a1; font: inherit; font-size: 14px; line-height: 20px; white-space: nowrap; background: none; border: 0; padding: 0; text-align: left; }
.dui-step i { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #cfd4da; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; background: #fff; color: #fff; box-sizing: border-box; }
.dui-step .who { display: block; font-size: 11px; line-height: 1.3; color: var(--ink-soft); font-weight: 400; }
.dui-step.done { color: var(--green); }
.dui-step.done i { background: var(--green); border-color: var(--green); }
.dui-step.now { color: var(--ink); font-weight: 700; }
.dui-step.now i { background: var(--rail); border-color: var(--rail); font-size: 8px; }
button.dui-step.back { cursor: pointer; }
button.dui-step.back:hover .lb { text-decoration: underline; }
.dui-ln { flex: 0 0 22px; min-width: 8px; height: 2px; background: #d7dbe0; margin: 9px 8px 0; }
.dui-ln.done { background: var(--green); }
.dui-sp { flex: 1; }
.dui-next { white-space: nowrap; flex: none; font-weight: 600; min-height: 34px; padding: 5px 14px; font-size: 14px; }
.dui-next:not(.off) { background: var(--acc); border-color: var(--acc); color: #fff; }
.dui-next:not(.off):hover { background: var(--acc-dark); border-color: var(--acc-dark); }
.dui-next.off { background: var(--gray-bg); border-color: var(--gray-bg); color: #8a939e; cursor: default; }
.dui-cancelled { display: flex; align-items: center; gap: 6px; flex: none; font-size: 13px; color: var(--red); }
.dui-alert { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 12px 0 0; padding: 7px 12px; border-radius: 8px; font-size: 14px; }
.dui-alert.warn { background: #fff7e6; border: 1px solid #f3d9a4; }
.dui-alert.quiet { padding: 0; }
.dui-alert .dui-sp { min-width: 0; }
.dui-alert b.dui-whynot { color: var(--yellow); }
.dui-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dui-tg { border: 1px solid var(--acc); border-radius: 999px; padding: 2px 11px; background: var(--acc); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.dui-tg.on::before { content: "✓ "; }
.dui-tg.off { background: #fff; color: var(--acc); border-style: dashed; }
.dui-tg.off::before { content: "+ "; }
.dui-tg[disabled] { opacity: .6; cursor: default; }
.dui-mark { display: inline-block; border: 1px solid transparent; border-radius: 8px; padding: 2px 10px; background: var(--gray-bg); color: var(--gray); font: inherit; font-size: 13px; font-weight: 600; }
.dui-mark.blue { background: var(--blue-bg); color: var(--blue-ink); }
.dui-mark.yellow { background: var(--yellow-bg); color: var(--yellow); }
.dui-mark.red { background: var(--red-bg); color: var(--red); }
.dui-mark.green { background: var(--green-bg); color: var(--green); }
button.dui-mark.edit { cursor: pointer; background: #fff; border-color: #e0a400; color: var(--ink); }
.dui-markbtn { min-height: 26px; padding: 0 10px; font-size: 12px; }
.dui-kpiwrap { margin: 12px 0 0; }
.dui-kpi { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dui-kpi > div { flex: 1 1 110px; padding: 7px 12px; min-width: 0; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
.dui-kpi small { display: block; color: var(--ink-soft); font-size: 12px; line-height: 1.25; margin-bottom: 1px; }
.dui-kpi > div > b { display: block; }
.dui-kpi b { font-size: 18px; }
.dui-kpi b.txt { font-size: 15px; }
.dui-kpi .dui-bad b, .dui-kpi .dui-bad { color: var(--red); }
.dui-kpi .dui-bad small { color: var(--ink-soft); }
.dui-kpi .more { flex: 0 0 auto; display: flex; align-items: center; }
.dui-bad { color: var(--red); font-weight: 650; }
a.dui-bad { text-decoration: underline; }
.dui-sumdet { background: #f6f7f9; border-radius: 8px; padding: 8px 12px; margin: 6px 0 0; }
.dui-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 12px 0 0; }
.dui-actions .btn { min-height: 34px; padding: 5px 13px; font-size: 14px; white-space: nowrap; }
.dui-right { margin-left: auto; display: inline-flex; gap: 7px; }
.dui-sep { width: 1px; height: 24px; background: var(--line-hard); margin: 0 4px; }
.btn.sv { background: #f1f3f5; border-color: #e0e3e8; color: #5b6470; }
.dui-actions .btn.dui-tl.on { background: var(--blue-bg); border-color: var(--acc); color: var(--blue-ink); }
.dui-works, .dui-money { margin: 8px 0 0; }
.dui-wk { font-size: 14px; }
.dui-wkbody { margin: 0; padding: 8px 12px; background: #f6f7f9; border-radius: 8px; }
.dui-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 10px 0 6px; font-size: 14px; }
.dui-tools .search { width: 330px; max-width: 100%; margin: 0; }
.dui-tools .check { margin: 0; min-height: 32px; }
.dui-count { font-size: 13px; }
.dui-prod { line-height: 1.3; }
.dui-prod small { display: block; color: var(--ink-soft); font-size: 12px; }
.dui-prod small b { color: var(--ink); }
.dui-doc .dui-doc-title { font-size: 15px; font-weight: 700; }
.dui-doc small.dui-doc-num { font-size: 11px; opacity: .85; }
.dui-lbl { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; line-height: 1.3; }
.dui-lbl .dui-doc-title { font-size: 15px; font-weight: 700; }
.dui-lbl small.dui-doc-num { font-size: 11px; color: var(--ink-soft); font-weight: 400; }
.dui-title .dui-num { color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.dui-photo { display: inline-block; width: 32px; height: 26px; border-radius: 4px; object-fit: cover; background: #c9d0cb; vertical-align: middle; }
.dui-photo.none { font-size: 9px; text-align: center; line-height: 26px; color: #4a554f; }
.dui-allchk input, .dui-chk { width: 18px; height: 18px; }
.dui-selbar { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 8px 0; padding: 10px 14px; background: var(--rail); color: #fff; border-radius: 10px; }
.dui-selbar .btn { min-height: 30px; padding: 3px 10px; font-size: 13px; background: #2f3a48; border-color: #47566a; color: #fff; }
.dui-selbar .btn:hover { background: #3a4757; }
.dui-selbar em { margin-left: 5px; font-style: normal; font-size: 11px; font-weight: 700; color: #ffd48a; }
.dui-selcount { margin-right: 6px; font-size: 15px; }
.dui-onlynote { font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.dui-selbreak { flex-basis: 100%; height: 0; }
.dui-notes { margin: 10px 0 4px; font-size: 14px; }
.dui-notes .pencil { text-decoration: none; }
.dui-histbar { margin: 4px 0; font-size: 14px; }
.dui-hist { background: #f6f7f9; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.dui-hrow { padding: 2px 0; }
.dui-chip { display: inline-block; border-radius: 8px; padding: 1px 9px; margin: 0 4px 2px 0; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--gray-bg); color: var(--gray); }
.dui-chip.blue { background: var(--blue-bg); color: var(--blue-ink); }
.dui-chip.green { background: var(--green-bg); color: var(--green); }
.dui-chip.yellow { background: var(--yellow-bg); color: var(--yellow); }
.dui-chip.red { background: var(--red-bg); color: var(--red); }
.dui-statuscell { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.dui-listtop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; }
.dui-listtop .search { width: auto; max-width: 330px; margin: 0; flex: 1 1 200px; min-width: 160px; }
.dui-listtop > .btn { flex: none; white-space: nowrap; }
.dui-list .tabs { flex-wrap: wrap; overflow: visible; }
.dui-list .tabs > button { padding: 8px 11px; }
.dui-svod .dui-svodtot { margin: 8px 0; text-align: right; font-size: 16px; }
.dui-svod .dui-svodhead { margin: 0 0 8px; }
.dui-ylw { margin: 10px 0 0; padding: 8px 12px; background: #fdf2c4; border: 1px solid #ecd88a; border-radius: 8px; color: #5c4500; }
.dui-ylw ul { margin: 4px 0; padding-left: 18px; }
.dui-ylw p { margin: 4px 0; }
.dui-warn { margin: 6px 0 0; padding-left: 18px; }
/* ===== ПМ, ПГ, брак на каркасе docui (U4): выбор строки в окнах, «ШК → новый ШК» ===== */
.dui-pick { display: flex; flex-direction: column; gap: 4px; max-height: 40vh; overflow: auto; }
.dui-pickrow { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border: 1px solid var(--line-hard); border-radius: 8px; cursor: pointer; background: #fff; }
.dui-pickrow:hover { background: #f3f7fe; }
.dui-pickrow input { margin-top: 3px; }
.dui-pickrow:has(input:checked) { border-color: var(--acc); background: var(--blue-bg); }
.move-doc .dui-prod .ink, .move-doc .dui-prod b.ink { color: var(--ink); }
.move-doc .dui-prod small.nw { white-space: nowrap; }
.modal .dui-card .dui-actions { margin: 8px 0; }
.modal .dui-fields { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)) !important; }
.modal .dui-title { margin-top: 2px; }
.dui-list td:first-child .dui-prod b { white-space: nowrap; }
.dui-list td:first-child .dui-prod b.dui-doc-title { white-space: normal; max-width: 340px; }
/* ---------- карточка клиента (сб.63): шапка, факты, кабинеты слева, блоки маркетплейсов ---------- */
.cl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; }
.cl-head .sp, .cl-card-h .sp, .cl-mp-head .sp { flex: 1 1 auto; }
.cl-back { font-size: 24px; line-height: 1; text-decoration: none; font-weight: 650; padding: 2px 6px; }
.cl-head h1 { margin: 0; }
.cl-facts { display: flex; gap: 8px 28px; flex-wrap: wrap; margin: 6px 0 10px; }
.cl-facts > div { font-size: 12.5px; color: var(--ink-soft); }
.cl-facts b { display: block; font-size: 15px; color: var(--ink); font-weight: 600; }
.cl-body { min-width: 0; }
.cl-cols { display: flex; gap: 16px; align-items: flex-start; }
.cl-left { width: 240px; flex: none; border-right: 1px solid var(--line); padding-right: 12px; }
.cl-right { flex: 1 1 auto; min-width: 0; }
.cl-cab { display: block; width: 100%; text-align: left; font: inherit; border: 0; background: transparent; border-radius: 8px; padding: 8px 10px; margin: 0 0 4px; cursor: pointer; color: var(--ink); }
.cl-cab:hover { background: var(--gray-bg); }
.cl-cab.on { background: var(--blue-bg); font-weight: 650; }
.cl-cab.closed { color: var(--ink-soft); }
.cl-cab .cl-cab-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cl-cab small { display: block; color: var(--ink-soft); font-weight: 400; font-size: 12.5px; }
.cl-card-h, .cl-mp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; font-size: 17px; }
.cl-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 6px 0; }
.cl-row .lab { color: var(--ink-soft); font-size: 13px; }
.cl-mp .check { min-height: 28px; margin: 0; }
.cl-mp .check input { width: 18px; height: 18px; }
.cl-mp .tbl-wrap { margin-top: 8px; }
.cl-write { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 14px; }
.cl-write.off { color: var(--red); }
.cl-write.on { color: var(--green); }
.cl-body .btn.small, .cl-facts .btn.small { min-height: 30px; padding: 3px 10px; font-size: 13px; }
.cl-row select { width: auto; min-width: 230px; max-width: 100%; }
.cl-mp td .btn.small { white-space: nowrap; }.cl-sw { position: relative; width: 36px; height: 20px; border-radius: 10px; border: 0; padding: 0; background: #c7cbd3; cursor: pointer; flex: none; }
.cl-sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .12s; }
.cl-sw.on { background: var(--green); }
.cl-sw.on::after { left: 19px; }
.cl-sw:disabled { cursor: default; opacity: .8; }
@media (max-width: 820px) {
  .cl-cols { flex-direction: column; }
  .cl-left { width: 100%; border-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
}