/* NEXEI 3.1.5 - Dashboard editável, ações uniformes, Assistant prioritário e cartão de usuário compacto */

/* 1. Barra global de ações dos documentos: um único componente visual. */
body.page-view .details .actions{
  display:flex!important;
  flex-flow:row nowrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:9px!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:auto!important;
  min-height:42px!important;
  margin:0 0 12px -7px!important;
  padding:3px 10px 3px 7px!important;
  box-sizing:border-box!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:none!important;
  scroll-padding-left:0!important;
}
body.page-view .details .actions::-webkit-scrollbar{display:none!important}
body.page-view .details .actions>form,
body.page-view .details .actions>a,
body.page-view .details .actions>button{
  flex:0 0 38px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:38px!important;
  min-width:38px!important;
  max-width:38px!important;
  height:38px!important;
  min-height:38px!important;
  max-height:38px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-sizing:border-box!important;
  position:relative!important;
  inset:auto!important;
  transform:none!important;
}
body.page-view .details .actions>form>button,
body.page-view .details .actions>a.icon-btn,
body.page-view .details .actions>button.icon-btn,
body.page-view .details .actions>.copy-barcode-btn{
  flex:0 0 38px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:38px!important;
  min-width:38px!important;
  max-width:38px!important;
  height:38px!important;
  min-height:38px!important;
  max-height:38px!important;
  margin:0!important;
  padding:0!important;
  border:1px solid #e1e8f3!important;
  border-radius:12px!important;
  background:#f3f6fb!important;
  color:#111827!important;
  box-sizing:border-box!important;
  line-height:1!important;
  position:relative!important;
  inset:auto!important;
  transform:none!important;
  overflow:hidden!important;
  box-shadow:none!important;
}
body.page-view .details .actions>form>button:hover,
body.page-view .details .actions>a.icon-btn:hover,
body.page-view .details .actions>button.icon-btn:hover,
body.page-view .details .actions>.copy-barcode-btn:hover{
  background:#e9effa!important;
  border-color:#cad6e8!important;
  transform:translateY(-1px)!important;
}
body.page-view .details .actions>.copy-barcode-btn,
body.page-view .details .actions>a[title="Download"]{
  background:#5b42e8!important;
  border-color:#5b42e8!important;
  color:#fff!important;
}
body.page-view .details .actions>form>button[title="Cancelar"],
body.page-view .details .actions>form>button[title="Excluir"],
body.page-view .details .actions>form>button[title="Excluir rascunho"]{
  background:#fff0f0!important;
  border-color:#f6caca!important;
  color:#991b1b!important;
}
body.page-view .details .actions img,
body.page-view .details .actions svg,
body.page-view .details .actions .action-icon-img,
body.page-view .details .actions .nexei-icon-real,
body.page-view .details .actions .nexei-icon-lite{
  display:block!important;
  flex:0 0 19px!important;
  width:19px!important;
  min-width:19px!important;
  max-width:19px!important;
  height:19px!important;
  min-height:19px!important;
  max-height:19px!important;
  margin:0!important;
  padding:0!important;
  object-fit:contain!important;
  vertical-align:middle!important;
  transform:none!important;
}
/* Mantém o padrão em qualquer tabela que use o componente icon-btn. */
.admin-table .row-actions,.table-actions,.list-actions{align-items:center!important;gap:9px!important}
.admin-table .row-actions .icon-btn,.table-actions .icon-btn,.list-actions .icon-btn{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;
  margin:0!important;padding:0!important;border-radius:12px!important;box-sizing:border-box!important;
}

