body.driver-mode .app-layout{grid-template-columns:minmax(0,1fr)}
body.driver-mode #app-sidebar,body.driver-mode #menu-toggle{display:none!important}
.driver-page{max-width:880px;margin:0 auto;width:100%;min-width:0}.driver-page header{margin-bottom:16px}
#driver-filter{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:10px;align-items:end;margin-bottom:12px}#driver-filter label{display:grid;gap:6px;margin:0;min-width:0}#driver-filter input{display:block;min-width:0;width:100%;max-width:100%;height:44px;margin:0;padding:0 10px;font-size:16px}#driver-filter button{height:44px;min-height:44px;margin:0;display:inline-flex;align-items:center;justify-content:center}
@media(max-width:600px){#driver-filter{grid-template-columns:minmax(0,1fr) auto}#driver-upcoming{grid-column:1/-1;justify-self:start}}
#driver-list{display:grid;gap:12px}.driver-trip{display:flex;flex-direction:column;align-items:start;gap:8px;width:100%;text-align:left;padding:18px;background:white;color:#17334c;border:1px solid #c6ddd9;border-radius:12px}.driver-trip strong{font-size:1.05rem}.driver-badge{font-size:.85rem;color:#087e72}
.driver-stop{background:#fff;border:1px solid #d6e0e6;border-radius:12px;padding:14px;margin:12px 0;overflow-wrap:anywhere}.driver-stop-head{display:flex;align-items:center;gap:8px}.driver-stop-head strong{flex:1;min-width:0}.driver-stop-head button{flex-shrink:0;min-width:38px;min-height:44px;padding:6px}.driver-handle{touch-action:none;background:#e8f4f1;color:#087e72;border:0;border-radius:6px;font-size:1.4rem}.driver-number{font-weight:700}.driver-stop p{margin:10px 0;font-size:.9rem}.driver-packages{color:#087e72}.driver-stop details{border-top:1px solid #e2e9ef;padding-top:10px}.driver-stop details strong{display:block;margin-top:12px}.driver-stop.dragging{outline:2px solid #087e72}.driver-actions,#driver-pages{display:flex;align-items:center;gap:12px;justify-content:space-between;margin-top:14px}.driver-actions button{flex:1}#driver-release{padding:10px;background:#e8f4f1;border-radius:8px}#driver-status{font-size:.9rem;color:#597083}

#driver-filter button[type="submit"],#driver-save{background:#087e72;color:#fff;border:1px solid #087e72;border-radius:7px;padding:11px 18px;font-weight:600}
.driver-login-link{display:block;margin-top:18px;color:#087e72;font-weight:600}#driver-activation .muted{font-size:.9rem;margin:12px 0}#driver-activate,#driver-admin-search button,#driver-admin-list button:not(.secondary){background:#087e72;color:white;border:1px solid #087e72;border-radius:7px;padding:12px 18px;font-weight:600}#driver-activate{width:100%;margin-top:12px}#driver-admin-search{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin:12px 0}#driver-admin-search label{flex:1;min-width:180px;margin:0}#driver-admin-search input{margin-top:6px}#driver-admin-code{border:1px solid #087e72;padding:16px;border-radius:10px;background:#eef8f5;margin:14px 0}#driver-admin-code input{font-size:16px;margin-bottom:10px}#driver-admin-code p{font-size:.9rem;line-height:1.5;overflow-wrap:anywhere}

.driver-primary{background:#087e72;color:white;border:0;border-radius:8px;padding:13px 18px;font-weight:700;min-height:46px}.driver-stop>.driver-primary{width:100%;margin-top:14px}.driver-done{border-left:5px solid #15946b;background:#f1faf6}.driver-warning{border-left:5px solid #d9a11c;background:#fffaf0}.driver-editor{background:white;padding:18px;border:1px solid #d6e0e6;border-radius:14px;margin-top:14px}.driver-editor h3{margin:20px 0 10px}.driver-editor label{display:block;margin:16px 0 8px}.driver-editor input,.driver-editor select,.driver-editor textarea{display:block;width:100%;min-width:0;font-size:16px;box-sizing:border-box;margin-top:6px;padding:10px;border:1px solid #cedbe2;border-radius:7px}.driver-editor details{margin:18px 0}.driver-editor details strong{display:block;margin-top:12px}.driver-map{display:inline-block;padding:12px 0;color:#087e72;font-weight:700}.driver-notice{padding:16px;background:#fff5dc;border-radius:8px}.driver-pack-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;border-bottom:1px solid #e2e9ef;padding:12px 0}.driver-pack-row>strong,.driver-pack-row>small{grid-column:1/-1}.driver-pack-row label{margin:0}.driver-photos{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px;margin:16px 0}.driver-photos img{width:100%;height:auto;border-radius:7px}.driver-editor form>.driver-primary{width:100%;margin:12px 0}.driver-editor .error:empty{display:none}.driver-editor button:disabled{opacity:.55}button.driver-primary:disabled{opacity:.5}
.driver-share-actions{display:flex;justify-content:space-between;align-items:center;gap:12px}.driver-share-actions button{min-width:0;white-space:normal}.driver-share-actions button:last-child{margin-left:auto}.driver-share-options{margin-top:12px;padding-top:8px;border-top:1px solid #d6e0e6}.driver-share-options button{margin:4px 8px 4px 0}
#driver-admin-search{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px}#driver-admin-search label{display:grid;gap:6px;min-width:0;margin:0}#driver-admin-search input,#driver-admin-search button{height:44px;min-height:44px;box-sizing:border-box;margin:0}#driver-admin-search input{min-width:0;padding:0 10px}#driver-admin-search button{display:inline-flex;align-items:center;justify-content:center;padding:0 18px}

.driver-tracking{margin:16px 0;padding:16px;border:1px solid #9bcfc2;border-radius:10px;background:#effaf6}.driver-tracking p{font-size:12px;line-height:1.6}.driver-tracking button{min-height:42px}

.driver-access-target{display:grid;gap:6px;max-width:320px;margin:16px 0}.driver-access-target select{height:44px;min-height:44px;width:100%;padding:0 10px;border:1px solid #cbd7e2;border-radius:7px;background:#fff;color:#203b50;font:inherit}

.driver-platform{display:inline-flex;align-items:center;gap:6px;padding:4px 9px;border:1px solid;border-radius:999px;font-size:12px;font-weight:600;line-height:1.4;white-space:nowrap}.driver-platform::before{content:'';width:7px;height:7px;border-radius:50%;background:currentColor}.driver-platform-android{color:#087e52;background:#eaf8ef;border-color:#a8d9bb}.driver-platform-web{color:#285b9b;background:#edf4ff;border-color:#b6cfee}#login-title+.driver-platform{margin:0 0 12px}.account .driver-platform{flex-shrink:0}

.driver-platform{font-size:14px;padding:6px 12px;gap:8px}.driver-platform::before{width:12px;height:12px;flex-shrink:0}.brand-dot{display:inline-block;font-size:1.3em;line-height:.8}
/* Mesmo progresso e prazo na web e no WebView Android. */
.driver-progress{display:grid;gap:8px;width:100%;min-width:0;margin:12px 0;color:#087e65;font-size:13px}.driver-progress progress{display:block;width:100%;height:9px;border:0;border-radius:8px;overflow:hidden;background:#dcece8;accent-color:#008675}.driver-progress progress::-webkit-progress-bar{background:#dcece8}.driver-progress progress::-webkit-progress-value{background:#008675}.driver-progress progress::-moz-progress-bar{background:#008675}.driver-progress-late{color:#b42332}.driver-progress-late progress{background:#f9d8dc;accent-color:#d93649}.driver-progress-late progress::-webkit-progress-bar{background:#f9d8dc}.driver-progress-late progress::-webkit-progress-value{background:#d93649}.driver-progress-late progress::-moz-progress-bar{background:#d93649}.driver-stop.driver-stop-late{border-left:5px solid #d93649}.driver-late-badge{background:#fff0f2;color:#b42332;border:1px solid #f2bdc4;border-radius:7px;padding:8px 10px;font-size:13px;font-weight:600}.driver-late-badge[hidden]{display:none}

.driver-accept{background:#f0faf7;border:1px solid #b6dcd3;border-radius:12px;padding:16px;margin:12px 0}.driver-accept:empty{display:none}.driver-accept p{line-height:1.5}.driver-accept ul{padding-left:22px}.driver-accept .driver-actions{flex-wrap:wrap}

/* Registro em popup, acompanhando a área visível quando o teclado abre. */
.driver-dialog{position:fixed;inset:auto;top:calc(var(--driver-viewport-top,0px) + 8px);left:0;right:0;margin:0 auto;width:min(560px,calc(100% - 24px));max-height:calc(var(--driver-viewport-height,100dvh) - 16px);box-sizing:border-box;overflow:auto;overscroll-behavior:contain;color:#17334c;padding:18px;box-shadow:0 18px 60px #102e4840}
.driver-dialog::backdrop{background:#102e4873}body:has(.driver-dialog[open]){overflow:hidden!important}
.driver-dialog-head{display:flex;align-items:center;gap:12px;justify-content:space-between}.driver-dialog-head h3{margin:0;min-width:0;overflow-wrap:anywhere}.driver-dialog-head button{flex-shrink:0;min-height:44px}
.driver-dialog input,.driver-dialog select{min-height:44px}.driver-dialog input[hidden]{display:none!important}.driver-dialog .driver-camera{width:100%;margin:0}.driver-photo-count{font-size:13px;color:#597083;margin:8px 0}
.driver-dialog-actions{display:flex;gap:10px;margin-top:18px}.driver-dialog-actions button{flex:1;min-height:46px}.driver-dialog .driver-photos{grid-template-columns:repeat(3,minmax(0,1fr))}.driver-dialog .driver-photos img{aspect-ratio:3/4;object-fit:contain;background:#f1f5f7}.driver-dialog .driver-photos button{width:100%;padding:8px 3px;min-height:44px}

.driver-dialog{scroll-padding:38px 0 20px}.driver-dialog input,.driver-dialog textarea,.driver-dialog select{scroll-margin:38px 0 20px}

/* Espaço real para trazer a observação ao topo, inclusive em teclados sobrepostos. */
.driver-dialog.driver-editing::after{content:"";display:block;height:65vh;min-height:240px;pointer-events:none}.driver-dialog textarea{height:96px;min-height:96px;max-height:120px;resize:none;overflow-y:auto}

.driver-delivery-wait{display:grid;justify-items:center;gap:10px;text-align:center;padding:16px;margin:16px 0;border:1px solid #b7d9cf;border-radius:12px;background:#f3faf7;color:#17334c}.driver-delivery-wait[hidden]{display:none}.driver-delivery-wait svg{width:180px;max-width:100%;height:86px}.driver-delivery-wait span{font-size:13px;line-height:1.4}.driver-wait-route{stroke-dasharray:100;animation:driver-draw-route 2.4s ease-in-out infinite}@keyframes driver-draw-route{0%{stroke-dashoffset:100}75%,100%{stroke-dashoffset:0}}@media(prefers-reduced-motion:reduce){.driver-wait-route{animation:none}}
.driver-receipt{min-width:0;border:1px solid #d5e1e5;border-radius:12px;padding:14px;margin:20px 0}.driver-receipt legend{font-weight:700}.driver-receipt button{margin:8px 8px 8px 0}.driver-sign-preview{display:block;max-width:100%;width:400px;border:1px solid #d5e1e5;background:white}.driver-sign-preview[hidden]{display:none}.driver-sign-dialog{box-sizing:border-box;width:min(850px,96vw);max-height:94dvh;overflow:auto;border:1px solid #cbdade;border-radius:14px;padding:16px;color:#203b4f}.driver-sign-dialog::backdrop{background:#17374499}.driver-sign-dialog canvas{display:block;width:100%;height:auto;aspect-ratio:8/3;touch-action:none;border:2px dashed #819ca5;border-radius:8px}.driver-sign-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}.driver-sign-actions button{flex:1;min-width:100px}
.driver-gps-dialog{box-sizing:border-box;width:min(440px,92vw);max-height:90dvh;overflow:auto;border:2px solid #b75a16;border-radius:14px;padding:22px;color:#203b4f;background:#fff}.driver-gps-dialog::backdrop{background:#102e4899}.driver-gps-dialog h3{margin:0 0 16px;color:#934210}.driver-gps-dialog p{line-height:1.5}.driver-gps-dialog button{width:100%;min-height:48px;margin-top:12px}
.driver-pack-step{border:1px solid #c9d9e1;border-radius:10px;padding:14px;margin:16px 0}.driver-pack-step legend{font-size:1.08rem;font-weight:700;padding:0 5px}.driver-pack-direction{display:block;padding:12px;background:#e7f3ff;color:#17466f;border-radius:6px;font-size:1.15rem}.driver-pack-step:nth-of-type(2) .driver-pack-direction{background:#fff0dd;color:#854300}.driver-pack-reference{display:block;color:#52616d;margin:6px 0 14px}.driver-editor .driver-pack-step input{font-size:32px;font-weight:700;text-align:center;min-height:64px}.driver-pack-step button{display:block;width:100%;margin-top:12px;min-height:46px}.driver-pack-step[hidden],.driver-delivery-details[hidden]{display:none!important}.driver-movement-review{box-sizing:border-box;width:min(94vw,520px);max-height:85dvh;overflow:auto;border:1px solid #ccdce3;border-radius:12px;padding:20px;color:#163a4d}.driver-movement-review::backdrop{background:#102c43b3}.driver-movement-review section{background:#f1f6f8;padding:10px 14px;border-radius:8px;margin:12px 0}.driver-movement-review h4{margin:4px 0}.driver-movement-review button{width:100%;margin-top:10px;min-height:46px}

.driver-pack-zero-hint{text-align:center;font-weight:700}

.driver-receipt [aria-invalid=true]{border:2px solid #b42318!important;background:#fff0ee!important;color:#8c1c13!important;outline-color:#b42318}.driver-field-error{display:block;color:#b42318;font-weight:700;margin:6px 0 10px}.driver-field-error[hidden]{display:none}

.driver-inline-signature{margin-top:18px}.driver-inline-signature>strong{display:block}.driver-inline-signature canvas{display:block;width:100%;height:auto;aspect-ratio:8/3;touch-action:none;background:#fff;border:2px dashed #819ca5;border-radius:8px;box-sizing:border-box}.driver-document-type{display:block;margin-top:6px;color:#52616d}

/* Fluxo de entrega: ações sem movimento e retorno. */
.driver-editor .driver-zero{background:#fff8dd!important;border-color:#e8dcae!important;color:#66521b!important}
.driver-back,#driver-back{background:#edf5fc!important;border-color:#c9ddec!important;color:#194b73!important}
.driver-receipt[hidden],.driver-dialog-actions button[hidden]{display:none!important}
.driver-sign-dialog{position:fixed;inset:0;margin:0;width:100vw;max-width:none;height:100dvh;max-height:none;border:0;border-radius:0;padding:16px;padding-bottom:max(16px,env(safe-area-inset-bottom));overflow:hidden;background:white}
.driver-sign-dialog[open]{display:flex;flex-direction:column;gap:12px}
.driver-sign-dialog>p{margin:0}.driver-sign-dialog>canvas{box-sizing:border-box;flex:1;min-height:0;width:100%;height:0;aspect-ratio:auto;background:white}
.driver-sign-dialog .driver-sign-actions{flex-shrink:0;display:grid;grid-template-columns:1fr 1.2fr .7fr;gap:8px;margin:0}
.driver-sign-dialog .driver-sign-actions button{min-width:0;min-height:52px;margin:0;padding:8px 5px;white-space:normal;font-size:14px}

.driver-editor .driver-cancel-delivery{background:#fbe8eb!important;border-color:#e9c2c9!important;color:#8b2939!important}.driver-editor .driver-cancel-delivery:hover{background:#f5d9df!important}

.driver-editor .driver-zero{font-weight:800;font-size:1.1rem;color:#493600!important}

.driver-editor .driver-pack-step input::placeholder{font-size:22px;font-weight:600}

/* Paleta suave exclusiva do fluxo do motorista. */
.driver-page .driver-primary,#driver-filter button[type="submit"],#driver-save,#driver-activate{background:#dcefe8;color:#205c4e;border:1px solid #b7d7ca}
.driver-page .driver-primary:hover:not(:disabled),#driver-filter button[type="submit"]:hover:not(:disabled),#driver-save:hover:not(:disabled),#driver-activate:hover:not(:disabled){background:#cde5da}
.driver-page button.secondary:not(.driver-zero):not(.driver-back):not(.driver-cancel-delivery):not(#driver-back){background:#f3f6f8;border-color:#d6e0e6;color:#355368}
.driver-page button:focus-visible{outline:3px solid #477f9b;outline-offset:3px}

/* Confirmação rápida, sem deslocar a próxima entrega. */
.driver-completion-ok{position:fixed;inset:0;margin:auto;padding:22px 28px;border:1px solid #b8dfc5;border-radius:20px;background:#fff;color:#23663c;box-shadow:0 12px 48px #0002;text-align:center;max-width:calc(100vw - 40px)}
.driver-completion-ok::backdrop{background:#16342b22}
.driver-completion-ok svg{display:block;width:80px;height:80px;margin:0 auto 12px}
.driver-completion-ok strong{display:block;font-size:1.15rem}
.driver-route{margin:16px 0;padding:16px;background:#edf7f4;border:1px solid #b7d9cf;border-radius:12px;display:grid;gap:10px}.driver-route p{margin:0}.driver-route>strong{font-size:1.1rem}.driver-route button{min-height:48px;width:100%}
#driver-tabs{display:flex;gap:6px;margin:16px 0;position:sticky;top:0;background:var(--surface,#fff);z-index:2;padding:8px 0}#driver-tabs[hidden]{display:none}#driver-tabs button{flex:1;min-width:0;min-height:44px;padding:10px 6px;font-weight:700;border-radius:8px}#driver-tabs [aria-selected="true"]{color:#fff;background:#087e72;border-color:#087e72}#driver-tabs button[data-tab="falhou"][aria-selected="true"]{background:#9a5615;border-color:#9a5615}.driver-selected{outline:2px solid #087e72;outline-offset:2px}.driver-selected-label{color:#08675e;font-weight:700;margin:0 0 8px}.driver-stop[hidden]{display:none!important}.driver-stop>button{margin-top:8px}.driver-route button:disabled{opacity:.55;cursor:not-allowed}
