/* GPS 387 v0.7 Dispatch – enterprise blue, integrated Fleet UI primitives */
.dispatch-shell{display:flex;flex-direction:column;gap:14px;padding-bottom:32px}
.dispatch-toolbar{padding:19px 20px;background:var(--paper);border:1px solid var(--border);border-radius:12px;display:flex;justify-content:space-between;align-items:center;gap:12px}
.dispatch-toolbar h2{font-size:17px;font-weight:600;letter-spacing:-.4px;margin:7px 0}.dispatch-toolbar p{font-size:11px;color:var(--muted);margin:0;line-height:1.6}
.dispatch-toolbar-actions{display:flex;gap:8px;flex-wrap:wrap}
.dispatch-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}
.dispatch-kpis .journey-kpi{min-height:96px}
.dispatch-kpis .journey-kpi strong{font-weight:600;font-size:23px}
.dispatch-grid{display:grid;grid-template-columns:minmax(280px,.83fr) minmax(390px,1.3fr);gap:14px;align-items:start}
.dispatch-list-card,.dispatch-detail-card{background:var(--paper);border:1px solid var(--border);border-radius:12px;overflow:hidden;min-width:0}
.dispatch-card-title{padding:17px 18px;display:flex;gap:10px;align-items:center;border-bottom:1px solid var(--border);font-size:12px;color:var(--ink2)}
.dispatch-card-title strong{font-size:12px;font-weight:600}.dispatch-card-title svg{width:17px;height:17px;color:var(--primary)}.dispatch-card-title span:last-child{margin-left:auto;color:var(--muted);font-size:10px}
.dispatch-filters{display:flex;gap:5px;padding:10px 12px;border-bottom:1px solid var(--border);overflow-x:auto}.dispatch-filter{padding:8px 10px;background:none;border:0;border-radius:6px;color:var(--muted);font-size:10px;white-space:nowrap}.dispatch-filter.active{color:var(--primary);background:var(--primary-light);font-weight:600}
.dispatch-jobs{max-height:680px;overflow-y:auto}.dispatch-job{display:block;width:100%;border:0;border-left:3px solid transparent;border-bottom:1px solid var(--border);background:transparent;text-align:left;padding:17px 16px;color:var(--ink2);cursor:pointer}.dispatch-job.active{background:var(--primary-light);border-left-color:var(--primary)}.dispatch-job:hover{background:var(--paper-soft)}.dispatch-job>strong{display:block;font-weight:600;line-height:1.5;font-size:12px;margin:11px 0 9px}
.dispatch-job-top,.dispatch-job-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px}.dispatch-ref{font-size:9px;letter-spacing:.55px;color:var(--primary);font-weight:600}.dispatch-job-sub{color:var(--muted);font-size:10px;display:flex;align-items:center;flex-wrap:wrap;gap:5px}.dispatch-job-sub svg,.dispatch-job-bottom svg{width:13px;height:13px}.dispatch-job-bottom{margin-top:13px;font-size:9.5px;color:var(--muted)}.dispatch-job-bottom span:last-child{display:flex;align-items:center;gap:4px}
.dispatch-pill{font-size:9px;padding:5px 8px;border-radius:5px;color:var(--primary);background:var(--primary-light);white-space:nowrap}.dispatch-pill.completed{background:#e8f3ec;color:#34734c}.dispatch-pill.cancelled{background:var(--paper-soft);color:var(--muted)}.dispatch-pill.in_progress{background:#e4eefc;color:#2c5cb6}
.dispatch-empty{min-height:470px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:13px;padding:25px;text-align:center}.dispatch-empty>svg{width:30px;height:30px;color:var(--primary)}.dispatch-empty h3{font-weight:500;font-size:14px;margin:0}.dispatch-empty p{font-size:11px;max-width:290px;line-height:1.8;color:var(--muted);margin:0}
.dispatch-detail-header{display:flex;justify-content:space-between;align-items:start;gap:10px;padding:20px 21px 14px}.dispatch-detail-header h3{font-weight:600;font-size:16px;line-height:1.4;letter-spacing:-.3px;margin:8px 0}
.dispatch-detail-info{display:grid;grid-template-columns:1fr 1fr;gap:12px;background:var(--paper-soft);padding:15px 20px;margin:0 17px 12px;border-radius:8px}.dispatch-detail-info span{display:flex;align-items:center;gap:7px;color:var(--ink2);font-size:10px}.dispatch-detail-info svg{width:14px;height:14px;color:var(--primary)}
.dispatch-stops{padding:13px 20px}.dispatch-stops h4,.dispatch-events h4{font-size:11px;font-weight:600;margin:0 0 14px;color:var(--ink)}.dispatch-stop{display:flex;gap:12px;align-items:start;padding:0 0 20px;position:relative}.dispatch-stop:not(:last-child):before{content:'';position:absolute;left:12px;top:27px;bottom:0;border-left:1px dashed var(--border)}.dispatch-stop-index{width:26px;height:26px;background:var(--primary-light);color:var(--primary);font-size:10px;display:grid;place-items:center;border-radius:50%;flex-shrink:0;z-index:1}.dispatch-stop>div{display:grid;gap:5px;min-width:0}.dispatch-stop>div>span{color:var(--muted);font-size:9px}.dispatch-stop strong{font-size:11px;font-weight:500;overflow-wrap:anywhere}.dispatch-stop small{color:var(--muted);font-size:10px}
.dispatch-job-notes{margin:3px 20px 13px;background:var(--paper-soft);border-radius:8px;padding:12px 13px;color:var(--ink2);line-height:1.7;font-size:10.5px;white-space:pre-wrap;overflow-wrap:anywhere}
.dispatch-controls{padding:13px 19px;display:flex;gap:8px;flex-wrap:wrap;border-top:1px solid var(--border)}
.dispatch-messaging{border-top:1px solid var(--border)}.dispatch-messages{padding:13px 17px;display:flex;flex-direction:column;gap:10px;max-height:330px;overflow:auto;min-height:80px}
.dispatch-message{border-radius:8px;max-width:90%;padding:12px 13px;background:var(--paper-soft);font-size:11px;line-height:1.65;overflow-wrap:anywhere;white-space:pre-wrap}.dispatch-message.from-dispatch{align-self:flex-end;background:var(--primary-light)}.dispatch-message.from-driver{align-self:flex-start}
.dispatch-message-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}.dispatch-message-meta strong{font-size:10px;font-weight:600;color:var(--ink2)}.dispatch-message-meta span{font-size:9px;color:var(--muted)}.dispatch-message-meta em{font-style:normal;color:var(--primary);font-size:9px}
#dispatchMessageForm{padding:15px 17px;border-top:1px solid var(--border)}#dispatchMessageForm textarea{width:100%;min-height:67px;max-height:120px;resize:vertical;border:1px solid var(--border);background:var(--paper-soft);color:var(--ink);border-radius:8px;padding:11px;font-size:11px;font-family:inherit}
.dispatch-send-row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:9px}.dispatch-send-row label{font-size:10px;color:var(--muted);display:flex;align-items:center;gap:7px}.dispatch-send-row input{accent-color:#2865d8}
.dispatch-hint{padding:11px 17px;background:var(--paper-soft);display:flex;align-items:start;gap:8px;font-size:9px;color:var(--muted);line-height:1.6}.dispatch-hint svg{width:14px;height:14px;flex-shrink:0;color:var(--primary)}
.dispatch-events{padding:17px 20px;border-top:1px solid var(--border)}.dispatch-event{display:flex;justify-content:space-between;align-items:center;gap:9px;border-bottom:1px solid var(--border);padding:10px 0;color:var(--ink2);font-size:10px}.dispatch-event small{color:var(--muted)}
@media(max-width:1100px){.dispatch-grid{grid-template-columns:1fr}.dispatch-jobs{max-height:360px}}
@media(max-width:690px){.dispatch-toolbar{flex-direction:column;align-items:start}.dispatch-kpis{grid-template-columns:repeat(2,1fr)}.dispatch-grid{gap:10px}.dispatch-detail-info{grid-template-columns:1fr}.dispatch-job{padding:13px}.dispatch-messages{max-height:230px}}
/* Responsive GPS 387 Driver Portal */
.driver-root{min-height:100dvh;display:flex;flex-direction:column;background:var(--page);color:var(--ink);font-family:'Plus Jakarta Sans',system-ui,sans-serif}
.driver-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px max(18px,calc((100vw - 1120px)/2));background:var(--paper);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:20}
.driver-brand{display:flex;align-items:center;gap:9px}.driver-brand-icon{display:grid;place-items:center;width:35px;height:35px;border-radius:10px;background:#2966d9;color:#fff}.driver-brand-icon svg{width:19px;height:19px}.driver-brand strong{font-size:20px;letter-spacing:-1px;font-weight:600}.driver-brand strong span{color:var(--primary)}.driver-brand small{margin-left:3px;color:var(--muted);letter-spacing:1.3px;font-size:9px}
.driver-header-actions{display:flex;align-items:center;gap:7px}.driver-header-actions button{width:auto;min-width:36px}
.driver-main{width:min(1120px,100%);margin:0 auto;flex:1;padding:30px 18px}
.driver-footer{font-size:10px;padding:16px;text-align:center;color:var(--muted);border-top:1px solid var(--border)}
.driver-login-card{margin:50px auto;background:var(--paper);padding:35px;border:1px solid var(--border);border-radius:14px;max-width:430px}.driver-login-card h1{font-size:25px;font-weight:600;letter-spacing:-1px;margin:14px 0 7px}.driver-login-card p{font-size:12px;color:var(--muted);line-height:1.75}.driver-login-card form{display:flex;flex-direction:column;gap:10px;padding-top:20px}.driver-login-card form label{font-size:11px;color:var(--ink2)}.driver-login-card form input{border:1px solid var(--border);background:var(--paper-soft);color:var(--ink);border-radius:8px;height:43px;padding:0 13px;font-size:12px}.driver-login-card form button{margin-top:13px;height:45px}.driver-login-card .driver-error{color:#bc4660;font-size:11px;min-height:16px}
.driver-greeting{display:flex;align-items:start;justify-content:space-between;gap:12px;margin:5px 0 20px}.driver-greeting h1{font-size:24px;letter-spacing:-.8px;font-weight:600;margin:9px 0}.driver-greeting p{color:var(--muted);font-size:11px;margin:0}
.driver-banner{display:flex;gap:10px;align-items:start;padding:13px 16px;background:var(--primary-light);border:1px solid var(--border);color:var(--ink2);border-radius:9px;font-size:10px;margin-bottom:15px;line-height:1.7}.driver-banner svg{color:var(--primary);width:17px;height:17px;flex-shrink:0}
.driver-grid{display:grid;grid-template-columns:minmax(240px,.76fr) minmax(330px,1.5fr);gap:14px;align-items:start}.driver-jobs,.driver-detail{background:var(--paper);border:1px solid var(--border);border-radius:12px;overflow:hidden;min-height:230px}.driver-jobs .dispatch-job{min-height:100px}
#driverMessageForm{padding:15px;border-top:1px solid var(--border)}#driverMessageForm textarea{width:100%;background:var(--paper-soft);color:var(--ink);border:1px solid var(--border);border-radius:9px;resize:vertical;font-family:inherit;font-size:12px;min-height:85px;padding:13px}
#driverMessageForm .dispatch-send-row{align-items:end}.driver-detail .dispatch-message.from-dispatch{align-self:flex-start;background:var(--primary-light)}.driver-detail .dispatch-message.from-driver{align-self:flex-end;background:var(--paper-soft)}
@media(max-width:760px){.driver-grid{grid-template-columns:1fr}.driver-main{padding:17px 12px}.driver-login-card{padding:22px;margin:30px auto}.driver-jobs{max-height:280px;overflow-y:auto}.driver-header{padding:11px 13px}.driver-greeting h1{font-size:20px}.driver-brand small{font-size:8px}}

/* GPS387 v0.9.6 — dispatch screen readability and generous whitespace, palette preserved. */
.dispatch-shell{gap:22px;padding-bottom:55px}
.dispatch-toolbar{padding:28px 32px;border-radius:16px;gap:20px}
.dispatch-toolbar h2{font-size:27px;font-weight:750;margin:9px 0 12px}
.dispatch-toolbar p{font-size:14px;line-height:1.7}
.dispatch-kpis{gap:16px}
.dispatch-kpis .journey-kpi{min-height:120px;padding:21px}
.dispatch-kpis .journey-kpi strong{font-size:29px;font-weight:700}
.dispatch-grid{gap:19px;grid-template-columns:minmax(300px,.85fr) minmax(420px,1.3fr)}
.dispatch-list-card,.dispatch-detail-card{border-radius:15px}
.dispatch-card-title{padding:22px 24px;font-size:15px}.dispatch-card-title strong{font-size:15px}
.dispatch-filters{gap:8px;padding:14px 17px}.dispatch-filter{font-size:13px;padding:10px 15px}
.dispatch-jobs{max-height:760px}.dispatch-job{padding:22px 21px}
.dispatch-job>strong{font-size:15px;line-height:1.5;margin:13px 0}
.dispatch-ref{font-size:12px}.dispatch-pill{font-size:12px;padding:7px 10px}
.dispatch-job-sub{font-size:13px;gap:9px}.dispatch-job-bottom{font-size:12px}
.dispatch-detail-header{padding:27px 27px 20px}.dispatch-detail-header h3{font-size:21px;margin:12px 0}
.dispatch-detail-info{gap:16px;padding:19px 22px;margin:0 20px 15px}.dispatch-detail-info span{font-size:13px}
.dispatch-stops{padding:20px 27px}.dispatch-stops h4,.dispatch-events h4{font-size:15px}
.dispatch-stop{gap:15px;padding-bottom:26px}.dispatch-stop strong{font-size:14px;font-weight:650}
.dispatch-stop>div>span{font-size:12px}.dispatch-stop small{font-size:12px}
.dispatch-job-notes{font-size:13px;padding:17px 19px;margin:7px 26px 15px}
.dispatch-controls{padding:19px 27px;gap:12px}
.dispatch-messages{padding:19px 26px;gap:15px}.dispatch-message{font-size:13px;padding:15px 18px}
.dispatch-message-meta strong,.dispatch-message-meta span{font-size:12px}
.dispatch-route-entry{padding:20px 27px!important;margin:5px 0}
.dispatch-connected-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.dispatch-connected-actions .section-eyebrow{width:100%;font-size:11px}
.dispatch-connected-actions button{font-size:13px;min-height:42px;padding:10px 14px}
.dispatch-route-entry small{display:block;font-size:12px;line-height:1.6;margin-top:12px}
.dispatch-assignment-choice select{min-height:44px;font-size:14px}
.dispatch-assignment-choice small{display:block;line-height:1.6;color:var(--muted);margin-top:8px;font-size:12px}
.dispatch-shell .fleet-button{font-size:13px;min-height:40px}
@media(max-width:1200px){.dispatch-grid{grid-template-columns:minmax(280px,.8fr) minmax(0,1.2fr)}}
@media(max-width:900px){.dispatch-grid{grid-template-columns:1fr}.dispatch-jobs{max-height:400px}.dispatch-toolbar{padding:22px}.dispatch-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:570px){.dispatch-toolbar{flex-direction:column;align-items:flex-start}.dispatch-toolbar h2{font-size:23px}.dispatch-detail-header{padding:18px}.dispatch-detail-info{grid-template-columns:1fr;gap:10px;margin:0 12px}.dispatch-stops{padding:15px}.dispatch-connected-actions button{width:100%;justify-content:center}}

/* v0.9.6: Dispatch creation is a guided assignment-to-route handoff. */
#dispatchDialog .fleet-dialog{width:min(780px,96vw);border-radius:17px}
#dispatchDialog .fleet-dialog-head{padding:27px 30px 20px}
#dispatchDialog .fleet-dialog-head h2{font-size:22px;font-weight:750}
#dispatchDialog .fleet-dialog form{padding:26px 30px 28px}
#dispatchDialog .fleet-form-grid{gap:22px 18px}
#dispatchDialog .fleet-field label{font-size:13px;font-weight:650}
#dispatchDialog .fleet-field input,#dispatchDialog .fleet-field select,#dispatchDialog .fleet-field textarea{font-size:14px;padding:13px 14px;min-height:46px;border-radius:9px}
#dispatchDialog .fleet-form-actions{padding-top:25px;gap:14px}
#dispatchDialog .fleet-form-actions button{font-size:14px;min-height:44px;padding:10px 22px}
#dispatchDialog .dispatch-form-step{display:flex;gap:13px;align-items:center;border-bottom:1px solid var(--border);padding:0 0 13px}
#dispatchDialog .dispatch-form-step span{width:37px;height:37px;background:var(--primary-light);color:var(--primary);border-radius:10px;display:grid;place-items:center;font-size:14px;font-weight:750}
#dispatchDialog .dispatch-form-step strong{font-size:16px;font-weight:750;line-height:1.35}
#dispatchDialog .dispatch-assignment-choice{padding:18px 19px;border:1px solid var(--border);border-radius:11px;background:var(--paper-soft)}
#dispatchDialog .fleet-dialog-error{font-size:13px;line-height:1.6}
@media(max-width:600px){#dispatchDialog .fleet-dialog-head,#dispatchDialog .fleet-dialog form{padding:19px}#dispatchDialog .fleet-form-grid{gap:14px}}

/* v0.9.16A — direct, accessible list-level CRUD actions. */
.dispatch-list-row{display:flex;flex-direction:column;border-bottom:1px solid var(--border);min-width:0;transition:background .15s}
.dispatch-list-row .dispatch-job{border-bottom:0}
.dispatch-list-row.active{background:var(--primary-light)}
.dispatch-list-row:focus-within{outline:2px solid var(--primary);outline-offset:-2px}
.dispatch-row-actions{display:flex;align-items:center;flex-wrap:wrap;gap:9px;padding:0 18px 14px;min-height:10px}
.dispatch-row-actions:empty{display:none}
.dispatch-row-actions button{font-family:inherit;cursor:pointer;border:1px solid var(--border);border-radius:8px;background:var(--paper);color:var(--ink2);font-size:12px;font-weight:650;display:inline-flex;align-items:center;gap:7px;min-height:38px;padding:9px 12px}
.dispatch-row-actions button:hover,.dispatch-row-actions button:focus-visible{border-color:var(--primary);color:var(--primary);background:var(--paper-soft)}
.dispatch-row-actions button svg{width:16px;height:16px}
.dispatch-row-actions .danger,.dispatch-controls .dispatch-danger{color:#b84b4b}
.dispatch-row-actions .danger:hover,.dispatch-row-actions .danger:focus-visible,.dispatch-controls .dispatch-danger:hover{border-color:#b84b4b;color:#a63636;background:var(--paper-soft)}
.dispatch-list-removed{display:grid;gap:10px;padding:20px 20px 13px;min-width:0}
.dispatch-list-removed strong{font-size:15px;line-height:1.5;color:var(--ink);overflow-wrap:anywhere}
.dispatch-list-removed small{font-size:12px;color:var(--muted)}
.dispatch-controls .dispatch-danger{margin-left:auto;border-color:var(--border)}
#dispatchDialog .fleet-form-grid .fleet-field input[type="number"],#dispatchDialog .fleet-form-grid .fleet-field input[type="datetime-local"]{min-width:0}
@media(max-width:600px){.dispatch-row-actions{padding:0 13px 13px}.dispatch-row-actions button{flex:1;justify-content:center;font-size:13px}.dispatch-controls .dispatch-danger{width:100%;justify-content:center;margin-left:0}}

/* GPS387 v0.9.21A: reusable company roles & paid calculation history */
.dispatch-linked-parties,.dispatch-calculation-history{margin:16px 0;padding:17px;border:1px solid var(--border);border-radius:12px;background:var(--paper)}
.dispatch-linked-parties h4,.dispatch-calculation-history h4{margin:0 0 11px;font-size:15px;font-weight:750;color:var(--ink)}
.dispatch-linked-parties>div,.dispatch-history-item{padding:9px 0;border-top:1px solid var(--border);display:grid;gap:5px;grid-template-columns:1fr auto;align-items:center}
.dispatch-linked-parties>div span,.dispatch-history-item span{font-size:12px;color:var(--muted)}
.dispatch-linked-parties>div strong,.dispatch-history-item strong{font-size:13px;color:var(--ink);text-align:right}
.dispatch-history-item small{grid-column:1/-1;font-size:12px;color:var(--muted);line-height:1.5}
.dispatch-calculation-history>p{font-size:13px;color:var(--muted)}

/* Recorded route provider activity remains visible even without a saved job. */
.dispatch-ledger-all{margin:13px 0 17px;padding:14px 18px;border:1px solid var(--border);border-radius:13px;background:var(--paper)}
.dispatch-ledger-all summary{display:flex;align-items:center;gap:9px;font-weight:720;cursor:pointer;font-size:14px;color:var(--ink)}
.dispatch-ledger-all summary svg{height:18px;width:18px;color:var(--primary)}
.dispatch-ledger-all>p{font-size:12px;color:var(--muted);line-height:1.6}
#dispatchLedgerAll{display:grid;max-height:370px;overflow-y:auto}
.dispatch-ledger-entry{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;padding:10px 0;border-top:1px solid var(--border)}
.dispatch-ledger-entry span{font-size:12px;color:var(--ink2);overflow-wrap:anywhere}
.dispatch-ledger-entry strong{font-size:14px;color:var(--ink)}
.dispatch-ledger-entry small{font-size:12px;color:var(--muted);grid-column:1/-1}
.dispatch-ledger-empty{font-size:13px;color:var(--muted)}

/* v0.9.21C: explicit paid recalculation of an existing transport order */
.dispatch-calculation-history>button{margin:0 0 12px;min-height:36px}
.dispatch-recalculation-note{grid-column:1/-1;color:var(--muted);font-size:12px;line-height:1.55;padding:8px 0}
