/* Oficina Portátil V41 · Apps nativos */
[data-op-legacy-native="1"]{display:none!important}
[data-op-totem-hidden="1"]{display:none!important}
.navigation [data-op-native] svg{width:20px;height:20px;flex:0 0 auto}
.navigation [data-op-native].active{background:var(--nav-active,rgba(255,255,255,.12));color:var(--nav-active-text,#fff)}
body[data-op-native-open] .navigation>button.active:not([data-op-native]){background:transparent!important;color:inherit!important}
.workspace>main.op-native-active>.route-view:not(#op-native-root){display:none!important}
#op-native-root{max-width:1460px;margin:0 auto;min-height:calc(100vh - 180px)}
#op-native-root[hidden]{display:none!important}
.op-native-page{animation:opNativeIn .18s ease-out}
@keyframes opNativeIn{from{opacity:.2;transform:translateY(7px)}to{opacity:1;transform:none}}
.op-native-heading{margin:0 0 22px}.op-native-heading .eyebrow{display:block;margin-bottom:7px}.op-native-heading h1{margin:0;color:var(--text);font-size:clamp(1.8rem,2.4vw,2.7rem);letter-spacing:-.04em}.op-native-heading p{max-width:760px;margin:8px 0 0;color:var(--muted);font-size:1rem}
.op-native-app-card svg{width:28px;height:28px}.op-native-app-card.op-room-tone .app-icon{color:var(--accent)}.op-native-app-card.op-reference-tone .app-icon{color:var(--accent)}
.op-native-app-card .app-meta{color:var(--muted)}
.admin-apps [data-op-native-admin] svg{width:22px;height:22px;flex:0 0 auto}.admin-apps [data-op-native-admin] span{display:flex;flex-direction:column;gap:2px;align-items:flex-start}.admin-apps [data-op-native-admin] small{color:var(--muted)}
.op-reference-frame-wrap{position:relative;min-height:650px;border:1px solid var(--line);border-radius:24px;overflow:hidden;background:var(--panel);box-shadow:var(--shadow);isolation:isolate}
#op-reference-frame{display:block;width:100%;height:calc(100vh - 210px);min-height:650px;border:0;background:transparent;opacity:0;transition:opacity .18s ease}
.op-reference-frame-wrap.loaded #op-reference-frame{opacity:1}.op-reference-loading{position:absolute;inset:0;display:grid;place-items:center;color:var(--muted);font-weight:700;pointer-events:none}.op-reference-frame-wrap.loaded .op-reference-loading{display:none}
.op-native-error{padding:28px;border:1px solid var(--line);border-radius:18px;background:var(--panel);color:var(--text)}
#rb-app.rb-embedded{width:100%}
@media(max-width:800px){#op-native-root{min-height:0}.op-native-heading{margin-bottom:16px}.op-reference-frame-wrap{border-radius:18px;min-height:560px}#op-reference-frame{height:calc(100vh - 175px);min-height:560px}}

/* Oficina Portátil V42 · integração visual real */
.op-native-app-card.teal,.op-native-app-card.blue{color:#fff}
.op-native-app-card .app-icon{color:#fff!important}
.op-native-app-card .app-content small,.op-native-app-card .app-meta{color:#ffffffb8!important}
.op-native-app-card .app-meta i{background:#b8ffe8!important}
.op-native-app-card .card-number{pointer-events:none}

/* Entrada nativa dentro de Administrativo > Acessos */
.op-registration-entry{margin:0 0 18px;padding:0;overflow:hidden}
.op-registration-entry>button{width:100%;min-height:92px;padding:18px 20px;display:grid;grid-template-columns:48px minmax(0,1fr) auto 22px;align-items:center;gap:14px;text-align:left;background:transparent;color:var(--text)}
.op-registration-entry>button:hover{background:color-mix(in srgb,var(--accent) 6%,transparent)}
.op-registration-entry-icon{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;background:color-mix(in srgb,var(--accent) 12%,var(--panel-solid));color:var(--accent)}
.op-registration-entry-icon svg{width:23px;height:23px}
.op-registration-entry button>span:nth-child(2){display:grid;gap:3px}
.op-registration-entry small{font-size:10px;letter-spacing:.12em;color:var(--muted);font-weight:800}
.op-registration-entry strong{font-size:18px}
.op-registration-entry em{font-style:normal;color:var(--muted);font-size:12px}
.op-registration-entry b{min-width:34px;height:34px;border-radius:999px;display:grid;place-items:center;background:var(--accent);color:#fff}
.op-registration-entry>button>svg{width:19px}

.op-registration-page{max-width:1220px;margin:0 auto}
.op-registration-toolbar{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:18px;margin-bottom:22px}
.op-registration-toolbar>div{min-width:0}.op-registration-toolbar h1{margin:5px 0 4px;font-size:clamp(30px,4vw,50px);letter-spacing:-.04em}.op-registration-toolbar p{margin:0;color:var(--muted)}
.op-registration-sync{display:grid;gap:3px;min-width:180px;padding:12px 14px;border:1px solid var(--line);background:var(--panel);border-radius:14px}.op-registration-sync small{color:var(--muted);font-size:10px}.op-registration-sync strong{font-size:12px}
.op-registration-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:18px}.op-registration-kpis>span{display:grid;gap:4px;padding:16px 18px;border:1px solid var(--line);background:var(--panel);border-radius:16px;box-shadow:var(--shadow)}.op-registration-kpis small{color:var(--muted)}.op-registration-kpis strong{font-size:20px}
.op-registration-list{display:grid;gap:12px}.op-registration-card{border:1px solid var(--line);background:var(--panel);border-radius:20px;padding:18px;box-shadow:var(--shadow)}
.op-registration-card>header{display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:12px}.op-registration-avatar{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;background:var(--accent);color:#fff;font-size:20px;font-weight:800}.op-registration-card h3{margin:0;font-size:20px}.op-registration-card header p{margin:3px 0 0;color:var(--muted)}.op-registration-status{padding:6px 10px;border-radius:999px;background:#ffb34724;color:#b06b00;font-size:11px;font-weight:800}
.op-registration-data{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:16px 0}.op-registration-data>span{display:grid;gap:4px;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:color-mix(in srgb,var(--panel-solid) 82%,transparent)}.op-registration-data small{color:var(--muted);font-size:10px}.op-registration-data strong{font-size:12px;overflow-wrap:anywhere}
.op-registration-card>footer{display:flex;justify-content:flex-end;gap:9px;border-top:1px solid var(--line);padding-top:14px}.op-registration-empty{min-height:260px;border:1px dashed var(--line);border-radius:20px;background:var(--panel);display:grid;place-items:center;align-content:center;gap:9px;text-align:center;color:var(--muted)}.op-registration-empty svg{width:38px;height:38px;color:var(--accent)}.op-registration-empty strong{color:var(--text);font-size:19px}
.op-registration-recent{margin-top:22px;border:1px solid var(--line);border-radius:20px;background:var(--panel);overflow:hidden}.op-registration-recent>header{padding:18px}.op-registration-recent h2{margin:4px 0 0}.op-registration-recent>div{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:12px;padding:13px 18px;border-top:1px solid var(--line)}.op-registration-recent>div>span{display:grid}.op-registration-recent small{color:var(--muted)}.op-registration-recent b{padding:5px 9px;border-radius:999px;font-size:11px}.op-registration-recent b.approved{background:#39c98c20;color:#168357}.op-registration-recent b.denied{background:#e6535320;color:#b13535}.op-registration-recent em{font-style:normal;color:var(--muted);font-size:11px}
.op-registration-loading{min-height:360px;display:grid;place-items:center;color:var(--muted);font-weight:800}

/* referênCIA ocupa a área do portal, sem parecer um segundo site */
.op-reference-frame-wrap{background:transparent!important;box-shadow:none;border-color:var(--line)}
#op-reference-frame{background:transparent!important}

@media(max-width:900px){.op-registration-toolbar{grid-template-columns:1fr}.op-registration-sync{min-width:0}.op-registration-kpis{grid-template-columns:1fr}.op-registration-data{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.op-registration-entry>button{grid-template-columns:42px minmax(0,1fr) auto}.op-registration-entry>button>svg{display:none}.op-registration-data{grid-template-columns:1fr}.op-registration-card>header{grid-template-columns:42px minmax(0,1fr)}.op-registration-status{grid-column:1/-1;width:max-content}.op-registration-card>footer{flex-direction:column}.op-registration-card>footer button{width:100%}.op-registration-recent>div{grid-template-columns:1fr}}

/* V45.6 — referênCIA / Agendar Sala usam exatamente o fluxo de rolagem das rotas normais. */
#op-native-root.op-native-route-view{
  display:block;
  box-sizing:border-box;
  width:100%;
  max-width:none;
  min-width:0;
  min-height:0;
  margin:0;
  overflow:visible;
}
#op-native-root.op-native-route-view[hidden]{display:none!important}
#op-native-root>.op-native-page{
  box-sizing:border-box;
  width:min(1460px,100%);
  margin:0 auto;
  padding-bottom:60px;
}
.workspace>main.op-native-active{
  /* deliberadamente sem height/overflow: herda o mesmo comportamento da Pesquisa SAP */
  min-width:0;
}
@media(max-width:800px){
  #op-native-root>.op-native-page{padding-bottom:42px}
}


/* V45.6 — arquitetura única de rolagem do portal.
   Desktop: a viewport pertence ao app-shell e SOMENTE <main> rola.
   Assim Pesquisa SAP, referênCIA e Agendar Sala usam o mesmo scroller. */
@media (min-width: 821px){
  .app-shell{
    height:100dvh!important;
    min-height:0!important;
    max-height:100dvh!important;
    overflow:hidden!important;
  }
  .app-shell>.workspace{
    height:100dvh!important;
    min-height:0!important;
    max-height:100dvh!important;
    overflow:hidden!important;
    display:flex!important;
    flex-direction:column!important;
  }
  .app-shell>.workspace>.topbar{
    flex:0 0 86px!important;
    height:86px!important;
    min-height:86px!important;
  }
  .app-shell>.workspace>main{
    flex:1 1 0%!important;
    min-height:0!important;
    height:auto!important;
    max-height:none!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-y!important;
  }
  .app-shell>.workspace>main>#op-native-root,
  .app-shell>.workspace>main>#op-native-root>.op-native-page{
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
  }
}


/* V45.7 — ao recolher a lateral, ela NÃO pode derrubar o flex que cria o scroller de <main>. */
@media (min-width:821px){
  .app-shell.op-sidebar-collapsed-native{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    height:100dvh!important;
    min-height:0!important;
    max-height:100dvh!important;
    overflow:hidden!important;
  }
  .app-shell.op-sidebar-collapsed-native>.workspace{
    display:flex!important;
    flex-direction:column!important;
    flex:1 1 auto!important;
    width:100%!important;
    height:100dvh!important;
    min-height:0!important;
    max-height:100dvh!important;
    overflow:hidden!important;
  }
  .app-shell.op-sidebar-collapsed-native>.workspace>.topbar{
    flex:0 0 86px!important;
  }
  .app-shell.op-sidebar-collapsed-native>.workspace>main{
    display:block!important;
    flex:1 1 0%!important;
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    height:auto!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-y!important;
  }
}

/* V45.7 — ordem fixa da topbar: busca -> claro/escuro -> notificações. */
.topbar .top-actions>.command-button{order:10!important}
.topbar .top-actions>button[aria-label="Alternar tema"]{order:20!important}
.topbar .top-actions>.notification{order:30!important}
.topbar .top-actions>.top-disconnect{order:40!important}
.topbar .top-actions>.top-profile-button,
.topbar .top-actions>.top-avatar{order:50!important}

/* No Totem, o título da própria topbar já diz Agendar Sala. Recupera o espaço do cabeçalho duplicado. */
body.op-native-totem[data-op-native-open="room"] #op-native-root [data-native-page="room"]>.op-native-heading{
  display:none!important;
}
body.op-native-totem[data-op-native-open="room"] #op-native-root>.op-native-page{
  padding-top:0!important;
}
html.op-totem-aprv body.op-native-totem[data-op-native-open="room"] .app-shell>.workspace>main{
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch!important;
  touch-action:pan-y!important;
  overscroll-behavior-y:contain!important;
}
html.op-totem-aprv body.op-native-totem[data-op-native-open="room"] #rb-app.rb-embedded{
  min-height:0!important;
  height:auto!important;
  overflow:visible!important;
}

/* V45.7.1 — o botão de tema nunca some da topbar, inclusive no Totem/tablet. */
.topbar .top-actions>button[aria-label="Alternar tema"]{
  display:grid!important;
  order:20!important;
}
.topbar .top-actions>.notification-center{order:30!important}

/* V45.7.1 — no Totem, Agendar Sala usa a mesma viewport fixa + main rolável em QUALQUER largura. */
html.op-totem-aprv body.op-native-totem[data-op-native-open="room"] .app-shell{
  height:100dvh!important;
  min-height:0!important;
  max-height:100dvh!important;
  overflow:hidden!important;
}
html.op-totem-aprv body.op-native-totem[data-op-native-open="room"] .app-shell>.workspace{
  display:flex!important;
  flex-direction:column!important;
  height:100dvh!important;
  min-height:0!important;
  max-height:100dvh!important;
  overflow:hidden!important;
}
html.op-totem-aprv body.op-native-totem[data-op-native-open="room"] .app-shell>.workspace>.topbar{
  flex:0 0 86px!important;
  height:86px!important;
  min-height:86px!important;
}
html.op-totem-aprv body.op-native-totem[data-op-native-open="room"] .app-shell>.workspace>main{
  flex:1 1 0%!important;
  min-height:0!important;
  height:auto!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  touch-action:pan-y!important;
  -webkit-overflow-scrolling:touch!important;
}
