
.document-edit-dialog{width:96vw;max-width:1300px;max-height:94dvh;overflow:auto}.document-edit-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.document-edit-fields label{display:flex;flex-direction:column}.document-edit-fields textarea{min-height:65px}.document-edit-dialog table input{width:100px}.document-edit-dialog table select{max-width:190px}.document-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.document-edit-dialog .invoice-lines{overflow:auto}@media(max-width:600px){.document-edit-fields{grid-template-columns:1fr}.document-edit-dialog{padding:12px}.document-edit-dialog h2{font-size:18px;white-space:normal}}

.document-picker-row{border-bottom:1px solid #ddd;padding:12px 0}.document-picker-row strong,.document-picker-row small{display:block}.document-picker-controls{display:flex;align-items:end;gap:10px;flex-wrap:wrap}.document-picker-controls label{display:flex;flex-direction:column}.document-picker-controls input{width:110px}.document-edit-dialog form>button{margin:8px 0}.document-edit-dialog small{color:#667085;font-size:12px}

.document-edit-dialog.shipment-workspace{width:calc(100vw - 32px);max-width:1800px;height:auto;max-height:calc(100dvh - 32px);min-height:0;padding:0 18px;background:#fff;color:#28323d}
.shipment-workspace>.dialog-header{position:sticky;top:0;z-index:10;display:flex;gap:14px;align-items:center;padding:12px 0;margin:0;background:white}
.shipment-workspace .dialog-header h2{margin:0;flex:1;font-size:20px}
.shipment-workspace .dialog-header>button{width:auto;height:auto;white-space:nowrap}
.shipment-workspace .dialog-header>button:last-child{width:32px;flex:none}
.shipment-state{white-space:nowrap;color:#16844b;font-size:13px}.shipment-notice{max-width:360px;font-size:12px;color:#64748b}
.shipment-fields{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:14px;margin:12px 0}
.shipment-fields label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:#64748b}
.shipment-fields :is(input,select){margin:0;width:100%;min-height:36px;box-sizing:border-box;font-size:14px}
.shipment-toolbar{display:flex;align-items:center;gap:10px;padding:10px 0;border-top:1px solid #dfe6ee}.shipment-toolbar>button:first-child{font-weight:700}.shipment-toolbar select{max-width:260px}
.shipment-edit-table{width:100%;border-collapse:collapse;font-size:13px}
.shipment-edit-table :is(th,td){position:static;min-width:0;max-width:none;width:1%;padding:8px 7px;white-space:nowrap;text-align:left;border-bottom:1px solid #e2e8ef}
@media(min-width:801px){
 .shipment-workspace .shipment-toolbar{position:sticky;top:var(--shipment-head-height,60px);z-index:4;background:#fff}
 .shipment-workspace .shipment-edit-table thead th{top:calc(var(--shipment-head-height,60px) + var(--document-toolbar-height,0px))}
}
.shipment-edit-table thead th{position:sticky;top:var(--shipment-head-height,60px);z-index:2;background:#f4f7fb}
.shipment-edit-table :is(th,td)[data-label="Товар"]{min-width:260px;width:430px;max-width:460px;white-space:normal}
.shipment-workspace .shipment-edit-table input{width:90px;min-width:0;margin:0;background:transparent;border:0;border-bottom:1px solid #d6dee8;padding:6px}
.shipment-edit-table td:is([data-label="Кол-во"],[data-label="Цена"]) input,.shipment-edit-table th{font-weight:700}
.shipment-edit-table :is(th,td):last-child{width:100%;text-align:right}.shipment-edit-table td:last-child button{background:transparent;border:0;color:#798798;padding:7px}
.shipment-footer{position:sticky;bottom:0;z-index:5;display:grid;grid-template-columns:auto 1fr;align-items:start;gap:12px 24px;background:white;border-top:1px solid #dfe6ee;padding:12px 0 0}
.shipment-total{font-size:18px;padding:8px 0;white-space:nowrap}.shipment-footer>label{display:flex;align-items:center;gap:10px;font-size:12px;color:#64748b}.shipment-footer textarea{flex:1;min-height:36px;height:36px;margin:0;resize:vertical}
.shipment-footer .document-actions{grid-column:1/-1;display:flex;justify-content:space-between;margin:0;padding:10px 0;border-top:1px solid #e2e8ef}
@media(max-width:800px){.shipment-fields{grid-template-columns:1fr}.shipment-workspace>.dialog-header{flex-wrap:wrap}.shipment-workspace .dialog-header h2{font-size:16px;min-width:65%}.shipment-toolbar{flex-wrap:wrap}.shipment-workspace .shipment-table-wrap{overflow:auto}.shipment-workspace .shipment-edit-table{min-width:850px}.shipment-footer{grid-template-columns:1fr}.shipment-footer .document-actions{grid-column:1}.shipment-workspace .shipment-edit-table :is(thead,tbody){display:table-row-group}.shipment-workspace .shipment-edit-table tr{display:table-row}.shipment-workspace .shipment-edit-table :is(th,td){display:table-cell}.shipment-workspace .shipment-edit-table td:before{display:none}}

.inventory-workspace .inventory-fields{grid-template-columns:repeat(4,minmax(0,1fr))}
.inventory-workspace .shipment-edit-table td[data-label="НДС"] select{width:100px}
.inventory-workspace .shipment-edit-table small{display:block;color:#798390;margin-top:4px}
.inventory-create-button{font-weight:700;margin:8px 0}
.inventory-product-form label{display:block;margin:12px 0}.inventory-product-form input,.inventory-product-form select{display:block;width:100%;box-sizing:border-box}
.inventory-workspace .search-select{min-width:0}
@media(max-width:900px){.inventory-workspace .inventory-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:550px){.inventory-workspace .inventory-fields{grid-template-columns:1fr}.inventory-workspace .shipment-edit-table{min-width:520px}}
.document-edit-dialog.inventory-workspace{box-sizing:border-box;height:fit-content;max-width:min(1800px,calc(100vw - 24px));width:calc(100vw - 24px);border:1px solid #dbe2ea;border-radius:10px;margin:auto}
.inventory-workspace button:disabled{opacity:.5;cursor:default}
@media(max-width:800px){.inventory-workspace>.dialog-header{padding-right:40px}.inventory-workspace>.dialog-header>button:last-child{position:absolute;right:0;top:12px}.inventory-workspace .shipment-edit-table thead th{top:0}.inventory-workspace .shipment-footer{position:static}.inventory-workspace .shipment-table-wrap{margin-bottom:12px}}
@media(max-width:800px){.inventory-workspace[data-kind="transfer"] .shipment-edit-table{min-width:0}.inventory-workspace[data-kind="transfer"] .shipment-edit-table :is(th,td)[data-label="Товар"]{min-width:110px;width:auto;max-width:200px}.inventory-workspace[data-kind="transfer"] .shipment-edit-table input{width:60px}.inventory-workspace[data-kind="transfer"] .shipment-edit-table :is(th,td){padding:6px 4px}}

.shipment-reserves-toggle{display:inline-flex!important;align-items:center;gap:7px;margin:0;white-space:nowrap}
.shipment-reserves-toggle input{width:18px!important;height:18px;margin:0}
.hide-shipment-reserves .shipment-edit-table :is([data-label="Из резерва заказа"],[data-label="Без резерва"]){display:none}

/* Keep the invoice fitted to its contents, with a compact action row. */
.document-edit-dialog.shipment-workspace{height:fit-content;box-sizing:border-box;margin:auto;padding-bottom:0}
.document-edit-dialog.shipment-workspace>form{min-height:0;height:auto;margin-bottom:0;padding-bottom:0}
.shipment-workspace .shipment-footer .document-actions{justify-content:flex-start;gap:8px;padding:8px 0;margin:0}
.shipment-workspace .shipment-footer .shipment-save-secondary{background:#fff;color:#0d6efd;border:1px solid #ccd7e5}
.shipment-workspace .shipment-footer .shipment-save-secondary:hover{background:#f4f7fb}
.shipment-workspace .shipment-footer .shipment-transfer{order:90;margin-left:auto}
.shipment-workspace .shipment-footer .shipment-close{order:100;margin-left:auto}
.shipment-workspace .shipment-footer .shipment-transfer~.shipment-close{margin-left:0}
.shipment-workspace .shipment-open-order{background:#fff;color:#0d6efd;border:1px solid #ccd7e5;white-space:nowrap}

:is(#order-filters,#receipts-filters,#transfers-filters)>.inventory-create-button{margin:0;white-space:nowrap;flex:none;align-self:end}

.document-actions .document-delete-button,#order-editor .editor-actions .document-delete-button{color:#dc3545;border-color:#f1b8bd;background:#fff}

.inventory-workspace .receipt-date-field{display:grid;gap:4px;min-width:0;align-self:start}
.inventory-workspace .receipt-date-field>label{margin:0}
.inventory-date-control{display:grid;grid-template-columns:minmax(0,1fr);align-items:center}
.inventory-date-control>*{grid-area:1/1}
.inventory-workspace .receipt-date-field input{padding-right:44px!important}
.receipt-date-field input::-webkit-calendar-picker-indicator{display:none}
.inventory-workspace .inventory-date-control>button{
 justify-self:end;z-index:1;width:40px;height:calc(100% - 4px);min-height:0;margin:0 2px 0 0;padding:0;
 display:grid;place-items:center;border:0;border-radius:5px;background:white;color:#435771
}
.inventory-workspace .inventory-date-control>button:hover{background:#edf4ff;color:#075cca}
.receipt-date-field dialog.receipt-calendar{
 box-sizing:border-box;position:fixed;inset:0;margin:auto;width:min(316px,calc(100vw - 24px));height:fit-content;
 max-height:calc(100dvh - 24px);padding:14px;overflow:auto;border:1px solid #d5dfea;border-radius:12px;background:white;color:#24364b
}
.receipt-calendar::backdrop{background:#15223855}
.receipt-calendar-header{display:grid;grid-template-columns:36px 1fr 36px;align-items:center;text-align:center;margin-bottom:8px}
.receipt-calendar-header strong::first-letter{text-transform:uppercase}
.receipt-calendar-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;text-align:center}
.receipt-calendar-days span{padding:4px 0;color:#68798b;font-size:12px}
.inventory-workspace .receipt-calendar button{
 width:100%;height:36px;min-height:36px;margin:0;padding:2px;border:0;border-radius:6px;background:white;color:#24364b;font-size:14px
}
.inventory-workspace .receipt-calendar button:enabled:hover{background:#edf4ff}
.inventory-workspace .receipt-calendar button[aria-pressed="true"]{background:#0d6efd;color:white;opacity:1}
.inventory-workspace .receipt-calendar>button{margin-top:8px;border:1px solid #cdd8e5}
@media(max-width:767px){
 .inventory-workspace .inventory-fields>.receipt-date-field{grid-column:1/-1}
}
.shipment-footer .shipment-total input{
 width:9em;max-width:58vw;min-height:38px;margin:0 3px;padding:4px 8px;box-sizing:border-box;
 font:inherit;color:inherit;text-align:right;border:1px solid #cdd7e4;border-radius:6px;background:white
}dialog.stock-error-dialog {
 position: fixed;
 inset: 0;
 margin: auto;
 box-sizing: border-box;
 width: min(440px, calc(100vw - 24px));
 height: fit-content;
 max-height: calc(100dvh - 32px);
 padding: 20px;
 overflow: auto;
 border: 1px solid #d6dce4;
 border-radius: 12px;
 background: white;
 color: #212529;
 box-shadow: 0 12px 48px #18263838;
}
dialog.stock-error-dialog::backdrop {background: #15223866}
dialog.stock-error-dialog h2 {margin: 0 0 12px; font-size: 20px}
dialog.stock-error-dialog p {margin: 0 0 16px; white-space: pre-line; overflow-wrap: anywhere}
dialog.stock-error-dialog > button:last-child {display: block; width: auto; margin: 12px 0 0 auto}
.stock-error-actions:empty {display: none}
.stock-error-dialog .stock-exchange-actions {display: grid; grid-template-columns: repeat(auto-fit,minmax(min(135px,100%),1fr)); gap: 8px}
.stock-error-dialog .stock-exchange-actions button {width: 100%; height: auto; min-height: 38px; white-space: normal}
.dialog-header h2 button.stock-error-button {display: inline-flex; align-items: center; width: auto; height: auto; min-height: 28px; padding: 2px 8px; border: 1px solid #f2b8bf; border-radius: 6px; background: #fff1f2; color: #a71930; font-weight: 600; line-height: 1.35; font-family: inherit; font-size: 14px; vertical-align: middle; cursor: pointer}

#orders-table td:nth-child(4),
:is(#shipments-list,#receipts-list,#transfers-list) td:nth-child(3){white-space:nowrap}
@media(min-width:768px){
 #shipments-list .shipment-table :is(th,td):first-child{width:1%;min-width:0;white-space:nowrap}
 #shipments-list .shipment-table :is(th,td):nth-child(2){width:1%;white-space:nowrap}
}