/* 2. Cartão do usuário: avatar, nome e ações somente. */
.sidebar .user-card-v315{padding:12px!important;gap:10px!important}
.sidebar .user-card-v315 .user-card-top{display:flex!important;align-items:center!important;gap:10px!important;min-width:0!important}
.sidebar .user-card-v315 .sidebar-avatar{flex:0 0 38px!important;width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important}
.sidebar .user-card-v315 .user-card-name{min-width:0!important;display:flex!important;align-items:center!important}
.sidebar .user-card-v315 .user-card-name b{display:block!important;max-width:118px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:13px!important}
.sidebar .user-card-v315 .user-card-actions{display:flex!important;align-items:center!important;gap:14px!important;margin-left:48px!important}
.sidebar .user-card-v315 .user-card-actions a,.sidebar .user-card-v315 .user-card-actions button{font-size:12px!important;font-weight:700!important}

/* 3. O Assistant sempre fica acima do shell, visualizadores e toolbars. */
.nexei-assistant-launcher{z-index:2147483601!important}
.nexei-assistant-modal{z-index:2147483600!important;isolation:isolate!important}
.nexei-assistant-modal .assistant-shell,
.nexei-assistant-modal .assistant-head,
.nexei-assistant-modal .assistant-head-actions,
.nexei-assistant-modal .assistant-form{position:relative!important;z-index:2!important}
.nexei-assistant-modal .assistant-head-actions button{pointer-events:auto!important}

