
#rental-workspace { display:none }
#dispatch-sheet[data-rental-page] #rental-workspace { display:block; margin:0 0 16px; color:#10283b; background:#faf9f5; border-radius:16px }
#rental-workspace header {padding:22px;background:#0c283d;color:white;border-radius:14px 14px 0 0}
#rental-workspace header h2 {font-size:clamp(24px,4vw,38px);color:white;margin:6px 0}
#rental-workspace header small {color:#ffe070}
#rental-workspace header span {display:inline-block;background:white;color:#12384a;border-radius:22px;padding:4px 12px;font-weight:700}
#rental-workspace nav {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;padding:14px 0}
#rental-workspace nav button {display:flex;align-items:flex-start;flex-direction:column;gap:6px;background:white;color:#17354a;border:1px solid #bbc9ce;border-radius:10px;padding:10px;text-align:left;min-width:0}
#rental-workspace nav i {background:#e6edf0;border-radius:50%;padding:3px 8px;font-style:normal}
#rental-workspace nav [aria-current=page] {background:#fff5bd;border-color:#a58703}
#rental-workspace nav [aria-current=page] i {background:#ffcf00}
#rental-workspace nav small {display:block;color:#48616f;line-height:1.3;margin-top:4px}
#rental-workspace [data-heading] {background:#102c40;color:white;padding:10px 16px;margin:0;border-radius:9px;font-size:20px}
#rental-workspace .rw-overview {display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}
#rental-workspace article {display:grid;gap:10px;align-content:start;background:white;padding:16px;border:1px solid #c4d0d4;border-radius:12px}
#rental-workspace article:first-child {background:#fffae3;border-color:#d4af27}
#rental-workspace article strong {font-size:19px;color:#142f42}
#rental-workspace article button {border-radius:9px;min-height:44px;background:#ffd21c;color:#142536;font-weight:700}
#dispatch-sheet[data-rental-page]:not([data-rental-page="0"]) .rw-overview,
#dispatch-sheet[data-rental-page="0"] #dispatch-detail,
#dispatch-sheet[data-rental-page]:not([data-rental-page="2"]) :is(#remote-sign-box,#external-invoice),
#dispatch-sheet[data-rental-page] #dispatch-detail > :is(.unified-rental-progress,.simple-flow-hero,.eyebrow),
#dispatch-sheet[data-rental-page]:not([data-rental-page="details"]) #dispatch-detail > .dispatch-title-row,
#dispatch-sheet[data-rental-page]:not([data-rental-page="2"]) #rental-identity-gallery {display:none}
@media(max-width:650px){
#rental-workspace nav {display:flex;overflow-x:auto;scroll-snap-type:x proximity}
#rental-workspace nav button {min-width:90px;flex:1 0 90px;scroll-snap-align:start}
#rental-workspace nav small {display:none}
#rental-workspace .rw-overview {grid-template-columns:1fr}
}

