/* ==========================================================================
   «Замовлення» у стилі 1С — реєстр документів і картка документа.
   Перший прохід, 08.09.2026. Тільки вигляд: жодних нових полів і сутностей.
   Файл підключається ОСТАННІМ, щоб перекривати compact-headers.css без !important.
   ========================================================================== */

/* --- РЕЄСТР --------------------------------------------------------------- */
#orders-card .orders-1c{
  min-width:0;
  width:100%;
  table-layout:fixed;
  font-variant-numeric:tabular-nums;
}
#orders-card .orders-1c th{
  padding:7px 10px;
  font-size:11px;
  font-weight:750;
  letter-spacing:.04em;
  color:#6b7d99;
  background:#f7f9fd;
  border-bottom:1px solid #d9e2ef;
  border-top:1px solid #d9e2ef;
  white-space:nowrap;
}
#orders-card .orders-1c td{
  padding:6px 10px;
  font-size:13px;
  line-height:1.3;
  vertical-align:middle;
  border-bottom:1px solid #eef2f8;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
#orders-card .orders-1c tbody tr:hover td{background:#f2f6ff}
#orders-card .orders-1c tbody tr.clickable{cursor:pointer}

/* Ширини: реєстр має бути ВУЖЧИМ за вікно, а не тягнути горизонтальну смугу. */
#orders-card .orders-1c .o1c-c-date{width:104px}
#orders-card .orders-1c .o1c-c-ship{width:132px}
#orders-card .orders-1c .o1c-c-sum{width:150px;text-align:right}
#orders-card .orders-1c .o1c-c-wb{width:120px}
#orders-card .orders-1c .o1c-c-state{width:96px;text-align:center}
#orders-card .orders-1c .o1c-c-party{width:auto;white-space:normal}

#orders-card .orders-1c td.o1c-c-party b{font-weight:700;font-size:13px}
#orders-card .orders-1c td.o1c-c-party small{
  display:inline;
  margin-left:7px;
  color:#8394ad;
  font-size:12px;
}
#orders-card .orders-1c td.o1c-c-sum{font-weight:700}
#orders-card .orders-1c .o1c-dash{color:#b6c2d4}
#orders-card .orders-1c .o1c-empty{
  padding:26px 12px;text-align:center;color:var(--muted);white-space:normal;
}

/* Ознака проблемної ціни — маленька, поруч із контрагентом. */
#orders-card .orders-1c .o1c-flag{
  display:inline-block;margin-left:8px;padding:1px 7px;border-radius:999px;
  font-size:11px;font-weight:700;vertical-align:1px;
}
#orders-card .orders-1c .o1c-flag.is-bad{background:#fdeaea;color:#b83b3b}
#orders-card .orders-1c .o1c-flag.is-wait{background:#fff3da;color:#a26300}
#orders-card .orders-1c .o1c-owed{display:inline;margin-left:8px;color:#b06a12;font-weight:700}

/* Стан рядка. Відвантажене — тихо-зелене, прострочене — тепла ліва межа. */
#orders-card .orders-1c tr.is-shipped td{background:#f6fdf8}
#orders-card .orders-1c tr.is-shipped:hover td{background:#eefaf2}
#orders-card .orders-1c tr.is-unpaid td:first-child{box-shadow:inset 3px 0 0 #e9b949}
#orders-card .orders-1c tr.is-overdue td:first-child{box-shadow:inset 3px 0 0 #e05c5c}
#orders-card .orders-1c tr.is-overdue td.o1c-c-ship{color:#c23b3b;font-weight:700}

