/* NEXEI v300 - estabilidade do menu, ações visíveis e miniaturas leves. */

/* O Canvas usa exatamente a mesma geometria do menu das demais páginas. */
@media (min-width:901px){
  html body.page-admin_workflow_canvas .sidebar,
  html body.page-admin_workflow_canvas .sidebar:hover,
  html body.page-admin_workflow_canvas .sidebar:focus,
  html body.page-admin_workflow_canvas .sidebar:focus-within{
    position:fixed!important;
    inset:0 auto 0 0!important;
    box-sizing:border-box!important;
    width:220px!important;
    min-width:220px!important;
    max-width:220px!important;
    height:100vh!important;
    padding:22px 18px!important;
    margin:0!important;
    border-width:0!important;
    transform:none!important;
    translate:none!important;
    scale:1!important;
    transition:none!important;
    animation:none!important;
    overflow:hidden!important;
  }
  html body.page-admin_workflow_canvas .sidebar::before,
  html body.page-admin_workflow_canvas .sidebar::after,
  html body.page-admin_workflow_canvas .sidebar:hover::before,
  html body.page-admin_workflow_canvas .sidebar:hover::after{
    content:none!important;
    display:none!important;
  }
  html body.page-admin_workflow_canvas .sidebar *,
  html body.page-admin_workflow_canvas .sidebar:hover *{
    box-sizing:border-box!important;
    transform:none!important;
  }
  html body.page-admin_workflow_canvas .sidebar .brand,
  html body.page-admin_workflow_canvas .sidebar:hover .brand{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    min-height:42px!important;
    gap:12px!important;
    margin:0 0 30px!important;
    padding:0!important;
  }
  html body.page-admin_workflow_canvas .sidebar nav,
  html body.page-admin_workflow_canvas .sidebar:hover nav{
    display:grid!important;
    width:100%!important;
    gap:8px!important;
    margin:0!important;
    padding:0!important;
  }
  html body.page-admin_workflow_canvas .sidebar nav a,
  html body.page-admin_workflow_canvas .sidebar:hover nav a{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
    min-width:0!important;
    min-height:42px!important;
    height:42px!important;
    gap:10px!important;
    margin:0!important;
    padding:11px 12px!important;
    border-width:0!important;
    transform:none!important;
    transition:background-color .15s ease,color .15s ease,border-color .15s ease!important;
  }
  html body.page-admin_workflow_canvas .sidebar .nav-icon,
  html body.page-admin_workflow_canvas .sidebar:hover .nav-icon{
    flex:0 0 22px!important;
    width:22px!important;
    min-width:22px!important;
    max-width:22px!important;
    height:22px!important;
    margin:0!important;
  }
  html body.page-admin_workflow_canvas .sidebar .brand>div:not(.brand-mark),
  html body.page-admin_workflow_canvas .sidebar:hover .brand>div:not(.brand-mark),
  html body.page-admin_workflow_canvas .sidebar .brand-text,
  html body.page-admin_workflow_canvas .sidebar:hover .brand-text,
  html body.page-admin_workflow_canvas .sidebar .nav-text,
  html body.page-admin_workflow_canvas .sidebar:hover .nav-text,
  html body.page-admin_workflow_canvas .sidebar .user-card,
  html body.page-admin_workflow_canvas .sidebar:hover .user-card{
    display:block!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
  }
  html body.page-admin_workflow_canvas .sidebar .user-card,
  html body.page-admin_workflow_canvas .sidebar:hover .user-card{
    position:absolute!important;
    left:16px!important;
    right:16px!important;
    bottom:18px!important;
    width:auto!important;
    min-width:0!important;
    height:auto!important;
    min-height:76px!important;
    max-height:none!important;
    margin:0!important;
    padding:12px 13px!important;
    transform:none!important;
    transition:none!important;
    overflow:visible!important;
  }
  html body.page-admin_workflow_canvas .main,
  html body.page-admin_workflow_canvas .sidebar + .main,
  html body.page-admin_workflow_canvas .sidebar ~ .main,
  html body.page-admin_workflow_canvas .sidebar:hover + .main,
  html body.page-admin_workflow_canvas .sidebar:hover ~ .main,
  html body.page-admin_workflow_canvas .sidebar:focus-within + .main,
  html body.page-admin_workflow_canvas .sidebar:focus-within ~ .main{
    box-sizing:border-box!important;
    margin-left:220px!important;
    width:calc(100vw - 220px)!important;
    max-width:calc(100vw - 220px)!important;
    transform:none!important;
    translate:none!important;
    transition:none!important;
    animation:none!important;
  }
}

