/* Route builder: To ship | routes (one column per truck) | map */
.rb-bar-top{display:flex;align-items:center;gap:8px;margin:0 0 10px}
.rb-bar-top input{height:34px;border:1px solid #cbdadd;border-radius:7px;padding:0 8px;font:inherit;font-size:13px;color:#173f4a}
.rb-bar-top .crm-secondary{padding:6px 12px;min-height:0}
.rb-bar-top strong{margin-left:6px;color:#173f4a}
.rb-layout{display:grid;grid-template-columns:280px minmax(330px,400px) minmax(0,1fr);gap:12px;height:calc(calc(100vh / var(--ui-zoom,1)) - 210px);min-height:520px}
.rb-pool,.rb-routes,.rb-map-panel{min-height:0}
.rb-pool{overflow:auto;background:#fff;border:1px solid #d6e2e4;border-radius:10px;padding:10px}
.rb-pool header{margin-bottom:6px}.rb-pool h3{margin:0;font-size:13px;text-transform:uppercase;letter-spacing:.04em;color:#2c5764}.rb-pool header small{display:block;font-size:11.5px;color:#6a7e83}
.rb-area{margin-top:10px}.rb-area h4{margin:0 0 6px;font-size:12.5px;color:#45616a;display:flex;justify-content:space-between}
.rb-area-today h4{color:#0f6f88}.rb-area-today h4:before{content:'●';color:#1286a0;margin-right:5px}
.rb-order{position:relative;border:1px solid #d6e2e4;border-left:3px solid #9fb9c0;border-radius:7px;padding:7px 28px 7px 9px;margin-bottom:6px;background:#fbfdfd;cursor:grab;font-size:12.5px}
.rb-area-today .rb-order{border-left-color:#1286a0}
.rb-order-top{display:flex;justify-content:space-between;gap:6px}.rb-order-top span{font-size:11px;color:#6a7e83}.rb-order-top .rb-late{color:#a3352b;font-weight:600}
.rb-order-cust{color:#173f4a}.rb-order small{display:block;color:#6a7e83;font-size:11px;margin-top:2px}.rb-ok{color:#266045}
.rb-add{position:absolute;right:5px;top:6px;border:1px solid #cbdadd;background:#fff;border-radius:5px;width:20px;height:20px;line-height:16px;padding:0;cursor:pointer;color:#1286a0}
.rb-empty{font-size:12px;color:#6a7e83}
.rb-routes{display:flex;flex-direction:column;gap:8px;overflow-y:auto;padding-right:2px}
.rb-route{flex:0 0 auto;display:flex;flex-direction:column;background:#fff;border:1px solid #d6e2e4;border-radius:10px;min-height:0}
.rb-route.rb-selected{border-color:#1286a0;box-shadow:0 0 0 2px #1286a033}
.rb-route>header{display:flex;justify-content:space-between;align-items:flex-start;padding:9px 10px;border-bottom:1px solid #e3ecee;cursor:pointer}
.rb-route>header strong{display:block;font-size:13.5px;color:#173f4a}.rb-route>header small{font-size:11.5px;color:#6a7e83}
.rb-route>header .crm-close{font-size:18px;padding:0 4px}
.rb-bar{position:relative;height:16px;margin:6px 10px 0;background:#eef4f5;border-radius:4px;overflow:hidden}
.rb-bar span{position:absolute;left:0;top:0;bottom:0;background:#9fd3df}.rb-bar.rb-over span{background:#f2a49b}
.rb-bar em{position:relative;font-style:normal;font-size:10.5px;padding-left:6px;color:#1d4652;line-height:16px}
.rb-stops{list-style:none;margin:8px 0 0;padding:0 8px}
.rb-stop{display:flex;gap:8px;border:1px solid #d6e2e4;border-radius:8px;padding:7px;margin-bottom:6px;background:#fbfdfd;cursor:grab}
.rb-num{flex:0 0 22px;height:22px;border-radius:50%;background:#1286a0;color:#fff;font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center}
.rb-stop-body{min-width:0;flex:1}.rb-stop-body strong{display:block;font-size:12.5px;color:#173f4a}.rb-stop-body>small{display:block;font-size:11px;color:#6a7e83}
.rb-stop-order{display:flex;align-items:center;gap:4px;font-size:11.5px;color:#2c5764;margin-top:3px}.rb-stop-order em{color:#946b2d;font-style:normal}
.rb-stop-order button{margin-left:auto;border:0;background:none;color:#8aa0a6;cursor:pointer;font-size:14px;line-height:1}
.rb-leg{color:#1286a0!important;margin-top:3px}
.rb-drop-hint{border:1px dashed #bfced2;border-radius:8px;padding:22px 8px;text-align:center;color:#8aa0a6;font-size:12px}
.rb-route>footer{border-top:1px solid #e3ecee;padding:8px 10px;font-size:11.5px;color:#45616a;display:flex;flex-wrap:wrap;gap:4px 8px;align-items:center}
.rb-route>footer>div{display:flex;gap:6px;width:100%}.rb-route>footer .crm-secondary{padding:5px 9px;font-size:12px;min-height:0}
.rb-total{color:#1286a0;font-weight:600}
.rb-noroutes{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border:1px dashed #c9d9dd;border-radius:10px;color:#5c757c;font-size:12.5px}
.rb-noroutes strong{color:#1d4652;font-size:14px}
.rb-over-target{outline:2px dashed #1286a0;outline-offset:-2px}
.rb-dragging{opacity:.45}
.rb-map-panel{display:flex;flex-direction:column;background:#fff;border:1px solid #d6e2e4;border-radius:10px;overflow:hidden}
.rb-map-panel>header{display:flex;justify-content:space-between;align-items:center;padding:8px 10px;border-bottom:1px solid #e3ecee}
.rb-map-panel>header strong{display:block;font-size:13.5px;color:#173f4a}.rb-map-panel>header small{font-size:11.5px;color:#1286a0}
.rb-map-panel .crm-secondary{padding:5px 10px;font-size:12px;min-height:0}
.rb-map{flex:1;min-height:300px;background:#e8eef0}
.rb-map-note{margin:0;padding:6px 10px;font-size:11.5px;color:#946b2d}.rb-map-note:empty{display:none}
.rb-pin span{display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;font:700 12px/1 Arial,sans-serif;color:#fff;background:#1286a0;border:2px solid #fff;box-shadow:0 1px 4px #0005}
.rb-pin-home span{background:#173f4a;font-size:14px}
.rb-pin-open span{background:#9aa9ad;width:16px;height:16px;margin:5px;font-size:9px}
.rb-pop-add{margin-top:6px;padding:4px 8px!important;font-size:12px!important}
@media(max-width:1300px){.rb-layout{grid-template-columns:250px minmax(0,1fr);height:auto}.rb-routes{max-height:70vh}.rb-map-panel{grid-column:1/-1;height:460px}}
.rb-bar-top input[type=date]{width:170px!important;flex:0 0 auto}
.rb-bar-top strong{white-space:nowrap}
.leaflet-div-icon.rb-pin{background:none;border:0}
.rb-return{display:flex;gap:8px;align-items:center;padding:6px 7px;margin-bottom:6px;border:1px dashed #c9d9dd;border-radius:8px;font-size:12px;color:#45616a}
.rb-return .rb-num{background:#173f4a}.rb-return strong{display:block;font-size:12px;color:#173f4a}.rb-return small{color:#1286a0}
.rb-map{position:relative}.rb-map-host{position:absolute;inset:0}

/* Closed route cards (one route open at a time) and route stages */
.rb-head-right{display:flex;align-items:center;gap:4px}
.rb-closed-body{display:block;width:100%;text-align:left;border:0;background:none;padding:6px 10px 9px;cursor:pointer;font:inherit;color:#2c5764}
.rb-closed-body span{display:block;font-size:12px}.rb-closed-body small{display:block;font-size:11px;color:#6a7e83;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rb-closed-empty{color:#8aa0a6}.rb-closed:hover{border-color:#9fc9d3}
.rt-stage{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:600;white-space:nowrap;background:#eef2f3;color:#45616a}
.rt-stage-loading{background:#fff3dc;color:#8a5a12}.rt-stage-ready{background:#dff3ea;color:#21613f}
.rt-stage-out{background:#dcecf7;color:#1d4f7a}.rt-stage-delivered{background:#e6e9f2;color:#3b4870}
/* Day board and route page */
.rt-link{border:0;background:none;padding:0;font:inherit;font-weight:700;color:#0f6f88;cursor:pointer;text-align:left}.rt-link:hover{text-decoration:underline}
.rt-flow{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;font-size:12px}.rt-flow span{font-weight:600;color:#1d4652}.rt-flow b{color:#9fb9c0;font-weight:400}.rt-flow em{flex-basis:100%;font-style:normal;color:#5c757c}
.rt-steps{list-style:none;display:flex;gap:0;margin:4px 0 14px;padding:0;counter-reset:none}
.rt-steps li{flex:1;display:flex;align-items:center;gap:8px;padding:9px 12px;font-size:12.5px;color:#7b9298;background:#f1f6f7;border:1px solid #d6e2e4;margin-right:-1px}
.rt-steps li:first-child{border-radius:8px 0 0 8px}.rt-steps li:last-child{border-radius:0 8px 8px 0}
.rt-steps li span{flex:0 0 22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11.5px;font-weight:700;background:#dbe6e8;color:#5c757c}
.rt-steps li.done{color:#21613f;background:#eef8f2}.rt-steps li.done span{background:#3d8a5f;color:#fff}
.rt-steps li.current{color:#0f4f60;background:#e3f3f7;border-color:#1286a0;font-weight:700;position:relative;z-index:1}.rt-steps li.current span{background:#1286a0;color:#fff}
.rt-summary{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:10px}
.rt-summary>div:not(.rt-next){background:#fff;border:1px solid #d6e2e4;border-radius:8px;padding:8px 14px;min-width:110px}
.rt-summary b{display:block;font-size:20px;color:#173f4a}.rt-summary span{font-size:11.5px;color:#6a7e83}
.rt-next{margin-left:auto;display:flex;gap:8px}
.rt-stop{background:#fff;border:1px solid #d6e2e4;border-radius:10px;margin:0 0 12px;overflow:hidden}
.rt-stop>header{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid #e3ecee;background:#f8fbfb}
.rt-stop>header>div:nth-child(2){flex:1;min-width:0}.rt-stop>header strong{display:block;color:#173f4a}.rt-stop>header small{color:#6a7e83;font-size:12px}
.rt-stop .crm-table-scroll{border:0;border-radius:0;margin:0}.rt-lines td small{display:block;color:#7b9298;font-size:11px}
.rt-pallets{margin:0;padding:8px 12px;font-size:12px;color:#45616a;border-top:1px solid #e3ecee}
.rt-status{display:inline-block;padding:2px 8px;border-radius:999px;font-size:11.5px;font-weight:600;background:#eef2f3;color:#45616a;white-space:nowrap}
.rt-status.rt-ok{background:#dff3ea;color:#21613f}.rt-status.rt-ready{background:#dcecf7;color:#1d4f7a}.rt-status.rt-part{background:#fff3dc;color:#8a5a12}.rt-status.rt-wait{background:#f6e5e3;color:#8f3a30}
@media(max-width:900px){.rt-steps{flex-wrap:wrap}.rt-steps li{flex:1 1 45%;border-radius:0!important}.rt-next{margin-left:0;width:100%}}
.rt-title{display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 12px;margin:-8px 0 12px}.rt-title h2{margin:0;font-size:22px;color:#173f4a}.rt-title>span:not(.rt-stage){color:#5c757c;font-size:13px}
/* Route page: pallets per stop (open one to see what is on it), order lines underneath */
.rt-stop-facts{display:block;margin-top:2px}.rt-warn{color:#8f3a30}
.rt-pallet-list{padding:8px 12px 4px}
.rt-pallet{border:1px solid #d6e2e4;border-radius:8px;margin-bottom:6px;background:#fff}
.rt-pallet-planned{border-style:dashed;background:#fbfdfd}
.rt-pallet>summary{display:flex;align-items:center;gap:12px;padding:8px 10px;cursor:pointer;list-style:none;font-size:13px}
.rt-pallet>summary::-webkit-details-marker{display:none}
.rt-pallet>summary:before{content:'▸';color:#6a7e83;font-size:12px}.rt-pallet[open]>summary:before{content:'▾'}
.rt-pallet-name{font-weight:700;color:#173f4a;white-space:nowrap}
.rt-pallet-facts{flex:1;min-width:0;color:#45616a;font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rt-fill{position:relative;flex:0 0 110px;height:16px;background:#eef4f5;border-radius:4px;overflow:hidden}
.rt-fill i{position:absolute;left:0;top:0;bottom:0;background:#9fd3df}.rt-fill-over i{background:#f2a49b}
.rt-fill em{position:relative;font-style:normal;font-size:10.5px;line-height:16px;padding-left:6px;color:#1d4652}
.rt-pallet-items{margin:0;border-top:1px solid #e3ecee}.rt-pallet-items td small{display:block;color:#7b9298;font-size:11px}
.rt-lines-box{border-top:1px solid #e3ecee}
.rt-lines-box>summary{padding:8px 12px;cursor:pointer;font-size:12.5px;color:#2c5764;font-weight:600}
@media(max-width:900px){.rt-pallet>summary{flex-wrap:wrap}.rt-fill{flex-basis:80px}}
.rt-driver{border:1px solid #cbdadd;background:#fff;border-radius:999px;padding:2px 10px;font:inherit;font-size:12.5px;color:#0f6f88;font-weight:600;cursor:pointer}.rt-driver:hover{border-color:#1286a0}
