/* Document editor follows the two-part reference: header, lines, catalog, manual line, history. */
.draft-shell{min-width:0;color:#173d30}.draft-title{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;background:#075740;color:#fff;border-radius:7px 7px 0 0}.draft-title h2{display:flex;gap:10px;align-items:center;font-size:17px;margin:0}.draft-title .document-open{flex-shrink:0;border:1px solid #ffffff60}.draft-actions{display:flex;align-items:center;gap:5px;flex-wrap:wrap;padding:8px;background:#fff;border:1px solid #c7dace}.draft-actions span{margin-left:auto;font-size:12px;color:#4c695b}.draft-shell button{min-height:40px;min-width:40px;border-radius:5px;border:1px solid #aac6b8;background:#e5f1eb;color:#064d36;padding:7px 12px;cursor:pointer;font:inherit}.draft-shell button:hover:not(:disabled){background:#cee4d8}.draft-shell button:disabled{opacity:.5;cursor:not-allowed}.draft-shell .document-open{background:#075740;color:white}.draft-shell input,.draft-shell select,.draft-shell textarea{box-sizing:border-box;min-width:0;border:1px solid #aec8ba;border-radius:4px;padding:7px 9px;background:white;color:#183d30;font:inherit;min-height:38px}.draft-shell input[readonly]{background:#f4f8f6;color:#244e3a}.draft-shell input[type=number],.draft-shell input[readonly]{text-align:right}.draft-customer-select{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:12px 0}.draft-customer-select>input{width:300px;max-width:100%}.draft-customer-select select{width:430px;max-width:100%}.draft-hint{font-size:12px;color:#506c5d;margin:8px 0 12px}.draft-layout-scroll{overflow-x:auto;max-width:100%;padding-bottom:6px}.draft-layout{min-width:1080px}.draft-section{margin-bottom:14px;border:1px solid #b4ccbf;background:#fff;border-radius:5px;overflow:hidden}.draft-section>header{display:flex;align-items:center;gap:12px;background:#d6eadd;min-height:36px;padding:4px 9px}.draft-section>header h3{margin:0 auto 0 0;font-size:14px;color:#164731}.draft-section>header button{min-height:32px;padding:2px 12px}.draft-section>header strong{font-size:15px}.draft-header-body{display:grid;grid-template-columns:260px minmax(0,1fr);gap:6px;padding:6px}.draft-contract{border:1px solid #b4ccbf;padding:8px 12px;background:#f1f7f4}.draft-contract-heading{display:flex;align-items:center;justify-content:space-between;gap:4px;margin-bottom:6px}.draft-contract-heading button{font-size:12px;min-height:36px;padding:6px}.draft-contract label{display:flex;align-items:center;justify-content:space-between;gap:6px;margin:7px 0;font-size:13px}.draft-contract label input,.draft-contract label select{width:66px;padding:6px}.draft-contract label:nth-last-child(3){margin-top:22px}.draft-header-fields{border:1px solid #b4ccbf;background:#f7faf8;padding:8px 12px;min-width:0}.draft-field-row{display:flex;align-items:center;gap:7px;margin-bottom:6px;min-width:0}.draft-field-row>span:first-child{width:120px;flex-shrink:0;font-size:13px}.draft-field-row>input,.draft-field-row>select{width:220px}.draft-field-row>select{flex-shrink:0}.draft-field-row>.draft-stretch{width:auto;flex:1}.draft-field-row>textarea{height:40px;min-height:40px;resize:vertical}.draft-field-row>textarea.expanded{height:110px}.draft-field-row .draft-news{display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:13px}.draft-news input{width:19px;min-height:19px}.draft-shell table{border-collapse:collapse;width:100%;font-size:13px}.draft-shell th,.draft-shell td{text-align:left;padding:8px 9px;border:1px solid #d1e0d8}.draft-shell th{background:#e6f0eb;font-weight:700;color:#164731}.draft-shell .numeric-column{text-align:right;white-space:nowrap}.draft-items{min-height:170px}.draft-items th:first-child{width:90px}.draft-items th:nth-child(2){width:100%}.draft-items td:nth-child(2){min-width:220px}.draft-items input{width:70px}.draft-items td:nth-child(n+3){white-space:nowrap}.draft-selected,.draft-sum{background:#e0efe6}.draft-sum{font-weight:700}.draft-error{display:block;color:#a12424;margin-top:4px}.draft-new-product{display:grid;grid-template-columns:400px minmax(0,1fr);gap:24px;padding:8px}.draft-product-picker input{width:100%;margin-bottom:8px}.draft-product-picker select{width:100%;height:220px;overflow:auto;border-radius:3px;padding:0}.draft-product-picker option{padding:10px 8px}.draft-product-picker option:checked{background:#075740;color:#fff}.draft-product-picker small{display:block;color:#506c5d;font-size:11px;margin-top:4px}.draft-new-controls{display:flex;flex-direction:column;justify-content:space-between;gap:18px}.draft-entry-fields{display:flex;align-items:flex-start;gap:14px}.draft-entry-fields label{display:block;font-size:13px;line-height:1.3}.draft-entry-fields input{display:block;width:108px;margin-top:6px}.draft-entry-fields>div:nth-child(2) input,.draft-entry-fields>div:nth-child(3) input,.draft-entry-fields>label:last-child input{width:66px}.draft-entry-fields>div>button{display:block;margin-top:4px}.draft-entry-fields .draft-insert{width:108px;min-height:82px;background:#075740;color:#fff}.draft-warning{display:block;font-size:13px}.draft-warning input{display:block;width:100%;margin-top:7px;text-align:left!important}.draft-manual{display:flex;align-items:flex-start;gap:16px;padding:8px}.draft-manual label{display:block;font-size:13px}.draft-manual input{display:block;margin-top:22px;width:110px}.draft-manual>label:first-child{width:410px;margin-right:0}.draft-manual>label:first-child input{width:100%;margin-top:38px}.draft-manual>label:nth-last-child(2) input{width:65px}.draft-manual button{margin-top:7px;min-width:80px}.draft-section>.draft-hint{padding:0 8px}.draft-history{max-height:340px;overflow:auto}.draft-history th:nth-child(2){width:100%}.draft-history th:nth-child(3){min-width:110px}.draft-history th:nth-child(6){min-width:170px}.draft-history select{display:block;width:100%;margin-top:5px}.draft-history td{white-space:nowrap}.draft-history .portal-icon{width:18px;height:18px}.draft-history thead{position:sticky;top:0;z-index:1}@media(max-width:760px){.draft-title{flex-wrap:wrap}.draft-title h2{font-size:15px}.draft-actions span{margin-left:0}.draft-customer-select select{max-width:calc(100vw - 110px)}}
.register-intro-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:16px}.register-intro-actions .customers-intro{margin:0}.register-intro-actions .draft-new{margin:0;min-height:44px;flex-shrink:0}
.draft-item-row{cursor:pointer}.draft-item-row:focus-visible{outline:2px solid #075740;outline-offset:-2px}.draft-items .draft-selected td{background:#c6e3d2}.draft-items .draft-selected td:first-child{box-shadow:inset 3px 0 #075740}
.draft-edit-fields{border:0;padding:0;margin:0;min-width:0}.draft-edit-fields:disabled{opacity:.65}
.draft-confirm-dialog{width:min(510px,calc(100vw - 24px));box-sizing:border-box}.draft-confirm-dialog p{line-height:1.6;margin:0;color:#345c49}.draft-confirm-dialog h2{color:#075740}.draft-confirm-dialog footer button{min-height:44px}.draft-confirm-dialog .draft-confirm-cancel{background:#e5f1eb;color:#075740;border:1px solid #aac6b8}

.draft-picker{min-width:0}.draft-customer-select .draft-picker{width:430px;max-width:calc(100vw - 110px)}.draft-contract label>.draft-picker{width:90px;flex-shrink:0}.draft-field-row>.draft-picker{width:220px;flex-shrink:0}.draft-history .draft-picker{margin-top:5px}.draft-shell .draft-picker .representative-trigger{min-width:0;min-height:40px;width:100%;background:#f4faf6;color:#245640;border:1px solid #c9dcd1;border-radius:6px;text-align:left}.draft-shell .draft-picker .representative-trigger:hover:not(:disabled){background:#dceee2}.draft-shell .representative-options button{min-height:44px}.draft-picker .representative-trigger span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.draft-toast{position:fixed;z-index:1200;bottom:calc(24px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:12px;max-width:min(560px,calc(100vw - 32px));width:max-content;box-sizing:border-box;padding:14px 20px;border:1px solid #477963;border-radius:10px;background:#075740;color:#fff;box-shadow:0 6px 24px #003a2d40;font-size:14px;font-weight:600;pointer-events:none}.draft-toast .portal-icon{width:22px;height:22px;flex-shrink:0}.draft-toast span{overflow-wrap:anywhere}
