/* Сделка: таблица деталей запроса, вставка из таблицы, подсказки номера.
   Часть общего каскада: порядок подключения — ui.Stylesheets. */
/* The parts table on the first step of a deal, laid out as the КП: every
   cell is one line tall and vertically centred, so the head sits squarely
   over the body; the editable cells carry the same input in the rows and in
   the add row at the foot. Edit and remove are icons at the end of the row. */
table.kp{width:100%}
table.kp th,table.kp td{vertical-align:middle;white-space:nowrap}
/* A heading wraps rather than lose its last letters to the next column
   («Цена заказчику/ш»): the figures under it stay on one line. */
table.kp th{white-space:normal;vertical-align:bottom}
/* Rows keep one height whether a cell is text or a field: the text line is
   as tall as the field that replaces it. */
table.kp tbody td{padding-top:6px;padding-bottom:6px;line-height:34px}
table.kp td.cell-desc{white-space:normal;max-width:260px;line-height:1.35}
/* The quotation: two lines in a cell where the part names what it is
   built on, so the rows are not stretched to a control's height. */
table.kp.quote tbody td{line-height:1.4;padding:10px 12px 10px 0}
table.kp.quote td .short{font-size:12.5px}
/* A cell that may be changed: text until clicked, a hint on hover. */
table.kp td.editable{cursor:text}
table.kp td.editable:hover{background:var(--wash);box-shadow:inset 0 0 0 1px var(--line-2);border-radius:6px}
table.kp td.editing{background:transparent;box-shadow:none}
td.line-acts{text-align:right}
table.kp .cell,table.kp tfoot input,table.kp tfoot select{
  font:inherit;color:var(--ink);background:var(--panel);border:1px solid var(--line);
  border-radius:7px;padding:6px 8px;height:34px;width:100%;min-width:0;box-sizing:border-box}
table.kp .cell.num,table.kp tfoot input.num{font-family:var(--mono)}
table.kp td.r .cell,table.kp tfoot td.r input{text-align:right;max-width:96px}
table.kp .cell-part,table.kp #la_part{min-width:0}
table.kp .cell-terms,table.kp #la_terms{min-width:0}
table.kp .cell:focus,table.kp tfoot input:focus,table.kp tfoot select:focus{
  border-color:var(--focus);outline:none;background:var(--panel)}
table.kp tfoot td{padding:12px 6px;
  border-top:1px dashed var(--line-2);background:var(--sunk)}
/* Breathing room between the inputs and the edge of the grey add-row
   strip. Without it the leftmost input (Part Number) and the rightmost
   button (Добавить) butt right up against the card edge. */
table.kp tfoot td:first-child{padding-left:18px}
table.kp tfoot td:last-child{padding-right:18px}
table.kp .lookup-cell{position:relative}

/* The empty-state row above the parts table on a draft or a fresh
   inquiry. A quiet document glyph on the left, the headline on the
   right, the hint underneath — one block the eye reads as a unit
   rather than a lonely sentence floating in a wide table cell. */
/* The inquiry's parts table follows a per-column pixel spec so the
   description cell can wrap long names across several lines instead of
   clipping. Only this instance is widened: the quotation and the other
   step tables keep their fitted layout. */
table.kp.inquiry{table-layout:auto;min-width:1210px}
table.kp.inquiry th,table.kp.inquiry td{padding:12px 16px;gap:12px}
table.kp.inquiry tbody tr{min-height:76px}
table.kp.inquiry tbody td{line-height:1.4}
table.kp.inquiry td.cell-desc{white-space:normal;max-width:none;min-width:320px;
  word-break:normal;overflow-wrap:anywhere}
table.kp.inquiry td.cell-desc .clamp{display:block;white-space:normal;overflow:visible;
  text-overflow:clip;line-height:1.4}
/* "Add" sits in the row of fields it adds: as tall as they are. Buttons
   come in two sizes, .btn (44, a step's decision) and .btn-s (36). */
#p_new #la_add{min-width:140px;justify-content:center}

/* The paste zone under the parts table. One drop target, framed with a
   dashed border so it reads as a landing pad rather than another card.
   The icon anchors the left; the button sits on the right. */
.paste-zone{display:flex;align-items:flex-start;gap:14px;padding:18px 20px;
  border:1.5px dashed var(--line-2);border-radius:10px;background:var(--sunk)}
