.early-page-index > input { width: 100%; margin-bottom: 12px; }
.early-page-filters { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.early-page-filters > summary { cursor: pointer; font-weight: 600; }
.early-page-filter-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 12px; align-items: end; }
.early-page-field { display: grid; gap: 4px; min-width: 0; }
.early-page-field :is(input,select) { width: 100%; min-width: 0; }
.early-page-table tr.early-page-card { cursor: pointer; }
.early-page-table tr.early-page-card:hover { background: var(--surface-2); }
.early-page-table td { min-width: 0; overflow-wrap: anywhere; }
.early-page-card-head small { display: block; }
.early-slip-actions { margin: 8px 0; }
.early-page-card-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.early-page-pager { justify-content: center; }
.early-page-back { margin-bottom: 16px; }
@media(max-width:850px) {
 #view-early-requests .page-head h1 { font-size: 18px; line-height: 1.3; }
 .early-page-filter-grid { grid-template-columns: minmax(0,1fr); }
 #view-early-requests .early-request-card .row-gap { flex-wrap: wrap; }
 #view-early-requests :is(.early-request-line,.early-request-card) { min-width: 0; overflow-wrap: anywhere; }
}

.early-quick-fields { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0; }
.early-quick-receipt input,.early-quick-receipt select { max-width:100%;box-sizing:border-box; }
.early-quick-receipt .recv-card { overflow-wrap:anywhere; }
@media(max-width:850px){ .early-quick-fields { grid-template-columns:minmax(0,1fr); } .early-quick-receipt .modal-foot .btn { width:100%; } }

.early-list-title,.early-list-select { display:flex;align-items:center;gap:10px;min-width:0; }
.early-list-check,.early-list-select input { flex:0 0 auto;width:22px;height:22px;margin:0; }
.early-list-bulk { display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:8px 12px;margin:0;background:var(--surface);border-bottom:1px solid var(--line); }
.early-list-bulk[data-selected="1"] { background:var(--blue-50); }
.early-list-bulk[hidden] { display:none; }
.early-list-bulk p { flex-basis:100%;margin:0; }
.early-list-bulk .error:empty { display:none; }
@media(max-width:850px){ .early-list-bulk>.btn.primary { flex:1 1 180px; } .early-list-title { min-height:36px; } }

.early-page-card .early-received-summary { color:#166534;background:#dcfce7;white-space:normal;line-height:1.5; }

/* The header, scrolling body and actions share one form frame. */
dialog.early-quick-receipt > form { display:flex;flex-direction:column;min-height:0;max-height:inherit;margin:0; }
.early-quick-receipt .modal-head,.early-quick-receipt .modal-foot { flex:none; }
.early-quick-receipt .modal-body { flex:1;min-height:0; }
.early-quick-quantities { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }
.early-quick-quantities label { min-width:0; }
.early-quick-receipt .modal-foot { display:flex;gap:12px;justify-content:flex-end; }
@media(max-width:600px){ .early-quick-quantities { grid-template-columns:minmax(0,1fr); } }

.early-photo-dialog .modal-body > img{display:block;max-width:100%;max-height:340px;object-fit:contain;margin:12px auto}.early-photo-dialog .modal-body > img[hidden]{display:none}.early-photo-dialog td input{min-width:100px;max-width:190px;width:100%}.early-photo-confirm{display:flex;gap:10px;align-items:center;margin-top:16px}.early-photo-confirm input{width:auto;flex:none}
.early-photo-references{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin:12px 0;padding:12px;border:1px solid #dbe3ef;border-radius:8px}.early-photo-references label{display:grid;gap:5px;font-size:13px}.early-photo-dialog td select{max-width:190px;width:100%;margin-top:5px}

.page-head .btn.early-quick-entry[data-mobile-primary] { color:#15803d; border-color:#86efac; background:#f0fdf4; display:inline-flex; align-items:center; gap:8px; }
.early-quick-entry > span:first-child { font-size:24px; line-height:1; font-weight:700; }
.early-quick-info { display:grid; gap:12px; margin-bottom:16px; }
.early-quick-info label { max-width:260px; }
.early-quick-info p { margin:0; }
.early-create-fields { border:0; padding:0; margin:0; min-width:0; }

@media (max-width:600px) { .early-quick-entry { min-width:44px; min-height:44px; justify-content:center; } .early-quick-entry > span:last-child { display:none; } }
@media (max-width:850px) {
 .early-quick-host .table-wrap { overflow:visible; }
 .early-quick-host .incoming-table,.early-quick-host .incoming-table tbody { display:block; min-width:0; }
 .early-quick-host .incoming-table thead { display:none; }
 .early-quick-host .incoming-table tbody > tr { display:grid; grid-template-columns:32px minmax(0,1fr); gap:10px; padding:12px; margin:12px 0; border:1px solid var(--line); border-radius:10px; background:#fff; }
 .early-quick-host .incoming-table td { display:block; min-width:0; max-width:none; padding:0; border:0; white-space:normal; overflow-wrap:anywhere; }
 .early-quick-host .incoming-table td:first-child { grid-column:1; grid-row:1; }
 .early-quick-host .incoming-table td:nth-child(2) { grid-column:2; grid-row:1; }
 .early-quick-host .incoming-table td:nth-child(n+3) { grid-column:1 / -1; }
 .early-quick-host .incoming-table td:nth-child(n+3)::before { content:attr(data-label); display:block; color:var(--muted); font-size:12px; margin-bottom:4px; }
 .early-quick-host .incoming-table .incoming-source-choice { white-space:normal; min-width:0; }
 .early-quick-host .incoming-table .incoming-details td { grid-column:1 / -1; }
}
