/* NEXEI v3.6.1 - refinamentos sobre a base v3.6.0 validada em producao. */
:root{--nexei-sidebar-v361:96px}

/* --------------------------------------------------------------------------
   SIDEBAR COMPACTA E ESTAVEL
   Mantem exatamente a mesma geometria em normal/hover/focus e tambem no Viewer/BPMN.
   -------------------------------------------------------------------------- */
@media (min-width:901px){
  html body:not(.page-login) .sidebar,
  html body:not(.page-login) .sidebar:hover,
  html body:not(.page-login) .sidebar:focus,
  html body:not(.page-login) .sidebar:focus-within,
  html body:not(.page-login) .sidebar-v351,
  html body:not(.page-login) .sidebar-v351:hover,
  html body:not(.page-login) .sidebar-v352,
  html body:not(.page-login) .sidebar-v352:hover{
    position:fixed!important;left:0!important;top:0!important;bottom:0!important;
    width:var(--nexei-sidebar-v361)!important;min-width:var(--nexei-sidebar-v361)!important;max-width:var(--nexei-sidebar-v361)!important;
    padding:14px 10px!important;margin:0!important;box-sizing:border-box!important;
    transform:none!important;translate:none!important;scale:1!important;
    transition:none!important;animation:none!important;overflow:hidden!important;
  }
  html body:not(.page-login) .sidebar::after,
  html body:not(.page-login) .sidebar:hover::after,
  html body.page-view .sidebar::after,
  html body.page-view .sidebar:hover::after{content:none!important;display:none!important}

  html body:not(.page-login) .sidebar .brand,
  html body:not(.page-login) .sidebar:hover .brand{
    width:76px!important;height:54px!important;min-height:54px!important;
    padding:0!important;margin:0 auto 12px!important;gap:0!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    transform:none!important;translate:none!important;transition:none!important;animation:none!important;
  }
  html body:not(.page-login) .sidebar .brand-mark,
  html body:not(.page-login) .sidebar:hover .brand-mark{
    width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
    flex:0 0 44px!important;margin:0!important;padding:0!important;
    transform:none!important;translate:none!important;scale:1!important;transition:none!important;animation:none!important;
  }
  html body:not(.page-login) .sidebar .brand-mark img,
  html body:not(.page-login) .sidebar:hover .brand-mark img{
    width:44px!important;height:44px!important;object-fit:contain!important;margin:0!important;padding:0!important;
    transform:none!important;translate:none!important;scale:1!important;transition:none!important;animation:none!important;
  }
  /* Nao deixa os textos NEXEI + empresa reaparecerem no hover do Viewer. */
  html body:not(.page-login) .sidebar .brand-copy-v351,
  html body:not(.page-login) .sidebar:hover .brand-copy-v351,
  html body:not(.page-login) .sidebar .brand>div:not(.brand-mark),
  html body:not(.page-login) .sidebar:hover .brand>div:not(.brand-mark),
  html body:not(.page-login) .sidebar .nav-text,
  html body:not(.page-login) .sidebar:hover .nav-text{
    display:none!important;visibility:hidden!important;opacity:0!important;width:0!important;max-width:0!important;
    overflow:hidden!important;margin:0!important;padding:0!important;
  }

  html body:not(.page-login) .sidebar nav,
  html body:not(.page-login) .sidebar:hover nav{
    width:76px!important;max-width:76px!important;margin:0 auto!important;padding:0!important;
    display:flex!important;flex-direction:column!important;align-items:center!important;gap:8px!important;
    transform:none!important;translate:none!important;transition:none!important;animation:none!important;
  }
  html body:not(.page-login) .sidebar nav a,
  html body:not(.page-login) .sidebar nav a:hover,
  html body:not(.page-login) .sidebar nav a:focus,
  html body:not(.page-login) .sidebar:hover nav a{
    position:relative!important;inset:auto!important;
    width:48px!important;min-width:48px!important;max-width:48px!important;
    height:44px!important;min-height:44px!important;max-height:44px!important;
    flex:0 0 44px!important;padding:0!important;margin:0!important;gap:0!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    transform:none!important;translate:none!important;scale:1!important;
    transition:none!important;animation:none!important;box-sizing:border-box!important;
  }
  html body:not(.page-login) .sidebar nav a *,
  html body:not(.page-login) .sidebar nav a:hover *,
  html body:not(.page-login) .sidebar:hover nav a *{
    transform:none!important;translate:none!important;scale:1!important;transition:none!important;animation:none!important;
  }
  html body:not(.page-login) .sidebar .nav-icon,
  html body:not(.page-login) .sidebar .nav-icon:hover{
    width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;max-width:30px!important;max-height:30px!important;
    margin:0!important;padding:0!important;display:flex!important;align-items:center!important;justify-content:center!important;
    transform:none!important;translate:none!important;scale:1!important;transition:none!important;animation:none!important;
  }
  html body:not(.page-login) .sidebar .nav-icon img,
  html body:not(.page-login) .sidebar .nav-icon svg{
    width:28px!important;height:28px!important;min-width:28px!important;max-width:28px!important;
    margin:0!important;padding:0!important;object-fit:contain!important;
    transform:none!important;translate:none!important;scale:1!important;transition:none!important;animation:none!important;
  }
  html body:not(.page-login) .sidebar .user-card-v351,
  html body:not(.page-login) .sidebar:hover .user-card-v351{
    position:absolute!important;left:17px!important;right:auto!important;bottom:14px!important;
    width:62px!important;height:82px!important;max-height:82px!important;padding:0!important;margin:0!important;
    display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-end!important;gap:7px!important;
    overflow:visible!important;transform:none!important;translate:none!important;transition:none!important;animation:none!important;
  }
  html body:not(.page-login) .sidebar .sidebar-profile-v351,
  html body:not(.page-login) .sidebar .sidebar-profile-v351:hover{
    width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;max-width:44px!important;max-height:44px!important;
    flex:0 0 44px!important;padding:0!important;margin:0!important;inset:auto!important;
    transform:none!important;translate:none!important;scale:1!important;transition:none!important;animation:none!important;
  }
  html body:not(.page-login) .sidebar .sidebar-logout-v351,
  html body:not(.page-login) .sidebar .sidebar-logout-v351:hover{
    width:36px!important;height:24px!important;min-height:24px!important;padding:0!important;margin:0!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    transform:none!important;translate:none!important;scale:1!important;transition:none!important;animation:none!important;
  }

  html body:not(.page-login) main.main{margin-left:var(--nexei-sidebar-v361)!important}
  html body.page-view main.main{margin-left:var(--nexei-sidebar-v361)!important;padding-left:10px!important}
  html body.page-admin_workflow_canvas main.main{margin:0!important;padding:0!important}
}