/* Rental phases own the visible hierarchy. The original controls retain their events. */
#dispatch-sheet[data-rental-page] > .dispatch-sheet-card {
  background:#f7f6f0 !important; color:#102b40 !important;
  border:1px solid #d1d8d9 !important; border-radius:18px !important;
  padding:clamp(14px,3vw,30px) !important; padding-top:58px !important;
}
#dispatch-sheet[data-rental-page] #dispatch-detail > :is(.eyebrow,.simple-flow-hero,.unified-rental-progress,.rental-flow-status),
#dispatch-sheet[data-rental-page]:not([data-rental-page="details"]) #dispatch-detail > :is(.dispatch-title-row,#review-whatsapp-open),
#dispatch-sheet[data-rental-page]:not([data-rental-page="1"],[data-rental-page="details"]) #dispatch-detail > .rental-services-summary,
#dispatch-sheet[data-rental-page]:not([data-rental-page="2"],[data-rental-page="details"]) #dispatch-detail > .rental-quick-payment,
#dispatch-sheet[data-rental-page]:not([data-rental-page="details"]) #rental-pending-panel,
#dispatch-sheet[data-rental-page="0"] #dispatch-detail,
#dispatch-sheet[data-rental-page] .documents-panel > :is(.panel-title-row,.panel-help:first-of-type) {display:none !important}
#dispatch-sheet[data-rental-page] #rental-workspace header {background:#fff !important;color:#112f45;border:1px solid #d2dadd;border-radius:12px;padding:16px}
#dispatch-sheet[data-rental-page] #rental-workspace header h2 {color:#102b40}
#dispatch-sheet[data-rental-page] #rental-workspace header small {color:#536875}
#dispatch-sheet[data-rental-page] #rental-workspace header span {background:#e8f4eb;color:#155437}
#dispatch-sheet[data-rental-page] #rental-workspace nav {gap:0;background:white;padding:12px 0}
#dispatch-sheet[data-rental-page] #rental-workspace nav button {
  align-items:center;text-align:center;position:relative;background:transparent;
  border:0;border-radius:0;color:#183649;isolation:isolate
}
#dispatch-sheet[data-rental-page] #rental-workspace nav button:not(:last-child)::after {
  content:"";position:absolute;left:50%;width:100%;top:23px;height:2px;background:#cbd5d8;z-index:-1
}
#dispatch-sheet[data-rental-page] #rental-workspace nav i {display:grid;place-items:center;width:27px;height:27px;padding:0;border:2px solid #9badb5;background:white;color:#354d59}
#dispatch-sheet[data-rental-page] #rental-workspace nav [aria-current=page] i {background:#ffd21c;border-color:#d4aa00;color:#10283b}
#dispatch-sheet[data-rental-page] #rental-workspace nav small {display:none}
#dispatch-sheet[data-rental-page] #dispatch-detail :is(section,article,details,.dispatch-scan,.guided-extra-card,.guided-extra-panel,.completion-status,.crm-total,.deposit-settlement-summary,.rental-final-close),
#dispatch-sheet[data-rental-page] :is(#proofs,#remote-sign-box,#external-invoice) {
  background:#fff !important;color:#163248 !important;border-color:#d3dddf !important;box-shadow:none !important
}
#dispatch-sheet[data-rental-page] #dispatch-detail :is(.dispatch-guide-panel,.material-category-list,.dispatch-items) {
  border:0 !important; padding:0 !important;background:transparent !important
}
#dispatch-sheet[data-rental-page] #dispatch-detail :is(h2,h3,h4,strong,b,label,small,p,summary,.eyebrow,.panel-help) {color:#19394c !important}
#dispatch-sheet[data-rental-page] #dispatch-detail :is(h2,h3,h4) {background:transparent !important}
#dispatch-sheet[data-rental-page] #dispatch-detail :is(.dispatch-item,.document-button,.dispatch-code,.guided-extra-panel,.quantity-control,.item-controls,.document-line,.material-category-heading,.rental-services-summary article,.rental-pending-panel li) {
  color:#19394c !important;background:#fff !important;border-color:#d0dadc !important
}
#dispatch-sheet[data-rental-page] :is(#dispatch-detail,#proofs,#external-invoice,#remote-sign-box) button,
#dispatch-sheet[data-rental-page] :is(.sheet-close,.sheet-back) {
  background:#f1f5f6 !important;color:#153348 !important;border:1px solid #bac9ce !important;box-shadow:none !important
}
#dispatch-sheet[data-rental-page] #dispatch-detail :is(button.primary,.clean-finish-button,.departure-action button:not(:disabled)) {
  color:#10283b !important;background:#ffd21c !important;border-color:#d4ad14 !important;min-height:44px
}
#dispatch-sheet[data-rental-page] #dispatch-detail button:disabled {opacity:.55}
#dispatch-sheet[data-rental-page] #dispatch-detail :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {color:#122f41 !important;background:#fff !important;border:1px solid #aebfc7 !important}
#dispatch-sheet[data-rental-page="2"] .documents-panel > :is(.guided-optional-section:has(.guided-extra-actions),.departure-action,.rental-final-close),
#dispatch-sheet[data-rental-page="3"] .documents-panel > :is(.signature-capture,#signature-status,#review-rental-contract,.panel-help,.guided-optional-section:has(.pdf-downloads)) {display:none !important}
#dispatch-sheet[data-rental-page] #rental-workspace [data-phase-link] {display:block;margin:12px 0;padding:10px 16px;background:white;color:#14364a;border:1px solid #acbdc4;border-radius:8px}
#dispatch-sheet[data-rental-page] #rental-workspace [data-phase-link][hidden] {display:none !important}
@media(max-width:650px){
 #dispatch-sheet[data-rental-page] #rental-workspace nav {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));overflow:visible}
 #dispatch-sheet[data-rental-page] #rental-workspace nav button {min-width:0;padding:10px 1px;font-size:11px}
 #dispatch-sheet[data-rental-page] > .dispatch-sheet-card {border-radius:10px !important;padding-inline:10px !important}
}

.pdf-downloads > #proofs {grid-column: 1 / -1; min-width: 0;}

