/* Milebs v0.8 visual layer: dark operational surfaces, restrained cyan light, and real interaction states. */
:root {
  --m08-void:#050d19;
  --m08-night:#081526;
  --m08-panel:#0c1c30;
  --m08-raised:#10243a;
  --m08-raised-2:#142b45;
  --m08-line:#23415f;
  --m08-ink:#f0f7ff;
  --m08-muted:#a8bdd3;
  --m08-blue:#1684ff;
  --m08-cyan:#35d7ff;
  --m08-green:#24ca91;
  --m08-motion:cubic-bezier(.2,.75,.25,1);
  color-scheme:dark;
}

html,body{min-height:100%;background:var(--m08-void);color:var(--m08-ink)}
body{background:radial-gradient(ellipse at 75% -20%,#12365a 0,transparent 42%),linear-gradient(145deg,#071321 0%,#081525 50%,#050d19 100%)}
main{background:transparent}
.sidebar{background:linear-gradient(180deg,#09182b 0%,#071321 100%);border-right-color:#1e3a56;box-shadow:12px 0 32px #02081335}
.brand .milebs-logo-symbol,.auth-brand .milebs-logo-symbol{filter:drop-shadow(0 0 10px #148cff45)}
.sidebar nav a{transition:color .18s var(--m08-motion),background .18s var(--m08-motion),border-color .18s,transform .18s var(--m08-motion),box-shadow .18s}
.sidebar nav a:hover{transform:translateX(2px);border-color:#28547a;background:#102b47;box-shadow:0 6px 20px #02081355}
.sidebar nav a.active{border-color:#278aff;background:linear-gradient(105deg,#1456aa,#116ec9);box-shadow:0 7px 22px #087bff35,inset 0 1px #69caff55}
.topbar{border-color:#1d3956;background:#081728eF;box-shadow:0 8px 30px #02081322}
.page{max-width:1960px}
.page-heading,.page>header,.route-planning-heading,.exec-title,.intel-title{border-color:#28435e}
.page-heading h1,.page>header h1,.route-planning-heading h1,.exec-title h1{letter-spacing:-.035em}
.directory,.operation-page,.operation-subpanel,.v04-page,.operation-block,.map-card,.operator-panel,.intel-map-card,.intel-left-panel,.intel-detail-panel,.intel-bottom-card,.route-controls,.route-map-panel,.route-result-panel,.saved-route-section,.exec-card,.exec-metric{border-color:#23415f;background:linear-gradient(155deg,#0d1e32f5,#0a192bf5);box-shadow:0 14px 40px #01071150,inset 0 1px #8bd5ff0b}
.directory-item,.appointment-card,.execution-visit-card,.portal-visit-card,.operation-company-card,.route-company,.route-operator-row,.route-result-card,.operator-visit-card,.operator-summary-cards article,.operator-route-summary article,.operator-route-sequence li,.portal-summary-cards article{border-color:#294660;background:linear-gradient(135deg,#112840,#0d1e32);box-shadow:0 7px 20px #01081337,inset 0 1px #a5dcff0c;transition:transform .2s var(--m08-motion),border-color .2s,box-shadow .2s,background .2s}
.directory-item:hover,.appointment-card:hover,.execution-visit-card:hover,.portal-visit-card:hover,.route-company:hover,.operator-visit-card:hover{transform:translateY(-2px);border-color:#3e84b2;box-shadow:0 12px 28px #01081366,0 0 0 1px #35d7ff1b}
button,.environment button,.operator-app-main button,.operator-app-main a{transition:transform .16s var(--m08-motion),box-shadow .18s,border-color .18s,background-color .18s,color .18s}
button:not(:disabled):hover,.environment button:hover{box-shadow:0 8px 22px #02091452,0 0 0 1px #35d7ff25}
button:not(:disabled):active{transform:scale(.985)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--m08-cyan);outline-offset:2px;box-shadow:0 0 0 5px #35d7ff20}
.page input:not([type=checkbox]):not([type=radio]):not([type=range]),.page select,.page textarea,dialog input:not([type=checkbox]):not([type=radio]):not([type=range]),dialog select,dialog textarea{min-height:42px;border-color:#31516e;background:#09192b;color:var(--m08-ink);color-scheme:dark;box-shadow:inset 0 1px #b8e4ff0a}
.page input::placeholder,.page textarea::placeholder,dialog input::placeholder{color:#829ab3}
input[type=date],input[type=datetime-local],input[type=time]{color-scheme:dark}
.page button.primary,.page .primary,.dialog-actions .primary{background:linear-gradient(110deg,#086bdd,#1684ff);box-shadow:0 6px 18px #087bff30,inset 0 1px #ffffff24}
.page button.primary:hover,.page .primary:hover,.dialog-actions .primary:hover{background:linear-gradient(110deg,#0879f5,#20a1ff);box-shadow:0 9px 25px #087bff48}
.auth-screen{background:radial-gradient(ellipse at 50% 6%,#124274 0,transparent 42%),linear-gradient(145deg,#050d19,#09182b 55%,#050d19)}
.auth-card{border-color:#315778;background:linear-gradient(150deg,#10243a,#091728);box-shadow:0 28px 90px #0009,0 0 36px #087bff18,inset 0 1px #c0e5ff14}
.operator-app-header{border-color:#1d3b58;background:#071626ed;box-shadow:0 8px 30px #0108134a}
.operator-app-main #operator-app-content>.operator-portal-section,.operator-app-main #operator-app-content .operator-portal-section,.operator-app-content,.operator-app-section,.operator-app-tabs{border-color:#274765;background:linear-gradient(150deg,#0e2035,#091829);box-shadow:0 14px 36px #02091445,inset 0 1px #b3e3ff0b}
.operator-app-tabs button[aria-current=page],.operator-app-tabs button[aria-selected=true],.operator-app-tabs button.active{background:linear-gradient(110deg,#124d91,#1167b4);border-color:#2d91dc;box-shadow:inset 0 -2px var(--m08-cyan),0 5px 16px #087bff24}
.operator-app-main .operator-route-map,.operator-app-main #portal-route-map{border-color:#31516e;box-shadow:0 8px 24px #01081370}
.operator-app-main .operator-route-controls{border:1px solid #294660;border-radius:12px;background:linear-gradient(145deg,#10263f,#0a1b2f);color:var(--m08-ink);box-shadow:inset 0 1px #b6e4ff12}
.operator-app-main .operator-route-controls label,.operator-app-main .operator-route-controls span{color:var(--m08-muted)}
.operator-app-main .operator-route-controls input{min-height:44px;border:1px solid #31516e;border-radius:9px;background:#09192b;color:var(--m08-ink);color-scheme:dark}
.operator-app-main #operator-route-status{padding:9px 12px;border:1px solid #294660;border-radius:10px;background:linear-gradient(120deg,#10263f,#0a1b2f);color:var(--m08-muted)}
.operator-app-main .operator-route-sequence li.is-active{border-color:#2b83c0;background:linear-gradient(120deg,#123557,#10263f);box-shadow:inset 3px 0 var(--m08-cyan),0 0 18px #1684ff18}
.operator-app-main .operator-route-map{background:linear-gradient(145deg,#09192b,#10243b)}
.operator-app-main .operator-detail-actions button,.operator-app-main .operator-map-actions a,.operator-app-main .operator-visit-card button{min-height:44px}
.operator-app-main .operator-visit-card .primary,.operator-app-main .operator-detail-actions .primary{background:linear-gradient(110deg,#0874e8,#1684ff)}

/* Três áreas independentes no desktop; colapsam somente quando a largura já não permite leitura. */
@media(min-width:1361px){body.route-planning-active .route-workspace{grid-template-columns:minmax(220px,.82fr) minmax(360px,1.25fr) minmax(300px,.92fr);gap:12px;align-items:stretch}body.route-planning-active .route-controls{grid-column:auto;grid-row:auto;max-height:calc(100vh - 215px)}body.route-planning-active .route-map-panel{grid-column:auto;grid-row:auto;min-height:620px}body.route-planning-active .route-result-panel{grid-column:auto;grid-row:auto;max-height:calc(100vh - 215px);min-height:520px}body.route-planning-active .route-result-panel>.route-results{min-height:0;overflow:auto;overscroll-behavior:contain}}
body.route-planning-active #route-planning-panel{background:radial-gradient(ellipse at 52% 18%,#0e2942 0,transparent 45%),linear-gradient(160deg,#071321,#081526)}
body.route-planning-active .route-planning-heading{border-color:#2c5271;background:linear-gradient(110deg,#0e2238,#102b45 55%,#0a1a2d);box-shadow:0 10px 34px #0209144a,inset 0 1px #b6e5ff16}
body.route-planning-active .route-heading-title h1{font-size:clamp(21px,1.8vw,27px)}
body.route-planning-active .route-control-block,body.route-planning-active .route-map-panel,body.route-planning-active .route-result-panel{border-color:#284b69;background:linear-gradient(155deg,#0d1f33f7,#091829f7);box-shadow:0 16px 42px #01081355,inset 0 1px #a9dbff0c}
body.route-planning-active .route-map-panel{position:relative;isolation:isolate;padding:12px}
body.route-planning-active .route-map-header,body.route-planning-active .route-map-metrics{position:relative;z-index:700;flex:none}
body.route-planning-active .route-map-toolbar{position:relative;z-index:701}
body.route-planning-active #route-preview-map{position:relative;z-index:0}
body.route-planning-active #route-preview-map{border-color:#365c7c;box-shadow:0 8px 28px #0108137a}
body.route-planning-active .route-result-panel{padding:14px}
body.route-planning-active .route-visit-sequence li.route-stop-card{border-color:#2c4c69;background:linear-gradient(120deg,#122b44,#0e2035);box-shadow:0 5px 16px #01081338,inset 0 1px #b8e2ff0c;transition:transform .24s var(--m08-motion),border-color .2s,background .2s,box-shadow .2s}
body.route-planning-active .route-visit-sequence li.route-stop-card:hover{border-color:#3d80aa;box-shadow:0 9px 22px #01081355,0 0 0 1px #35d7ff1a}
body.route-planning-active .route-visit-sequence li.route-stop-card.is-drop-before,body.route-planning-active .route-visit-sequence li.route-stop-card.is-drop-after{border-color:#35d7ff;background:#123351;box-shadow:0 0 20px #1684ff38,inset 0 0 0 1px #35d7ff45;}
body.route-planning-active .route-drag-handle{border-color:#376486!important;background:linear-gradient(145deg,#123250,#0a1a2c)!important;box-shadow:inset 0 1px #b4e7ff18}
body.route-planning-active .route-order-pending{border-color:#8d6a2e;background:linear-gradient(110deg,#342a18,#211e19);box-shadow:0 0 22px #f4b84b12}
body.route-planning-active .route-map-metrics article,body.route-planning-active .route-results-summary article{border-color:#294d6c;background:linear-gradient(140deg,#112943,#0b1b2e);box-shadow:inset 0 1px #b6e4ff12}
body.route-planning-active .route-map-toolbar button,body.route-planning-active .route-heading-actions button{border-color:#315577;background:#102943;color:#e8f5ff}
body.route-planning-active #route-save-button{background:linear-gradient(110deg,#0d579d,#087fca);border-color:#208fe0}
body.route-planning-active #route-publish-button{background:linear-gradient(110deg,#087551,#10a575);border-color:#31cb98;color:#fff}
body.executive-dashboard-active .exec-metric,body.executive-dashboard-active .exec-card{border-color:#284b69;background:linear-gradient(145deg,#10243b,#0a192b);box-shadow:0 12px 32px #01081345,inset 0 1px #b4e0ff10}
body.executive-dashboard-active .exec-metric:hover{border-color:#3c79a1;box-shadow:0 13px 30px #01081366,0 0 20px #1684ff17}
.intel-map-card,.intel-left-panel,.intel-detail-panel,.intel-bottom-card,.map-card,.operator-panel,.directory,.operation-page,.operation-subpanel,.operation-block,.saved-route-section{border-color:#284b69;box-shadow:0 12px 32px #0108134a,inset 0 1px #b4e0ff0c}
.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#0b1b2e;color:#f0f7ff}
.leaflet-control-zoom a{background:#0d2239!important;border-color:#345979!important;color:#f0f7ff!important}
.app-message:not([hidden]){box-shadow:0 14px 38px #0009,0 0 20px #24ca9120}

/* Movimento observável em navegação e estados de interação, sem atingir a camada SVG do Leaflet. */
@keyframes m08-screen-enter{from{opacity:0;transform:translateY(9px) scale(.997);filter:brightness(.88)}to{opacity:1;transform:translateY(0) scale(1);filter:brightness(1)}}
@keyframes m08-card-enter{from{opacity:0;transform:translateY(11px)}to{opacity:1;transform:translateY(0)}}
@keyframes m08-route-glow{0%,100%{box-shadow:0 5px 16px #01081338,inset 0 1px #b8e2ff0c}50%{box-shadow:0 10px 26px #01081370,0 0 17px #1684ff22,inset 0 1px #b8e2ff18}}
body.route-planning-active #route-planning-panel:not([hidden]),body.executive-dashboard-active #overview-panel:not([hidden]),body.executive-dashboard-active #map-panel:not([hidden]),#operator-authenticated:not([hidden]) .operator-app-main{animation:m08-screen-enter .34s var(--m08-motion) both}
body.route-planning-active .route-stop-card{animation:m08-card-enter .28s var(--m08-motion) both}
body.route-planning-active .route-stop-card:nth-child(2){animation-delay:25ms}body.route-planning-active .route-stop-card:nth-child(3){animation-delay:45ms}body.route-planning-active .route-stop-card:nth-child(4){animation-delay:65ms}
body.route-planning-active .route-visit-sequence li.route-stop-card.is-drag-source{animation:m08-route-glow .8s ease-in-out infinite}
body.route-planning-active .route-visit-sequence li.route-stop-card.is-drop-before,body.route-planning-active .route-visit-sequence li.route-stop-card.is-drop-after{animation:m08-route-glow .7s ease-in-out infinite}
dialog[open],.remote-dialog[open]{animation:m08-screen-enter .22s var(--m08-motion) both}
body.route-planning-active #route-planning-panel button:not(:disabled):hover,.operator-app-main button:not(:disabled):hover{transform:translateY(-1px)}
@media(max-width:1360px) and (min-width:901px){body.route-planning-active .route-planning-heading{display:grid;grid-template-columns:minmax(0,1fr);align-items:start;gap:10px;padding:13px 16px}body.route-planning-active .route-heading-actions{justify-content:flex-start;align-items:end;gap:7px}body.route-planning-active .route-workspace{grid-template-columns:minmax(215px,.74fr) minmax(370px,1.26fr)}body.route-planning-active .route-controls{grid-column:1;grid-row:1/span 2}body.route-planning-active .route-map-panel{grid-column:2;grid-row:1}body.route-planning-active .route-result-panel{grid-column:2;grid-row:2}}
@media(max-width:900px){body.route-planning-active .route-workspace{display:flex;flex-direction:column}body.route-planning-active .route-result-panel{max-height:none}body.route-planning-active .route-result-panel>.route-results{max-height:70vh;overflow:auto}}
@media(max-width:560px){.page input:not([type=checkbox]):not([type=radio]):not([type=range]),.page select,.page textarea,.operator-app-main button,.operator-app-main a{min-height:44px}body.route-planning-active .route-map-panel{padding:9px}body.route-planning-active .route-result-panel{padding:11px}.operator-app-header{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right));padding-top:max(10px,env(safe-area-inset-top))}.operator-app-main{padding-bottom:max(30px,env(safe-area-inset-bottom))}.operator-app-main .operator-route-map,.operator-app-main #portal-route-map{height:42vh;min-height:270px}}
@media(prefers-reduced-motion:reduce){body.route-planning-active #route-planning-panel:not([hidden]),body.executive-dashboard-active #overview-panel:not([hidden]),body.executive-dashboard-active #map-panel:not([hidden]),#operator-authenticated:not([hidden]) .operator-app-main,body.route-planning-active .route-stop-card,body.route-planning-active .route-visit-sequence li.route-stop-card.is-drag-source,body.route-planning-active .route-visit-sequence li.route-stop-card.is-drop-before,body.route-planning-active .route-visit-sequence li.route-stop-card.is-drop-after,dialog[open],.remote-dialog[open]{animation:none!important}body.route-planning-active #route-planning-panel *,body.executive-dashboard-active #overview-panel *,body.executive-dashboard-active #map-panel *,#operator-authenticated *{scroll-behavior:auto!important;transition:none!important}body.route-planning-active #route-planning-panel button:not(:disabled):hover,.operator-app-main button:not(:disabled):hover{transform:none}}
