.afp-tabs { display:flex; align-items:stretch; gap:0; overflow-x:auto; border-block:1px solid var(--border); background:var(--panel-alt); }
.afp-tab { flex:0 0 auto; padding:.75rem 1rem; border:0; border-bottom:3px solid transparent; background:none; color:var(--muted); font:inherit; font-size:.82rem; cursor:pointer; }
.afp-tab.active { color:var(--text); border-bottom-color:var(--accent); font-weight:700; }
.afp-tab:hover { background:var(--panel); }
.afp-tab:focus-visible,.afp-invoices button:focus-visible { outline:2px solid var(--accent,var(--portal-accent)); outline-offset:2px; }
#dc-invoice-batches-workspace .dc-invoice-batch-toolbar { position:relative; z-index:12; padding:.75rem; }
#dc-invoice-batches-workspace .dc-invoice-batch-toolbar .field { flex:1 1 280px; min-width:220px; }
#dc-invoice-batches-workspace .dc-invoice-batch-toolbar .afp-date-filter { flex:1 1 170px; min-width:150px; flex-direction:column; align-items:stretch; }
#dc-invoice-batches-workspace .afp-date-filter input { width:100%; box-sizing:border-box; padding:.65rem .75rem; border:1px solid var(--border); border-radius:10px; background:var(--panel); color:var(--text); font:inherit; color-scheme:dark; }
:root[data-theme="light"] #dc-invoice-batches-workspace .afp-date-filter input { color-scheme:light; }
#dc-invoice-batches-workspace .afp-date-filter input:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
#dc-invoice-batches-workspace .ts-dropdown { z-index:40; }
#dc-invoice-batches-workspace .dc-invoice-batch-card-heading { gap:.75rem; }
#dc-invoice-batch-selected-summary { margin-left:auto; }
#dc-invoice-batches-workspace .dc-invoice-batch-card { padding:.75rem; }
#dc-invoice-batches-workspace .afp-results { height:clamp(280px,53vh,680px); max-height:none; margin-top:.5rem; }
#dc-invoice-batches-workspace .afp-work-orders { min-width:1280px; width:100%; table-layout:auto; font-size:.8rem; }
#dc-invoice-batches-workspace .afp-work-orders th,#dc-invoice-batches-workspace .afp-work-orders td { padding:.6rem .55rem; vertical-align:middle; }
#dc-invoice-batches-workspace .afp-work-orders th button { padding:0; border:0; background:none; color:inherit; font:inherit; cursor:pointer; text-align:inherit; }
#dc-invoice-batches-workspace .afp-work-orders td:nth-child(2) { min-width:100px; max-width:180px; }
#dc-invoice-batches-workspace .afp-work-orders td:nth-child(3) { white-space:nowrap; }
#dc-invoice-batches-workspace .afp-work-orders td:nth-child(4) { min-width:150px; max-width:230px; }
#dc-invoice-batches-workspace .afp-work-orders td:nth-child(8) { min-width:160px; }
.afp-numeric { text-align:right!important; white-space:nowrap; font-variant-numeric:tabular-nums; }
.afp-selection-hold { display:block; color:var(--muted); font-size:.72rem; line-height:1.3; margin-top:.3rem; }
.afp-invoices { margin-top:1.2rem; --afp-border:var(--portal-border,var(--border,#b6bdc6)); --afp-surface:var(--portal-input-bg,var(--panel,#fff)); }
.afp-invoice-card { padding:1rem; margin:.75rem 0; border:1px solid var(--afp-border); border-radius:12px; }
.afp-invoice-card h5 { font-size:1rem; margin:0 0 .6rem; }
.afp-invoice-card p { margin:.6rem 0; }
.afp-comments { white-space:pre-wrap; overflow-wrap:anywhere; }
.afp-invoice-form { display:flex; flex-wrap:wrap; align-items:flex-end; gap:.75rem; margin-top:1rem; padding-top:1rem; border-top:1px solid var(--afp-border); }
.afp-invoice-form>h5,.afp-invoice-form>p { flex-basis:100%; margin:0; }
.afp-field { display:flex; flex-direction:column; gap:.4rem; flex:1 1 220px; min-width:0; font-size:.85rem; }
.afp-field:has(textarea),.afp-field:has(input[type=file]) { flex-basis:100%; }
.afp-field input,.afp-field textarea { width:100%; box-sizing:border-box; padding:.7rem .8rem; border:1px solid var(--afp-border); border-radius:10px; color:inherit; font:inherit; background:var(--afp-surface); }
.afp-field input:focus,.afp-field textarea:focus { outline:2px solid var(--portal-accent,var(--accent)); outline-offset:1px; }
.afp-field input[type=file]::file-selector-button { font:inherit; padding:.45rem .7rem; margin-right:.75rem; border:1px solid var(--afp-border); border-radius:7px; color:inherit; background:var(--portal-surface,var(--panel)); cursor:pointer; }
.afp-form-actions { display:flex; flex-wrap:wrap; gap:.5rem; flex-basis:100%; }
.afp-invoices button { cursor:pointer; }
.afp-invoices button:disabled { cursor:wait; opacity:.65; }
.afp-invoices .error,#dc-invoice-batch-action-status.error { color:var(--portal-danger,#d23535); }
@media(max-width:767px) { .afp-field { flex-basis:100%; } #dc-invoice-batches-workspace .dc-invoice-batch-toolbar .field { min-width:0; flex-basis:100%; } #dc-invoice-batch-job-status-filter { min-height:8rem; } #dc-invoice-batch-selected-summary { margin-left:0; } }
@media(prefers-reduced-motion:reduce) { #dc-invoice-batches-workspace *, .afp-invoices * { scroll-behavior:auto!important; transition:none!important; } }

#afp-work-order-history { padding: 1rem; border-top: 1px solid var(--portal-border); }
#afp-work-order-history h3 { margin: 0; }
#afp-work-order-history p { margin: .65rem 0; }
#afp-work-order-history form { display: flex; align-items: end; flex-wrap: wrap; gap: .6rem; }
#afp-work-order-history .field-group { flex: 1 1 13rem; min-width: 0; margin: 0; }
#afp-work-order-history .job-list { max-height: 24rem; overflow-y: auto; }
.afp-history-order { display: grid; justify-items: start; gap: .3rem; padding: .65rem .1rem; overflow-wrap: anywhere; }