#dispatch-sheet #dispatch-detail .pdf-downloads > #proofs {
  margin:0; padding:0; border:0; box-shadow:none; min-width:0;
}
#proofs > h3 {display:none}
#proofs > div {display:grid; gap:6px}
#dispatch-sheet #dispatch-detail #proofs .proof-document {
  display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center;
  width:100%; text-align:left; gap:10px; background:white !important;
}
#proofs .proof-document > span {background:#22664f;color:white}
#proofs details {padding:0 10px;border:0}
#proofs details summary {cursor:pointer;font-size:.85rem;padding:8px 0}
#proofs details > div {display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:8px 0}
#proofs details strong {flex-basis:100%}

#dispatch-sheet[data-rental-page] #rental-workspace nav{grid-template-columns:repeat(6,minmax(0,1fr))}
#dispatch-sheet[data-rental-page="5"] #dispatch-detail > :not(.documents-panel),
#dispatch-sheet[data-rental-page="5"] .documents-panel > :not(:has(.pdf-downloads)),
#dispatch-sheet[data-rental-page="5"] #rental-quick-actions{display:none!important}
@media(max-width:540px){
 #dispatch-sheet[data-rental-page] #rental-workspace nav{grid-template-columns:repeat(3,minmax(0,1fr));row-gap:8px}
 #dispatch-sheet[data-rental-page] #rental-workspace nav button:nth-child(3)::after{display:none}
}

#dispatch-sheet[data-rental-page="5"] #dispatch-detail,
#dispatch-sheet[data-rental-page="5"] #dispatch-detail .documents-panel,
#dispatch-sheet[data-rental-page="5"] #dispatch-detail details:has(>.pdf-downloads){display:block!important}
#dispatch-sheet[data-rental-page="5"] #dispatch-detail .pdf-downloads{display:grid!important;gap:8px}
#dispatch-sheet[data-rental-page="5"] #dispatch-detail .pdf-downloads .document-button{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px}
@media(max-width:540px){#dispatch-sheet[data-rental-page] #rental-workspace nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}#dispatch-sheet[data-rental-page] #rental-workspace nav button{min-width:0;width:100%}}

/* En recogida, mantener el formulario original con sus permisos, firma y liquidación. */
#dispatch-sheet[data-rental-page="4"] #dispatch-detail .documents-panel.hidden:has(.rental-final-close){display:block!important}
#dispatch-sheet[data-rental-page="4"] #dispatch-detail .documents-panel.hidden > :not(.rental-final-close):not(#signature-capture):not(#signature-status):not([data-manual-signature]){display:none!important}
#dispatch-sheet[data-rental-page="4"] #dispatch-detail .rental-final-close{display:block!important;margin-top:16px}
#dispatch-sheet[data-rental-page="4"] #close-rental-guided{width:100%;min-height:48px;background:#ffd21c!important;color:#10283b!important}
#dispatch-sheet[data-rental-page="4"] #close-rental-guided:disabled{opacity:.55}

#dispatch-sheet[data-rental-page] #rental-workspace nav{gap:8px;background:transparent;padding:12px 0}
#dispatch-sheet[data-rental-page] #rental-workspace nav button{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px;border:1px solid #cbd5d8;background:#fff;border-radius:12px;padding:9px 3px;min-height:62px}
#dispatch-sheet[data-rental-page] #rental-workspace nav button::after{display:none}
#dispatch-sheet[data-rental-page] #rental-workspace nav button[aria-current="page"]{border-color:#d9ad00;background:#fff6ce}
#dispatch-sheet[data-rental-page] #rental-workspace nav button b{line-height:1.15}
#dispatch-sheet[data-rental-page] #rental-workspace [data-phase-link]{width:100%;text-align:center;font-weight:650}

#dispatch-sheet[data-rental-page] #rental-workspace nav:has(#customer-preview:not([hidden])){grid-template-columns:repeat(7,minmax(0,1fr))}
#rental-workspace nav #customer-preview{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:5px;padding:9px 3px;border:1px solid #cbd5d8;border-radius:12px;color:#183649;background:white;text-decoration:none;min-width:0}
#rental-workspace nav #customer-preview[hidden]{display:none!important}
#dispatch-sheet[data-rental-page]:not([data-rental-page="3"]) #rental-quick-actions{display:none!important}
@media(max-width:540px){
 #dispatch-sheet[data-rental-page] #rental-workspace nav:has(#customer-preview:not([hidden])){grid-template-columns:repeat(3,minmax(0,1fr))}
 #rental-workspace nav #customer-preview{grid-column:1/-1;flex-direction:row;min-height:44px;font-size:13px}
}
