/* Delivery corrections and physical returns — original Delivery page only. */
#deliveryCorrectionModal .modal-card { width:min(1180px,98vw);max-height:94dvh;display:flex;flex-direction:column;overflow:hidden;padding:0; }
#deliveryCorrectionModal .correction-head {display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:20px 24px;background:#f8fafc;border-bottom:1px solid var(--line);flex:0 0 auto;}
#deliveryCorrectionModal .correction-head h2 {font-size:21px;margin:0;}
#deliveryCorrectionModal .correction-body {padding:20px 24px;overflow-y:auto;flex:1;min-height:0;}
#deliveryCorrectionModal .correction-footer {display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;padding:15px 24px;background:#f8fafc;border-top:1px solid var(--line);flex:0 0 auto;}
.delivery-correction-grid-head,.delivery-amend-row {display:grid;grid-template-columns:78px minmax(230px,1fr) 180px;gap:12px;align-items:center;padding:11px 14px;border-bottom:1px solid var(--line);}
.delivery-correction-grid-head {background:#f1f5f9;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:850;}
.delivery-amend-row:nth-child(even) {background:#fafbfd;}
.delivery-amend-row input[type=checkbox] {width:20px;height:20px;accent-color:var(--brand);}
.delivery-cancelled-row {background:#fff0ee!important;color:#b42318;}
.delivery-cancelled-row .small {color:#b42318;}
.delivery-correction-lines {max-height:44vh;overflow-y:auto;border:1px solid var(--line);border-radius:10px;}
.delivery-return-lines {max-height:52vh;overflow-y:auto;border:1px solid var(--line);border-radius:11px;margin-top:14px;}
.delivery-return-row,.delivery-return-count {display:grid;grid-template-columns:24px minmax(260px,1fr) minmax(180px,240px);align-items:center;gap:14px;padding:13px 15px;border-bottom:1px solid var(--line);color:var(--text);font-size:12px;}
.delivery-return-row:nth-child(even),.delivery-return-count:nth-child(even) {background:#fafbfd;}
/* The legacy .delivery-return-row is a grid for form divs. Bulk return rows
   are actual <tr> elements and must retain native table layout. */
#deliveryCorrectionContent table tr.delivery-bulk-return-table-row {
  display:table-row;
  grid-template-columns:none;
  color:var(--text);
}
#deliveryCorrectionContent table tr.delivery-bulk-return-table-row td {
  display:table-cell;
  padding:11px 12px;
  vertical-align:top;
  border-bottom:1px solid var(--line);
}
#deliveryCorrectionContent table tr.delivery-bulk-return-table-row:nth-child(even) td {
  background:#fafbfd;
}
#deliveryCorrectionContent table tr.delivery-bulk-return-table-row .returnReason,
#deliveryCorrectionContent table tr.delivery-bulk-return-table-row .returnCustomReason {
  width:100%;
  min-width:160px;
}

.delivery-return-row input[type=checkbox] {width:18px;height:18px;accent-color:var(--brand);}
.delivery-return-row .small,.delivery-return-count .small {display:block;margin-top:4px;}
.delivery-return-count {grid-template-columns:minmax(250px,1fr) 210px;}
.delivery-return-count input[type=number] {font-size:13px;}
.delivery-status-returned td,.delivery-status-returned {background:#fff0ee!important;color:#b42318!important;}
.delivery-status-returned b {color:#b42318!important;}
.delivery-status-returned .small {color:#a92821!important;}
@media(max-width:660px) {
 #deliveryCorrectionModal .modal-card {width:100%;max-height:97dvh;}
 #deliveryCorrectionModal .correction-head,#deliveryCorrectionModal .correction-body,#deliveryCorrectionModal .correction-footer {padding:14px;}
 .delivery-amend-row,.delivery-correction-grid-head {grid-template-columns:44px minmax(145px,1fr) 100px;gap:7px;padding:10px 8px;}
 .delivery-return-row {grid-template-columns:22px 1fr;gap:10px;}
 .delivery-return-row select {grid-column:2;}
 .delivery-return-count {grid-template-columns:1fr;}
}


/* Deleted delivery is audit-visible but no longer active. */
#routeMonitor tr.delivery-status-returned td {background:#fff0ee!important;color:#b42318!important;}
#routeMonitor tr.delivery-status-returned .pill.red {background:#fbd7d2;color:#a7271d;}
#routeMonitor tr.delivery-status-returned a {color:#a7271d;}
/* Final dispatch confirmation, including truck -> school direction illustration. */
.delivery-dispatch-confirm-card {width:min(590px,96vw);padding:25px;}
.delivery-dispatch-confirm-card h2 {font-size:21px;margin:12px 0;}
.delivery-dispatch-confirm-card p {font-size:13px;color:var(--muted);line-height:1.6;}
.delivery-dispatch-illustration {display:flex;justify-content:center;align-items:center;padding:8px 14px;border:1px solid #cce5df;border-radius:14px;background:#f2faf7;color:#087a68;}
.delivery-dispatch-illustration svg {max-width:380px;}
.delivery-dispatch-confirm-actions {display:flex;justify-content:flex-end;gap:11px;flex-wrap:wrap;margin-top:22px;}
@media(max-width:600px){.delivery-dispatch-confirm-card{padding:16px}.delivery-dispatch-confirm-actions button{flex:1}}


/* Simplified, high-visibility date and accessible confirmation/edit screens. */
.delivery-date-highlight {display:flex;gap:10px;align-items:center;flex-wrap:wrap;
  margin:11px 0;padding:12px 15px;border:2px solid #a9d9ce;border-radius:11px;
  background:#f0faf7;color:#08665e;font-size:13px;font-weight:800;}
.delivery-date-highlight strong{font-size:20px;font-weight:900;color:#073e39;}
.delivery-date-highlight span{font-size:13px;color:#315e59;}
.delivery-date-highlight input[type=date]{width:auto;min-width:180px;border:1px solid #8fbab3;font-weight:850;}
.delivery-action-confirm {width:min(520px,96vw);padding:24px;}
.delivery-action-confirm h2 {font-size:21px;margin:9px 0;}
.delivery-action-confirm p {font-size:13px;line-height:1.55;}
.delivery-action-icon {display:flex;align-items:center;justify-content:center;width:44px;height:50px;
  background:#eaf7f3;color:#076c61;border:1px solid #b6ded3;border-radius:9px;font-size:33px;}
.delivery-urdu{font-family:system-ui,"Noto Nastaliq Urdu",serif;line-height:2!important;
  font-size:14px!important;color:#38546a;padding:9px 11px;border-radius:8px;background:#f6f8fb;}
.delivery-action-buttons{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:9px;margin-top:19px;}
.delivery-conflict-list{margin-top:12px;}
.delivery-conflict-list:empty{display:none;}
.delivery-conflict-scroll{max-height:210px;overflow:auto;}
.delivery-conflict-scroll p{padding:8px;margin:4px 0;border-bottom:1px solid #e8edf2;}
.delivery-draft-edit-card{width:min(950px,97vw);max-height:94dvh;overflow:auto;padding:22px;}
.delivery-draft-edit-card h2{margin:0 0 13px;font-size:20px;}
.delivery-edit-search{margin:13px 0;}
.delivery-edit-matches{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0;max-height:160px;overflow-y:auto;}
.delivery-edit-matches button{white-space:normal;text-align:left;}
#deliveryEditSchools{max-height:53vh;}
#deliveryEditSchools .delivery-edit-mode{min-width:145px;margin:0 0 5px;}
#deliveryEditSchools .delivery-edit-quantity{width:150px;display:block;}
#deliveryEditSummary{font-size:12px;font-weight:800;padding:12px 0;}
.returnCustomReason{resize:vertical;min-height:56px;}
@media(max-width:660px){
 .delivery-draft-edit-card,.delivery-action-confirm{padding:14px;}
 .delivery-action-buttons{flex-direction:column;}
 .delivery-action-buttons button{width:100%;}
 .delivery-date-highlight strong{font-size:17px;}
}

/* Larger, readable school selection for nontechnical field operators. */
#ddSchoolTable .ddSchoolPick {appearance:auto;width:24px!important;height:24px!important;
  min-width:24px;cursor:pointer;accent-color:#087f70;vertical-align:middle;}
#ddSchoolTable td:first-child {min-width:54px;text-align:center;}
#ddSchoolTable th:first-child {text-align:center;}
#deliveryFinalizeConfirmModal .delivery-action-confirm {width:min(760px,96vw);padding:28px 32px;
  max-height:90dvh;overflow:auto;}
#deliveryFinalizeConfirmModal .delivery-action-confirm h2 {font-size:25px;}
#deliveryFinalizeConfirmModal .delivery-action-confirm p {font-size:16px;line-height:1.7;}
#deliveryFinalizeConfirmModal .delivery-conflict-scroll {max-height:300px;}
#deliveryFinalizeConfirmModal .delivery-conflict-scroll p {font-size:14px;}
#deliveryFinalizeConfirmModal .delivery-urdu {font-size:17px!important;line-height:2.5!important;}
#deliveryDispatchConfirmModal .delivery-dispatch-confirm-card {width:min(710px,96vw);padding:29px 34px;
 max-height:90dvh;overflow:auto;}
#deliveryDispatchConfirmModal h2 {font-size:24px;margin:15px 0;}
#deliveryDispatchConfirmModal p {font-size:16px;line-height:1.7;}
#deliveryDispatchConfirmModal .delivery-urdu {font-size:17px!important;line-height:2.4!important;}
.delivery-dispatch-confirm-actions button,.delivery-action-buttons button {min-height:43px;font-size:14px;}
.delivery-progress-pill {display:inline-flex;gap:7px;align-items:center;flex-wrap:wrap;
  font-size:12px;font-weight:800;}
.delivery-progress-pill span {padding:4px 9px;border-radius:14px;background:#e8f5f0;color:#136551;}
.delivery-progress-pill .pending {background:#fff1d8;color:#805414;}
.delivery-progress-pill .returned {background:#fee4e2;color:#a52c23;}
.delivery-progress-summary {display:flex;gap:12px;align-items:center;flex-wrap:wrap;
  padding:13px 15px;background:#f0faf7;border:1px solid #c8e4dc;border-radius:10px;margin:15px 0;}
.delivery-progress-summary strong {font-size:19px;color:#0b645b;}
.delivery-progress-table .delivery-accept-check {width:23px;height:23px;accent-color:#087969;
  cursor:pointer;vertical-align:middle;}
.delivery-progress-table tr.is-returned {background:#fff0ee;color:#a5281d;}
.delivery-progress-table tr.is-voided {background:#fff1f0;color:#992d24;}
.delivery-progress-table tr.is-voided .school-state.returned {color:#b42318;font-weight:900;}
.delivery-progress-table tr.is-reported {background:#fff8ea;}
.delivery-progress-table tr.is-accepted {background:#f0faf7;}
.delivery-progress-table .school-state {font-size:12px;font-weight:850;}
.delivery-progress-table .school-state.confirmed {color:#076e60;}
.delivery-progress-table .school-state.reported {color:#9c641c;}
.delivery-progress-table .school-state.returned {color:#b42318;}
.delivery-progress-table .school-state.pending {color:#6c7787;}
.delivery-progress-actions {display:flex;gap:7px;flex-wrap:wrap;align-items:center;}
.delivery-progress-tools {display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0;}
.delivery-progress-tools input[type=search] {max-width:310px;min-width:220px;}
.delivery-evidence-row td {background:#f4faf8!important;padding:16px!important;}
.delivery-evidence-row .field {min-width:200px;flex:1;}
.delivery-evidence-row .row {align-items:end;gap:10px;flex-wrap:wrap;}
.delivery-evidence-row input[type=checkbox] {width:20px;height:20px;vertical-align:middle;}
@media(max-width:660px){
  #deliveryFinalizeConfirmModal .delivery-action-confirm,
  #deliveryDispatchConfirmModal .delivery-dispatch-confirm-card {padding:18px;}
  .delivery-progress-tools input[type=search] {min-width:150px;width:100%;}
}


/* Explicit physical Headteacher signature attestation (single and bulk). */
#deliveryHeadteacherVerifyModal .delivery-signature-confirm-card {
  width:min(760px,96vw);max-height:92dvh;overflow-y:auto;padding:27px 31px;
}
.delivery-signature-modal-heading {display:flex;align-items:center;gap:13px;margin-bottom:16px;}
.delivery-signature-modal-heading h2 {font-size:23px;margin:0 0 5px;line-height:1.3;}
.delivery-signature-modal-heading p {margin:0;}
.delivery-signature-mark {display:flex;align-items:center;justify-content:center;flex-shrink:0;
 width:53px;height:53px;background:#eaf7f3;color:#086e60;border:1px solid #c2e5da;border-radius:12px;}
.delivery-signature-question {font-size:16px;line-height:1.6;}
.delivery-signature-summary {font-size:14px;font-weight:850;color:#095c53;background:#edf9f4;
 border:1px solid #c5e4da;border-radius:8px;padding:12px 14px;margin:12px 0;}
.delivery-signature-school-list {max-height:235px;overflow-y:auto;border:1px solid #dce5ec;
 border-radius:9px;margin:13px 0;background:#fff;}
.delivery-signature-school {display:flex;flex-direction:column;gap:5px;padding:10px 14px;
 border-bottom:1px solid #e8eef2;font-size:13px;}
.delivery-signature-school:last-child {border-bottom:0;}
.delivery-signature-school span {color:#56647a;}
.delivery-signature-stock-warning {line-height:1.55;margin:12px 0;}
.delivery-signature-stock-warning .delivery-urdu {margin-top:9px;}
.delivery-signature-attest {display:flex;gap:12px;align-items:flex-start;margin:18px 0 11px;
 font-size:14px;font-weight:800;line-height:1.6;cursor:pointer;}
.delivery-signature-attest input {width:25px;height:25px;min-width:25px;margin-top:3px;
 accent-color:#087969;cursor:pointer;}
.delivery-signature-attest .delivery-urdu {display:block;font-weight:500;margin-top:8px;}
#deliveryHeadteacherCommit:disabled {opacity:.52;cursor:not-allowed;}
.delivery-signature-selection-cell {text-align:center;min-width:66px;}
.delivery-select-signature {width:25px!important;height:25px!important;min-width:25px;
 accent-color:#087969;cursor:pointer;}
.delivery-signature-tick {color:#078071;font-size:23px;font-weight:900;}
#deliveryVerifySelected:disabled {opacity:.5;cursor:not-allowed;}
@media(max-width:660px){
 #deliveryHeadteacherVerifyModal .delivery-signature-confirm-card {padding:16px;}
 .delivery-signature-modal-heading h2{font-size:19px;}
 .delivery-signature-attest{font-size:13px;}
}


/* One-step return: clearly identify the stock credit and required attestation. */
.delivery-simple-return-notice {border:1px solid #b8dcd2;background:#f1faf7;
 padding:15px 18px;border-radius:11px;color:#124d46;font-size:14px;line-height:1.65;}
.delivery-simple-return-notice p {margin:8px 0 0;font-size:14px;line-height:1.7;}
.delivery-simple-return-notice .delivery-urdu {font-size:15px!important;line-height:2.4!important;}
.delivery-return-attest {display:flex;align-items:flex-start;gap:12px;padding:14px 16px;
 margin-top:17px;background:#fff7e8;border:1px solid #f4d8a5;border-radius:10px;
 font-size:14px;line-height:1.6;cursor:pointer;}
.delivery-return-attest input {width:24px;height:24px;min-width:24px;accent-color:#087c6f;
 margin-top:2px;cursor:pointer;}
.delivery-return-attest .delivery-urdu {display:block;margin-top:7px;background:transparent;padding:0;}
.delivery-return-success {font-size:14px;line-height:1.65;padding:13px 16px;}
.delivery-return-success .delivery-urdu {margin:8px 0 0;background:transparent;padding:0;}
#deliveryCorrectionModal .delivery-return-row .returnPick {width:22px;height:22px;}
#deliveryCorrectionModal .delivery-return-row {align-items:center;}

/* Single-DC undelivered dialog: no bulk selection and no checkboxes. */
#deliveryCorrectionModal .delivery-return-single {
  display:grid;grid-template-columns:minmax(250px,1fr) minmax(210px,290px);
  gap:16px;align-items:start;margin-top:15px;padding:18px;
  background:#fff;border:1px solid #d7e3ec;border-radius:11px;
}
#deliveryCorrectionModal .delivery-return-single .delivery-return-school b {
  display:block;font-size:16px;line-height:1.5;
}
#deliveryCorrectionModal .delivery-return-reason-label {
  display:block;font-size:13px;font-weight:800;
}
#deliveryCorrectionModal .delivery-return-reason-label select {
  display:block;margin-top:8px;width:100%;
}
#deliveryCorrectionModal .delivery-return-single .returnCustomReason {
  grid-column:1/-1;width:100%;
}
@media(max-width:660px){
  #deliveryCorrectionModal .delivery-return-single {grid-template-columns:1fr;}
}

/* Provincial single-DC correction dialog. */
#deliveryCorrectionModal .delivery-undo-attest {
  grid-column:1/-1;display:flex;gap:10px;align-items:flex-start;
  font-size:13px;line-height:1.6;font-weight:750;
}
#deliveryCorrectionModal .delivery-undo-attest input {
  width:24px;height:24px;min-width:24px;accent-color:#087c6f;
}
#deliveryCorrectionModal #deliveryUndoReason {width:100%;min-height:92px;margin-top:7px;}


/* Strict Tehsil delivery-closure guard: prominent Urdu with actionable list. */
#deliveryClosureModal .delivery-closure-modal-card{
  width:min(900px,96vw);max-height:94dvh;overflow-y:auto;
  padding:clamp(18px,3vw,32px);border-top:7px solid #b42318;
}
#deliveryClosureModal .delivery-closure-top{display:flex;gap:16px;align-items:center;margin-bottom:18px}
#deliveryClosureModal .delivery-closure-lock{
  display:grid;place-items:center;flex:0 0 66px;width:66px;height:66px;
  background:#fff0ee;border:1px solid #f3ccc8;border-radius:16px;font-size:30px
}
#deliveryClosureModal .delivery-closure-eyebrow{
  font-weight:850;letter-spacing:.02em;color:#8a342d;font-size:13px;margin-bottom:7px
}
#deliveryClosureModal .delivery-closure-heading{
  margin:0;text-align:right;color:#98271f;font-size:clamp(24px,3vw,31px);
  font-weight:900;line-height:1.9;font-family:"Noto Nastaliq Urdu",system-ui,serif;
}
#deliveryClosureModal .delivery-closure-urdu{
  font-size:clamp(19px,2.3vw,23px)!important;line-height:2.25!important;
  font-family:"Noto Nastaliq Urdu",system-ui,serif;text-align:right;
  border:1px solid #f0cbc6;border-radius:12px;padding:15px 20px;
  background:#fff8f6;color:#392a2a
}
#deliveryClosureModal .delivery-closure-urdu p{margin:7px 0 17px}
#deliveryClosureModal .delivery-closure-urdu p:last-child{margin-bottom:7px}
#deliveryClosureModal .delivery-closure-count{
  text-align:right;color:#8f2b23;font-weight:900;font-size:20px;
  font-family:"Noto Nastaliq Urdu",system-ui,serif;margin:19px 0 11px;line-height:2
}
#deliveryClosureModal .delivery-closure-list{
  max-height:34dvh;min-height:50px;overflow-y:auto;display:grid;gap:10px;
  padding-right:4px
}
#deliveryClosureModal .delivery-closure-row{
  border:1px solid #dbe3ed;background:#fafbfd;border-radius:11px;
  padding:12px 16px;display:grid;gap:9px
}
#deliveryClosureModal .delivery-closure-row-head{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  font-size:15px
}
#deliveryClosureModal .delivery-closure-state{
  background:#fff1de;color:#805313;border-radius:100px;
  font-size:15px;font-family:"Noto Nastaliq Urdu",system-ui,serif;
  padding:4px 12px;line-height:1.7
}
#deliveryClosureModal .delivery-closure-details{
  display:flex;gap:8px 18px;align-items:center;justify-content:flex-start;flex-wrap:wrap;
  color:#3c4c62;font-size:16px;line-height:1.9;
  font-family:"Noto Nastaliq Urdu",system-ui,serif
}
#deliveryClosureModal .delivery-closure-row button{justify-self:start}
#deliveryClosureModal .delivery-closure-actions{
  display:flex;justify-content:flex-end;gap:12px;flex-wrap:wrap;
  margin-top:20px;padding-top:16px;border-top:1px solid #e1e6ed
}
#deliveryClosureModal .delivery-closure-actions .btn{font-size:14px;padding:12px 16px}
@media(max-width:650px){
  #deliveryClosureModal .delivery-closure-top{align-items:flex-start}
  #deliveryClosureModal .delivery-closure-lock{width:48px;height:48px;flex-basis:48px;font-size:24px}
  #deliveryClosureModal .delivery-closure-urdu{padding:12px}
  #deliveryClosureModal .delivery-closure-actions{flex-direction:column}
  #deliveryClosureModal .delivery-closure-actions button{width:100%}
}
