/* Shared ERP dialog density. Specialized workflows retain their scroll areas. */
.erp-compact{--erp-field-line:#a6bfd3;--erp-block-line:#9fbad0;--erp-row:#f3f7fb}
.erp-compact dialog{border:1px solid var(--erp-block-line);border-radius:14px;box-shadow:0 20px 70px #17355040;font-size:13px;line-height:1.45;color:var(--ink);scrollbar-gutter:stable;scroll-padding-block:18px 88px}
.erp-compact dialog::backdrop{background:#18304770;backdrop-filter:blur(2px)}
.erp-compact dialog.editor:not(.purchase-editor):not(.inventory-dialog):not(.inventory-document-editor):not(.international-purchase-editor):not(.simple-payment-dialog):not(:has(#return-form,#refund-form)){width:min(1020px,calc(100vw - 32px));max-width:1020px;max-height:calc(100dvh - 32px);padding:18px 22px}
.erp-compact dialog.supplier-inline-dialog{padding:18px 22px;max-height:calc(100dvh - 32px)}
.erp-compact dialog :where(h2){font-size:21px;margin:0 0 12px;line-height:1.25;letter-spacing:-.02em}
.erp-compact dialog :where(h3){font-size:15px;line-height:1.3;margin:0 0 8px}
.erp-compact dialog :where(p){margin:8px 0;overflow-wrap:anywhere}
.erp-compact dialog :where(label){font-size:12px;line-height:1.35;margin-bottom:4px}
.erp-compact dialog :where(.small,small){font-size:12px;line-height:1.4}
.erp-compact dialog :where(input:not([type=checkbox]):not([type=radio]),select,textarea){min-width:0;max-width:100%;min-height:36px;border:1px solid var(--erp-field-line);border-radius:6px;padding:7px 9px;font-size:13px;line-height:1.4;background:#fff}
.erp-compact dialog :where(textarea){min-height:68px}
.erp-compact dialog :where(input,select,textarea):focus-visible{outline:2px solid #0063dc;outline-offset:1px;border-color:#0063dc}
.erp-compact dialog :where(input,select,textarea):disabled{background:#edf1f5;color:#52677a}
.erp-compact dialog :where(input[type=checkbox],input[type=radio]){width:18px;height:18px;min-height:18px}
.erp-compact dialog :where(.form-grid){gap:8px 12px;grid-template-columns:repeat(2,minmax(0,1fr))}
.erp-compact dialog :where(.form-grid)>.field{min-width:0;padding:8px 10px;border:1px solid #c1d2df;border-radius:7px;background:var(--erp-row);margin:0}
.erp-compact dialog :where(.form-grid)>.field:focus-within{border-color:#6b9ac2;background:#edf5fc}
.erp-compact dialog :where(.form-grid)>.field.wide{grid-column:1/-1}
.erp-compact dialog :where(form)>.field:not(.checkline){display:grid;grid-template-columns:minmax(150px,.65fr) minmax(0,1fr);align-items:center;gap:5px 14px;padding:9px 12px;margin:7px 0;border:1px solid #bfd0de;border-radius:7px;background:var(--erp-row)}
.erp-compact dialog :where(form)>.field>small{grid-column:2}
.erp-compact dialog :where(.checkline){gap:8px;margin:9px 0;align-items:center;font-size:12px}
.erp-compact dialog :where(.checkline) input{margin-top:0}
.erp-compact dialog :where(.btn){min-height:36px;padding:8px 14px;border-radius:7px;font-size:13px;line-height:1.4;white-space:normal}
.erp-compact dialog :where(.tiny-btn){min-height:30px;padding:6px 9px;border:1px solid #c2d3e0;border-radius:6px;line-height:1.4}
.erp-compact dialog :where(.form-actions){gap:8px;flex-wrap:wrap;margin-top:14px;padding:10px 0;bottom:-18px;border-top:1px solid #bed0df;background:#fff;z-index:3}
.erp-compact dialog :where(.notice){padding:10px 12px;margin:10px 0;border-radius:7px;font-size:12px;border-color:#a9c2d6;line-height:1.5}
.erp-compact dialog :where(.notice.warn){border-color:#e6c474}
.erp-compact dialog :where(.error-text):empty{display:none}
.erp-compact dialog :where(.panel,.settings-section,.import-section,.import-charge,.supplier-contact-row,.client-contact-row){padding:12px 14px;margin-block:10px;border-color:var(--erp-block-line);border-radius:9px;box-shadow:0 2px 5px #17355009}
.erp-compact dialog :where(.list-row,.supplier-link,.client-picker-row,.purchase-line,.received-line){padding:9px 12px;margin-block:6px;border:1px solid #b3c9db;border-radius:7px;background:var(--erp-row);gap:10px}
.erp-compact dialog :where(.list-row,.client-picker-row):nth-child(even){background:#fff}
.erp-compact dialog :where(.detail-grid){gap:12px}
.erp-compact dialog :where(.detail-grid)>div{min-width:0;padding:10px 12px;border:1px solid #bccfdf;border-radius:8px;background:var(--erp-row)}
.erp-compact dialog :where(.detail-grid) p{font-size:13px;margin:6px 0}
.erp-compact dialog :where(th,td){padding:8px 10px;line-height:1.45;font-size:12px;border-bottom-color:#c4d4e0}
.erp-compact dialog :where(thead th){background:#e8f1f8;color:#294c69}
.erp-compact dialog :where(tbody tr:nth-child(even)){background:#f4f8fc}
.erp-compact dialog :where(.toolbar,.inline-form){gap:8px;margin-block:10px}
.erp-compact dialog :where(summary){cursor:pointer;line-height:1.5}
.erp-compact dialog :where(details)>summary:focus-visible{outline:2px solid #0063dc;outline-offset:3px}
.erp-compact dialog :where(select[multiple]){min-height:120px}
.erp-compact .purchase-editor .purchase-editor-head{padding:12px 18px}
.erp-compact .purchase-editor .purchase-editor-scroll{padding:12px 18px 18px}
.erp-compact .purchase-editor .purchase-edit-lines{gap:10px}
.erp-compact .purchase-editor .purchase-editor-footer{padding:10px 18px}
.erp-compact .purchase-editor .purchase-line-head{margin-bottom:8px;gap:9px}
.erp-compact .purchase-editor .purchase-edit-line{padding:10px 12px}
.erp-compact .purchase-editor .purchase-editor-footer .form-actions{border-top:0}
.erp-compact .inventory-document-editor,.erp-compact .international-purchase-editor{padding:18px}
.erp-compact .inventory-document-footer{bottom:-18px;padding-block:10px}
.erp-compact .import-section{padding:12px;margin-bottom:12px}
.erp-compact .import-charge{padding:12px;margin-bottom:10px;border-color:#adc5d8}
.erp-compact .import-section h3{font-size:17px;margin-bottom:10px}
.erp-compact .import-charge-main{gap:8px}
.erp-compact .import-cost-summary>div{padding:9px 11px}
.erp-compact .admin-content #fiscal-config-form .panel{padding:16px;margin-bottom:12px;border-color:#abc3d6}
.erp-compact .admin-content #fiscal-config-form .form-grid{gap:10px}
.erp-compact .admin-content #fiscal-config-form :where(input:not([type=checkbox]),select){min-height:36px;padding:7px 9px;font-size:13px;border-color:#aac1d4;border-radius:6px}
@media(max-width:700px){
 .erp-compact dialog.editor:not(.purchase-editor):not(.inventory-dialog):not(.inventory-document-editor):not(.international-purchase-editor):not(.simple-payment-dialog):not(:has(#return-form,#refund-form)){width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:14px}
 .erp-compact dialog.supplier-inline-dialog{padding:14px;width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}
 .erp-compact dialog :where(.form-grid){grid-template-columns:minmax(0,1fr);gap:8px}
 .erp-compact dialog :where(form)>.field:not(.checkline){grid-template-columns:minmax(0,1fr);gap:4px;padding:8px 10px}
 .erp-compact dialog :where(form)>.field>small{grid-column:1}
 .erp-compact dialog :where(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px;min-height:40px}
 .erp-compact dialog :where(.btn){min-height:40px}
 .erp-compact dialog :where(.form-actions){bottom:-14px;gap:8px}
 .erp-compact dialog :where(.form-actions)>.btn{flex:1 1 auto;max-width:100%}
 .erp-compact dialog :where(.detail-grid){grid-template-columns:minmax(0,1fr)}
 .erp-compact .purchase-editor .purchase-editor-head{padding:10px 12px}
 .erp-compact .purchase-editor .purchase-editor-scroll{padding:10px 12px}
 .erp-compact .purchase-editor .purchase-editor-footer{padding:8px 12px}
 .erp-compact .inventory-document-editor,.erp-compact .international-purchase-editor{padding:14px}
 .erp-compact .inventory-document-footer{bottom:-14px}
}
/* Regular editors present paired fields as compact list rows on desktop. */
.erp-compact dialog .form-grid{gap:8px 10px}
@media(min-width:701px){
 .erp-compact dialog .form-grid>.field:not(.wide):not(.checkline):is(:has(>label+input),:has(>label+select)){display:grid;grid-template-columns:minmax(110px,.8fr) minmax(0,1.3fr);align-items:center;gap:5px 10px;padding:7px 9px}
 .erp-compact dialog .form-grid>.field:not(.wide):is(:has(>label+input),:has(>label+select))>label{margin:0;font-size:12px}
 .erp-compact dialog .form-grid>.field:not(.wide):is(:has(>label+input),:has(>label+select))>:is(small,details,p){grid-column:1/-1}
}
.erp-compact #settings-form .settings-section{padding:16px;border-color:#a9c2d6;border-radius:10px}
.erp-compact #settings-form .settings-section>h2{font-size:19px;margin-bottom:12px}
.erp-compact #settings-form .form-grid{gap:8px 10px}
.erp-compact #settings-form .form-grid>.field{padding:8px 10px;background:#f3f7fb;border:1px solid #bdd0df;border-radius:7px;min-width:0}
.erp-compact #settings-form label{font-size:12px;line-height:1.4}
.erp-compact #settings-form :is(input:not([type=checkbox]):not([type=radio]),select,textarea){min-height:36px;padding:7px 9px;border:1px solid #a6bfd3;border-radius:6px;font-size:13px}
.erp-compact #settings-form textarea{min-height:80px}
.erp-compact #settings-form .checkline{margin-block:8px;gap:8px}
.erp-compact #settings-form .notice{margin-block:10px;padding:10px 12px;font-size:12px}
.erp-compact #settings-form .btn{min-height:36px;padding:8px 14px;border-radius:7px;font-size:13px}
.erp-compact #settings-form .small{font-size:12px}
.erp-compact .compact-section-body .connection-card{padding:16px;border-color:#a9c2d6;border-radius:10px}
.erp-compact .compact-section-body .connection-card p{margin-block:10px;font-size:13px}
.erp-compact .compact-section-body .connection-card .btn{min-height:36px;padding:8px 14px;font-size:13px}
@media(max-width:700px){
 .erp-compact #settings-form :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px;min-height:40px}
 .erp-compact #settings-form .settings-section{padding:12px}
 .erp-compact #settings-form .btn,.erp-compact .compact-section-body .connection-card .btn{min-height:40px}
}
