.oms-document-management{display:grid;gap:var(--space-3)}
.oms-delivery-files{border:1px solid var(--color-border);border-radius:var(--radius-card);padding:20px;background:var(--color-surface)}
.oms-delivery-files>header,.oms-delivery-plans>header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.oms-delivery-files h3,.oms-delivery-plans h3{margin:0;font-size:16px}.oms-delivery-files h3 small{font-size:13px;color:var(--color-text-secondary);margin-left:8px}
.oms-delivery-files header p,.oms-delivery-plans header p,.oms-delivery-file-help{font-size:12px;color:var(--color-text-secondary);margin:8px 0 0;line-height:1.6}
.oms-delivery-upload{position:relative;overflow:hidden;flex-shrink:0;cursor:pointer}.oms-delivery-upload input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}.oms-delivery-upload:focus-within{outline:2px solid var(--color-brand);outline-offset:2px}
.oms-delivery-file-list{display:grid}.oms-delivery-file-row{display:flex;align-items:center;border-bottom:1px solid var(--color-border);min-width:0;position:relative}
.oms-delivery-file-name{display:flex;align-items:center;gap:12px;flex:1;min-width:0;text-align:left;border:0;background:transparent;color:inherit;padding:16px 4px;cursor:pointer;font:inherit;font-size:14px}.oms-delivery-file-name>span:last-child{overflow-wrap:anywhere}.oms-delivery-file-name:hover{text-decoration:underline}
.oms-delivery-file-kind{flex-shrink:0;font-size:10px;font-weight:700;border-radius:6px;background:var(--color-surface-muted);padding:8px;color:var(--color-text-secondary)}
.oms-delivery-file-menu summary{cursor:pointer;list-style:none;padding:10px;font-size:20px}.oms-delivery-file-menu>div{position:absolute;right:0;top:44px;z-index:3;display:grid;gap:8px;padding:8px;background:var(--color-surface);border:1px solid var(--color-border);border-radius:8px;box-shadow:0 4px 16px #0002}
.oms-delivery-files-empty{text-align:center;padding:36px 16px;background:var(--color-surface-subtle);border-radius:8px}.oms-delivery-files-empty p{color:var(--color-text-secondary);font-size:13px}
.oms-delivery-plans{border-top:1px solid var(--color-border);padding-top:24px}.oms-delivery-plans>.actions{margin-bottom:16px;display:flex;flex-wrap:wrap;gap:8px}
.oms-delivery-file-viewer{display:grid;grid-template-columns:230px minmax(0,1fr);height:65vh;min-height:360px;gap:16px}.oms-delivery-file-viewer aside{overflow:auto;border-right:1px solid var(--color-border);padding-right:12px}.oms-delivery-file-viewer .is-selected{background:var(--color-surface-muted);border-radius:6px}.oms-delivery-file-viewer .oms-delivery-file-name{font-size:12px;gap:8px}.oms-delivery-file-content{min-width:0;min-height:0}.oms-delivery-file-content iframe{width:100%;height:100%;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface-muted)}
.oms-document-modal:has(.oms-delivery-file-viewer){width:min(1200px,calc(100vw - 24px));max-width:1200px}
@media(max-width:640px){.oms-delivery-files{padding:14px}.oms-delivery-files>header{align-items:flex-start;flex-wrap:wrap}.oms-delivery-file-viewer{grid-template-columns:1fr;grid-template-rows:110px minmax(0,1fr);height:65vh;gap:8px}.oms-delivery-file-viewer aside{border-right:0;border-bottom:1px solid var(--color-border);padding-right:0}.oms-delivery-file-viewer .oms-delivery-file-name{padding:8px 4px}}
.oms-document-card>header{min-height:100px;border-bottom:0;padding:var(--space-4) var(--space-5)}
.oms-document-card header>div{min-width:0}.oms-document-card h2{font-size:var(--font-size-section)}
.oms-document-card p{margin:var(--space-2) 0 0;color:var(--color-text-secondary);font-size:var(--font-size-caption);overflow-wrap:anywhere}
.oms-document-card .btn{flex-shrink:0}
.oms-document-modal>.ui-modal__body{display:flex;flex-direction:column;gap:var(--space-5)}
.oms-document-modal>.ui-modal__body>*{flex-shrink:0;min-width:0}
.oms-document-current{display:grid;gap:var(--space-4);padding:var(--space-4);border:1px solid var(--color-border);border-radius:var(--radius-card)}
.oms-document-current>div:first-child,.oms-document-project{display:grid;gap:var(--space-2)}
.oms-document-current span,.oms-document-project span{color:var(--color-text-secondary);font-size:var(--font-size-caption)}
.oms-document-history h3{margin:0 0 var(--space-3);font-size:var(--font-size-body)}
.oms-document-history>div{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3) 0;border-bottom:1px solid var(--color-border)}
.oms-document-history span{flex:1;color:var(--color-text-secondary);font-size:var(--font-size-caption)}
.oms-document-history .actions{display:flex;flex-wrap:wrap;gap:var(--space-2)}
.oms-quote-revision-items{display:grid;gap:var(--space-4)}
.oms-quote-revision-items article{padding:var(--space-4);border:1px solid var(--color-border);border-radius:var(--radius-card)}
.oms-quote-revision-items h3{margin:0 0 var(--space-3)}
.oms-quote-revision-items p{margin:var(--space-2) 0;white-space:pre-wrap;overflow-wrap:anywhere}
.oms-document-help{margin:0;padding:var(--space-3) var(--space-4);background:var(--color-surface-subtle);border-radius:var(--radius-control);color:var(--color-text-secondary);font-size:var(--font-size-caption);line-height:1.6}
.oms-delivery-note-list{display:grid;gap:var(--space-3)}.oms-delivery-note-list article{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);padding:var(--space-4);border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-surface)}.oms-delivery-note-list article div{display:grid;gap:var(--space-1)}.oms-delivery-note-list article span{font-size:var(--font-size-caption);color:var(--color-text-secondary)}
.oms-document-select-all{display:flex;align-items:center;gap:var(--space-2);cursor:pointer}.oms-document-select-all span{margin-left:auto;color:var(--color-text-secondary);font-size:var(--font-size-caption)}
.oms-document-select-all input{width:1rem;height:1rem;accent-color:var(--color-brand)}
.oms-delivery-fields{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-4)}.oms-delivery-address{grid-column:1/-1}
.oms-delivery-table table{width:100%}.oms-delivery-table th,.oms-delivery-table td{padding:var(--space-3);text-align:left;border-bottom:1px solid var(--color-border)}
.oms-delivery-table th{font-size:var(--font-size-caption);color:var(--color-text-secondary);white-space:nowrap}.oms-delivery-table input{min-width:100px;width:120px}.oms-delivery-table td:first-child{min-width:160px}
@media(max-width:640px){.oms-document-card>header{align-items:flex-start;flex-direction:column;gap:var(--space-3)}.oms-document-card .btn{align-self:flex-end}.oms-delivery-fields{grid-template-columns:1fr}.oms-document-modal .ui-modal__footer{flex-wrap:wrap}.oms-document-history>div{flex-wrap:wrap}.oms-delivery-note-list article{align-items:flex-start;flex-direction:column}.oms-delivery-note-list article .btn{align-self:flex-end}}
@media(max-width:640px){.oms-delivery-table thead{display:none}.oms-delivery-table table,.oms-delivery-table tbody{display:block}.oms-delivery-table tbody{display:grid;gap:var(--space-3)}.oms-delivery-table tr{display:grid;grid-template-columns:1fr 1fr;padding:var(--space-3);border:1px solid var(--color-border);border-radius:var(--radius-card)}.oms-delivery-table td{border:0;min-width:0;padding:var(--space-2)}.oms-delivery-table td:first-child{grid-column:1/-1;min-width:0}.oms-delivery-table td[data-label]::before{content:attr(data-label);display:block;margin-bottom:var(--space-2);font-size:var(--font-size-caption);color:var(--color-text-secondary)}.oms-delivery-table input{width:100%;min-width:0}}

