/* Wide, multiline item entry for invoices and delivery notes. */
.modal-card:has(.pi-item-editor){width:min(1240px,100%);display:flex;flex-direction:column;overflow:hidden}
.modal-card:has(.pi-item-editor)>.modal-head{flex-shrink:0}
.modal-card:has(.pi-item-editor)>form{display:flex;flex-direction:column;min-height:0;overflow:hidden}
.modal-card:has(.pi-item-editor) .modal-body{overflow-y:auto;min-height:0;overscroll-behavior:contain}
.modal-card:has(.pi-item-editor) .modal-foot{position:static;flex-shrink:0}
.pi-item-editor{table-layout:fixed;min-width:1000px!important;width:100%}
.pi-item-editor th,.pi-item-editor td{padding:9px!important;vertical-align:top!important}
.pi-item-editor textarea{display:block;width:100%;min-height:135px;max-height:600px;resize:vertical;box-sizing:border-box;padding:10px;border:1px solid #c9d6e4;border-radius:7px;font:14px/1.55 "Segoe UI",Arial,sans-serif;color:#182b40;white-space:pre-wrap;overflow-wrap:anywhere}
.pi-item-editor input,.pi-item-editor select{box-sizing:border-box;width:100%;min-width:0;min-height:38px;padding:8px;border:1px solid #c9d6e4;border-radius:6px;font:13px "Segoe UI",Arial,sans-serif}
.pi-item-editor:not(.dn-create-table) th:first-child,.pi-item-editor:not(.dn-create-table) td:first-child{width:50%}
.dn-create-table th:nth-child(1){width:18%}.dn-create-table th:nth-child(2){width:53%}.dn-create-table th:nth-child(3){width:12%}.dn-create-table th:nth-child(4){width:8%}.dn-create-table th:nth-child(5){width:9%}
.dn-create-table select{white-space:normal}.dn-line-balance{display:block;font-size:11px;line-height:1.6;margin-top:8px;color:#5c6c7e}
.pi-item-editor.dn-edit-table th:first-child,.pi-item-editor.dn-edit-table td:first-child{width:66%}
/* Invoice amounts and editable prices need their own space. Keep horizontal
   overflow inside the existing items container rather than squeezing columns. */
@media(min-width:701px){
 .pi-item-editor:has(>tbody#invItems){min-width:1416px!important}
 .pi-item-editor:has(>tbody#invItems) :is(th,td):nth-child(1){width:400px}
 .pi-item-editor:has(>tbody#invItems) :is(th,td):nth-child(2){width:84px}
 .pi-item-editor:has(>tbody#invItems) :is(th,td):nth-child(3){width:96px}
 .pi-item-editor:has(>tbody#invItems) :is(th,td):nth-child(4){width:144px}
 .pi-item-editor:has(>tbody#invItems) :is(th,td):nth-child(5),
 .pi-item-editor:has(>tbody#invItems) :is(th,td):nth-child(6){width:80px}
 .pi-item-editor:has(>tbody#invItems) :is(th,td):nth-child(7),
 .pi-item-editor:has(>tbody#invItems) :is(th,td):nth-child(8),
 .pi-item-editor:has(>tbody#invItems) :is(th,td):nth-child(9){width:160px}
 .pi-item-editor:has(>tbody#invItems) :is(th,td):nth-child(10){width:52px}
}
@media(max-width:700px){
 .pi-item-editor,.pi-item-editor tbody{display:block;min-width:0!important;width:100%;table-layout:auto}
 .pi-item-editor thead{display:none}.pi-item-editor tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border:1px solid #dce5ef;border-radius:10px;margin-bottom:14px;padding:8px}
 .pi-item-editor td{display:block;width:auto!important;min-width:0;border:0!important}.pi-item-editor td:before{content:attr(data-entry-label);display:block;font-size:11px;color:#5c6c7e;margin-bottom:5px}
 .pi-item-editor:not(.dn-create-table) td:first-child,.dn-create-table td:nth-child(1),.dn-create-table td:nth-child(2){grid-column:1/-1}
 .pi-item-editor textarea{font-size:14px;min-height:145px}
}