.paste-zone-ico{color:var(--ink-3);flex:none;display:inline-flex;margin-top:2px}
.paste-zone-text{flex:1;min-width:0}
.paste-zone-head{margin:0;font-size:14.5px;font-weight:500;color:var(--ink)}
.paste-zone-sub{margin:3px 0 0;font-size:13px;color:var(--ink-3);line-height:1.4}
/* A tiny snippet showing how one line should look. Monospace, muted, and
   sunken a touch so it reads as a sample, not as copy to paste. */
.paste-zone-sample{margin:10px 0 0}
.paste-zone-sample-head{font-size:12px;color:var(--ink-3);margin:0 0 4px}
.paste-zone-sample-row{margin:0;padding:8px 10px;font:12px/1.5 var(--mono);
  color:var(--ink);background:var(--panel);border:1px solid var(--line);
  border-radius:7px;overflow-x:auto;white-space:pre}
.paste-zone>button{align-self:center}

/* The row under the primary CTA that counts what the manager has
   gathered: positions, total units, and the sum the quotation will
   carry. The CTA stays on the left; the totals read as a running tally
   on the right. */
.inquiry-foot{align-items:center;flex-wrap:wrap;gap:16px}
.inquiry-totals{margin-left:auto;display:flex;gap:22px;flex-wrap:wrap;
  color:var(--ink);font-size:14px}
.inquiry-totals b{font-weight:600}

/* The paste-from-sheet modal and its preview. The textarea is one
   stretched input the whole paste lands in; the preview below shows
   what the parser understood, with the rejected rows muted and labelled
   with the reason, so the manager fixes the paste rather than filing
   half a bad batch. */
.paste-modal textarea{width:100%;min-height:140px;padding:10px 12px;font:14px/1.5 var(--mono);
  color:var(--ink);background:var(--panel);border:1px solid var(--line);border-radius:8px;
  box-sizing:border-box;resize:vertical}
.paste-modal textarea:focus{border-color:var(--focus);outline:none}
.pz-preview{margin-top:14px;border:1px solid var(--line);border-radius:8px;overflow:auto;max-height:260px}
.pz-table{width:100%;border-collapse:collapse;font-size:13.5px}
.pz-table th{text-align:left;padding:8px 10px;background:var(--sunk);color:var(--ink-2);
  font-weight:500;font-size:12.5px;letter-spacing:.02em;text-transform:uppercase}
.pz-table th.r,.pz-table td.r{text-align:right}
.pz-table td{padding:8px 10px;border-top:1px solid var(--line-2)}
.pz-table td.num{font-family:var(--mono)}
.pz-table tr.pz-bad td{color:var(--ink-3)}
.pz-table tr.pz-bad td:last-child{color:var(--crit)}
/* The second row of an «… ALT …» split: a quiet background shift and a
   small tag next to the number read it as hanging off the one above. */
.pz-table tr.pz-alt td{background:var(--sunk)}
.pz-table tr.pz-alt td.num{padding-left:22px}
.pz-alt-tag{display:inline-block;margin-left:8px;padding:1px 7px;
  font-family:var(--font);font-size:11px;font-weight:500;
  color:var(--ink-3);background:var(--panel);
  border:1px solid var(--line-2);border-radius:9px;vertical-align:1px}

.empty-lines{padding:22px 20px;text-align:center}
.empty-lines-inner{display:inline-flex;align-items:center;gap:14px;text-align:left}
.empty-lines-ico{display:inline-flex;color:var(--ink-3)}
.empty-lines-head{margin:0;color:var(--ink);font-weight:500;font-size:14.5px}
.empty-lines-sub{margin:3px 0 0;color:var(--ink-3);font-size:13px}
/* The suggestion list is lifted onto the page (see dropUnder) so no
   scrolling box can clip it; it keeps the look of a list under a field. */
.kp-drop{right:auto;top:auto;width:max-content;max-width:min(640px,calc(100vw - 32px));
  z-index:60;max-height:260px;overflow:auto;overscroll-behavior:contain;margin:0;padding:4px;list-style:none;
  background:var(--panel);border:1px solid var(--line);border-radius:9px;
  box-shadow:0 8px 24px rgba(0,0,0,.14);white-space:normal;font-size:14px}
/* The number first, the name after it, both from the left: the list sits
   under the number being typed, so that is where the eye already is. */
.kp-drop li{display:flex;gap:12px;align-items:baseline;padding:7px 9px;border-radius:6px;cursor:pointer}
.kp-drop li span{margin-left:0;text-align:left}
.kp-drop li span.num{font-family:var(--mono);font-weight:600;font-size:14px;white-space:nowrap}
.kp-drop li:hover{background:var(--wash)}
.kp-drop li.none{color:var(--ink-3);cursor:default}
.kp-drop[hidden]{display:none}