/* --- ТРИ ГАЛОЧКИ: Склад / Транспорт / Рахунок ----------------------------- */
#orders-card .orders-1c th.o1c-c-state{padding:5px 6px}
#orders-card .orders-1c th.o1c-c-state i{
  display:inline-block;width:26px;font-style:normal;font-size:9px;
  letter-spacing:.02em;color:#8ea0bb;text-align:center;
}
#orders-card .orders-1c td.o1c-c-state{padding:5px 6px;white-space:nowrap}
.o1c-mark{
  display:inline-block;width:15px;height:15px;margin:0 5px;
  border:1.5px solid #bcc9db;border-radius:4px;background:#fff;
  font-style:normal;vertical-align:middle;position:relative;
}
.o1c-mark.is-part{
  border-color:#e3a72c;
  background:linear-gradient(135deg,#f6c96a 0 50%,#fff 50% 100%);
}
.o1c-mark.is-done,.o1c-mark.is-extra{border-color:#1f9254;background:#22a35c}
.o1c-mark.is-done::after,.o1c-mark.is-extra::after{
  content:"";position:absolute;left:4px;top:1px;width:4px;height:8px;
  border:solid #fff;border-width:0 2px 2px 0;transform:rotate(42deg);
}
/* «Готово» проти «закрито фактом»: подвійна обручка — вісь закрита не
   готовністю, а фактом (товар поїхав / рахунок відвантажено). */
.o1c-mark.is-extra{box-shadow:0 0 0 1.5px #fff,0 0 0 3px #22a35c}
.o1c-mark.is-na{border-style:dashed;border-color:#dde4ee;background:#fafbfd}

@media(max-width:820px){
  #orders-card .orders-1c{table-layout:auto;min-width:660px}
  #orders-card .orders-1c .o1c-c-sum{width:120px}
}

/* --- КАРТКА ДОКУМЕНТА ----------------------------------------------------- */
dialog.modal-wide .order-1c .o1c-subtitle{display:none}

.order-1c .o1c-doc-head{
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  flex-wrap:wrap;margin:0 0 12px;padding:0 0 11px;border-bottom:1px solid #e3eaf4;
}
.order-1c .o1c-doc-name{display:flex;align-items:baseline;gap:11px;min-width:0}
.order-1c .o1c-doc-name b{font-size:19px;font-weight:800}
.order-1c .o1c-doc-name span{color:#7488a5;font-size:13px;white-space:nowrap}
.order-1c .o1c-doc-chips{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.order-1c .o1c-doc-state{display:flex;align-items:center;gap:13px}
.order-1c .o1c-doc-state span{
  display:inline-flex;align-items:center;gap:6px;color:#5f7390;font-size:12px;font-weight:650;
}
/* Перемикач типу лишається, але вже як компактний сегмент у шапці. */
.order-1c .order-kind-switch{margin:0;padding:3px;gap:2px;border-radius:9px}
.order-1c .order-kind-switch button{padding:6px 13px;font-size:12.5px;border-radius:7px}

dialog.modal-wide .order-1c .o1c-head-block{
  margin-bottom:12px;padding:12px 14px;border-radius:10px;background:#f8fafe;border:1px solid #e4ebf6;
}
dialog.modal-wide .order-1c .o1c-head-block .coil-grid{
  grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 16px;
}

/* --- Вкладки -------------------------------------------------------------- */
.order-1c .o1c-tabs{
  display:flex;gap:2px;margin:0 0 -1px;border-bottom:1px solid #d9e2ef;
}
.order-1c .o1c-tabs button{
  border:1px solid transparent;border-bottom:0;background:transparent;
  padding:8px 15px;border-radius:8px 8px 0 0;
  color:#5f7390;font-size:13px;font-weight:700;cursor:pointer;
}
.order-1c .o1c-tabs button:hover{background:#f1f5fd;color:var(--ink)}
.order-1c .o1c-tabs button.is-active{
  background:#fff;border-color:#d9e2ef;color:var(--ink);
  box-shadow:inset 0 2px 0 var(--blue);
}
.order-1c .o1c-panel-hidden{display:none !important}
dialog.modal-wide .order-1c .o1c-panel{
  margin:0 0 12px;padding:14px;border:1px solid #d9e2ef;border-radius:0 10px 10px 10px;background:#fff;
}
dialog.modal-wide .order-1c .o1c-items .coil-section{
  margin:0;padding:0;border:0;background:transparent;
}

/* --- Таблиця позицій ------------------------------------------------------
   Флекс, а не grid: приховані `.shipment-only` колонки не мають зсувати сусідів. */
.order-1c .o1c-items-head,
.order-1c .o1c-row,
.order-1c .o1c-items article.order-extra-item{
  display:flex;align-items:flex-start;gap:10px;
}
.order-1c .o1c-items article.order-extra-item > .coil-grid{display:contents}
.order-1c .o1c-row.o1c-row-first{display:flex}

.order-1c .o1c-items-head{
  padding:6px 8px;border-radius:7px;background:#f2f6fd;border:1px solid #e2e9f5;
  color:#6b7d99;font-size:11px;font-weight:750;letter-spacing:.03em;text-transform:uppercase;
}
.order-1c .o1c-row,
.order-1c .o1c-items article.order-extra-item{
  margin:0;padding:9px 8px;border:0;border-bottom:1px solid #eef2f8;background:transparent;
}
.order-1c .o1c-items article.order-extra-item:hover,
.order-1c .o1c-row:hover{background:#fbfcff}

.order-1c .o1c-cell{min-width:0;font-size:12px;font-weight:700;color:var(--ink)}
.order-1c .o1c-lbl{display:none}
.order-1c .o1c-cell input,
.order-1c .o1c-cell select{width:100%;margin-top:0}

.order-1c .o1c-c-no{flex:0 0 96px}
.order-1c .o1c-c-model{flex:1 1 210px}
.order-1c .o1c-c-qty{flex:0 0 104px}
.order-1c .o1c-c-price{flex:0 0 112px}
.order-1c .o1c-c-rowsum{flex:0 0 124px;text-align:right}
.order-1c .o1c-c-pallets{flex:0 0 86px}
.order-1c .o1c-c-psize{flex:0 0 170px}
.order-1c .o1c-c-act{flex:1 1 190px;display:flex;flex-wrap:wrap;align-items:center;gap:6px}

/* Поповнення складу не має ані ціни, ані палет — шапка ховає ті самі колонки,
   що й `.shipment-only` у рядках, інакше вони роз'їхались би. */
.order-1c .o1c-items.is-stock .o1c-items-head .o1c-c-price,
.order-1c .o1c-items.is-stock .o1c-items-head .o1c-c-rowsum,
.order-1c .o1c-items.is-stock .o1c-items-head .o1c-c-pallets,
.order-1c .o1c-items.is-stock .o1c-items-head .o1c-c-psize,
.order-1c .o1c-items.is-stock .o1c-row .o1c-c-rowsum{display:none}

.order-1c .o1c-c-no{padding-top:7px;color:#7488a5;font-size:12px;font-weight:650}
.order-1c .o1c-c-no b{font-weight:650}
.order-1c .o1c-items article.order-extra-item > header.o1c-c-no{
  display:flex;flex-direction:column;align-items:flex-start;gap:2px;margin:0;
}
.order-1c .o1c-c-no .remove-order-item{padding:0;color:#c0563f;font-size:11px}
.order-1c .o1c-c-rowsum{padding-top:7px;font-variant-numeric:tabular-nums}
.order-1c .o1c-c-rowsum output{font-size:13px;font-weight:750}
.order-1c .o1c-c-model .model-stock-hint{display:block;margin-top:4px;font-size:11px;font-weight:600;color:#3d7a54}

.order-1c .o1c-c-act .o1c-note{font-size:11px;font-weight:700;color:var(--muted);line-height:1.25}
.order-1c .o1c-c-act .o1c-note.is-done{color:#157347}
.order-1c .o1c-c-act .o1c-note.is-work{color:var(--blue)}
.order-1c .o1c-c-act .o1c-note.is-wait{color:#a26712}
.order-1c .o1c-act-btn{padding:5px 9px;font-size:11.5px;line-height:1.2;border-radius:7px}

.order-1c .o1c-items-total{
  display:flex;justify-content:flex-end;gap:24px;
  margin-top:10px;padding:9px 10px;border-radius:8px;background:#f7f9fd;
  font-size:12.5px;color:#5f7390;
}
.order-1c .o1c-items-total b{color:var(--ink);font-size:14px;font-variant-numeric:tabular-nums}
.order-1c #add-order-item{margin-top:10px;padding:6px 11px;font-size:12.5px}

@media(max-width:980px){
  .order-1c .o1c-items-head{display:none}
  .order-1c .o1c-lbl{display:block;margin-bottom:2px;color:var(--muted);font-size:11px;font-weight:700}
  .order-1c .o1c-row,
  .order-1c .o1c-items article.order-extra-item{flex-wrap:wrap}
  dialog.modal-wide .order-1c .o1c-head-block .coil-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Хрестик закриття не має накривати перемикач типу документа. */
dialog.modal-wide .order-1c .o1c-doc-head{padding-right:34px}
.order-1c .order-kind-switch{flex:0 0 auto;white-space:nowrap}
.order-1c .order-kind-switch button{white-space:nowrap}

/* `.coil-grid input{min-height:48px}` сильніший за компактні відступи
   `.modal-wide`; у рядку позицій 48 px — це третина висоти рядка. */
dialog.modal-wide .order-1c .coil-grid input,
dialog.modal-wide .order-1c .coil-grid select,
dialog.modal-wide .order-1c .o1c-cell input,
dialog.modal-wide .order-1c .o1c-cell select{min-height:34px;padding:6px 9px}
dialog.modal-wide .order-1c .o1c-head-block .coil-grid > label{gap:3px;font-size:11.5px;color:#5f7390}
dialog.modal-wide .order-1c .o1c-head-block .coil-grid input,
dialog.modal-wide .order-1c .o1c-head-block .coil-grid select{min-height:32px}

.order-1c .o1c-items-head .o1c-c-rowsum{text-align:right}
.order-1c .o1c-items-head .o1c-c-act{flex:1 1 190px}

/* Голий селектор `header{background:#142b50;height:68px}` зі style.css бʼє по
   БУДЬ-ЯКОМУ <header>, зокрема по шапці додаткової позиції — вона виходила
   темно-синьою плашкою на всю комірку. */
.order-1c .o1c-items article.order-extra-item > header{
  height:auto;padding:0;background:transparent;color:#7488a5;box-shadow:none;
}
.order-1c .o1c-items article.order-extra-item{border:0;border-radius:0;background:transparent}
.order-1c .o1c-items article.order-extra-item + article.order-extra-item{margin-top:0}

/* `production.css` має ГОЛИЙ `header b{color:#fff!important;font-size:14px!important}`
   — правило для верхньої панелі застосунку, яке б'є по <b> у БУДЬ-ЯКОМУ <header>.
   Номер додаткової позиції через нього був білим по білому: текст у DOM є,
   на екрані його немає. Перебити можна лише таким самим !important. */
.order-1c .o1c-items article.order-extra-item > header b{
  color:#7488a5!important;font-size:12px!important;font-weight:650;
  letter-spacing:0;text-transform:none;
}

/* Видимий слід падіння нового рендера. Без нього «новий код упав» і «деплой
   не доїхав» виглядають на екрані абсолютно однаково — старою таблицею. */
.o1c-failure{
  margin:0 0 14px;padding:10px 13px;border:1px solid #f3c2c2;border-left:4px solid #d94b4b;
  border-radius:9px;background:#fff8f8;color:#a33636;font-size:13px;font-weight:650;
}

/* --- MASTER–DETAIL: реєстр зверху, склад вибраного замовлення знизу ------- */
#orders-card .o1c-registry-wrap{
  max-height:42vh;min-height:190px;overflow:auto;border:1px solid #d9e2ef;border-radius:9px 9px 0 0;
}
#orders-card .o1c-registry-wrap .orders-1c thead{position:sticky;top:0;z-index:2}
#orders-card .orders-1c tr.is-selected td{background:#e8f0ff;box-shadow:inset 0 1px #c7d7f4,inset 0 -1px #c7d7f4}
#orders-card .orders-1c tr.is-selected td:first-child{box-shadow:inset 3px 0 0 var(--blue),inset 0 1px #c7d7f4,inset 0 -1px #c7d7f4}
#orders-card .orders-1c tr:focus{outline:2px solid #7f9fe9;outline-offset:-2px}

.o1c-inline-detail{border:1px solid #cbd8ea;border-top:0;border-radius:0 0 10px 10px;background:#fff;min-height:210px}
.o1c-detail-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:11px 14px;border-bottom:1px solid #dce5f1;background:#f6f9fd}
.o1c-detail-head small{display:block;color:#71839e;font-size:10px;font-weight:750;text-transform:uppercase;letter-spacing:.06em}
.o1c-detail-head h3{margin:2px 0 0;font-size:16px;color:var(--ink)}
.o1c-detail-actions{display:flex;gap:7px;flex-wrap:wrap}
.o1c-detail-actions button{padding:6px 10px;font-size:12px}
.o1c-detail-meta{display:grid;grid-template-columns:repeat(7,minmax(105px,1fr));gap:0;border-bottom:1px solid #e3eaf3}
.o1c-detail-meta>span{display:grid;gap:3px;min-width:0;padding:9px 11px;border-right:1px solid #edf1f6}
.o1c-detail-meta>span:last-child{border-right:0}
.o1c-detail-meta small{color:#71839e;font-size:10px;text-transform:uppercase;letter-spacing:.04em}
.o1c-detail-meta b{overflow:hidden;color:#243b5a;font-size:12px;text-overflow:ellipsis;white-space:nowrap}
.o1c-detail-meta .o1c-detail-axes{grid-column:span 2}
.o1c-detail-axes>b{display:flex;align-items:center;gap:9px;overflow:visible}
.o1c-detail-axes>b>span{display:inline-flex;align-items:center;white-space:nowrap;font-weight:650}
.o1c-detail-axes .o1c-mark{margin:0 4px 0 0}
.o1c-detail-table-wrap{overflow:auto;max-height:31vh}
.o1c-detail-table{width:100%;min-width:900px;table-layout:auto;font-variant-numeric:tabular-nums}
.o1c-detail-table th{position:sticky;top:0;z-index:1;padding:7px 9px;background:#f7f9fd;font-size:10px;white-space:nowrap}
.o1c-detail-table td{padding:8px 9px;font-size:12px;vertical-align:middle;white-space:nowrap}
.o1c-detail-table td:nth-child(2){min-width:170px;white-space:normal}
.o1c-detail-table .num{text-align:right}
.o1c-detail-no{width:38px;text-align:center;color:#7b8da7}
.o1c-detail-state{display:inline-block;padding:3px 7px;border-radius:999px;font-size:10.5px;font-weight:750}
.o1c-detail-state.is-muted{background:#f0f3f7;color:#677990}
.o1c-detail-state.is-work{background:#eaf0ff;color:#315be8}
.o1c-detail-state.is-done{background:#e4f6ea;color:#187344}
.o1c-detail-table td small{display:block;margin-top:3px;color:#71839e;font-size:10px}

@media(max-width:1100px){
  .o1c-detail-meta{grid-template-columns:repeat(4,minmax(120px,1fr))}
  .o1c-detail-meta .o1c-detail-axes{grid-column:span 2}
}
@media(max-width:700px){
  #orders-card .o1c-registry-wrap{max-height:38vh}
  .o1c-detail-head{align-items:flex-start;flex-direction:column}
  .o1c-detail-meta{grid-template-columns:repeat(2,minmax(0,1fr))}
  .o1c-detail-meta .o1c-detail-axes{grid-column:1/-1}
}

/* --- ЩІЛЬНЕ РОБОЧЕ ВІКНО: одна панель команд і максимум місця таблицям --- */
#orders-card{padding:14px 16px 16px}
#orders-card>.section-title{min-height:0;margin:0 0 6px;align-items:center}
#orders-card>.section-title .eyebrow,
#orders-card>.section-title p:not(.eyebrow){display:none}
#orders-card>.section-title h2{margin:0;font-size:18px;line-height:1.2}
#orders-card>.section-title .section-title-actions:empty{display:none}

#orders-card .o1c-commands{
  display:flex;align-items:center;gap:5px;min-height:34px;margin:0;padding:4px 6px;
  border:1px solid #cbd8ea;border-bottom:0;border-radius:5px 5px 0 0;background:#eef3ff;
}
#orders-card .o1c-commands button{min-height:26px;padding:3px 9px;border-radius:4px;font-size:12px;line-height:1.2}
#orders-card .o1c-commands .o1c-new-order{order:0}
#orders-card .o1c-commands .o1c-filter-toggle{order:1}
#orders-card .o1c-commands .o1c-filter-toggle.is-active{border-color:#8ba6ec;background:#dfe8ff;color:#244fbd}
#orders-card .o1c-document-count{order:2;margin-left:auto;color:#637b9f;font-size:11px;white-space:nowrap}
#orders-card .o1c-columns-button{order:3;width:28px;min-width:28px;padding:2px 0;font-size:19px;font-weight:800}

#orders-card .order-filters{
  display:none;margin:0;padding:7px 8px;border-radius:0;border-color:#cbd8ea;background:#f7f9fd;
  gap:6px;align-items:end;
}
#orders-card .order-filters.is-open{display:flex}
#orders-card .order-filters label{min-width:112px;gap:2px;font-size:10px}
#orders-card .order-filters label:first-child{min-width:210px}
#orders-card .order-filters input,
#orders-card .order-filters select{height:29px;min-height:29px;padding:3px 7px;font-size:12px}
#orders-card .order-filters button{min-height:29px;padding:3px 7px;font-size:11px}
#orders-card .order-filters small{padding:6px 0;font-size:10px}
#orders-card .order-filters #order-sort-mode{min-width:155px}
#orders-card .order-filters #order-sort-note{display:none}

#orders-card .o1c-registry-wrap{
  max-height:34vh;min-height:140px;margin:0;overflow:auto;border-color:#cbd8ea;border-radius:0;
}
#orders-card .orders-1c th{height:25px;padding:3px 7px;background:#edf2fc;border-color:#d1dcef;font-size:10px;color:#526b92}
#orders-card .orders-1c td{height:27px;padding:3px 7px;font-size:12px;line-height:1.18;border-color:#e1e8f3}
#orders-card .orders-1c th,
#orders-card .orders-1c td{text-align:center}
#orders-card .orders-1c .o1c-c-sum{text-align:center}
#orders-card .orders-1c td.o1c-c-party b{font-size:12px}
#orders-card .orders-1c td.o1c-c-party small{font-size:10.5px}
#orders-card .orders-1c tr.is-selected td{background:#e2eaff;box-shadow:inset 0 1px #bed0f4,inset 0 -1px #bed0f4}
#orders-card .orders-1c tr.is-selected td:first-child{box-shadow:inset 3px 0 0 var(--blue),inset 0 1px #bed0f4,inset 0 -1px #bed0f4}

#orders-card .o1c-inline-detail{min-height:155px;border-color:#cbd8ea;border-radius:0 0 5px 5px}
#orders-card .o1c-detail-head{position:relative;min-height:31px;padding:4px 120px 4px 10px;border-color:#cbd8ea;background:#e8efff}
#orders-card .o1c-detail-head>div:first-child{min-width:0;width:100%;text-align:center}
#orders-card .o1c-detail-head small{display:none}
#orders-card .o1c-detail-head h3{margin:0;overflow:hidden;font-size:13px;line-height:22px;text-overflow:ellipsis;white-space:nowrap}
#orders-card .o1c-detail-actions{position:absolute;right:5px;top:4px;gap:4px}
#orders-card .o1c-detail-actions button{min-height:23px;padding:2px 6px;border-radius:3px;font-size:10px}
#orders-card .o1c-detail-meta{grid-template-columns:1.2fr .8fr .9fr 1fr .9fr .9fr 1.55fr;background:#f8faff}
#orders-card .o1c-detail-meta>span{display:flex;align-items:center;gap:5px;min-height:31px;padding:4px 7px;border-color:#e2e8f3}
#orders-card .o1c-detail-meta small{font-size:8.5px;white-space:nowrap}
#orders-card .o1c-detail-meta b{font-size:10.5px}
#orders-card .o1c-detail-meta .o1c-detail-axes{grid-column:auto}
#orders-card .o1c-detail-axes>b{gap:4px}
#orders-card .o1c-detail-axes>b>span{font-size:9px}
#orders-card .o1c-detail-axes .o1c-mark{width:12px;height:12px;margin-right:2px}
#orders-card .o1c-detail-table-wrap{max-height:32vh;overflow:auto}
#orders-card .o1c-detail-table{min-width:0;table-layout:fixed}
#orders-card .o1c-detail-table th{height:24px;padding:3px 6px;background:#edf2fc;color:#526b92;font-size:9px}
#orders-card .o1c-detail-table td{height:28px;padding:4px 6px;font-size:11px}
#orders-card .o1c-detail-table th,
#orders-card .o1c-detail-table td,
#orders-card .o1c-detail-table td.num{text-align:center}
#orders-card .o1c-detail-table th:nth-child(1){width:34px}
#orders-card .o1c-detail-table th:nth-child(2){width:24%}
#orders-card .o1c-detail-table td:nth-child(2){min-width:0;white-space:nowrap}
#orders-card .o1c-detail-state{padding:2px 5px;border-radius:4px;font-size:9.5px}

@media(max-width:900px){
  #orders-card .o1c-detail-meta{grid-template-columns:repeat(4,minmax(110px,1fr))}
  #orders-card .o1c-detail-meta .o1c-detail-axes{grid-column:auto}
}

/* --- ФОРМА ДОКУМЕНТА ПІД РЕЄСТРОМ (редагування без модалки) --------------- */
/* Реквізити редагуються, службовий рядок (менеджер/статус/транспорт/сума/
   готовність) — ні: це не поля документа, а те, що система порахувала. */
/* Смуга реквізитів має ВЛАСНУ сітку: у службовому рядку сім колонок, а тут
   шість полів плюс примітка на всю ширину. Успадкований 7-колонковий шаблон
   давав восьмий елемент, який перенісся й наліз на сусіда. */
#orders-card .o1c-detail-form{grid-template-columns:repeat(6,minmax(0,1fr))}
/* Службовий рядок компактний «підпис: значення» в один рядок (так зробив
   Codex). Для полів вводу це не годиться: підпис і поле ділять ширину, і
   підпис обрізається до «КОНТРАГЕ». У формі підпис стоїть НАД полем. */
#orders-card .o1c-detail-form>span{
  display:grid;grid-template-rows:auto auto;align-content:center;
  gap:2px;min-width:0;padding:5px 7px;
}
#orders-card .o1c-detail-form>span>small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#orders-card .o1c-detail-form>span>*{max-width:100%;min-width:0}
#orders-card .o1c-detail-form input,
#orders-card .o1c-detail-form select{
  width:100%;min-height:22px;padding:2px 5px;
  border:1px solid #cdd9ea;border-radius:3px;background:#fff;
  color:#243b5a;font:650 11px/1.2 inherit;
}
#orders-card .o1c-detail-form input:focus,
#orders-card .o1c-detail-form select:focus,
#orders-card .o1c-detail-table input:focus,
#orders-card .o1c-detail-table select:focus{
  outline:0;border-color:var(--blue);box-shadow:0 0 0 2px #315be822;
}
#orders-card .o1c-detail-form .o1c-detail-note{grid-column:1/-1;border-right:0}
#orders-card .o1c-detail-form .o1c-detail-note{grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto;align-items:center;gap:8px}
/* Поле дати в Chrome має власну мінімальну ширину під іконку календаря —
   без цього воно розпирало комірку й вилазило на сусідню. */
#orders-card .o1c-detail-form input[type="date"]{min-width:0;padding-right:2px}
#orders-card .o1c-detail-state-row{background:#fbfcfe}

#orders-card .o1c-detail-table input,
#orders-card .o1c-detail-table select{
  width:100%;min-height:22px;padding:2px 5px;
  border:1px solid #cdd9ea;border-radius:3px;background:#fff;
  color:#243b5a;font:650 11px/1.2 inherit;text-align:center;
}
#orders-card .o1c-detail-table td.num input{text-align:right}
/* Замкнене поле лишається у формі ВИМКНЕНИМ і читабельним, а не зникає:
   людина має бачити значення й розуміти, чому його не можна змінити. */
#orders-card .o1c-detail-table input:disabled,
#orders-card .o1c-detail-table select:disabled{
  border-color:#e3e9f2;background:#f4f6fa;color:#7b8da7;cursor:not-allowed;
}
#orders-card .o1c-detail-table th:last-child,
#orders-card .o1c-detail-rowact{width:26px;padding:0}
#orders-card .o1c-detail-rowact .link-button{color:#b5637a;font-size:12px}
#orders-card .o1c-detail-rowact .link-button:hover{color:#c0392b}

#orders-card .o1c-detail-lock{
  margin:0;padding:5px 10px;border-bottom:1px solid #f0dfc3;
  background:#fff8ec;color:#8a6014;font-size:10.5px;font-weight:700;
}
#orders-card .o1c-detail-foot{padding:6px 10px;border-top:1px solid #e6ecf5;background:#fbfcfe}
#orders-card .o1c-detail-foot button{min-height:23px;padding:2px 8px;font-size:11px}

/* Незбережений документ видно з будь-якої точки екрана: смуга зліва і живий
   стан кнопки. Без цього «завжди редагована» форма мовчить про те, що в ній
   щось змінено. */
#orders-card .o1c-inline-detail.is-dirty{box-shadow:inset 3px 0 0 #e9a13b}
#orders-card .o1c-inline-detail.is-dirty .o1c-detail-head{background:#fff6e8}
#orders-card .o1c-inline-detail.has-error .o1c-detail-head{background:#fdeeee}
#orders-card .o1c-detail-actions .primary:disabled{background:#c3cddf}
#orders-card .o1c-detail-actions button[data-detail-save]{min-width:74px}

@media(max-width:1100px){
  #orders-card .o1c-detail-form{grid-template-columns:repeat(4,minmax(120px,1fr))}
  #orders-card .o1c-detail-form .o1c-detail-note{grid-column:1/-1}
}

/* Дії по позиції у формі документа. Вони НЕ гаснуть разом із замкненими
   полями: склад документа може бути замкнений, а резервувати й передавати у
   виробництво все одно потрібно. */
#orders-card .o1c-item-action{
  display:block;margin:3px auto 0;padding:2px 7px;
  border:1px solid #b9c8ff;border-radius:4px;background:#fff;
  color:var(--blue);font:700 10px/1.3 inherit;cursor:pointer;white-space:nowrap;
}
#orders-card .o1c-item-action:hover:not(:disabled){background:#eef3ff;border-color:#8ba6ec}
#orders-card .o1c-item-action.is-primary{border-color:var(--blue);background:var(--blue);color:#fff}
#orders-card .o1c-item-action.is-primary:hover:not(:disabled){background:#244bd2}
#orders-card .o1c-item-action:disabled{border-color:#d5dce8;background:#f2f5fa;color:#9aa8bd;cursor:not-allowed}

/* --- ФІДБЕК РОМАНА БАРКОВА, 08.09.2026 ------------------------------------ */

/* 1. «Контрагент» — рівно назва. Майданчик, чипи стану ціни, борг і примітка
      переїхали в «Коментар»: так колонку з назвами можна читати колонкою. */
#orders-card .orders-1c .o1c-c-comment{
  width:auto;max-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  color:#6b7d99;text-align:left;
}
#orders-card .orders-1c td.o1c-c-party{
  width:auto;max-width:0;overflow:hidden;text-overflow:ellipsis;
}
#orders-card .orders-1c .o1c-comment-site{color:#8394ad}
#orders-card .orders-1c .o1c-comment-note{color:#6b7d99}
/* Розділювач між частинами коментаря потрібен МІЖ УСІМА, зокрема після чипів:
   без нього «не оплачено 14 500,00 грнЗолочівська» злипалось в одне слово. */
#orders-card .orders-1c .o1c-c-comment>span+span::before{content:" · ";color:#c3ccda}
#orders-card .orders-1c .o1c-c-comment .o1c-owed{margin-left:0}
#orders-card .orders-1c .o1c-c-comment .o1c-flag{margin-left:0;margin-right:2px}

/* 2. Службовий рядок прибрано. Лишилась ОДНА цифра в шапці панелі: під час
      правки вона показує ще НЕ збережену суму, якої в реєстрі за визначенням
      немає — це не дублювання, а єдине місце, де видно результат набраного. */
#orders-card .o1c-detail-total{
  display:flex;align-items:baseline;gap:6px;margin-left:auto;margin-right:12px;
  white-space:nowrap;
}
#orders-card .o1c-detail-total small{
  display:inline;color:#71839e;font-size:9px;font-weight:750;
  text-transform:uppercase;letter-spacing:.04em;
}
#orders-card .o1c-detail-total b{color:#243b5a;font-size:12px;font-variant-numeric:tabular-nums}
#orders-card .o1c-detail-head>div:first-child{width:auto;flex:0 1 auto;text-align:left}
#orders-card .o1c-detail-head{padding:4px 10px;display:flex;align-items:center;gap:10px}
#orders-card .o1c-detail-actions{position:static;right:auto;top:auto}

/* 3. Таблиця позицій — вміст по центру, зокрема й у полях вводу.
      Статичні комірки Codex уже центрував; праворуч лишались тільки числові
      поля вводу, через що рядок читався «сходинками». */
#orders-card .o1c-detail-table td.num input{text-align:center}

/* --- ПАКЕТ 08.09.2026: колонки таблиці позицій без прокрутки --------------
   `table-layout:fixed` розподіляє ширину лише за ЯВНО заданими колонками;
   без них вміст (два поля вводу + дві кнопки дій) розпирав таблицю і давала
   горизонтальну смугу. Числові колонки звужено — там був найбільший запас. */
#orders-card .o1c-detail-table-wrap{overflow-x:hidden;overflow-y:auto}
#orders-card .o1c-detail-table{width:100%;min-width:0;table-layout:fixed}
#orders-card .o1c-detail-table th:nth-child(1){width:30px}
#orders-card .o1c-detail-table th:nth-child(2){width:auto}
#orders-card .o1c-detail-table th:nth-child(3){width:8.5%}
#orders-card .o1c-detail-table th:nth-child(4){width:9.5%}
#orders-card .o1c-detail-table th:nth-child(5){width:10%}
#orders-card .o1c-detail-table th:nth-child(6){width:7%}
#orders-card .o1c-detail-table th:nth-child(7){width:12%}
#orders-card .o1c-detail-table th:nth-child(8){width:13%}
#orders-card .o1c-detail-table th:nth-child(9){width:13%}
#orders-card .o1c-detail-table th:nth-child(10){width:24px}
#orders-card .o1c-detail-table td{overflow:hidden;text-overflow:ellipsis}
#orders-card .o1c-detail-table input,
#orders-card .o1c-detail-table select{max-width:100%}
#orders-card .o1c-item-action{max-width:100%;overflow:hidden;text-overflow:ellipsis}

/* Кнопка колонок нижньої таблиці — той самий компактний «⋮», що в реєстрі. */
#orders-card .o1c-detail-actions .o1c-columns-button{
  order:9;width:24px;min-width:24px;min-height:23px;padding:0;
  font-size:16px;font-weight:800;line-height:1;
}
/* Верхнє та нижнє меню «Замовлень» використовують загальний компактний
   стандарт CRM, без різних розмірів у сусідніх таблицях. */
#orders-card .o1c-columns-button,
#orders-card .o1c-detail-actions .o1c-columns-button{
  width:26px!important;min-width:26px!important;height:26px!important;min-height:26px!important;
  padding:0!important;border-radius:5px!important;font-size:18px!important;font-weight:800!important;line-height:1!important;
}

/* Чернетка нового документа — видно, що рядок ще не існує в базі. */
#orders-card .orders-1c tr.o1c-draft td{background:#fff8ea}
#orders-card .orders-1c tr.o1c-draft td:first-child{box-shadow:inset 3px 0 0 #e9a13b}
#orders-card .orders-1c tr.o1c-draft.is-selected td{background:#fdf0d8}
#orders-card .orders-1c .o1c-draft-tag{
  padding:1px 6px;border-radius:999px;background:#fdefd4;color:#8a6014;
  font-size:10px;font-weight:750;
}
#orders-card .o1c-detail-form select[data-of="type"]{font-weight:700}

/* --- Площадки контрагента в його картці ---------------------------------- */
.cu-sites{display:grid;gap:8px}
/* Список площадок росте необмежено, а картка мусить лишатись в один екран:
   інакше «+ Додати площадку» і «Зберегти» їдуть за нижній край і стають
   недосяжними — модалка сама по собі не прокручується. Тому прокрутка тут. */
.cu-sites-list{display:grid;gap:6px;max-height:38vh;overflow-y:auto;padding-right:2px}
.cu-site-row{
  display:grid;grid-template-columns:1.1fr 1.4fr 1fr .8fr auto auto;gap:8px;align-items:end;
  padding:8px;border:1px solid #e2e9f5;border-radius:9px;background:#fbfcfe;
}
.cu-site-row label{display:grid;gap:2px;min-width:0;font-size:12px;font-weight:700}
.cu-site-row label i{font-style:normal;color:#71839e;font-size:10px;text-transform:uppercase;letter-spacing:.03em}
.cu-site-row input[type="text"],.cu-site-row input:not([type]){width:100%;min-width:0}
.cu-site-row .cu-site-primary{
  display:flex;flex-direction:row;align-items:center;gap:5px;padding-bottom:7px;
  color:#3d7a54;font-size:11px;white-space:nowrap;
}
.cu-site-row .cu-site-primary input{width:15px;height:15px;accent-color:#22a35c}
.cu-site-row [data-site-remove]{padding-bottom:7px;color:#b5637a;font-size:13px}
.cu-sites-hint{margin:0;font-size:11px}
.cu-site-add{align-self:start;padding:5px 10px;font-size:12px}
@media(max-width:900px){ .cu-site-row{grid-template-columns:1fr 1fr} }

/* Контрагент, якого ще немає в довіднику. */
#orders-card .o1c-new-customer{
  margin:0;padding:5px 10px;border-bottom:1px solid #e6ecf5;
  background:#eef4ff;color:#2f4f8f;font-size:10.5px;font-weight:700;
}
#orders-card .o1c-detail-form input.is-known-customer{border-color:#8fc9a6;background:#fbfffc}
.cu-sites-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.cu-sites-heading .cu-site-add{margin:0;white-space:nowrap}

/* Висока картка з довгим списком: прокручується вміст модалки, а не форма. */
dialog#modal.modal-scroll-body{max-height:94vh}
dialog#modal.modal-scroll-body #modal-form{max-height:94vh;overflow:hidden;display:flex;flex-direction:column}
dialog#modal.modal-scroll-body #modal-content{min-height:0;overflow-y:auto;overflow-x:hidden;padding-right:4px}

/* Картка контрагента була ~1030 px заввишки, бо її сітка полів лишалась
   одноколонковою (перша секція сама по собі 468 px). Через це низ картки не
   діставався навіть прокруткою. Ущільнюємо — і вона вміщається в екран. */
dialog#modal.modal-scroll-body .coil-grid{grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px 12px}
dialog#modal.modal-scroll-body .coil-section{padding:10px 12px;margin-bottom:8px}
dialog#modal.modal-scroll-body .coil-grid>label{gap:2px;font-size:11.5px}
dialog#modal.modal-scroll-body .coil-grid input,
dialog#modal.modal-scroll-body .coil-grid select,
dialog#modal.modal-scroll-body .coil-section>label input{min-height:32px;padding:6px 9px}
dialog#modal.modal-scroll-body .coil-section>label textarea{min-height:52px}

/* ==========================================================================
   СПІЛЬНИЙ ВИГЛЯД РЕЄСТРУ Й КАРТКИ ДЛЯ ВСІХ РОЗДІЛІВ-ДОКУМЕНТІВ
   Правила вище прив'язані до #orders-card історично; тут ті самі під спільним
   класом `.o1c-doc-section`, який отримують «Постачання» й «Документи та
   оплати». Другого набору стилів не заводимо — лише розширюємо область дії.
   ========================================================================== */
.o1c-doc-section .orders-1c{min-width:0;width:100%;table-layout:fixed;font-variant-numeric:tabular-nums}
.o1c-doc-section .orders-1c th{
  height:25px;padding:3px 7px;background:#edf2fc;border-color:#d1dcef;
  border-bottom:1px solid #d9e2ef;border-top:1px solid #d9e2ef;
  font-size:10px;font-weight:700;letter-spacing:.04em;color:#526b92;white-space:nowrap;text-align:center;
}
.o1c-doc-section .orders-1c td{
  height:27px;padding:3px 7px;font-size:12px;font-weight:400;line-height:1.18;vertical-align:middle;
  border-bottom:1px solid #e1e8f3;text-align:center;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis;
}
.o1c-doc-section .orders-1c td b{font-weight:600}
.o1c-doc-section .orders-1c tbody tr:hover td{background:#f2f6ff}
.o1c-doc-section .orders-1c tbody tr.clickable{cursor:pointer}
.o1c-doc-section .orders-1c tr.is-selected td{background:#e2eaff;box-shadow:inset 0 1px #bed0f4,inset 0 -1px #bed0f4}
.o1c-doc-section .orders-1c tr.is-selected td:first-child{box-shadow:inset 3px 0 0 var(--blue),inset 0 1px #bed0f4,inset 0 -1px #bed0f4}
.o1c-doc-section .orders-1c tr.is-overdue td:first-child{box-shadow:inset 3px 0 0 #e05c5c}
.o1c-doc-section .orders-1c tr.is-shipped td{background:#f6fdf8}
.o1c-doc-section .o1c-registry-wrap{
  position:relative;width:100%;max-height:34vh;min-height:120px;overflow-x:hidden;overflow-y:auto;
  border:1px solid #cbd8ea;border-radius:5px 5px 0 0;
}
.o1c-doc-section .o1c-registry-wrap .orders-1c thead{position:sticky;top:0;z-index:2}
.o1c-doc-section .o1c-registry-wrap .orders-1c{width:100%;min-width:0}
.o1c-doc-section .orders-1c th.o1c-c-party,
.o1c-doc-section .orders-1c td.o1c-c-party{text-align:center}
.o1c-doc-section .orders-1c th.o1c-c-no,
.o1c-doc-section .orders-1c td.o1c-c-no,
.o1c-doc-section .orders-1c th.o1c-c-party,
.o1c-doc-section .orders-1c td.o1c-c-party,
.o1c-doc-section .orders-1c th.o1c-c-comment,
.o1c-doc-section .orders-1c td.o1c-c-comment{text-align:left}
.o1c-doc-section .orders-1c td.o1c-c-party b{font-size:12px}
.o1c-doc-section .o1c-registry-menu{
  width:24px!important;min-width:24px!important;height:23px!important;min-height:23px!important;
  padding:0!important;border-radius:3px!important;font-size:16px!important;font-weight:800;line-height:1!important;
}
.o1c-doc-section .orders-1c .o1c-c-menu{width:31px;padding:1px 3px!important;text-align:center}
.o1c-doc-section .orders-1c .o1c-c-date{width:98px}
.o1c-doc-section .orders-1c .o1c-c-kind{width:56px}
.o1c-doc-section .orders-1c .o1c-c-no{width:118px}
.o1c-doc-section .orders-1c .o1c-c-sum{width:112px;text-align:center;padding-right:7px}
.o1c-doc-section .orders-1c .o1c-c-wb{width:120px}
.o1c-doc-section .orders-1c .o1c-c-state{width:110px}
.o1c-doc-section .orders-1c .o1c-c-state4{width:136px}
.o1c-doc-section .orders-1c th.o1c-c-state i,
.o1c-doc-section .orders-1c th.o1c-c-state4 i{
  display:inline-block;width:26px;font-style:normal;font-size:9px;color:#8ea0bb;text-align:center;
}
.o1c-doc-section .orders-1c .o1c-c-sum.is-owed{color:#b06a12;font-weight:600}
.o1c-doc-section .orders-1c .o1c-empty{padding:22px;text-align:center;color:var(--muted);white-space:normal}
.o1c-doc-section .orders-1c .o1c-more{
  margin-left:5px;padding:0 5px;border-radius:999px;background:#eef2f8;color:#7b8da7;font-size:10px;font-weight:750;
}
.o1c-kind{
  display:inline-block;min-width:44px;padding:1px 6px;border-radius:4px;
  font-size:9.5px;font-weight:800;letter-spacing:.04em;
}
.o1c-kind.is-order{background:#e7eeff;color:#31509d}
.o1c-kind.is-receipt{background:#e4f6ea;color:#187344}

/* Картка документа — та сама, що в «Замовленнях». */
.o1c-doc-section .o1c-inline-detail{
  border:1px solid #cbd8ea;border-top:0;border-radius:0 0 5px 5px;background:#fff;min-height:140px;
}
.o1c-doc-section .o1c-detail-head{
  display:flex;align-items:center;gap:10px;min-height:31px;padding:4px 10px;
  border-bottom:1px solid #cbd8ea;background:#e8efff;
}
.o1c-doc-section .o1c-detail-head h3{margin:0;overflow:hidden;font-size:13px;line-height:22px;text-overflow:ellipsis;white-space:nowrap}
.o1c-doc-section .o1c-detail-head small{display:none}
.o1c-doc-section .o1c-detail-actions{display:flex;gap:4px;margin-left:auto}
.o1c-doc-section .o1c-detail-actions button{min-height:23px;padding:2px 8px;border-radius:3px;font-size:10.5px}
/* «Документи та оплати»: верхнє й нижнє меню колонок мають той самий
   розмір та форму, що компактне меню в інших розділах CRM. */
#finance-card .o1c-registry-menu,
#finance-card .o1c-detail-actions .o1c-columns-button{
  width:26px!important;min-width:26px!important;height:26px!important;min-height:26px!important;
  padding:0!important;border-radius:5px!important;font-size:18px!important;font-weight:800!important;line-height:1!important;
}
.o1c-doc-section .o1c-detail-total{display:flex;align-items:baseline;gap:6px;margin-left:auto;white-space:nowrap}
.o1c-doc-section .o1c-detail-total small{display:inline;color:#71839e;font-size:9px;font-weight:750;text-transform:uppercase}
.o1c-doc-section .o1c-detail-total b{color:#243b5a;font-size:12px;font-variant-numeric:tabular-nums}
.o1c-doc-section .o1c-detail-meta{
  display:grid;grid-template-columns:repeat(6,minmax(0,1fr));
  border-bottom:1px solid #e3eaf3;background:#f8faff;
}
.o1c-doc-section .o1c-detail-meta>span{
  display:grid;grid-template-rows:auto auto;gap:2px;min-width:0;
  padding:5px 8px;border-right:1px solid #edf1f6;
}
.o1c-doc-section .o1c-detail-meta>span:last-child{border-right:0}
.o1c-doc-section .o1c-detail-meta small{display:block;color:#71839e;font-size:9px;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap}
.o1c-doc-section .o1c-detail-meta b{overflow:hidden;color:#243b5a;font-size:11px;text-overflow:ellipsis;white-space:nowrap}
.o1c-doc-section .o1c-detail-meta .o1c-detail-note{grid-column:1/-1;border-right:0}
.o1c-doc-section .o1c-detail-table-wrap{max-height:30vh;overflow-x:hidden;overflow-y:auto}
.o1c-doc-section .o1c-detail-table{width:100%;min-width:0;table-layout:fixed;font-variant-numeric:tabular-nums}
.o1c-doc-section .o1c-detail-table th{
  position:sticky;top:0;z-index:1;height:24px;padding:3px 6px;
  background:#edf2fc;color:#526b92;font-size:9px;white-space:nowrap;text-align:center;
}
.o1c-doc-section .o1c-detail-table td{
  height:28px;padding:4px 6px;font-size:11px;text-align:center;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.o1c-doc-section .o1c-detail-table th:nth-child(1){width:30px}
.o1c-doc-section .o1c-detail-table th:nth-child(2){width:auto}
.o1c-doc-section .o1c-detail-table td:nth-child(2){text-align:left}
.o1c-doc-section .o1c-detail-no{color:#7b8da7}
.o1c-doc-section .o1c-failure{margin:10px;padding:10px 13px;border-radius:8px;background:#fff8f8;color:#a33636;font-size:12px}

/* Єдина щільність для CRM-реєстрів: заголовок 700, ключове значення 600,
   звичайні дані 400. Так таблиці не «стрибають» між випадковими жирностями. */
.o1c-doc-section .o1c-detail-meta b,.o1c-doc-section .o1c-detail-total b{font-weight:600}

/* Верх «Постачання» — одна низька робоча панель замість трьох окремих рядів. */
#supply-card>.section-title{align-items:center;margin-bottom:4px}
#supply-card>.section-title .eyebrow{display:none}
#supply-card>.section-title h2{font-size:17px;line-height:1.15}
#supply-card>.section-title p{margin:2px 0 0;font-size:11px;line-height:1.2}
#supply-card>.section-title.supply-title-compact{min-height:0;margin:0 0 4px;padding:0}
#supply-card>.section-title.supply-title-compact p,#supply-card>.section-title.supply-title-compact .eyebrow{display:none!important}
#supply-card>.section-title .supply-title-actions button{min-height:30px;padding:5px 9px;font-size:12px}
#supply-card .supply-overview{display:flex;align-items:stretch;gap:6px;margin:4px 0 7px}
#supply-card .supply-overview .supply-stock-metrics{display:flex;flex:1 1 440px;flex-wrap:nowrap;gap:5px;margin:0;min-width:0}
#supply-card .supply-overview .stock-tile{flex:1 1 0;min-width:0;gap:6px;padding:4px 7px;border-radius:6px}
#supply-card .supply-overview .nom-icon-tile{width:27px;height:27px;padding:5px;border-radius:7px}
#supply-card .supply-overview .stock-tile-body span{font-size:9.5px;line-height:1.1}
#supply-card .supply-overview .stock-tile-body strong{display:inline;font-size:14px;line-height:1;font-weight:600}
#supply-card .supply-overview .stock-tile-body small{margin-left:3px;font-size:9px;line-height:1.1}
#supply-card .supply-overview .supply-flow-tabs{display:flex;flex:0 0 auto;align-items:center;gap:3px;margin:0;padding:0;border:0}
#supply-card .supply-overview .supply-flow-tabs button{padding:4px 7px;border-radius:6px;font-size:10px}
#supply-card .supply-overview .inventory-summary{display:flex;flex:1 1 520px;gap:5px;margin:0;min-width:0}
#supply-card .supply-overview .inventory-summary article{display:flex;flex:1 1 0;align-items:baseline;gap:5px;min-width:0;padding:4px 7px;border-radius:6px}
#supply-card .supply-overview .inventory-summary article span,
#supply-card .supply-overview .inventory-summary article small{overflow:hidden;font-size:9px;line-height:1.1;text-overflow:ellipsis;white-space:nowrap}
#supply-card .supply-overview .inventory-summary article b{font-size:14px;line-height:1;font-weight:600;white-space:nowrap}
@media(max-width:1150px){
  #supply-card .supply-overview{flex-wrap:wrap}
  #supply-card .supply-overview .supply-stock-metrics,
  #supply-card .supply-overview .inventory-summary{flex-basis:calc(50% - 6px)}
}

/* «Документи та оплати»: шапка — це панель швидкої роботи, а не окремий
   екран. Ущільнюємо тільки її, не змінюючи реєстр і картку документа нижче. */
#finance-card .accounting-tasks{
  gap:7px;margin:0 0 5px;padding:4px 7px;border-left-width:3px;border-radius:6px;
}
#finance-card .accounting-tasks>div:first-child{display:flex;align-items:baseline;gap:10px;min-width:0;flex:1}
#finance-card .accounting-tasks h3{margin:0;white-space:nowrap;font-size:12px}
#finance-card .accounting-tasks p{
  min-width:0;margin:0;overflow:hidden;font-size:10px;line-height:1.15;
  text-overflow:ellipsis;white-space:nowrap;
}
#finance-card .accounting-task-list{gap:5px;flex-wrap:nowrap}
#finance-card .accounting-task{min-width:0;width:112px;gap:0;padding:3px 5px;border-radius:5px}
#finance-card .accounting-task b{font-size:11px}
#finance-card .accounting-task span,#finance-card .accounting-task em{
  display:none;
}
#finance-card .finance-daily{display:flex;gap:5px;align-items:center;margin:0 0 5px}
#finance-card .finance-daily article{display:flex;flex:1;align-items:baseline;gap:6px;padding:4px 7px;border-radius:6px}
#finance-card .finance-daily small,#finance-card .finance-daily span{font-size:10px}
#finance-card .finance-daily b{font-size:16px;line-height:1}
#finance-card .finance-filters{gap:4px;padding-left:0}
#finance-card .finance-filters button{padding:4px 6px;border-radius:6px;font-size:10px}
@media(max-width:900px){
  #finance-card .accounting-tasks>div:first-child{display:block}
  #finance-card .accounting-tasks p{margin-top:2px;white-space:normal}
  #finance-card .accounting-task-list{flex-wrap:wrap}
  #finance-card .finance-daily{display:grid}
  #finance-card .finance-daily article{display:grid}
}

@media(max-width:1100px){
  .o1c-doc-section .o1c-detail-meta{grid-template-columns:repeat(3,minmax(0,1fr))}
}
/* Блоки, що стали дублем після зведення в один реєстр. */
.o1c-doc-section .o1c-hidden-block{display:none !important}
.inline-workspace-editor{margin-top:6px;border:1px solid #b9c9e3;border-radius:4px;background:#fff;box-shadow:0 5px 16px rgba(20,43,80,.08);overflow:hidden}
.inline-workspace-editor-shell{position:relative}
.inline-workspace-editor-close{position:absolute;z-index:3;top:7px;right:8px;width:30px;height:30px;padding:0;border:1px solid #c8d5e8;border-radius:5px;background:#fff;color:#142b50;font-size:21px;line-height:1;cursor:pointer}
.inline-workspace-editor-close:hover{border-color:#315cf4;background:#edf2ff}
.inline-workspace-editor-body{max-width:100%;padding:12px 14px 10px;overflow-x:auto}
.inline-workspace-editor-body>.modal-title{margin:0 42px 3px 0;font-size:18px}
.inline-workspace-editor-body>.modal-subtitle{margin:0 42px 9px 0;font-size:12px}
.inline-workspace-editor .coil-section{margin-bottom:8px;padding:10px}
.inline-workspace-editor .actions{position:sticky;right:0;margin-top:8px;padding-top:8px;background:#fff}
.o1c-inline-detail.supply-inline-editor{margin-top:0;border-top:0;border-radius:0 0 5px 5px;box-shadow:none}
.o1c-inline-detail.supply-inline-editor .inline-workspace-editor-body{max-height:62vh;overflow:auto}
.o1c-inline-detail.supply-inline-compact .inline-workspace-editor-body{padding:0;overflow-x:hidden}
.supply-inline-document-head{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:8px;min-height:36px;padding:3px 42px 3px 10px;border-bottom:1px solid #c6d4e8;background:#e7efff}
.supply-inline-caption{min-width:0;flex:1}.supply-inline-caption .modal-title{margin:0!important;font-size:13px!important;line-height:18px;white-space:nowrap}.supply-inline-caption .modal-subtitle{display:none}
.supply-inline-head-total{display:flex;align-items:baseline;gap:5px;margin:0!important;padding:0!important;border:0!important;background:none!important;font-size:9px;text-transform:uppercase;white-space:nowrap}.supply-inline-head-total b{font-size:12px}
.supply-inline-head-actions{position:static!important;display:flex;gap:4px;margin:0!important;padding:0!important;background:none!important}.supply-inline-head-actions button{min-height:25px;padding:3px 8px;border-radius:3px;font-size:10px}
.supply-inline-compact .inline-workspace-editor-close{position:absolute;top:4px;right:7px;margin:0;width:27px;height:27px;border-radius:4px;font-size:18px}
.supply-inline-compact .coil-form{display:block;min-width:0!important}.supply-inline-compact .coil-section{margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:#fff!important}
.supply-inline-meta{border-bottom:1px solid #d5dfed!important}.supply-inline-meta-grid{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:0!important}
.supply-inline-meta-grid>label{min-width:0;padding:4px 7px;border-right:1px solid #e1e8f2;border-bottom:1px solid #e1e8f2;color:#526b92;font-size:8px!important;line-height:1.1;text-transform:uppercase}
.supply-inline-meta-grid>label input,.supply-inline-meta-grid>label select,.supply-inline-meta-grid>label textarea{width:100%;height:27px;min-height:27px;margin-top:2px;padding:3px 5px;border-radius:4px;color:#0b2347;font-size:11px;text-transform:none}
.supply-inline-meta-grid>label textarea{resize:none}.supply-inline-meta-grid>label:has(#so-note),.supply-inline-meta-grid>label:has(#dr-note){grid-column:span 2}
.supply-inline-compact .supply-import-block[hidden]{display:none!important}.supply-inline-compact .supply-import-block:not([hidden]){display:grid!important;border-top:1px solid #d5dfed}
.supply-inline-lines>.customer-mail-title{min-height:30px;margin:0;padding:3px 7px;border-bottom:1px solid #d5dfed;background:#f7f9fd}.supply-inline-lines>.customer-mail-title h3{margin:0;font-size:11px}.supply-inline-lines>.customer-mail-title p{display:none}.supply-inline-lines>.customer-mail-title button{min-height:24px;padding:2px 7px;font-size:10px}
.supply-inline-compact .supply-line-head{height:25px;align-items:center;margin:0;padding:0 7px;background:#edf2fc;color:#35517a;font-size:8px;font-weight:700;text-align:center;text-transform:uppercase}
.supply-inline-compact .supply-line{min-height:30px;margin:0;padding:2px 7px;border-bottom:1px solid #e1e8f2}.supply-inline-compact .supply-line input,.supply-inline-compact .supply-line select{height:25px;min-height:25px;padding:2px 5px;border-radius:3px;font-size:10px}.supply-inline-compact .supply-line button{width:25px;height:25px;min-height:25px;padding:0}
.supply-inline-compact .supply-line-head,.supply-inline-compact .supply-line{grid-template-columns:minmax(260px,2.4fr) minmax(80px,.65fr) minmax(65px,.5fr) minmax(90px,.7fr) minmax(65px,.5fr) minmax(90px,.7fr) 27px;gap:5px}
.supply-inline-compact .supply-line>.sl-supplier-name{grid-column:1 / -1;margin-top:1px}
.supply-inline-compact .supply-line>.supply-line-new{grid-column:1 / -1}
@media(max-width:1100px){.supply-inline-meta-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
.production-inline-editor .inline-workspace-editor-body>.coil-form{min-width:1180px}
.production-inline-editor .inline-workspace-editor-body{scrollbar-gutter:stable}
.coil-inline-entry-row>td{padding:0!important;border:0!important;background:#fff!important}
.coil-inline-entry-row .production-inline-editor{margin:0;border-width:0 0 1px;border-radius:0;box-shadow:inset 3px 0 #315cf4}
.coil-inline-entry-row .inline-workspace-editor-body{max-height:66vh;overflow:auto}
.coil-inline-entry-row .inline-workspace-editor-body>.modal-title{position:sticky;left:0;width:max-content}
.coil-inline-entry-row .inline-workspace-editor-body>.modal-subtitle{position:sticky;left:0;max-width:900px}
@media(max-width:800px){.inline-workspace-editor-body{padding:10px}.production-inline-editor .inline-workspace-editor-body>.coil-form{min-width:1050px}}

/* Виробничий журнал: щільна клітинкова сітка за зразком цехового Excel. */
.production-coils-card{padding:8px!important;border-radius:5px!important}
.production-coils-card>.section-title{align-items:center;min-height:34px;padding:0 4px}
.production-coils-card>.section-title h2{font-size:15px}.production-coils-card>.section-title p{margin:1px 0 5px;font-size:10px}
.coil-filters{display:grid;grid-template-columns:minmax(130px,1.15fr) 120px 120px minmax(110px,.8fr) minmax(150px,1fr) minmax(130px,1fr) auto;gap:5px;align-items:end;padding:4px;margin-bottom:5px;border:1px solid #cad6e6;background:#f5f8fc}.coil-filters label{display:grid;gap:2px;margin:0;color:#18345c;font-size:9px}.coil-filters select,.coil-filters input{width:100%;height:27px;min-height:27px;padding:2px 6px;border:1px solid #b9c8db;border-radius:3px;background:#fff;color:#07182f;font-size:10px}.coil-filters button{height:27px;min-height:27px;padding:2px 9px;font-size:10px}.production-coils-card #coil-filter-count{color:#405a80;font-size:10px;white-space:nowrap}
.production-coils-grid{height:clamp(360px,calc(100vh - 190px),760px);max-height:calc(100vh - 150px);overflow:auto;border:1px solid #8999ad;background:#fff;scrollbar-gutter:stable both-edges}
.production-coils-table{width:100%;min-width:3300px;border-collapse:collapse;table-layout:fixed;font-size:10px;color:#07182f}
.production-coils-table th,.production-coils-table td{height:27px;padding:2px 5px;border:1px solid #aab5c3!important;line-height:1.1;text-align:center;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.production-coils-table th{position:sticky;top:0;z-index:2;height:34px;background:#e9eef6!important;color:#0b2347!important;font-size:9px;font-weight:700;letter-spacing:0;text-transform:uppercase;white-space:normal}
.production-coils-table th{width:82px}.production-coils-table th:nth-child(1){width:105px}.production-coils-table th:nth-child(2){width:82px}.production-coils-table th:nth-child(3){width:100px}.production-coils-table th:nth-child(4){width:90px}.production-coils-table th:nth-child(11){width:145px}.production-coils-table th:nth-child(18){width:155px}.production-coils-table th:nth-child(20),.production-coils-table th:nth-child(25),.production-coils-table th:nth-child(30){width:125px}
.production-coils-table .coil-group-head th[colspan]{height:25px;background:#dce6f5!important;border-bottom-color:#71839b!important;font-size:10px}
.production-coils-table .coil-group-head th[colspan="5"]{width:470px}.production-coils-table .coil-group-head th:nth-child(13){width:650px}
.production-coils-table .coil-cell-input{width:100%;min-width:0;height:23px;min-height:23px;padding:1px 4px;border:1px solid #a9b8cc!important;border-radius:0!important;background:#fff!important;color:#07182f!important;font-size:10px;text-align:left;box-shadow:none!important}
.production-coils-table .coil-grid-edit td{padding:1px 2px}.production-coils-table .coil-grid-save{min-height:23px;padding:2px 6px;border-radius:2px;font-size:9px;white-space:nowrap}
.production-coils-table .coil-cell-stack{display:grid;gap:2px}.production-coils-table .coil-grid-edit{outline:2px solid #3860ee;outline-offset:-2px}.production-coils-table tr.plan:not(.coil-grid-edit) td{height:25px}
.production-coils-table .coil-cell-editor{position:relative;min-width:0}.production-coils-table .coil-cell-editor .coil-cell-input{padding-right:19px}.production-coils-table .coil-copy-prev{position:absolute;top:2px;right:2px;width:16px;height:19px;min-height:0;padding:0;border:0;border-radius:2px;background:#eaf0ff;color:#214fc6;font-size:11px;line-height:19px;cursor:pointer}.production-coils-table .coil-copy-prev:hover{background:#315cf5;color:#fff}.production-coils-table .coil-pallet-editor{display:flex;align-items:stretch;gap:2px}.production-coils-table .coil-pallet-editor>.coil-cell-editor{min-width:74px;flex:1}.production-coils-table .coil-new-pallet{min-height:23px;padding:1px 4px;border:1px solid #315cf5;border-radius:2px;background:#fff;color:#214fc6;font-size:9px;white-space:nowrap}.production-coils-table .coil-cell-input.is-new-pallet{color:#087c43!important;font-weight:700}
.production-coils-table thead tr:nth-child(2) th{top:25px}
@media(max-height:650px){.production-coils-grid{height:420px;max-height:calc(100vh - 120px)}}
@media(max-width:1050px){.coil-filters{grid-template-columns:repeat(3,minmax(120px,1fr)) auto}}
.production-coils-table tbody tr.plan td{background:#fff3bd}.production-coils-table tbody tr.finished td{background:#fff}
.production-coils-table tbody tr:hover td{background:#e8f0ff!important}.production-coils-table td:first-child{font-weight:700;text-align:left;padding-left:8px}
.production-coils-table th:first-child,.production-coils-table td:first-child{position:sticky;left:0;z-index:3;box-shadow:2px 0 0 #8999ad}
.production-coils-table th:first-child{z-index:5;background:#dce6f5!important}
.production-coils-table tbody tr.plan td:first-child{background:#fff3bd}.production-coils-table tbody tr.finished td:first-child{background:#fff}
.production-coils-table tbody tr:hover td:first-child{background:#e8f0ff!important}
.production-coils-table .status{font-size:10px}.production-coils-table .underwound-badge{margin-left:3px;padding:1px 4px;font-size:8px}
.production-coils-table input[type="checkbox"]{width:16px;height:16px;margin:0;vertical-align:middle}
.reference-die-models{display:flex;flex-wrap:wrap;gap:3px}.reference-die-models span{padding:2px 6px;border-radius:10px;background:#e9efff;color:#173f9f;font-size:11px;white-space:nowrap}.die-model-picker{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:5px;max-height:42vh;overflow:auto;padding:7px;border:1px solid #cbd7e8;border-radius:6px;background:#f7f9fc}.die-model-picker label{display:flex;align-items:center;gap:7px;margin:0;padding:5px 7px;border:1px solid #d8e1ee;border-radius:4px;background:#fff}.die-model-picker input{width:16px;height:16px;margin:0}

/* Редактор котушки розгортається в горизонтальну технологічну відомість. */
.production-inline-editor .inline-workspace-editor-body{padding:5px!important;background:#fff}
.production-inline-editor .inline-workspace-editor-body>.modal-title{margin:0 38px 1px 0;font-size:13px}.production-inline-editor .inline-workspace-editor-body>.modal-subtitle{margin:0 38px 4px 0;font-size:9px}
.production-inline-editor .inline-workspace-editor-body>.coil-form{display:grid;grid-template-columns:520px repeat(3,500px);gap:0;min-width:2020px!important;border:1px solid #8999ad}
.production-inline-editor .coil-section{margin:0!important;padding:4px!important;border:0!important;border-right:1px solid #8999ad!important;border-radius:0!important}
.production-inline-editor .coil-section>h3{height:25px;margin:-4px -4px 4px;padding:5px 6px;border-bottom:1px solid #8999ad;background:#e9eef6;font-size:10px;text-align:center}
.production-inline-editor .coil-plan-section{grid-column:1/-1;border-bottom:1px solid #8999ad!important}
.production-inline-editor .coil-plan-grid{display:grid!important;grid-template-columns:repeat(8,minmax(0,1fr))!important;gap:0!important}
.production-inline-editor .coil-plan{min-height:34px;padding:2px 5px;border-right:1px solid #c4ccd7}
.production-inline-editor .coil-plan span,.production-inline-editor label{font-size:8px!important;line-height:1.05}.production-inline-editor .coil-plan b{font-size:10px}
.production-inline-editor .coil-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:3px!important}
.production-inline-editor .coil-grid>label{gap:1px!important}.production-inline-editor input,.production-inline-editor select,.production-inline-editor textarea{min-height:25px!important;height:25px!important;padding:2px 4px!important;border-radius:0!important;font-size:10px!important}
.production-inline-editor .coil-materials-head{min-height:24px;margin:3px 0 0}.production-inline-editor .coil-materials-head h4{font-size:9px}.production-inline-editor .coil-material-add{min-height:22px;padding:1px 5px;border-radius:2px;font-size:9px}
.production-inline-editor .coil-material{grid-template-columns:minmax(150px,2fr) 58px 90px 70px 24px;gap:2px;padding:2px 0;border-top:1px solid #c4ccd7}
.production-inline-editor .coil-material-drop{width:24px;height:25px;padding:0;border-radius:0}.production-inline-editor .coil-materials-sum,.production-inline-editor .field-hint{font-size:8px}
.production-inline-editor .coil-close-section,.production-inline-editor .coil-form>.coil-section:has(#handover){grid-column:1/-1;border-top:1px solid #8999ad!important}
.production-inline-editor .actions{position:sticky;left:0;width:max-content;margin:4px 0 0;padding:0;background:#fff}.production-inline-editor .actions button{min-height:27px;padding:3px 8px;border-radius:3px;font-size:10px}

/* Фактичне споживання у «Постачанні»: щільний реєстр без модального вікна. */
.supply-consumption-panel{padding:0;overflow:hidden}
.supply-consumption-head{position:relative;display:flex;align-items:center;min-height:42px;padding:6px 45px 6px 10px;border-bottom:1px solid #cbd8ea;background:#e8efff}
.supply-consumption-head h3{margin:0;color:#0b2347;font-size:14px}.supply-consumption-head p{margin:1px 0 0;color:#405878;font-size:10px}
.supply-consumption-head .inline-workspace-editor-close{top:6px;right:7px;width:28px;height:28px;font-size:18px}
.supply-consumption-tools{display:flex;align-items:end;gap:5px;padding:6px 8px;border-bottom:1px solid #dbe4f1;background:#f8faff}
.supply-consumption-tools label{display:grid;gap:2px;color:#526b92;font-size:9px;text-transform:uppercase}
.supply-consumption-tools input,.supply-consumption-tools select,.supply-consumption-tools button{height:29px;min-height:29px;padding:3px 7px;font-size:11px}
.supply-consumption-tools>[data-consumption-search]{flex:1;min-width:150px}.supply-consumption-presets{display:flex;gap:3px}
.supply-consumption-presets button{border:1px solid #c8d5e8;background:#fff;color:#17355f}.supply-consumption-presets button.active{border-color:#315cf4;background:#315cf4;color:#fff}
.supply-consumption-kpi{display:flex;border-bottom:1px solid #dbe4f1;background:#fff}.supply-consumption-kpi span{display:flex;flex:1;align-items:baseline;gap:6px;min-width:0;padding:5px 9px;border-right:1px solid #e4eaf3}.supply-consumption-kpi span:last-child{border-right:0}
.supply-consumption-kpi small{color:#526b92;font-size:9px;text-transform:uppercase}.supply-consumption-kpi b{color:#0b2347;font-size:13px;font-weight:600}
.supply-consumption-table{max-height:42vh;overflow:auto}.supply-consumption-table table{width:100%;border-collapse:collapse;font-size:11px;font-variant-numeric:tabular-nums}
.supply-consumption-table th{position:sticky;top:0;z-index:1;padding:4px 7px;border-bottom:1px solid #cbd8ea;background:#edf2fc;color:#35517a;font-size:9px;text-align:center;text-transform:uppercase;white-space:nowrap}
.supply-consumption-table td{height:28px;padding:4px 7px;border-bottom:1px solid #e1e8f2;color:#0b2347;text-align:center;white-space:nowrap}.supply-consumption-table td:first-child{text-align:left}
.supply-consumption-table .stock-days{display:inline-block;min-width:40px;padding:2px 5px;border-radius:4px;background:#edf2f8}.supply-consumption-table .stock-days.ok{background:#e8f6ed;color:#08783c}.supply-consumption-table .stock-days.warning{background:#fff3d6;color:#925b00}.supply-consumption-table .stock-days.danger{background:#ffe8e8;color:#b42323}
.supply-consumption-loading,.supply-consumption-error{padding:18px;text-align:center;color:#405878;font-size:12px}.supply-consumption-error{color:#a33636}
@media(max-width:1000px){.supply-consumption-tools{flex-wrap:wrap}.supply-consumption-kpi{flex-wrap:wrap}.supply-consumption-kpi span{flex-basis:45%}}
