/* Invoice details keep the invoice, related business and attachments together. */
/* Registration/editing uses the same compact hierarchy with an independent action footer. */
.iv-editor-heading h3{margin:0;font-size:16px}
.iv-editor-setup,.iv-editor-ticket{display:grid;gap:10px 14px}
.iv-editor-setup{grid-template-columns:repeat(3,minmax(0,1fr))}
.iv-editor-ticket{grid-template-columns:repeat(4,minmax(0,1fr))}
.iv-editor-party{grid-column:1/-1;min-width:0;display:flex;flex-wrap:wrap;gap:6px 24px;padding:3px 0;font-size:13px;line-height:20px}
.iv-editor-party[hidden],.iv-party-item[hidden]{display:none}
.iv-party-item{display:flex;gap:8px;min-width:0;overflow-wrap:anywhere}
.iv-party-label{flex:none;color:#677e99;font-size:12px}
.iv-client-profile{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;min-width:0}
.iv-client-profile[hidden]{display:none}
.iv-client-profile-data{flex:1;min-width:0}
.iv-client-profile-data>summary,.iv-client-profile-snapshot>summary{cursor:pointer;color:#61748b;font-size:12px;line-height:20px;padding:4px 0}
.iv-client-profile>button{flex:none}
.iv-client-profile-snapshot{margin:6px 0 10px}
.iv-editor-business{min-width:0;border:1px solid #dce5ef;border-radius:5px}
.iv-editor-business legend{font-size:13px;font-weight:600;padding:0 6px}
.iv-editor-business-footer{display:flex;gap:12px;justify-content:space-between;align-items:center;flex-wrap:wrap}
.iv-editor .iv-allocation-info:empty,.iv-editor-kept:empty{display:none}
.iv-editor-extra>summary{cursor:pointer;color:#61748b;font-size:12px;padding:5px 0}
.iv-editor-extra>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px;padding-top:8px}
.iv-editor-extra [data-iv-red-note]{grid-column:1/-1}
.iv-editor-kept{display:flex;gap:6px 14px;flex-wrap:wrap}
.iv-editor-kept .iv-keep{max-width:100%;min-width:0}
.iv-editor-kept .iv-keep span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.iv-editor-footer{display:flex;gap:8px;justify-content:flex-end;background:#fff;border-top:1px solid #dce5ef;flex:none}
@media(min-width:769px){
 body.pc-ui-preview .iv-modal .iv-shell:has(.iv-editor){width:min(1180px,100%);max-height:calc(100dvh - 32px)}
 body.pc-ui-preview .iv-modal .iv-body:has(>.iv-editor){display:flex;min-height:0;overflow:hidden;padding:0}
 body.pc-ui-preview .iv-modal .iv-editor{display:flex;flex-direction:column;width:100%;min-height:0;max-height:calc(100dvh - 110px);gap:0;margin:0;padding:0}
 body.pc-ui-preview .iv-modal .iv-editor-content{min-height:0;overflow:auto;padding:10px 16px;display:flex;flex-direction:column;gap:10px}
 body.pc-ui-preview .iv-modal .iv-editor-heading{margin:0;padding:0}
 body.pc-ui-preview .iv-modal .iv-editor-heading h3{margin:0;font-size:15px;line-height:20px}
 body.pc-ui-preview .iv-modal .iv-editor :is(label,fieldset,p){margin:0}
 body.pc-ui-preview .iv-modal .iv-editor .iv-field{display:grid;gap:4px;font-size:12px;line-height:17px}
 body.pc-ui-preview .iv-modal .iv-editor .iv-field :is(input,select){height:32px;min-height:32px;padding:4px 7px;margin:0;font-size:13px}
 body.pc-ui-preview .iv-modal .iv-editor .iv-field textarea{min-height:54px;max-height:120px;padding:6px 8px;margin:0}
 body.pc-ui-preview .iv-modal .iv-editor-business{padding:5px 10px 8px}
 body.pc-ui-preview .iv-modal .iv-editor .iv-allocation{grid-template-columns:120px minmax(180px,1fr) 160px auto;gap:6px 8px;padding:5px 0 7px;border-bottom:1px solid #e7edf4}
 body.pc-ui-preview .iv-modal .iv-editor .iv-allocation>button{grid-column:auto;min-height:30px;margin:0}
 body.pc-ui-preview .iv-modal .iv-editor .iv-allocation-info{font-size:12px;line-height:17px}
 body.pc-ui-preview .iv-modal .iv-editor-business-footer{padding-top:6px}
 body.pc-ui-preview .iv-modal .iv-editor .iv-note{font-size:12px;line-height:18px}
 body.pc-ui-preview .iv-modal .iv-editor button{min-height:30px;padding:4px 9px;font-size:12px;margin:0}
 body.pc-ui-preview .iv-modal .iv-editor .iv-keep{margin-top:5px;font-size:12px;gap:5px}
 body.pc-ui-preview .iv-modal .iv-editor-footer{padding:10px 16px;margin:0;position:static}
 body.pc-ui-preview .iv-modal .iv-editor-footer button[type=submit]{background:#155dcc;color:#fff;border-color:#155dcc}
}
@media(max-width:768px){
 .iv-editor-content{display:grid;gap:12px}
 .iv-editor-setup,.iv-editor-ticket,.iv-editor-extra>div{grid-template-columns:minmax(0,1fr)}
 .iv-editor-footer{position:sticky;bottom:-14px;margin-top:12px;padding:12px 0 0}
 .iv-editor-footer button{min-height:40px}
 .iv-editor-business{padding:8px}
}
.iv-detail{font-size:13px;line-height:1.4}
.iv-detail-title,.iv-detail-title>div:first-child{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.iv-detail-title{justify-content:space-between;padding:0 0 10px;border-bottom:1px solid #dce5ef;margin-bottom:10px}
.iv-detail-title>div:first-child{min-width:0;flex:1}
.iv-detail-title h3{font-size:17px;margin:0;overflow-wrap:anywhere}
.iv-detail-status{background:#edf4ff;border-radius:4px;padding:3px 7px;color:#18569f;white-space:nowrap}
.iv-detail-amount{display:flex;gap:9px;align-items:baseline;white-space:nowrap}
.iv-detail-amount>span{font-size:12px;color:#61748b}
.iv-detail-amount strong{font-size:23px;color:#203f62}
.iv-detail-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:22px;row-gap:8px;margin:0 0 10px}
.iv-detail-fields>div{display:grid;grid-template-columns:72px minmax(0,1fr);gap:8px;align-items:start;min-width:0}
.iv-detail-fields dt{color:#677e99;font-size:12px}
.iv-detail-fields dd{margin:0;overflow-wrap:anywhere;white-space:pre-wrap}
.iv-detail-context{font-size:12px;margin:7px 0;padding:6px 8px;background:#f6f9fc;white-space:pre-wrap;overflow-wrap:anywhere}
.iv-detail h4{margin:0 0 7px;font-size:13px}
.iv-detail h4 span{font-weight:400;color:#677e99;margin-left:5px;font-size:12px}
.iv-detail-sources,.iv-detail-attachments{border-top:1px solid #e1e8f2;padding:10px 0 0;margin-top:10px}
.iv-detail .iv-table-wrap{overflow:auto;border:1px solid #dce5ef;border-radius:4px}
.iv-detail .iv-table-wrap table{table-layout:fixed;font-size:13px;margin:0}
.iv-detail .iv-table-wrap th,.iv-detail .iv-table-wrap td{padding:6px 8px;min-width:0;white-space:normal;vertical-align:middle}
.iv-detail .iv-table-wrap th:first-child{width:16%}
.iv-detail .iv-table-wrap th:nth-child(2){width:35%}
.iv-detail .iv-table-wrap th:nth-child(3){width:30%}
.iv-detail .iv-table-wrap th:last-child{width:19%}
.iv-detail .iv-table-wrap th:last-child,.iv-detail .iv-table-wrap td:last-child{position:static;text-align:right;box-shadow:none;white-space:nowrap}
.iv-detail-files{display:flex;flex-wrap:wrap;gap:6px 10px}
.iv-detail-file{display:flex;align-items:center;gap:8px;max-width:100%;min-width:0;border:1px solid #dce5ef;border-radius:4px;padding:5px 7px}
.iv-detail-file>span{min-width:0;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.iv-detail-file>div{display:flex;gap:4px;flex:none}
.iv-detail-file button{min-height:26px;padding:3px 7px;font-size:12px}
.iv-detail-delivery{display:grid;grid-template-columns:72px minmax(0,1fr);gap:8px;margin-top:10px;padding-top:9px;border-top:1px solid #e1e8f2;overflow-wrap:anywhere}
.iv-detail-delivery>strong{font-size:12px;color:#677e99;font-weight:400}
.iv-detail-delivery small{display:block;color:#677e99;margin-top:3px;white-space:pre-wrap}
.iv-detail-history{border-top:1px solid #e1e8f2;margin-top:10px;padding-top:9px}
.iv-detail-history>summary{font-weight:600;cursor:pointer;color:#294c72;padding:2px 0;font-size:12px}
.iv-detail-history .iv-history{margin:5px 0 0;padding:0 0 0 16px}
.iv-detail-history .iv-history li{padding:6px 0;font-size:12px;line-height:1.4}
.iv-detail-history .iv-history li>div{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px}
.iv-detail-history .iv-history li>div>span{color:#677e99}
.iv-detail-history .iv-history p{margin:4px 0 0}
.iv-detail-footer{position:sticky;bottom:-12px;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border-top:1px solid #dce5ef;margin-top:10px;padding:10px 0 0}
.iv-detail-footer>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.iv-detail-footer button,.iv-detail-context button{min-height:30px;padding:5px 9px;font-size:12px}
.iv-detail-footer button:is([data-iv=approve],[data-iv=submit]){background:#155dcc;color:#fff;border-color:#155dcc}
.iv-detail-more{position:relative}
.iv-detail-more>summary{padding:7px 5px;cursor:pointer;color:#61748b;font-size:12px}
.iv-detail-more>div{position:absolute;left:0;bottom:100%;z-index:4;min-width:150px;padding:5px;background:#fff;border:1px solid #dce5ef;border-radius:5px;box-shadow:0 6px 20px #16375426;display:grid;gap:4px}
.iv-detail-more>div button{width:100%;text-align:left;background:#fff;border:0;color:#85505a}
.iv-detail-more>div button:hover{background:#fff3f3}
.iv-file-preview{position:absolute;inset:16px;z-index:10;margin:auto;max-width:1300px;background:#fff;border-radius:8px;box-shadow:0 16px 60px #0b1a2f50;display:flex;flex-direction:column;overflow:hidden}
.iv-file-preview>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border-bottom:1px solid #dce5ef;flex:none}
.iv-file-preview>header>strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:14px}
.iv-file-preview>header>div{display:flex;gap:8px;flex:none}
.iv-file-preview button{min-height:32px;font-size:12px;padding:5px 9px}
.iv-preview-content{min-height:0;flex:1;overflow:auto;background:#edf1f6;display:flex;align-items:center;justify-content:center;padding:10px}
.iv-preview-content img{display:block;max-width:100%;max-height:100%;object-fit:contain}
.iv-preview-content iframe{width:100%;height:100%;border:0;background:#fff;min-height:0}
.iv-preview-message:empty{display:none}
.iv-preview-message{margin:0;padding:8px 14px;color:#9c3c36;font-size:12px}
@media(min-width:769px){
 .iv-modal .iv-shell{width:min(1040px,100%);border-radius:7px}
 .iv-modal .iv-shell>header{padding:10px 16px;background:#fff}
 .iv-modal .iv-shell h2{font-size:18px}
 .iv-modal .iv-shell>header button{min-height:30px;padding:5px 10px}
 .iv-modal .iv-body{padding:12px 16px}
 .iv-modal .iv-message:not(:empty){padding:7px 16px;font-size:13px}
 .iv-modal .iv-body>form>h3{font-size:16px;margin:8px 0 12px}
 .iv-modal .iv-body>form>.iv-actions{margin:0 0 8px}
 .iv-modal .iv-form{gap:10px 16px}
 .iv-modal .iv-field{gap:4px;font-size:13px}
 .iv-modal .iv-field input,.iv-modal .iv-field select{min-height:32px;padding:5px 8px;font-size:13px}
 .iv-modal .iv-form fieldset{border-radius:5px;padding:9px 10px}
 .iv-modal .iv-allocation{gap:7px;padding:7px 0}
 .iv-modal .iv-form>.iv-note{margin:0}
 .iv-modal .iv-footer{bottom:-12px;margin-top:10px;padding:10px 0 0}
}
@media(max-width:768px){
 .iv-detail-title{gap:8px}
 .iv-detail-title>div:first-child{flex-basis:100%}
 .iv-detail-fields{grid-template-columns:minmax(0,1fr)}
 .iv-detail .iv-table-wrap table{table-layout:auto}
 .iv-detail .iv-table-wrap td:last-child{text-align:left;white-space:normal}
 .iv-detail-footer{bottom:-14px;align-items:flex-start}
 .iv-detail-footer>div:last-child{justify-content:flex-end}
 .iv-detail-footer button{min-height:38px}
 .iv-detail-file{width:100%;justify-content:space-between}
 .iv-detail-file>span{max-width:none}
 .iv-file-preview{inset:8px}
 .iv-file-preview>header{flex-wrap:wrap}
 .iv-preview-content{padding:5px}
}
