/* A. S. Bookbinding ERP V45.20 — Smart Document Inbox */
#orderImport{max-width:100%;overflow-x:hidden}
.v4520-page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:14px;min-width:0}
.v4520-page-head>div:first-child{min-width:0}.v4520-page-head h1{margin:.1rem 0 .35rem}.v4520-page-head p{margin:0;max-width:900px;color:var(--muted,#607080);line-height:1.45}
.v4520-head-actions{justify-content:flex-end;flex-wrap:wrap;max-width:520px}
.v4520-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:14px 0}
.v4520-kpi{min-width:0;text-align:left;padding:13px 14px;border:1px solid #d7e0e8;border-radius:10px;background:#fff;color:inherit;display:flex;flex-direction:column;gap:3px;box-shadow:0 1px 2px rgba(17,44,68,.04)}
.v4520-kpi:hover{border-color:#91afc6;transform:none}.v4520-kpi span{font-size:12px;font-weight:700;color:#5d6b77}.v4520-kpi b{font-size:24px;line-height:1.1;color:#15374f}.v4520-kpi small{font-size:11px;color:#7b8790}.v4520-kpi.danger{border-color:#e7bbb8;background:#fff8f7}.v4520-kpi.danger b{color:#a22b25}.v4520-kpi.good{border-color:#b8d7c6;background:#f8fcfa}.v4520-kpi.good b{color:#25704a}
.v4520-intake-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:stretch}.v4520-intake-card{margin:0;min-width:0;display:flex;flex-direction:column;gap:10px}.v4520-card-title{display:flex;gap:10px;align-items:flex-start}.v4520-card-title h3{margin:0 0 3px}.v4520-card-title p{margin:0;color:#6f7c86;font-size:12px;line-height:1.35}.v4520-icon{width:28px;height:28px;border-radius:8px;background:#edf4f8;color:#16425f;display:grid;place-items:center;font-weight:800;flex:0 0 auto}.v4520-intake-card textarea{width:100%;min-width:0;resize:vertical}.v4520-intake-card .toolbar{margin-top:auto;flex-wrap:wrap}.v4520-drop{height:100%;min-width:0}.v4520-email-results{max-height:250px;overflow:auto;min-width:0}
.v4520-queue-panel{margin-top:14px;overflow:hidden}.v4520-queue-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin-bottom:10px}.v4520-queue-head h2{margin:0}.v4520-filters{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;min-width:0}.v4520-filters .search{min-width:230px;max-width:340px}.v4520-filters select{width:auto;max-width:220px;min-width:140px}
.v4520-history-wrap{width:100%;overflow:visible}.v4520-history-table{width:100%;table-layout:fixed}.v4520-history-table th,.v4520-history-table td{padding:9px 8px;vertical-align:top;overflow-wrap:anywhere}.v4520-history-table th:nth-child(1){width:26%}.v4520-history-table th:nth-child(2){width:16%}.v4520-history-table th:nth-child(3){width:17%}.v4520-history-table th:nth-child(4){width:11%}.v4520-history-table th:nth-child(5){width:13%}.v4520-history-table th:nth-child(6){width:17%}.v4520-history-table td b,.v4520-history-table td span{display:block}.v4520-history-table td small{display:block;margin-top:3px;color:#77838d}.v4520-row-actions{display:flex;gap:5px;justify-content:flex-end;flex-wrap:wrap}.v4520-row-actions button{padding:6px 8px;font-size:11px;min-height:30px}.v4520-status{display:inline-block!important;width:max-content;max-width:100%;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:800;background:#edf1f4;color:#485660}.v4520-status.good{background:#e7f5ec;color:#236944}.v4520-status.bad{background:#fdebea;color:#a02c27}.v4520-status.work{background:#fff4d9;color:#805c0b}.v4520-status.muted{background:#f0f1f3;color:#687078}.v4520-empty{text-align:center;padding:28px!important;color:#77838d}

/* Review modal: all important fields fit without sideways scrolling. */
.v37-import-modal .modalbox{width:min(97vw,1540px)!important;max-width:97vw!important;overflow-x:hidden!important}.v37-review-layout{min-width:0!important}.v37-source,.v37-review,.v37-review-scroll,.v37-source-view{min-width:0!important;max-width:100%!important}.v37-review .scrollbox{overflow:visible!important;max-width:100%!important}.v37-line-table{display:block!important;width:100%!important;min-width:0!important;border:0!important}.v37-line-table thead{display:none!important}.v37-line-table tbody{display:block!important;width:100%!important}.v37-line-table tr{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 10px;width:100%!important;min-width:0!important;padding:10px;margin:0 0 9px;border:1px solid #dbe3e9;border-radius:9px;background:#fbfcfd}.v37-line-table td{display:block!important;width:auto!important;min-width:0!important;padding:0!important;border:0!important;overflow:visible!important}.v37-line-table td::before{content:attr(data-label);display:block;margin:0 0 3px;font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:#6c7882;font-weight:800}.v37-line-table td:nth-child(1),.v37-line-table td:nth-child(6){grid-column:1/-1}.v37-line-table td:nth-child(8){display:flex!important;justify-content:flex-end;align-items:flex-end}.v37-line-table input,.v37-line-table select,.v37-line-table .v37-description{width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box}.v37-line-table td:nth-child(8)::before{margin-right:auto}.v37-line-table td:nth-child(8) button{width:auto!important;min-width:0!important}

.v4520-preflight-panel{position:relative;margin:0 0 12px;border:1px solid #bfd0dc;background:#f8fbfd;border-radius:10px;padding:10px}.v4520-preflight-head{display:flex;gap:10px;align-items:center;justify-content:space-between}.v4520-preflight-head>div{min-width:0}.v4520-preflight-head b{display:block;color:#183c55}.v4520-preflight-head span{display:block;font-size:11px;color:#667681;margin-top:2px;line-height:1.35}.v4520-quality{margin-top:9px;padding-top:9px;border-top:1px solid #dde6ec}.v4520-quality-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:7px}.v4520-quality-head b,.v4520-quality-head span{display:block}.v4520-quality-head span{font-size:11px;color:#6b7881;margin-top:2px}.v4520-quality-head strong{font-size:22px;color:#254b64}.v4520-quality.ready .v4520-quality-head strong{color:#2b764f}.v4520-quality.blocked .v4520-quality-head strong{color:#a52f2a}.v4520-issue{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:7px;padding:7px 8px;border-radius:7px;margin-top:5px;font-size:12px;line-height:1.35}.v4520-issue.bad{background:#fff0ef;border:1px solid #efc5c1;color:#7f2723}.v4520-issue.warn{background:#fff8e7;border:1px solid #eed99b;color:#704f0a}.v4520-issue b{font-size:10px;text-transform:uppercase;letter-spacing:.04em}.v4520-issue button{padding:4px 7px;font-size:10px;min-height:26px}.v4520-info-note,.v4520-dirty-note{margin-top:7px;padding:7px 8px;background:#edf5fb;border-radius:7px;color:#365b74;font-size:11px;line-height:1.4}.v4520-field-error{border-color:#c43b34!important;box-shadow:0 0 0 2px rgba(196,59,52,.13)!important;background:#fffafa!important}.v4520-error-text{display:block!important;color:#a72f29!important;font-weight:700!important;font-size:10px!important;margin-top:3px!important;line-height:1.25!important}

@media(max-width:1200px){.v4520-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.v4520-intake-grid{grid-template-columns:1fr 1fr}.v4520-intake-card:last-child{grid-column:1/-1}.v4520-page-head{flex-direction:column}.v4520-head-actions{justify-content:flex-start;max-width:none}}
@media(max-width:1050px){.v4520-history-table,.v4520-history-table tbody{display:block;width:100%}.v4520-history-table thead{display:none}.v4520-history-table tr{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:8px 12px;padding:11px;margin:0 0 10px;border:1px solid #dbe3e9;border-radius:9px;background:#fff}.v4520-history-table td{display:block;width:auto!important;padding:0!important;border:0!important;min-width:0}.v4520-history-table td::before{content:attr(data-label);display:block;font-size:9px;text-transform:uppercase;letter-spacing:.05em;color:#7a8790;font-weight:800;margin-bottom:2px}.v4520-history-table td:last-child{grid-column:1/-1}.v4520-row-actions{justify-content:flex-start}}
@media(max-width:820px){.v4520-intake-grid{grid-template-columns:1fr}.v4520-intake-card:last-child{grid-column:auto}.v4520-kpis{grid-template-columns:1fr 1fr}.v4520-queue-head{align-items:stretch;flex-direction:column}.v4520-filters{justify-content:flex-start;width:100%}.v4520-filters .search,.v4520-filters select{flex:1 1 190px;max-width:none;min-width:0}.v37-review-layout{grid-template-columns:1fr!important}.v37-source{max-height:42vh!important}.v4520-preflight-head{align-items:stretch;flex-direction:column}.v4520-preflight-head button{align-self:flex-start}}
@media(max-width:620px){.v4520-kpis{grid-template-columns:1fr}.v4520-history-table tr{grid-template-columns:1fr}.v4520-history-table td:last-child{grid-column:auto}.v37-line-table tr{grid-template-columns:1fr}.v37-line-table td:nth-child(1),.v37-line-table td:nth-child(6){grid-column:auto}.v4520-issue{grid-template-columns:auto minmax(0,1fr)}.v4520-issue button{grid-column:1/-1;justify-self:start}.v4520-row-actions button{flex:1 1 120px}.v4520-filters{display:grid;grid-template-columns:1fr}.v4520-filters .search,.v4520-filters select{width:100%;max-width:none}}
