/* V1.03.8.80 — Mobile SGO com 4 menus oficiais. Desktop intocado. */
@media (max-width:900px){
  html.sgo-mobile49, html.sgo-mobile49 body{overflow-x:hidden!important;background:#eef3f0!important}
  html.sgo-mobile49 body{--m49-bg:#f4f7f5;--m49-surface:#fff;--m49-soft:#f7faf8;--m49-text:#17251e;--m49-muted:#69776f;--m49-line:#dce5e0;--m49-g950:#07372a;--m49-g900:#0a4938;--m49-g800:#0f5d43;--m49-g700:#177a50;--m49-g100:#dfeee6;--m49-g50:#eff7f3;--m49-danger:#d83d34;--m49-warn:#e6aa13;--m49-blue:#358bd0;--m49-purple:#7954d8;--m49-shadow:0 7px 22px rgba(7,55,42,.075)}
  html.sgo-mobile49[data-sgo-mobile49-theme="dark"] body{--m49-bg:#08110e;--m49-surface:#101a16;--m49-soft:#14201b;--m49-text:#edf5f1;--m49-muted:#a0b0a8;--m49-line:#27372f;--m49-g100:#17382b;--m49-g50:#10261d;--m49-shadow:0 8px 22px rgba(0,0,0,.22);background:#08110e!important}
  html.sgo-mobile49 #appView{display:block!important;min-height:100dvh!important;background:var(--m49-bg)!important;color:var(--m49-text)!important;padding:0!important}
  html.sgo-mobile49 #appView.hidden{display:none!important}
  html.sgo-mobile49 #sidebarPrincipal,html.sgo-mobile49 #btnSidebarHandle,html.sgo-mobile49 #appView>.app.main>.topbar,html.sgo-mobile49 #pimsRealtimeClockDock{display:none!important}
  html.sgo-mobile49 #appView>.app.main{margin:0!important;padding:0!important;width:100%!important;max-width:none!important;min-height:100dvh!important;background:var(--m49-bg)!important;overflow:visible!important}
  html.sgo-mobile49 #menuHost{background:var(--m49-bg)!important;color:var(--m49-text)!important;padding:calc(138px + env(safe-area-inset-top)) 10px calc(84px + env(safe-area-inset-bottom))!important;min-height:100dvh!important;overflow:visible!important}
  html.sgo-mobile49 #menuHost>.menu-fragment{background:transparent!important;color:var(--m49-text)!important;min-height:0!important;overflow:visible!important}
  html.sgo-mobile49 body.sgo49-overview-open #menuHost,html.sgo-mobile49 body.sgo49-semaforo-open #menuHost{visibility:hidden!important;height:0!important;min-height:0!important;padding:0!important;overflow:hidden!important}

  /* Cabeçalho mobile oficial */
  .sgo49-header{position:fixed;z-index:850;top:0;left:0;right:0;padding:calc(8px + env(safe-area-inset-top)) 11px 8px;background:color-mix(in srgb,var(--m49-surface) 96%,transparent);backdrop-filter:blur(16px);border-bottom:1px solid var(--m49-line);box-shadow:0 4px 14px rgba(7,55,42,.055)}
  .sgo49-header-main{display:flex;align-items:center;gap:9px;min-height:44px}.sgo49-logo{width:43px;height:40px;border:1px solid var(--m49-line);border-radius:10px;background:#fff;display:grid;place-items:center;overflow:hidden;flex:none}.sgo49-logo img{width:37px;height:auto}.sgo49-brand{flex:1;min-width:0}.sgo80-title-row{display:flex;align-items:center;gap:6px;min-width:0}.sgo80-title-row>b{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--m49-g900);font-size:13px;letter-spacing:-.25px}.sgo80-rotation{flex:none;color:#fff;background:var(--m49-g800);border-radius:999px;padding:3px 6px;font-size:7px;font-weight:900}.sgo80-grinding-meta{display:flex!important;gap:5px;align-items:center;color:var(--m49-muted);font-size:6.5px;white-space:nowrap;overflow-x:auto;scrollbar-width:none}.sgo80-grinding-meta::-webkit-scrollbar{display:none}.sgo80-grinding-meta>b,.sgo80-grinding-meta>span{display:inline;max-width:84px;overflow:hidden;text-overflow:ellipsis}.sgo80-grinding-meta>b{color:var(--m49-g700)}.sgo49-header-actions{display:flex;gap:5px}.sgo49-icon{width:37px;height:37px;border:1px solid var(--m49-line);border-radius:10px;background:var(--m49-surface);color:var(--m49-g800);display:grid;place-items:center;padding:0}.sgo49-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8}.sgo49-icon[hidden]{display:none!important}
  .sgo49-statusline{display:flex;gap:6px;align-items:center;overflow-x:auto;scrollbar-width:none;margin-top:6px}.sgo49-statusline::-webkit-scrollbar{display:none}.sgo49-pill{white-space:nowrap;font-size:7.5px;font-weight:800;color:var(--m49-muted);background:var(--m49-soft);border:1px solid var(--m49-line);border-radius:999px;padding:4px 7px}.sgo49-pill .live{display:inline-block;width:6px;height:6px;border-radius:50%;background:#44ad68;margin-right:4px}
  .sgo49-consult-tabs{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;margin-top:7px;padding-bottom:1px}.sgo49-consult-tabs::-webkit-scrollbar{display:none}.sgo49-consult-tabs button{border:1px solid var(--m49-line);background:var(--m49-surface);color:var(--m49-text);border-radius:8px;padding:6px 9px;font-size:8px;font-weight:800;white-space:nowrap}.sgo49-consult-tabs button.active{background:linear-gradient(135deg,var(--m49-g900),var(--m49-g700));color:#fff;border-color:var(--m49-g700)}

  /* Visão Geral e Semáforo, alimentados pelos mesmos endpoints oficiais */
  .sgo49-custom-view{position:relative;z-index:1;padding:calc(138px + env(safe-area-inset-top)) 10px calc(84px + env(safe-area-inset-bottom));min-height:100dvh;background:var(--m49-bg);color:var(--m49-text)}
  .sgo49-custom-view[hidden]{display:none!important}.sgo49-search{display:grid;grid-template-columns:1fr 42px;gap:7px;margin-bottom:10px}.sgo49-search input{height:43px;border:1px solid var(--m49-line);border-radius:12px;background:var(--m49-surface);color:var(--m49-text);padding:0 12px;font-size:12px;outline:none}.sgo49-search button{border:0;border-radius:12px;background:var(--m49-g800);color:#fff;font-weight:900}
  .sgo49-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.sgo49-card{background:var(--m49-surface);border:1px solid var(--m49-line);border-radius:14px;box-shadow:var(--m49-shadow);padding:11px}.sgo49-card small{display:block;color:var(--m49-muted);font-size:7.5px;font-weight:850;text-transform:uppercase;letter-spacing:.04em}.sgo49-card strong{display:block;color:var(--m49-text);font-size:23px;letter-spacing:-.65px;margin-top:5px}.sgo49-card em{display:block;color:var(--m49-muted);font-style:normal;font-size:8px;margin-top:3px}.sgo49-card.action{min-height:104px;display:flex;flex-direction:column;justify-content:space-between}.sgo49-card.action button{border:0;background:transparent;color:var(--m49-g700);font-size:8px;font-weight:900;text-align:left;padding:0;margin-top:8px}
  .sgo49-section-title{display:flex;justify-content:space-between;align-items:center;margin:13px 1px 8px}.sgo49-section-title b{font-size:11px}.sgo49-section-title span{font-size:7.5px;color:var(--m49-muted)}
  .sgo49-semaforo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.sgo49-sem{border:1px solid var(--m49-line);background:var(--m49-surface);border-radius:12px;box-shadow:var(--m49-shadow);padding:9px 6px;text-align:center;min-height:70px}.sgo49-sem i{display:block;width:8px;height:8px;border-radius:50%;margin:0 auto 5px}.sgo49-sem span{display:block;font-size:6.7px;font-weight:900;color:var(--m49-muted);line-height:1.15;min-height:16px}.sgo49-sem b{display:block;font-size:19px;margin-top:4px}.sgo49-sem[data-sem]{cursor:pointer}
  .sgo49-os-list{display:grid;gap:7px}.sgo49-os-card{border:1px solid var(--m49-line);background:var(--m49-surface);border-radius:12px;padding:10px;box-shadow:var(--m49-shadow)}.sgo49-os-head{display:flex;justify-content:space-between;gap:8px}.sgo49-os-head b{font-size:10px}.sgo49-os-head span{font-size:7px;font-weight:900;color:#147544;background:#e4f3e9;border-radius:6px;padding:4px 5px}.sgo49-os-card p{font-size:8px;color:var(--m49-muted);margin:4px 0 0;line-height:1.3}
  .sgo49-loading{padding:24px 10px;text-align:center;color:var(--m49-muted);font-size:9px}.sgo49-warning{border:1px solid #ecd9a8;background:#fff7df;color:#7e5b11;border-radius:10px;padding:9px;font-size:8px;margin-bottom:8px}

  /* Barra inferior: quatro menus oficiais lado a lado */
  .sgo49-bottom-nav{position:fixed;z-index:900;left:0;right:0;bottom:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px;background:color-mix(in srgb,var(--m49-surface) 97%,transparent);backdrop-filter:blur(16px);border-top:1px solid var(--m49-line);padding:6px 6px calc(6px + env(safe-area-inset-bottom));box-shadow:0 -7px 20px rgba(7,55,42,.07)}.sgo49-bottom-nav button{min-width:0;border:0;background:transparent;color:var(--m49-muted);border-radius:10px;padding:6px 1px;font-size:7px;font-weight:850;overflow:hidden}.sgo49-bottom-nav button span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sgo49-bottom-nav button svg{display:block;width:20px;height:20px;margin:0 auto 3px;fill:none;stroke:currentColor;stroke-width:1.8}.sgo49-bottom-nav button.active{background:var(--m49-g50);color:var(--m49-g800)}

  /* Filtros fora da tela principal, em bottom sheet */
  .sgo49-filter-backdrop{position:fixed;z-index:1200;inset:0;background:rgba(4,18,13,.48);display:none;align-items:flex-end}.sgo49-filter-backdrop.open{display:flex}.sgo49-filter-sheet{width:100%;max-height:82dvh;background:var(--m49-bg);border-radius:20px 20px 0 0;border-top:1px solid var(--m49-line);box-shadow:0 -18px 45px rgba(0,0,0,.22);display:flex;flex-direction:column}.sgo49-filter-head{display:flex;justify-content:space-between;align-items:center;padding:12px;border-bottom:1px solid var(--m49-line)}.sgo49-filter-head b{font-size:12px}.sgo49-filter-head button{width:34px;height:34px;border:1px solid var(--m49-line);border-radius:9px;background:var(--m49-surface);color:var(--m49-text)}.sgo49-filter-body{padding:10px 10px 4px;overflow:auto;overscroll-behavior:contain}.sgo49-filter-foot{display:grid;grid-template-columns:1fr 1fr;gap:7px;padding:8px 10px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--m49-line);background:var(--m49-surface)}.sgo49-filter-foot button{height:40px;border-radius:10px;border:1px solid var(--m49-line);font-size:9px;font-weight:850;background:var(--m49-surface);color:var(--m49-text)}.sgo49-filter-foot .primary{background:var(--m49-g800);color:#fff;border-color:var(--m49-g800)}
  html.sgo-mobile49 body:not(.sgo49-filter-open) #menuHost :is(.consultas-filters,.det-filters,.disp-filters,.gos-filter-panel,.mat-filter-panel){display:none!important}
  .sgo49-filter-body :is(.consultas-filters,.det-filters,.disp-filters,.gos-filter-panel,.mat-filter-panel){display:grid!important;position:static!important;visibility:visible!important;opacity:1!important;max-height:none!important;overflow:visible!important;width:100%!important;background:transparent!important;border:0!important;box-shadow:none!important;margin:0!important;padding:0!important;grid-template-columns:1fr!important;gap:9px!important}
  .sgo49-filter-body .ms-filter{width:100%!important;min-width:0!important}.sgo49-filter-body .field,.sgo49-filter-body label{min-width:0!important;width:100%!important}

  /* Menus oficiais renderizados dentro da nova navegação */
  html.sgo-mobile49 #menuHost :is(.consultas-page,.det-page,.disponibilidade-page,.gos-page,.materiais-page){width:100%!important;max-width:none!important;margin:0!important;padding:0!important;color:var(--m49-text)!important;background:transparent!important}
  html.sgo-mobile49 #menuHost :is(.card,.panel,.table-shell,.mat-card,.mat-panel,.gos-card,.gos-table-card,.process-block,.front-card){border-color:var(--m49-line)!important}

  /* Consultas: tabela vira cartões de leitura rápida */
  html.sgo-mobile49 #tabelaConsultas{display:block!important;width:100%!important;border:0!important;background:transparent!important}html.sgo-mobile49 #tabelaConsultas thead{display:none!important}html.sgo-mobile49 #tabelaConsultas tbody{display:grid!important;gap:8px!important}html.sgo-mobile49 #tabelaConsultas tbody tr{display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px 9px!important;background:var(--m49-surface)!important;border:1px solid var(--m49-line)!important;border-radius:13px!important;padding:10px!important;box-shadow:var(--m49-shadow)!important;height:auto!important;min-height:0!important}html.sgo-mobile49 #tabelaConsultas td{display:block!important;border:0!important;padding:0!important;background:transparent!important;color:var(--m49-text)!important;min-width:0!important;white-space:normal!important;overflow:visible!important;font-size:8.5px!important}html.sgo-mobile49 #tabelaConsultas td:before{content:attr(data-sgo49-label);display:block;color:var(--m49-muted);font-size:6.5px;font-weight:900;text-transform:uppercase;margin-bottom:2px}html.sgo-mobile49 .consultas-table-shell{overflow:visible!important;border:0!important;background:transparent!important;box-shadow:none!important}html.sgo-mobile49 .consultas-pagination-p26{position:static!important;margin-top:10px!important}

  /* Alocação: preserva lógica, compacta apenas visual */
  html.sgo-mobile49 .det-page :is(.process-block,.front-card){border-radius:13px!important;box-shadow:var(--m49-shadow)!important;margin-bottom:8px!important}html.sgo-mobile49 .det-page .process-head{padding:9px!important}html.sgo-mobile49 .det-page .fleet-card{min-width:0!important;max-width:100%!important}html.sgo-mobile49 .det-page .front-grid,html.sgo-mobile49 .det-page .fleet-grid{grid-template-columns:1fr!important;gap:7px!important}html.sgo-mobile49 .det-toolbar{flex-wrap:wrap!important;gap:6px!important}

  /* Disponibilidade: um scroll vertical; matriz é a única área horizontal */
  html.sgo-mobile49 .disp-summary{display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important;margin-bottom:9px!important}.disp-summary-card{min-width:0!important;border-radius:12px!important;padding:9px!important}.disp-summary-card strong{font-size:18px!important}.disp-table-shell{overflow-x:auto!important;overflow-y:visible!important;max-height:none!important;border-radius:12px!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior-x:contain!important}.disp-table-shell #tabelaDisponibilidade{min-width:720px!important}.disp-table-shell #tabelaDisponibilidade th:first-child,.disp-table-shell #tabelaDisponibilidade td:first-child{position:sticky!important;left:0!important;z-index:2!important}

  /* Gestão de O.S. */
  html.sgo-mobile49 .gos-hero{display:none!important}html.sgo-mobile49 .gos-page :is(.gos-card,.gos-table-card){border-radius:13px!important;box-shadow:var(--m49-shadow)!important}.gos-table-shell{overflow:visible!important}.gos-table{display:block!important}.gos-table thead{display:none!important}.gos-table tbody{display:grid!important;gap:8px!important}.gos-table tbody tr{display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px;background:var(--m49-surface)!important;border:1px solid var(--m49-line)!important;border-radius:12px!important;padding:9px!important}.gos-table td{border:0!important;padding:0!important;white-space:normal!important;font-size:8.5px!important}

  /* Materiais: compacta hero, gráficos e tabela em cards */
  html.sgo-mobile49 .mat-command-hero-p26{display:grid!important;grid-template-columns:1fr!important;padding:12px!important;border-radius:14px!important;margin-bottom:8px!important}.mat-command-copy-p26>p,.mat-command-meta-p26,.mat-operational-strip-c7{display:none!important}.mat-command-copy-p26 h2{font-size:20px!important;margin:3px 0!important}.mat-executive-panel{padding:8px!important}.mat-health-card{padding:8px!important}.mat-health-ring{width:72px!important;height:72px!important}.mat-view-switcher{display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px!important;margin:0 0 8px!important}.mat-view-tab{min-width:0!important;padding:8px!important}.mat-view-tab:nth-child(2){display:none!important}.mat-view-tab strong{font-size:9px!important}.mat-view-tab small{font-size:7px!important}.materiais-dashboard{grid-template-columns:1fr!important;gap:8px!important}.materiais-chart-card{padding:10px!important}.mat-table-panel-header p,.mat-panel-header p{display:none!important}.materiais-table-shell{overflow:visible!important;border:0!important;background:transparent!important;box-shadow:none!important}#tabelaMateriais{display:block!important}#tabelaMateriais thead{display:none!important}#tabelaMateriais tbody{display:grid!important;gap:8px!important}#tabelaMateriais tbody tr{display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px 9px!important;background:var(--m49-surface)!important;border:1px solid var(--m49-line)!important;border-radius:12px!important;padding:9px!important;box-shadow:var(--m49-shadow)!important}#tabelaMateriais td{display:block!important;border:0!important;padding:0!important;background:transparent!important;color:var(--m49-text)!important;white-space:normal!important;font-size:8.3px!important;min-width:0!important}#tabelaMateriais td:before{content:attr(data-sgo49-label);display:block;color:var(--m49-muted);font-size:6.3px;font-weight:900;text-transform:uppercase;margin-bottom:2px}

  /* PIMS MAP iframe ocupa toda a área útil */
  html.sgo-mobile49 body[data-current-menu="mapa-equipamentos"] #menuHost{padding-left:0!important;padding-right:0!important;padding-bottom:calc(72px + env(safe-area-inset-bottom))!important}html.sgo-mobile49 .pims-map-page,html.sgo-mobile49 .pims-map-frame-shell{height:calc(100dvh - 138px - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;min-height:520px!important;border:0!important;border-radius:0!important;margin:0!important;overflow:hidden!important}.pims-map-frame{width:100%!important;height:100%!important;border:0!important}

  /* Dark opcional só no mobile */
  html.sgo-mobile49[data-sgo-mobile49-theme="dark"] :is(#menuHost,.sgo49-custom-view){background:var(--m49-bg)!important;color:var(--m49-text)!important}html.sgo-mobile49[data-sgo-mobile49-theme="dark"] #menuHost :is(input,select,textarea,.ms-filter-button,.ms-filter-panel){background:var(--m49-surface)!important;color:var(--m49-text)!important;border-color:var(--m49-line)!important}

  body.sgo49-filter-open{overflow:hidden!important}
}