/* Desabilita tooltips antigos para existir apenas um tooltip rico e previsivel. */
.nexei-tooltip-v352,.nexei-tooltip-v359,#nexeiTooltipV360{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important}
.nexei-tooltip-v361{
  position:fixed;z-index:2147483300;width:min(300px,calc(100vw - 120px));padding:10px 12px;border-radius:11px;
  background:#0f172a;color:#fff;box-shadow:0 12px 34px rgba(15,23,42,.28);pointer-events:none;
  display:grid;gap:3px;opacity:0;visibility:hidden;transform:none!important;transition:opacity .08s linear!important;
}
.nexei-tooltip-v361.is-visible{opacity:1;visibility:visible}
.nexei-tooltip-v361 b{font-size:12px;line-height:1.25}.nexei-tooltip-v361 span{font-size:10.5px;line-height:1.35;color:#cbd5e1}

/* --------------------------------------------------------------------------
   VIEWER
   -------------------------------------------------------------------------- */
@media (min-width:1181px){
  body.page-view .viewer{
    grid-template-columns:220px minmax(520px,1fr) minmax(400px,460px)!important;
    gap:10px!important;width:100%!important;max-width:none!important;box-sizing:border-box!important;
  }
}
body.page-view .viewer .files{padding:14px 12px!important;text-align:center!important;overflow-x:hidden!important}
body.page-view .viewer .files>h3{text-align:left!important;margin:2px 4px 12px!important}
body.page-view .viewer .file-item{width:100%!important;max-width:196px!important;display:flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;margin:0 auto 10px!important}
body.page-view .viewer .file-item.main-file{padding:4px!important}
body.page-view .viewer .file-main-link{
  width:100%!important;min-height:168px!important;padding:10px 6px!important;margin:0!important;
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:8px!important;
  text-align:center!important;box-sizing:border-box!important;
}
body.page-view .viewer .file-main-link .file-thumb-mini{margin:0 auto!important;display:grid!important;place-items:center!important}
body.page-view .viewer .file-main-link small{display:block!important;width:100%!important;text-align:center!important;margin:0!important}
body.page-view .viewer .file-item.sub-file{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:6px!important;align-items:center!important;padding:6px 7px!important}
body.page-view .viewer .file-sub-link{
  width:100%!important;min-width:0!important;margin:0!important;padding:7px!important;
  display:grid!important;grid-template-columns:20px minmax(0,1fr)!important;gap:8px!important;align-items:center!important;text-align:left!important;
}
body.page-view .viewer .file-sub-link>span:first-child{display:grid!important;place-items:center!important}
body.page-view .viewer .file-sub-link>span:last-child{min-width:0!important;text-align:left!important;white-space:normal!important;overflow-wrap:anywhere!important}
body.page-view .viewer .file-item.sub-file form{margin:0!important;display:grid!important;place-items:center!important}

body.page-view .viewer .details{padding:12px 15px 18px!important;overflow-x:hidden!important}
body.page-view .viewer .details>.actions{
  display:grid!important;grid-template-columns:repeat(auto-fill,40px)!important;grid-auto-rows:40px!important;
  justify-content:start!important;align-items:center!important;gap:7px!important;
  width:100%!important;min-height:40px!important;padding:0 34px 8px 0!important;margin:0!important;box-sizing:border-box!important;overflow:visible!important;
}
body.page-view .viewer .details>.actions>a,
body.page-view .viewer .details>.actions>button,
body.page-view .viewer .details>.actions>form{
  width:40px!important;height:40px!important;min-width:40px!important;max-width:40px!important;min-height:40px!important;max-height:40px!important;
  margin:0!important;padding:0!important;overflow:visible!important;box-sizing:border-box!important;
}
body.page-view .viewer .details>.actions>form{display:block!important}
body.page-view .viewer .details>.actions .icon-btn{
  width:40px!important;height:40px!important;min-width:40px!important;max-width:40px!important;
  padding:0!important;margin:0!important;display:grid!important;place-items:center!important;overflow:hidden!important;box-sizing:border-box!important;
}
body.page-view .viewer .details>.actions .icon-btn img,
body.page-view .viewer .details>.actions .icon-btn svg{max-width:24px!important;max-height:24px!important;object-fit:contain!important}
body.page-view .viewer-close{right:8px!important;top:64px!important;width:38px!important;height:38px!important;display:grid!important;place-items:center!important}

body.page-view .viewer-fields-v359{width:100%!important;gap:0!important}
body.page-view .viewer-fields-v359 .field-line{
  display:grid!important;grid-template-columns:minmax(170px,1fr) minmax(130px,42%)!important;
  gap:18px!important;align-items:start!important;width:100%!important;box-sizing:border-box!important;padding:9px 2px!important;
}
body.page-view .viewer-fields-v359 .field-line>b{text-align:left!important;justify-self:start!important;min-width:0!important;overflow-wrap:anywhere!important}
body.page-view .viewer-fields-v359 .field-line>span{
  justify-self:end!important;text-align:right!important;width:100%!important;max-width:100%!important;min-width:0!important;
  overflow-wrap:anywhere!important;word-break:normal!important;
}

/* --------------------------------------------------------------------------
   BPMN
   -------------------------------------------------------------------------- */
@media (min-width:901px){
  html body.page-admin_workflow_canvas .bpmn-page-v359{
    left:var(--nexei-sidebar-v361)!important;right:0!important;top:0!important;bottom:0!important;
    width:auto!important;margin:0!important;padding:0!important;
  }
}
.bpmn-page-v359 .djs-palette,
.bpmn-page-v359 .djs-palette:hover{left:0!important;margin:0!important;transform:none!important;translate:none!important;transition:none!important;animation:none!important}
.bpmn-page-v359 .djs-palette .entry,
.bpmn-page-v359 .djs-palette .entry:hover,
.bpmn-page-v359 .djs-palette .entry:focus,
.bpmn-page-v359 .djs-palette .entry *,
.bpmn-page-v359 .djs-palette .entry:hover *{
  transform:none!important;translate:none!important;scale:1!important;transition:none!important;animation:none!important;
}

/* Versoes e metadados do workflow */
.bpmn-title-meta-v361{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:3px;color:#64748b;font-size:11px}
.bpmn-title-meta-v361 .bpmn-last-save-v361{white-space:nowrap}
.bpmn-version-switch-v361{display:flex;align-items:center;gap:6px;border:1px solid #dbe3ef;border-radius:10px;padding:4px 7px;background:#fff}
.bpmn-version-switch-v361 label{font-size:10px;font-weight:800;color:#64748b;text-transform:uppercase;letter-spacing:.04em}
.bpmn-version-switch-v361 select{border:0!important;background:transparent!important;min-width:145px!important;padding:4px 24px 4px 4px!important;font-size:12px!important;box-shadow:none!important}
.bpmn-published-badge-v361{display:inline-flex;align-items:center;padding:3px 7px;border-radius:999px;background:#ecfdf5;color:#047857;font-size:10px;font-weight:800}
.bpmn-page-v359.is-published-view #bpmnSaveV359,
.bpmn-page-v359.is-published-view #bpmnPublishFormV359{display:none!important}
.bpmn-page-v359.is-published-view .djs-palette,
.bpmn-page-v359.is-published-view .djs-context-pad,
.bpmn-page-v359.is-published-view .nexei-bpmn-overlay-v359{display:none!important}
.bpmn-page-v359.is-published-view #nexeiBpmnCanvas .djs-container{pointer-events:none!important}
.bpmn-page-v359.is-published-view .bpmn-inspector-v359{display:none!important}

/* Teste dinamico de vencimentos */
.bpmn-test-field-v359[data-due-index-v361][hidden]{display:none!important}
.bpmn-test-due-hint-v361{grid-column:1/-1;padding:9px 11px;border:1px solid #dbeafe;border-radius:10px;background:#eff6ff;color:#475569;font-size:11px}

@media(max-width:1180px) and (min-width:901px){
  body.page-view .viewer{grid-template-columns:190px minmax(390px,1fr) minmax(350px,400px)!important}
}