.quote-register-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.quote-register-option{display:grid;gap:12px;min-height:140px;padding:24px;text-align:left;font:inherit;color:var(--color-text);background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-card);cursor:pointer}.quote-register-option:hover{background:var(--color-surface-subtle);border-color:var(--brand)}.quote-register-option strong{font-size:18px}.quote-register-option span{font-size:13px;line-height:1.7;color:var(--color-text-secondary)}
.quote-pdf-intro{display:grid;justify-items:start;gap:12px;padding:24px;border:1px dashed var(--color-border);border-radius:var(--radius-card)}.quote-pdf-intro p{margin:0;line-height:1.7;font-size:13px;color:var(--color-text-secondary)}.quote-pdf-picker{position:relative;overflow:hidden}.quote-pdf-picker input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}.quote-pdf-picker:focus-within{outline:2px solid var(--brand);outline-offset:2px}.quote-pdf-error{color:var(--color-danger);white-space:pre-line;overflow-wrap:anywhere}
#quote-pdf-review{display:grid;gap:20px;min-width:0}.quote-pdf-source{margin:0;font-size:13px;overflow-wrap:anywhere}.quote-pdf-meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.quote-pdf-meta label,.quote-pdf-amounts label{display:grid;align-content:start;gap:6px;min-width:0;font-size:12px}.quote-pdf-meta input,.quote-pdf-amounts input{width:100%;min-width:0}.quote-pdf-item{display:grid;gap:16px;padding:20px;border:1px solid var(--color-border);border-radius:var(--radius-card);min-width:0}.quote-pdf-item header{display:flex;flex-wrap:wrap;gap:12px;align-items:center}.quote-pdf-item header span{font-size:12px;color:var(--color-text-secondary)}.quote-pdf-item header strong{overflow-wrap:anywhere}.quote-pdf-before,.quote-pdf-spec{font-size:12px;line-height:1.8;margin:0;white-space:pre-line;overflow-wrap:anywhere;color:var(--color-text-secondary)}.quote-pdf-amounts{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.quote-pdf-retain{display:grid;gap:12px;padding:20px;background:var(--color-surface-subtle);border-radius:var(--radius-card)}.quote-pdf-retain h3,.quote-pdf-retain p{margin:0}.quote-pdf-retain p{font-size:12px;line-height:1.7;color:var(--color-text-secondary)}.quote-pdf-retain label,.quote-pdf-confirm{display:flex;gap:8px;align-items:flex-start;font-size:13px;line-height:1.7}.quote-pdf-retain input[type=checkbox],.quote-pdf-confirm input[type=checkbox]{width:16px;height:16px;min-height:16px;min-width:16px;flex:0 0 16px;margin:3px 0 0;padding:0}.quote-editor-actions{display:flex;flex-wrap:wrap;gap:8px}.oms-document-modal:has(.quote-pdf-intro),.oms-document-modal:has(.quote-register-options),.oms-document-modal:has(#quote-pdf-review){z-index:2}
@media(max-width:720px){.quote-register-options,.quote-pdf-meta{grid-template-columns:1fr}.quote-register-option{min-height:110px;padding:18px}.quote-pdf-amounts{grid-template-columns:repeat(2,minmax(0,1fr))}.quote-pdf-item,.quote-pdf-intro,.quote-pdf-retain{padding:14px}.quote-editor-actions{width:100%}.quote-editor-actions .btn{flex:1}.oms-document-modal:has(#quote-pdf-review){width:calc(100vw - 16px)}.oms-document-modal:has(#quote-pdf-review) .ui-modal__footer{flex-wrap:wrap}.oms-document-modal:has(#quote-pdf-review) .ui-modal__footer .primary{flex:1;white-space:normal}}

.quote-pdf-intro{transition:background .15s,border-color .15s,box-shadow .15s}.quote-pdf-intro.is-dragging{border-color:var(--brand);background:var(--color-surface-subtle);box-shadow:inset 0 0 0 1px var(--brand)}.quote-pdf-intro[aria-busy="true"]{cursor:progress}

.quote-pdf-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;list-style:none;margin:0;padding:0;font-size:12px;color:var(--color-text-secondary)}.quote-pdf-steps li{padding:10px 8px;border-bottom:2px solid var(--color-border);line-height:1.5}.quote-pdf-steps .is-current{color:var(--brand);border-color:var(--brand);font-weight:600}.quote-pdf-selected{display:flex;align-items:center;gap:14px;padding:16px;border:1px solid var(--color-border);border-radius:var(--radius-card)}.quote-pdf-file-badge{flex:none;padding:12px 8px;background:var(--color-surface-subtle);border-radius:6px;font-size:11px;font-weight:600}.quote-pdf-selected>div:first-of-type{display:grid;gap:6px;flex:1;min-width:0}.quote-pdf-selected strong{font-size:14px;overflow-wrap:anywhere}.quote-pdf-selected small{font-size:12px;color:var(--color-text-secondary)}.quote-pdf-file-actions{display:flex;gap:8px;flex-wrap:wrap;flex:none}.oms-document-modal:has(.quote-pdf-intro) .ui-modal__footer{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
@media(max-width:540px){.quote-pdf-selected{flex-wrap:wrap;padding:14px;gap:12px}.quote-pdf-file-actions{width:100%;justify-content:flex-end}.quote-pdf-steps{gap:4px;font-size:11px}.quote-pdf-steps li{padding:8px 4px}.oms-document-modal:has(.quote-pdf-intro) .ui-modal__footer .primary{flex:1}}

/* Compact comparison grid. Numeric fields look like values until focused. */
.oms-document-modal:has(.quote-pdf-review-layout){width:min(1100px,calc(100vw - 32px));max-width:1100px}
.quote-pdf-review-layout,.quote-pdf-review-content{min-width:0}.quote-pdf-meta{gap:12px}.quote-pdf-meta input{min-height:34px;padding:6px 8px}#quote-pdf-review{gap:16px}
.quote-pdf-item{gap:8px;padding:0;border:0;border-radius:0}.quote-pdf-item header{justify-content:space-between;gap:8px}.quote-pdf-item header strong{font-size:14px}.quote-pdf-item>.ui-field{display:flex;align-items:center;gap:10px;margin:0;font-size:12px}.quote-pdf-item>.ui-field>span{flex:none}.quote-pdf-item select{min-height:32px;padding:4px 8px;font-size:12px;width:auto;flex:1}.quote-pdf-before{font-size:11px;line-height:1.4}
.quote-pdf-comparison table{table-layout:fixed;width:100%;border-collapse:collapse;font-size:13px;line-height:1.5}.quote-pdf-comparison th,.quote-pdf-comparison td{padding:6px 10px;border:1px solid #ccc;vertical-align:middle;text-align:left;overflow-wrap:anywhere}.quote-pdf-comparison th:first-child{width:19%}.quote-pdf-comparison thead th{background:var(--color-surface-subtle);font-size:12px;font-weight:600;color:var(--color-text)}.quote-pdf-comparison tbody th{font-size:12px;font-weight:400}.quote-pdf-comparison .is-number td{text-align:right;font-variant-numeric:tabular-nums}.quote-pdf-comparison td:last-child{font-weight:600}.quote-pdf-comparison .is-changed{background:#fff5df}.quote-pdf-comparison td small{display:inline;margin-left:6px;font-size:10px;font-weight:400;color:var(--color-text-secondary)}
.quote-pdf-comparison input[data-quote-pdf-number]{display:block;width:100%;min-width:0;min-height:26px;height:26px;padding:2px 0;border:1px solid transparent;border-radius:2px;background:transparent;text-align:right;font:inherit;font-weight:600;color:inherit;box-shadow:none}.quote-pdf-comparison input[data-quote-pdf-number]:hover{border-color:var(--color-border)}.quote-pdf-comparison input[data-quote-pdf-number]:focus{border-color:var(--brand);background:var(--color-surface);outline:1px solid var(--brand);outline-offset:0}
input[data-quote-pdf-number]{text-align:right;font-variant-numeric:tabular-nums}.quote-pdf-status{font-size:11px;color:var(--color-text-secondary)}
.quote-pdf-summary{padding:20px;border:1px solid var(--color-border);border-radius:var(--radius-card);background:var(--color-surface-subtle)}.quote-pdf-summary h3{margin:0 0 10px;font-size:16px}.quote-pdf-summary>p{font-size:13px;line-height:1.7;margin:8px 0}.quote-pdf-totals{margin:16px 0 0;display:grid;gap:10px;font-size:13px}.quote-pdf-totals>div{display:flex;justify-content:space-between;gap:12px}.quote-pdf-totals dt{color:var(--color-text-secondary)}.quote-pdf-totals dd{margin:0;font-variant-numeric:tabular-nums;text-align:right}.quote-pdf-totals .is-total{padding-top:12px;border-top:1px solid var(--color-border);font-size:17px;font-weight:600}.quote-pdf-balanced{color:var(--color-text-secondary)}.quote-pdf-final{display:grid;gap:20px}.quote-pdf-change-list{list-style:none;margin:16px 0;padding:0}.quote-pdf-change-list li{padding:14px 0;border-top:1px solid var(--color-border);font-size:13px;overflow-wrap:anywhere}.quote-pdf-change-list .quote-pdf-status{margin-left:8px}.quote-pdf-change-list p{margin:8px 0 0;line-height:1.8;color:var(--color-text-secondary)}

@media(max-width:720px){.oms-document-modal:has(.quote-pdf-review-layout){width:calc(100vw - 16px)}.quote-pdf-comparison table,.quote-pdf-comparison tbody{display:block}.quote-pdf-comparison thead{display:none}.quote-pdf-comparison tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-left:1px solid #ccc;border-top:1px solid #ccc}.quote-pdf-comparison tr:last-child{border-bottom:1px solid #ccc}.quote-pdf-comparison tbody th:first-child{grid-column:1/-1;width:auto;padding:4px 6px;border:0;border-right:1px solid #ccc;border-bottom:1px solid #ccc;background:var(--color-surface-subtle);font-weight:500}.quote-pdf-comparison td{padding:5px 6px;border:0;border-right:1px solid #ccc;font-size:12px}.quote-pdf-comparison td::before{content:attr(data-label);display:block;margin-bottom:4px;color:var(--color-text-secondary);font-size:10px;text-align:left;font-weight:400}.quote-pdf-comparison td small{display:block;margin:3px 0 0}.quote-pdf-comparison input[data-quote-pdf-number]{font-size:12px}.quote-pdf-summary{padding:12px}.quote-pdf-totals .is-total{font-size:16px}.oms-document-modal:has(.quote-pdf-review-layout) .ui-modal__footer{flex-wrap:wrap}.oms-document-modal:has(.quote-pdf-review-layout) .ui-modal__footer .primary{flex:1;white-space:normal}}

/* Each document card has one explicit management button. */
.oms-document-card>header{display:flex;align-items:center;justify-content:space-between;gap:16px}.oms-document-card>header>div{flex:1;min-width:0}
@media(max-width:640px){.oms-document-card>header{flex-direction:row;align-items:center;min-height:90px;gap:12px}.oms-document-card .btn{align-self:center}}