/* Corrige uma regra legada que escondia todos os formulários dos cards. */
.workflow-card-box .workflow-card-actions,
.workflow-card-box .workflow-card-actions-v291{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  margin-top:auto!important;
  padding-top:4px!important;
  flex-wrap:wrap!important;
}
.workflow-card-box .workflow-card-actions form,
.workflow-card-box .workflow-card-actions-v291 form,
.workflow-card-box form.workflow-toggle-form,
.workflow-card-box form.workflow-delete-form{
  display:block!important;
  margin:0!important;
  flex:1 1 92px!important;
}
.workflow-card-box .workflow-card-actions button,
.workflow-card-box .workflow-card-actions-v291 button{
  display:inline-flex!important;
  width:100%!important;
  min-height:34px!important;
}
.workflow-delete-form .danger{
  background:#fff1f2!important;
  color:#be123c!important;
  border:1px solid #fecdd3!important;
  box-shadow:none!important;
}
.workflow-delete-form .danger:hover{background:#ffe4e6!important}

/* Miniaturas em imagem cacheada: evita um visualizador PDF completo por cartão. */
.document-thumb-image{
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  object-fit:contain!important;
  object-position:center!important;
  background:#fff!important;
  border:0!important;
}
.dashboard-thumb .document-thumb-image{border-radius:inherit!important}
.file-thumb-mini .document-thumb-image{width:100%!important;height:100%!important;border-radius:10px!important}

/* Reduz trabalho de pintura fora da área visível nas listagens longas. */
.doc-card,.supplier-process-card,.workflow-card-box{
  content-visibility:auto;
  contain-intrinsic-size:120px;
}

@media (min-width:901px){
  html body.page-admin_workflow_canvas .sidebar .user-card,
  html body.page-admin_workflow_canvas .sidebar:not(:hover) .user-card,
  html body.page-admin_workflow_canvas .sidebar:hover .user-card,
  html body.page-admin_workflow_canvas .sidebar:focus-within .user-card{
    height:98px!important;
    min-height:98px!important;
    max-height:98px!important;
    display:grid!important;
    grid-template-rows:18px 18px 22px!important;
    align-content:center!important;
    row-gap:3px!important;
  }
  html body.page-admin_workflow_canvas .sidebar .user-card b,
  html body.page-admin_workflow_canvas .sidebar:not(:hover) .user-card b,
  html body.page-admin_workflow_canvas .sidebar:hover .user-card b,
  html body.page-admin_workflow_canvas .sidebar .user-card span,
  html body.page-admin_workflow_canvas .sidebar:not(:hover) .user-card span,
  html body.page-admin_workflow_canvas .sidebar:hover .user-card span{
    display:block!important;
    height:18px!important;
    min-height:18px!important;
    max-height:18px!important;
    margin:0!important;
    padding:0!important;
    line-height:18px!important;
    overflow:hidden!important;
  }
  html body.page-admin_workflow_canvas .sidebar .user-card-actions,
  html body.page-admin_workflow_canvas .sidebar:not(:hover) .user-card-actions,
  html body.page-admin_workflow_canvas .sidebar:hover .user-card-actions{
    display:flex!important;
    align-items:center!important;
    gap:12px!important;
    width:100%!important;
    height:22px!important;
    min-height:22px!important;
    max-height:22px!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  html body.page-admin_workflow_canvas .sidebar .user-card-actions a,
  html body.page-admin_workflow_canvas .sidebar:not(:hover) .user-card-actions a,
  html body.page-admin_workflow_canvas .sidebar:hover .user-card-actions a,
  html body.page-admin_workflow_canvas .sidebar .user-card-actions button,
  html body.page-admin_workflow_canvas .sidebar:not(:hover) .user-card-actions button,
  html body.page-admin_workflow_canvas .sidebar:hover .user-card-actions button,
  html body.page-admin_workflow_canvas .sidebar .user-card-actions form,
  html body.page-admin_workflow_canvas .sidebar:not(:hover) .user-card-actions form,
  html body.page-admin_workflow_canvas .sidebar:hover .user-card-actions form{
    display:inline-flex!important;
    align-items:center!important;
    width:auto!important;
    min-width:0!important;
    height:22px!important;
    min-height:22px!important;
    max-height:22px!important;
    margin:0!important;
    padding:0!important;
    line-height:22px!important;
  }
}