/* 4. Modo real de personalização do Painel Gerencial. */
.dashboard-flow-v315{
  display:grid!important;
  grid-template-columns:repeat(12,minmax(0,1fr))!important;
  gap:18px!important;
  width:100%!important;
  margin-top:16px!important;
}
.dashboard-flow-v315>.dashboard-widget-v309[hidden]{display:none!important}
.dashboard-flow-v315>.dashboard-widget-v309{
  grid-column:span 12!important;
  min-width:0!important;
  margin:0!important;
  position:relative!important;
  transition:opacity .18s ease,transform .18s ease,box-shadow .18s ease!important;
}
.dashboard-flow-v315>.dashboard-widget-v309[data-dashboard-size="small"]{grid-column:span 4!important}
.dashboard-flow-v315>.dashboard-widget-v309[data-dashboard-size="medium"]{grid-column:span 6!important}
.dashboard-flow-v315>.dashboard-widget-v309[data-dashboard-size="large"]{grid-column:span 8!important}
.dashboard-flow-v315>.dashboard-widget-v309[data-dashboard-size="full"]{grid-column:span 12!important}
.dashboard-flow-v315>.dashboard-widget-v309.dashboard-dragging-v315{opacity:.45!important;transform:scale(.99)!important}
.dashboard-flow-v315>.dashboard-widget-v309.dashboard-drop-before-v315::before{
  content:"";position:absolute!important;left:0!important;right:0!important;top:-10px!important;height:4px!important;border-radius:4px!important;background:#5b42e8!important;z-index:30!important
}
.dashboard-edit-mode-v315 .dashboard-widget-v309:not([hidden]){
  outline:2px dashed rgba(91,66,232,.38)!important;
  outline-offset:5px!important;
  cursor:grab!important;
}
.dashboard-edit-mode-v315 .dashboard-widget-v309:active{cursor:grabbing!important}
.dashboard-widget-toolbar-v315{
  position:absolute!important;top:8px!important;right:8px!important;z-index:35!important;
  display:flex!important;align-items:center!important;gap:5px!important;padding:5px!important;
  border:1px solid #dfe6f2!important;border-radius:12px!important;background:rgba(255,255,255,.96)!important;
  box-shadow:0 8px 24px rgba(15,23,42,.14)!important;cursor:default!important
}
.dashboard-widget-toolbar-v315 button{
  width:30px!important;height:30px!important;min-width:30px!important;padding:0!important;border:1px solid #e4e9f3!important;border-radius:9px!important;background:#f8faff!important;color:#27334d!important;cursor:pointer!important
}
.dashboard-widget-toolbar-v315 button:hover{background:#eef2ff!important;color:#4338ca!important}
.dashboard-widget-toolbar-v315 .dashboard-remove-v315{background:#fff1f2!important;color:#be123c!important;border-color:#fecdd3!important}
.dashboard-custom-widget-v315{
  min-height:260px!important;padding:18px!important;border:1px solid #dfe6f2!important;border-radius:20px!important;background:#fff!important;box-shadow:0 12px 32px rgba(15,23,42,.06)!important;overflow:hidden!important
}
.dashboard-custom-widget-v315 h3{margin:0 0 4px!important;font-size:16px!important}.dashboard-custom-widget-v315 .dash-subtitle{margin:0 0 16px!important;color:#64748b!important;font-size:12px!important}
.dashboard-bars-v315{display:grid!important;gap:10px!important}.dashboard-bar-row-v315{display:grid!important;grid-template-columns:minmax(80px,150px) minmax(80px,1fr) auto!important;align-items:center!important;gap:10px!important;font-size:12px!important}.dashboard-bar-track-v315{height:10px!important;border-radius:999px!important;background:#edf1f8!important;overflow:hidden!important}.dashboard-bar-fill-v315{height:100%!important;border-radius:999px!important;background:linear-gradient(90deg,#4f46e5,#38bdf8)!important}.dashboard-bar-row-v315 b{font-size:12px!important}
.dashboard-donut-wrap-v315{display:grid!important;grid-template-columns:150px 1fr!important;gap:18px!important;align-items:center!important}.dashboard-donut-v315{width:145px!important;height:145px!important;border-radius:50%!important;position:relative!important}.dashboard-donut-v315::after{content:""!important;position:absolute!important;inset:34px!important;border-radius:50%!important;background:#fff!important}.dashboard-legend-v315{display:grid!important;gap:8px!important}.dashboard-legend-v315 div{display:flex!important;align-items:center!important;gap:8px!important;font-size:12px!important}.dashboard-legend-v315 i{width:10px!important;height:10px!important;border-radius:50%!important}.dashboard-legend-v315 b{margin-left:auto!important}
.dashboard-kpi-custom-v315{display:flex!important;min-height:170px!important;flex-direction:column!important;justify-content:center!important;align-items:center!important;text-align:center!important}.dashboard-kpi-custom-v315 strong{font-size:46px!important;line-height:1!important;color:#4f46e5!important}.dashboard-kpi-custom-v315 span{margin-top:10px!important;color:#64748b!important}
.dashboard-line-v315{width:100%!important;height:190px!important}.dashboard-line-v315 .grid{stroke:#e7ebf3!important;stroke-width:1!important}.dashboard-line-v315 .line{fill:none!important;stroke:#4f46e5!important;stroke-width:4!important;stroke-linecap:round!important;stroke-linejoin:round!important}.dashboard-line-v315 .area{fill:url(#dashGradientV315)!important;opacity:.28!important}
.dashboard-gauge-v315{width:190px!important;height:95px!important;overflow:hidden!important;margin:28px auto 0!important;position:relative!important}.dashboard-gauge-v315 .arc{width:190px!important;height:190px!important;border-radius:50%!important;background:conic-gradient(from 270deg,#4f46e5 0 var(--gauge),#e8edf6 var(--gauge) 50%,transparent 50% 100%)!important}.dashboard-gauge-v315::after{content:""!important;position:absolute!important;left:28px!important;top:28px!important;width:134px!important;height:134px!important;border-radius:50%!important;background:#fff!important}.dashboard-gauge-value-v315{position:absolute!important;left:0!important;right:0!important;bottom:4px!important;z-index:2!important;text-align:center!important;font-size:28px!important;font-weight:850!important;color:#27334d!important}

.dashboard-editor-backdrop-v315[hidden],.dashboard-editor-v315[hidden]{display:none!important}
.dashboard-editor-backdrop-v315{
  position:fixed!important;inset:0!important;z-index:2147482500!important;background:rgba(15,23,42,.22)!important;pointer-events:none!important
}
.dashboard-editor-v315{
  position:fixed!important;top:76px!important;right:22px!important;bottom:22px!important;width:min(420px,calc(100vw - 32px))!important;
  z-index:2147482501!important;display:flex!important;flex-direction:column!important;border:1px solid #dbe4f2!important;border-radius:22px!important;background:#fff!important;
  box-shadow:0 28px 80px rgba(15,23,42,.24)!important;overflow:hidden!important;pointer-events:auto!important
}
.dashboard-editor-head-v315{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;padding:17px 18px!important;background:linear-gradient(135deg,#172554,#3730a3)!important;color:#fff!important}.dashboard-editor-head-v315 b{display:block!important;font-size:16px!important}.dashboard-editor-head-v315 small{display:block!important;margin-top:3px!important;color:rgba(255,255,255,.75)!important}.dashboard-editor-head-v315 button{width:36px!important;height:36px!important;border:1px solid rgba(255,255,255,.25)!important;border-radius:11px!important;background:rgba(255,255,255,.12)!important;color:#fff!important}
.dashboard-editor-body-v315{flex:1!important;min-height:0!important;overflow:auto!important;padding:16px!important}.dashboard-editor-section-v315{margin-bottom:20px!important}.dashboard-editor-section-v315 h4{margin:0 0 10px!important;font-size:13px!important;text-transform:uppercase!important;letter-spacing:.04em!important;color:#475569!important}.dashboard-existing-list-v315{display:grid!important;gap:8px!important}.dashboard-existing-row-v315{display:grid!important;grid-template-columns:1fr auto!important;align-items:center!important;gap:10px!important;padding:10px 12px!important;border:1px solid #e4eaf4!important;border-radius:13px!important;background:#f8faff!important}.dashboard-existing-row-v315 span{font-weight:700!important;font-size:12px!important}.dashboard-existing-row-v315 input{width:18px!important;height:18px!important}
.dashboard-chart-form-v315{display:grid!important;gap:10px!important}.dashboard-chart-form-v315 label{display:grid!important;gap:5px!important;font-size:12px!important;font-weight:700!important}.dashboard-chart-form-v315 input,.dashboard-chart-form-v315 select{width:100%!important;min-height:40px!important;border:1px solid #dbe4f2!important;border-radius:11px!important;padding:8px 10px!important;background:#fff!important}.dashboard-chart-form-v315 .chart-form-grid{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important}.dashboard-editor-actions-v315{display:flex!important;gap:9px!important;padding:14px 16px!important;border-top:1px solid #e9edf5!important;background:#fff!important}.dashboard-editor-actions-v315 button{flex:1!important}.dashboard-save-state-v315{font-size:11px!important;color:#64748b!important;text-align:center!important;padding:4px 12px 0!important}

@media(max-width:1000px){
  .dashboard-flow-v315>.dashboard-widget-v309[data-dashboard-size="small"],
  .dashboard-flow-v315>.dashboard-widget-v309[data-dashboard-size="medium"],
  .dashboard-flow-v315>.dashboard-widget-v309[data-dashboard-size="large"]{grid-column:span 12!important}
}
@media(max-width:520px){
  body.page-view .details .actions{gap:7px!important;margin-left:-4px!important;padding-right:8px!important}
  body.page-view .details .actions>form,body.page-view .details .actions>a,body.page-view .details .actions>button,
  body.page-view .details .actions>form>button,body.page-view .details .actions>a.icon-btn,body.page-view .details .actions>button.icon-btn,body.page-view .details .actions>.copy-barcode-btn{
    flex-basis:36px!important;width:36px!important;min-width:36px!important;max-width:36px!important;height:36px!important;min-height:36px!important;max-height:36px!important
  }
  .dashboard-editor-v315{top:12px!important;right:12px!important;bottom:12px!important;width:calc(100vw - 24px)!important}
  .dashboard-donut-wrap-v315{grid-template-columns:1fr!important;justify-items:center!important}
}
