:root{--sidebar-width:248px;--header-height:42px;--footer-height:28px;--app-font-size:.875rem}html,body{height:100%;margin:0;overflow:hidden}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI Variable","Segoe UI",system-ui,ui-sans-serif,Helvetica,Arial,sans-serif;font-size:var(--app-font-size);background:#f5f6f8}.app-container{height:100vh;display:flex;flex-direction:column;min-width:0}.app-header{min-height:var(--header-height);padding:.25rem .65rem;display:flex;align-items:center;gap:.55rem;flex-shrink:0}.header-left{display:flex;gap:.35rem}.app-title{display:inline-flex;align-items:center;justify-content:flex-end;gap:.4rem;margin-left:auto;font-size:.98rem;line-height:1}.btn-icon-text{display:inline-flex;align-items:center;gap:.35rem;line-height:1;padding:.2rem .45rem}.main-content{flex:1 1 auto;overflow:hidden;min-height:0}.workspace{height:100%;display:flex;min-height:0}.desktop-sidebar{position:relative;width:var(--sidebar-width);min-width:var(--sidebar-width);max-width:var(--sidebar-width);background:#fff;border-right:1px solid #dfe3e8;flex-direction:column;min-height:0}.sidebar-collapsed .desktop-sidebar{display:none!important}.sidebar-toolbar{height:34px;display:flex;align-items:center;justify-content:space-between;padding:.35rem .5rem;border-bottom:1px solid #edf0f2}.sidebar-title{font-size:.74rem;text-transform:uppercase;color:#6c757d;font-weight:700;letter-spacing:.035em}.btn-xs{--bs-btn-padding-y:.1rem;--bs-btn-padding-x:.32rem;--bs-btn-font-size:.72rem}.treeview{padding:.35rem;overflow:auto;min-height:0;flex:1}.tree-root,.tree-children{list-style:none;margin:0;padding-left:0}.tree-children{padding-left:.72rem}.tree-node{margin:.04rem 0}.tree-row{display:flex;align-items:center;min-width:0;border-radius:.25rem}.tree-row:hover,.tree-row.is-current{background:#edf7ff}.tree-toggle,.tree-toggle-spacer{width:18px;height:22px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 18px}.tree-toggle{border:0;background:transparent;color:#495057;border-radius:.25rem;font-size:.68rem}.tree-toggle:hover{background:#dee6ef}.tree-link{display:flex;align-items:center;gap:.32rem;padding:.18rem .3rem;text-decoration:none;color:#202428;min-width:0;flex:1}.tree-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tree-item-icon{width:16px;text-align:center;font-size:.82rem}.tree-access-icon{margin-left:auto;color:#6c757d;font-size:.72rem}.tree-node.is-closed>.tree-children{display:none}.tree-type-company>.tree-row .tree-link{font-weight:700}.sidebar-resize-handle{position:absolute;top:0;right:-4px;width:8px;height:100%;cursor:col-resize;z-index:5}.sidebar-resize-handle:hover{background:rgba(13,110,253,.16)}.is-resizing-sidebar{cursor:col-resize;user-select:none}.content-area{flex:1;overflow:auto;padding:.75rem;min-width:0;background:#f8f9fb}.app-footer{height:var(--footer-height);display:flex;align-items:center;padding:0 .65rem;flex-shrink:0}.compact-alert{padding:.35rem 2.25rem .35rem .6rem;margin-bottom:.5rem}.page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;margin-bottom:.65rem}.page-header h1{font-size:1.15rem;margin:0}.compact-panel{background:#fff;border:1px solid #e4e8ed;border-radius:.55rem;padding:.65rem;box-shadow:0 1px 2px rgba(0,0,0,.03)}.section-title{font-size:.92rem;margin:0 0 .45rem;font-weight:700}.mini-title{font-size:.82rem;text-transform:uppercase;color:#6c757d;margin:.25rem 0 .4rem}.info-card{display:flex;gap:.65rem;align-items:flex-start;background:#fff;border:1px solid #e4e8ed;border-radius:.55rem;padding:.65rem;min-height:76px}.info-card>i{font-size:1.35rem;color:#0d6efd}.info-card strong,.info-card span{display:block}.info-card span{font-size:.8rem;color:#6c757d}.breadcrumb-wrap a{text-decoration:none}.toolbar-row{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}.grid-search{max-width:360px}.document-panel{height:calc(100vh - 160px);display:flex;flex-direction:column}.document-grid{flex:1;min-height:280px;border:1px solid #e5e7eb;border-radius:.4rem;overflow:hidden}.tabulator{font-size:.8rem}.child-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:.5rem}.child-card{display:grid;grid-template-columns:22px 1fr;gap:.25rem .4rem;align-items:center;padding:.55rem;border:1px solid #e4e8ed;border-radius:.5rem;background:#fff;text-decoration:none;color:#212529}.child-card:hover{background:#f2f9ff}.child-card small{grid-column:2;color:#6c757d}.json-box,.code-textarea{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:.78rem}.json-box{background:#101418;color:#e9ecef;padding:.7rem;border-radius:.5rem;max-height:420px;overflow:auto}.form-compact .form-label{font-size:.78rem;margin-bottom:.12rem}.checkbox-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:.25rem}.empty-state{height:55vh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#6c757d}.empty-state i{font-size:2rem}.compact-menu .dropdown-item{font-size:.83rem}.auth-body{min-height:100vh;background:linear-gradient(135deg,#edf7ff,#f8f9fb);overflow:auto}.auth-shell{min-height:100vh;display:grid;place-items:center;padding:1rem}.auth-card{width:min(420px,100%);background:#fff;border:1px solid #e4e8ed;border-radius:.8rem;padding:1rem}.auth-brand{display:flex;align-items:center;gap:.5rem;font-weight:700;font-size:1.05rem;margin-bottom:.8rem}.auth-title{font-size:1.15rem;margin:0 0 .75rem}.auth-hint{font-size:.78rem;color:#6c757d;margin-top:.8rem;padding:.5rem;background:#f8f9fa;border-radius:.45rem}.compact-offcanvas-header{padding:.65rem}.offcanvas-title{font-size:.98rem}@media(max-width:767.98px){.app-title span{max-width:44vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content-area{padding:.55rem}.document-panel{height:calc(100vh - 150px)}.page-header{flex-direction:column}}

/* Chiusura centrata negli avvisi flash compatti. */
.compact-alert.alert-dismissible .btn-close{
  top:50%;
  right:.35rem;
  padding:.45rem;
  transform:translateY(-50%);
}

/* Aggiornamenti layout compatto Calypso */
.breadcrumb-meta-row{display:flex;align-items:center;gap:.55rem;flex-wrap:wrap;margin-bottom:.12rem}.breadcrumb-wrap{margin:0;display:inline-flex;align-items:center;gap:.28rem;min-width:0}.item-meta-inline{display:inline-flex;align-items:center;gap:.35rem;flex-wrap:wrap}.item-heading-main{min-width:0;flex:1}.page-actions-stack{display:flex;flex-direction:column;align-items:flex-end;gap:.35rem;min-width:270px}.item-search-box{width:min(360px,34vw);max-width:100%}.document-toolbar{justify-content:flex-end}.document-panel{height:calc(100vh - 136px);padding:.42rem}.document-grid{min-height:260px;border-radius:.3rem}.tabulator{font-size:.735rem}.tabulator .tabulator-header .tabulator-col{background:#f8f9fa}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{padding:2px 4px}.tabulator .tabulator-header .tabulator-col-title{font-size:.71rem;line-height:1.15}.tabulator .tabulator-header .tabulator-header-filter{margin-top:2px}.tabulator .tabulator-header .tabulator-header-filter input{height:21px;font-size:.7rem;padding:.05rem .25rem}.tabulator .tabulator-row .tabulator-cell{padding:2px 5px;line-height:1.25}.tabulator .tabulator-footer{padding:2px 5px;font-size:.72rem}.tabulator .tabulator-page,.tabulator .tabulator-page-size{font-size:.72rem;padding:1px 5px}.row-click-hint{cursor:pointer}.compact-modal-header{padding:.5rem .75rem}.compact-modal-header .modal-title{font-size:.98rem}.modal-header-actions{display:flex;align-items:center;gap:.45rem}.document-record-modal .modal-xl{--bs-modal-width:min(1180px,96vw)}.document-record-modal .modal-body{padding:.65rem}.detail-view{display:flex;flex-direction:column;gap:.45rem}.detail-section-title{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:#6c757d;font-weight:700;margin:.25rem 0 0}.key-value-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.35rem}.key-value-item{border:1px solid #e7ebef;border-radius:.38rem;background:#fbfcfd;padding:.32rem .45rem;min-width:0}.key-value-item span{display:block;font-size:.67rem;text-transform:uppercase;color:#6c757d;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.key-value-item strong{display:block;font-size:.8rem;font-weight:600;line-height:1.25;word-break:break-word}.detail-meta-row{display:flex;gap:.35rem;flex-wrap:wrap;color:#6c757d;font-size:.72rem}.detail-meta-row span{background:#f4f6f8;border:1px solid #e5e9ed;border-radius:999px;padding:.12rem .42rem}.detail-grid-holder{border:1px solid #e5e9ed;border-radius:.4rem;overflow:hidden;background:#fff}.detail-scalar-box{background:#f8f9fa;border:1px solid #e5e9ed;border-radius:.4rem;padding:.45rem}.tree-branch.is-closed>.tree-children{display:none}.tree-branch.is-open>.tree-children{display:block}
@media(max-width:767.98px){.breadcrumb-meta-row{align-items:flex-start}.page-actions-stack{align-items:stretch;width:100%;min-width:0}.item-search-box{width:100%}.document-panel{height:calc(100vh - 190px)}}

/* V3: layout toolbar, metadati e dettaglio documento via routing */
.item-page-header{align-items:flex-start}.item-heading-main .breadcrumb-wrap{margin-bottom:.12rem}.item-meta-actions-row{display:flex;align-items:center;justify-content:flex-end;gap:.45rem;flex-wrap:wrap}.item-meta-actions-row .item-meta-inline{justify-content:flex-end}.page-actions-stack{align-items:flex-end;min-width:360px}.document-toolbar{justify-content:flex-start;align-items:center;gap:.38rem;flex-wrap:wrap}.document-toolbar .item-search-box{width:min(420px,42vw);max-width:100%}.document-panel{height:calc(100vh - 126px);padding:.38rem}.document-grid{min-height:270px}.tabulator{font-size:.72rem}.tabulator .tabulator-row .tabulator-cell{padding:1px 4px;line-height:1.18}.tabulator .tabulator-row{min-height:24px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{padding:1px 4px}.tabulator .tabulator-header .tabulator-col-title{font-size:.69rem}.tabulator .tabulator-header .tabulator-header-filter input{height:20px;font-size:.68rem}.row-click-hint,.clickable-row{cursor:pointer}.clickable-row:hover{--bs-table-bg:#f2f9ff}.document-detail-panel{padding:.5rem}.document-detail-toolbar{justify-content:flex-start}.document-record-header{margin-bottom:.5rem}.detail-section-heading{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin:.6rem 0 .32rem}.detail-section-heading .section-title,.detail-section-heading .detail-section-title{margin:0}.document-detail-table{font-size:.76rem}.document-detail-table th,.document-detail-table td{padding:.18rem .35rem;vertical-align:middle}.document-detail-table th{font-size:.68rem;text-transform:uppercase;color:#6c757d;background:#f8f9fa}.key-value-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:.28rem}.key-value-item{padding:.26rem .38rem}.key-value-item span{font-size:.64rem}.key-value-item strong{font-size:.76rem}.detail-meta-row{font-size:.7rem}.detail-scalar-box{font-size:.8rem;padding:.38rem}.tree-branch.is-closed>.tree-children{display:none}.tree-branch.is-open>.tree-children{display:block}
@media(max-width:767.98px){.item-page-header{gap:.45rem}.page-actions-stack{align-items:stretch;width:100%;min-width:0}.item-meta-actions-row{justify-content:flex-start}.item-meta-actions-row .item-meta-inline{justify-content:flex-start;text-align:left!important}.document-toolbar .item-search-box{width:100%}.document-panel{height:calc(100vh - 180px)}}

/* V4: CRUD documenti, toolbar e griglie più compatte */
.document-admin-toolbar{justify-content:flex-end;gap:.3rem}.document-toolbar{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.document-toolbar-left{display:flex;align-items:center;gap:.35rem;flex-wrap:wrap}.document-toolbar .grid-search{margin-left:auto}.document-panel{height:calc(100vh - 172px);max-height:calc(100vh - 172px);min-height:220px;overflow:hidden}.document-grid{height:100%;min-height:0}.tabulator .tabulator-row .tabulator-cell{display:flex;align-items:center;min-height:22px}.tabulator .tabulator-row .tabulator-cell[tabulator-field]{vertical-align:middle}.data-grid-table th,.data-grid-table td{vertical-align:middle!important}.document-detail-table th,.document-detail-table td{vertical-align:middle!important}.detail-grid-actions{display:flex;justify-content:flex-start;margin:.2rem 0}.document-edit-form{max-height:calc(100vh - 112px);overflow:auto}.dynamic-field .form-text{font-size:.68rem}.field-options.d-none{display:none!important}.page-actions-stack .document-admin-toolbar{width:100%}.table .btn-xs{white-space:nowrap}.tabulator .tabulator-editable{background:#fffdf3}.tabulator .tabulator-row .tabulator-cell.tabulator-editing{display:block}.tabulator .tabulator-footer{min-height:28px}.tabulator .tabulator-header-filter input{line-height:1}.compact-panel .table{margin-bottom:0}@media(max-width:767.98px){.document-toolbar{align-items:stretch}.document-toolbar-left{width:100%}.document-toolbar .grid-search{width:100%;margin-left:0!important}.document-panel{height:calc(100vh - 215px);max-height:calc(100vh - 215px)}.document-admin-toolbar{justify-content:flex-start}.document-edit-form{max-height:none}}
.file-list{display:flex;flex-direction:column;gap:.12rem}.file-list-item{font-size:.68rem;color:#6c757d;display:flex;gap:.25rem;align-items:center}.file-list-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}

/* V5: fix altezza righe Tabulator e editor eventi */
.tabulator .tabulator-row {
  min-height: 24px !important;
  height: auto !important;
}
.tabulator .tabulator-row .tabulator-cell {
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle !important;
  min-height: 24px !important;
  height: 24px !important;
  line-height: 1.1 !important;
  padding: 1px 4px !important;
  white-space: nowrap;
}
.tabulator .tabulator-row .tabulator-cell .grid-open-btn,
.tabulator .tabulator-row .tabulator-cell .btn {
  line-height: 1 !important;
  padding: 1px 5px !important;
  margin: 0 !important;
  white-space: nowrap;
}
.tabulator .tabulator-row .tabulator-cell.tabulator-editing {
  display: inline-flex !important;
  align-items: center !important;
}
.tabulator .tabulator-row .tabulator-cell.tabulator-editing input,
.tabulator .tabulator-row .tabulator-cell.tabulator-editing select {
  min-height: 20px !important;
  height: 20px !important;
  padding: 0 4px !important;
  font-size: .7rem !important;
}
.document-panel {
  height: calc(100vh - 184px) !important;
  max-height: calc(100vh - 184px) !important;
}
.event-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: .75rem;
  align-items: start;
}
.event-editor-main,
.event-context-panel {
  min-width: 0;
}
.event-editor-main{display:flex;flex-direction:column;min-height:0}
.event-context-panel {
  border: 1px solid #e5e9ed;
  border-radius: .45rem;
  background: #fbfcfd;
  padding: .55rem;
  overflow:auto;
}
.object-tree {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.object-token {
  border: 1px solid #d7dde3;
  border-radius: .35rem;
  background: #fff;
  color: #212529;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem;
  text-align: left;
  padding: .22rem .35rem;
}
.object-token:hover {
  background: #eef5ff;
  border-color: #b9d8ff;
}
.event-example {
  background: #f3f5f7;
  border: 1px solid #e0e4e8;
  border-radius: .35rem;
  font-size: .68rem;
  padding: .45rem;
  margin: 0;
  white-space: pre-wrap;
}
.code-editor-textarea,
.CodeMirror {
  min-height: 340px;
  height: 340px;
  border: 1px solid #d7dde3;
  border-radius: .35rem;
  font-size: .78rem;
}
.CodeMirror {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background:#fff;
  color:#202428;
}
.event-script-form .CodeMirror-gutters{
  background:#f4f6f8;
  border-right:1px solid #dfe3e8;
}
.event-script-form .CodeMirror-linenumber{color:#8a949e;}
.event-script-form .cm-s-eclipse span.cm-keyword{color:#7c3aed;font-weight:600;}
.event-script-form .cm-s-eclipse span.cm-variable,
.event-script-form .cm-s-eclipse span.cm-variable-2{color:#075985;}
.event-script-form .cm-s-eclipse span.cm-variable-3{color:#9a3412;}
.event-script-form .cm-s-eclipse span.cm-def{color:#1d4ed8;}
.event-script-form .cm-s-eclipse span.cm-string,
.event-script-form .cm-s-eclipse span.cm-string-2{color:#087f5b;}
.event-script-form .cm-s-eclipse span.cm-number{color:#b45309;}
.event-script-form .cm-s-eclipse span.cm-comment{color:#718096;font-style:italic;}
.event-script-form .cm-s-eclipse span.cm-operator{color:#9f1239;}
.event-script-form .cm-s-eclipse span.cm-builtin,
.event-script-form .cm-s-eclipse span.cm-atom{color:#be185d;}
.event-script-form .cm-s-eclipse span.cm-meta{color:#5b21b6;}
.event-script-form .CodeMirror-selected{background:#d8edff!important;}
.event-script-form .CodeMirror-cursor{border-left-color:#111827;}
.event-script-form .CodeMirror-matchingbracket{
  color:#111827!important;
  background:#fde68a;
  outline:1px solid #f59e0b;
}
.content-area:has(.event-script-form){display:flex;flex-direction:column;overflow:hidden}
.content-area:has(.event-script-form)>.page-header{flex:0 0 auto;margin-bottom:.45rem}
.event-script-form{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:.5rem .6rem}
.workflow-header-controls{
  display:grid!important;
  grid-template-columns:minmax(220px,1.4fr) minmax(170px,1fr) minmax(150px,.9fr) 72px minmax(200px,1.1fr) minmax(260px,1.6fr) 78px;
  gap:.35rem!important;
  align-items:end;
  margin-bottom:.45rem!important;
}
.workflow-header-controls>[class*="col-"]{width:auto;max-width:none;padding:0}
.workflow-header-controls .form-label{margin-bottom:.08rem;font-size:.66rem;text-transform:uppercase;color:#6c757d;font-weight:700}
.workflow-header-controls .form-control-sm,
.workflow-header-controls .form-select-sm{min-height:28px;padding-top:.15rem;padding-bottom:.15rem}
.workflow-header-controls .form-text{margin-top:.08rem;font-size:.62rem;line-height:1.15}
.workflow-header-controls .form-check{min-height:28px;display:flex;align-items:center;gap:.25rem;margin-bottom:0}
.workflow-mode-tabs{flex:0 0 auto;display:flex;gap:.35rem;align-items:center;margin-bottom:.45rem!important}
.workflow-mode-tabs .btn{min-height:28px;padding:.18rem .5rem}
#eventCodePanel{flex:1 1 auto;min-height:0;overflow:hidden}
#eventCodePanel .event-editor-layout{height:100%;min-height:0}
#eventCodePanel .CodeMirror{flex:1 1 auto;height:auto;min-height:0}
.workflow-builder{display:grid;grid-template-columns:220px minmax(0,1fr)300px;gap:.55rem;height:calc(100vh - 258px);min-height:420px;max-height:760px;overflow:hidden}
.workflow-palette,.workflow-properties,.workflow-canvas-wrap{border:1px solid #e2e7ec;border-radius:.45rem;background:#fff;min-width:0}
.workflow-palette,.workflow-properties{min-height:0;padding:.55rem;overflow-y:auto;overflow-x:hidden;max-height:100%}
.workflow-palette{display:flex;flex-direction:column;gap:.35rem}
.workflow-palette>.section-title{margin-bottom:.05rem}
.workflow-palette-group{border:1px solid #e0e6ec;border-radius:.42rem;background:#fbfcfe;overflow:hidden}
.workflow-palette-group summary{display:flex;align-items:center;justify-content:space-between;gap:.4rem;padding:.38rem .45rem;cursor:pointer;list-style:none;font-size:.72rem;font-weight:700;color:#334155}
.workflow-palette-group summary::-webkit-details-marker{display:none}
.workflow-palette-group summary:after{content:"+";display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:999px;background:#eef3f8;color:#526071;font-size:.75rem}
.workflow-palette-group[open] summary:after{content:"-"}
.workflow-palette-group summary small{margin-left:auto;color:#788491;font-weight:700}
.workflow-palette-list{display:flex;flex-direction:column;gap:.25rem;padding:0 .35rem .38rem}
.workflow-palette-node{width:100%;display:flex;align-items:center;gap:.4rem;border:1px solid #d7dde3;background:#fff;border-radius:.35rem;padding:.28rem .4rem;color:#242b33;text-align:left;font-size:.72rem}
.workflow-palette-node:hover{background:#eef6ff;border-color:#b9d8ff}
.workflow-palette-node i{width:16px;text-align:center;color:#0d6efd}
.workflow-canvas-wrap{display:flex;flex-direction:column;overflow:hidden}
.workflow-toolbar{min-height:34px;display:flex;align-items:center;gap:.35rem;padding:.35rem .45rem;border-bottom:1px solid #edf0f2;background:#f8fafc}
.workflow-status{margin-left:auto;font-size:.72rem;color:#6c757d}
.workflow-canvas{position:relative;flex:1 1 auto;min-height:0;overflow:auto;background-color:#f6f8fb;background-image:radial-gradient(#d9e0e7 1px,transparent 1px);background-size:18px 18px}
.workflow-edges{position:absolute;inset:0;width:1800px;height:1100px;pointer-events:none;overflow:visible}
.workflow-edge{fill:none;stroke:#7f8ea3;stroke-width:2.2}
.workflow-edge-label{font-size:11px;fill:#475569;font-weight:700;paint-order:stroke;stroke:#fff;stroke-width:4px}
.workflow-nodes{position:relative;width:1800px;height:1100px}
.workflow-node{position:absolute;width:166px;min-height:66px;background:#fff;border:1px solid #cfd8e3;border-radius:.55rem;box-shadow:0 6px 16px rgba(33,37,41,.08);cursor:grab;user-select:none}
.workflow-node:active{cursor:grabbing}
.workflow-node.is-selected{border-color:#0d6efd;box-shadow:0 0 0 2px rgba(13,110,253,.14),0 8px 20px rgba(13,110,253,.12)}
.workflow-node-head{display:flex;align-items:center;gap:.38rem;padding:.38rem .45rem;border-bottom:1px solid #eef1f4;background:#fbfcfe;border-radius:.55rem .55rem 0 0}
.workflow-node-head i{color:#0d6efd}
.workflow-node-head strong{font-size:.76rem;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.workflow-node-body{padding:.35rem .45rem .45rem;color:#586574;font-size:.68rem;line-height:1.2;min-height:28px;word-break:break-word}
.workflow-node-ports{position:absolute;right:-38px;top:24px;display:flex;flex-direction:column;gap:.24rem}
.workflow-node-port{min-width:48px;max-width:76px;min-height:18px;border:1px solid #0d6efd;background:#fff;color:#0d6efd;border-radius:999px;font-size:.55rem;line-height:1;padding:0 .22rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.workflow-node-port:hover{background:#0d6efd;color:#fff}
.workflow-properties-body{display:flex;flex-direction:column;gap:.45rem}
.workflow-selected-title{display:flex;align-items:center;gap:.35rem;margin-bottom:.45rem}
.workflow-selected-title i{color:#0d6efd}
.workflow-prop{display:flex;flex-direction:column;gap:.15rem;margin-bottom:.42rem}
.workflow-prop>span{font-size:.66rem;text-transform:uppercase;color:#6c757d;font-weight:700}
.workflow-json-mini{height:104px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.72rem}
.workflow-code-mini{height:116px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.72rem}
.workflow-helper{border:1px dashed #c9d4e2;border-radius:.4rem;background:#f8fafc;padding:.42rem .48rem;color:#526071;font-size:.68rem;line-height:1.45}
.workflow-helper strong{display:block;margin-bottom:.18rem;color:#3a4653;font-size:.68rem}
.workflow-helper code{display:inline-block;margin:.06rem .08rem .06rem 0;background:#eef3f8;color:#263340;border-radius:.25rem;padding:.04rem .2rem;font-size:.64rem}
.workflow-connectors{display:flex;gap:.28rem;flex-wrap:wrap;padding-top:.25rem;border-top:1px solid #edf0f2}
.workflow-edge-list{display:flex;flex-direction:column;gap:.25rem;margin-top:.45rem;padding-top:.4rem;border-top:1px solid #edf0f2}
.workflow-edge-list>div{display:flex;align-items:center;justify-content:space-between;gap:.35rem;font-size:.7rem;color:#586574}
.workflow-edge-list span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:1199.98px){.workflow-header-controls{grid-template-columns:repeat(4,minmax(0,1fr))}.workflow-builder{grid-template-columns:190px minmax(0,1fr)}.workflow-properties{grid-column:1/-1;max-height:220px}.workflow-canvas{min-height:0}}
@media(max-width: 991.98px) {
  .content-area:has(.event-script-form){overflow:auto}
  .event-script-form{overflow:visible}
  .event-editor-layout { grid-template-columns: 1fr; }
  .event-context-panel { order: -1; }
  .workflow-header-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
  .workflow-builder{grid-template-columns:1fr;height:auto;max-height:none;overflow:visible}
  .workflow-palette{max-height:none}
  .workflow-canvas{min-height:360px}
}
@media(max-width:767.98px){
  .document-panel {
    height: calc(100vh - 225px) !important;
    max-height: calc(100vh - 225px) !important;
  }
}
.object-group-title{font-size:.62rem;text-transform:uppercase;letter-spacing:.05em;color:#6c757d;font-weight:700;margin:.45rem 0 .12rem}

/* Workflow editor fullscreen */
html:has(body.workflow-fullscreen-layout),
body.workflow-fullscreen-layout {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}
body.workflow-fullscreen-layout {
  background: #f4f7fa;
  color: #1f2937;
}
.workflow-fullscreen-shell {
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: .35rem;
  overflow: hidden;
}
.workflow-editor-topbar {
  flex: 0 0 auto;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .3rem .45rem;
  border: 1px solid #dce3ea;
  border-bottom: 0;
  border-radius: .45rem .45rem 0 0;
  background: #fff;
}
.workflow-editor-heading,
.workflow-editor-actions {
  display: flex;
  align-items: center;
  min-width: 0;
}
.workflow-editor-heading { gap: .45rem; }
.workflow-editor-actions { gap: .4rem; flex: 0 0 auto; }
.workflow-editor-back {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.workflow-editor-title-wrap { min-width: 0; }
.workflow-editor-breadcrumb {
  display: flex;
  align-items: center;
  gap: .25rem;
  min-width: 0;
  color: #718096;
  font-size: .62rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workflow-editor-breadcrumb a { color: #526171; text-decoration: none; }
.workflow-editor-topbar h1 {
  margin: .1rem 0 0;
  font-size: 1rem;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}
.workflow-editor-topbar .workflow-mode-tabs {
  gap: 0;
  margin: 0 !important;
}
.workflow-editor-topbar .workflow-mode-tabs .btn {
  min-height: 28px;
  border-radius: 0;
}
.workflow-editor-topbar .workflow-mode-tabs .btn:first-child { border-radius: .32rem 0 0 .32rem; }
.workflow-editor-topbar .workflow-mode-tabs .btn:last-child { border-radius: 0 .32rem .32rem 0; margin-left: -1px; }
.workflow-fullscreen-layout .event-script-form {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: .35rem .45rem .45rem;
  border-radius: 0 0 .45rem .45rem;
  overflow: hidden;
}
.workflow-fullscreen-layout .workflow-header-controls {
  flex: 0 0 auto;
  margin-bottom: .3rem !important;
}
.workflow-fullscreen-layout .workflow-header-controls .form-label {
  font-size: .6rem;
  line-height: 1;
}
.workflow-fullscreen-layout .workflow-header-controls .form-control-sm,
.workflow-fullscreen-layout .workflow-header-controls .form-select-sm {
  min-height: 25px;
  height: 25px;
  padding-top: .08rem;
  padding-bottom: .08rem;
  font-size: .7rem;
}
.workflow-fullscreen-layout .workflow-header-controls .form-text { display: none; }
.workflow-fullscreen-layout .workflow-header-controls .form-check { min-height: 25px; font-size: .72rem; }
.workflow-fullscreen-layout .workflow-catalog-only {
  flex: 0 0 auto;
  margin-bottom: .3rem;
  padding: .25rem .45rem !important;
  font-size: .65rem !important;
  line-height: 1.25;
}
.workflow-fullscreen-layout .workflow-builder {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
}
.workflow-fullscreen-layout #eventCodePanel {
  flex: 1 1 auto;
  min-height: 0;
}
.workflow-fullscreen-layout #eventCodePanel .event-editor-layout {
  height: 100%;
  align-items: stretch;
}
.workflow-fullscreen-layout #eventCodePanel .event-editor-main,
.workflow-fullscreen-layout #eventCodePanel .event-context-panel { min-height: 0; }
.workflow-fullscreen-layout #eventCodePanel .event-context-panel { overflow: auto; }
.workflow-fullscreen-layout #eventCodePanel .CodeMirror { height: auto; min-height: 0; }

@media (max-width: 991.98px) {
  html:has(body.workflow-fullscreen-layout),
  body.workflow-fullscreen-layout { overflow: auto; }
  .workflow-fullscreen-shell { height: auto; min-height: 100vh; overflow: visible; }
  .workflow-editor-topbar { position: sticky; top: 0; z-index: 20; }
  .workflow-editor-breadcrumb { display: none; }
  .workflow-editor-topbar h1 { margin-top: 0; }
  .workflow-fullscreen-layout .event-script-form { overflow: visible; }
  .workflow-fullscreen-layout .workflow-builder { height: auto; min-height: 640px; }
}

@media (max-width: 575.98px) {
  .workflow-editor-topbar { gap: .35rem; padding-inline: .3rem; }
  .workflow-editor-topbar h1 { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
  .workflow-editor-topbar .workflow-mode-tabs .btn { padding-inline: .35rem; }
  .workflow-editor-topbar .workflow-mode-tabs .btn i { margin: 0; }
  .workflow-editor-topbar .workflow-mode-tabs .btn { font-size: 0; }
  .workflow-editor-topbar .workflow-mode-tabs .btn i { font-size: .8rem; }
}

/* V6: struttura documento flessibile e griglie annidate */
.nested-document-grid{height:260px;border:1px solid #e5e9ed;border-radius:.35rem;overflow:hidden;background:#fff}.document-detail-page{max-height:calc(100vh - 116px);overflow:auto}.key-value-item strong p{margin:0}.tox-tinymce{border-radius:.35rem!important}.tabulator .tabulator-row .tabulator-cell{align-items:center!important}.tabulator .tabulator-row{min-height:24px!important}.document-toolbar-left .btn{white-space:nowrap}.detail-section-heading .toolbar-row{justify-content:flex-end}.tabulator-cell .tabulator-row-header{height:24px}.tabulator .tabulator-row .tabulator-cell:first-child{justify-content:center}

/* V7: rifiniture UX griglie, form tabellari e WYSIWYG */
.tabulator .tabulator-row {
  display: flex !important;
  align-items: stretch !important;
  min-height: 24px !important;
}
.tabulator .tabulator-row .tabulator-cell {
  display: inline-flex !important;
  align-items: center !important;
  height: 24px !important;
  min-height: 24px !important;
  line-height: 1.05 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.tabulator .tabulator-row .tabulator-cell .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 19px !important;
  min-height: 19px !important;
  line-height: 1 !important;
}
.tabulator .tabulator-row .tabulator-cell:first-child,
.tabulator .tabulator-row .tabulator-cell[tabulator-field="_erp_expand"] {
  justify-content: center !important;
}
.nested-document-grid,
.document-form-table {
  height: 220px;
  border: 1px solid #e5e9ed;
  border-radius: .35rem;
  overflow: hidden;
  background: #fff;
}
.nested-document-grid-lite {
  height: 190px;
  margin-top: .25rem;
}
.nested-row-detail {
  flex: 0 0 100%;
  width: 100%;
  padding: .35rem .5rem .55rem 3rem;
  background: #f8fafc;
  border-top: 1px solid #e5e9ed;
}
.nested-row-block + .nested-row-block {
  margin-top: .45rem;
}
.nested-row-title {
  font-size: .68rem;
  font-weight: 700;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .15rem;
}
.form-table-box {
  border: 1px solid #e5e9ed;
  border-radius: .4rem;
  padding: .35rem;
  background: #fbfcfd;
}
.form-table-toolbar {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  margin-bottom: .3rem;
}
.technical-json-details {
  border: 1px dashed #cfd6dd;
  border-radius: .4rem;
  padding: .45rem .55rem;
  background: #fbfcfd;
}
.technical-json-details > summary {
  cursor: pointer;
  font-size: .76rem;
  font-weight: 700;
  color: #495057;
}
.attribute-richtext-value .tox-tinymce,
.dynamic-field-richtext .tox-tinymce {
  min-height: 260px;
}
.tox.tox-tinymce {
  border-radius: .35rem !important;
}
.tox .tox-toolbar__group { padding: 0 1px !important; }
.tox .tox-tbtn { width:22px !important;height:22px !important;margin:0 1px !important; }
.tox .tox-tbtn svg{transform:scale(.82);}
.tox .tox-tbtn--select{width:auto !important;min-width:42px !important;font-size:.68rem !important;}
.tox .tox-tbtn--select .tox-tbtn__select-label{font-size:.68rem !important;margin:0 2px !important;}
.tox .tox-toolbar,
.tox .tox-toolbar__primary,
.tox .tox-toolbar__overflow{background:#fff !important;}
.document-detail-page {
  max-height: calc(100vh - 118px);
  overflow: auto;
}
@media(max-width:767.98px){
  .nested-row-detail { padding-left: .65rem; }
  .document-form-table,.nested-document-grid{height:200px;}
}

/* V8: espansione sottorighe separata dalla checkbox e UI ancora più compatta */
.btn-sm {
  --bs-btn-padding-y: .12rem;
  --bs-btn-padding-x: .38rem;
  --bs-btn-font-size: .72rem;
  --bs-btn-border-radius: .24rem;
  line-height: 1.12 !important;
}
.toolbar-row .btn,
.page-header .btn,
.document-toolbar .btn,
.document-admin-toolbar .btn,
.form-table-toolbar .btn,
.detail-section-heading .btn {
  min-height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .22rem;
  white-space: nowrap;
}
.btn-xs {
  --bs-btn-padding-y: .06rem;
  --bs-btn-padding-x: .26rem;
  --bs-btn-font-size: .66rem;
  line-height: 1.05 !important;
}
.nested-expand-btn {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  padding: 0 !important;
  font-size: .72rem !important;
  font-weight: 700;
  position: relative;
  z-index: 5;
  pointer-events: auto;
}
.tabulator .tabulator-row .tabulator-cell[tabulator-field="_erp_expand"] {
  justify-content: center !important;
  padding: 0 2px !important;
  overflow: visible !important;
  z-index: 4;
}
.tabulator .tabulator-row .tabulator-cell .tabulator-row-selector {
  margin: 0 !important;
}
.tabulator .tabulator-footer {
  min-height: 21px !important;
  height: 22px !important;
  padding: 0 4px !important;
  font-size: .66rem !important;
  display: flex !important;
  align-items: center !important;
}
.tabulator .tabulator-footer .tabulator-footer-contents {
  min-height: 20px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  width: 100%;
}
.tabulator .tabulator-paginator {
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px !important;
  line-height: 1 !important;
}
.tabulator .tabulator-page,
.tabulator .tabulator-page-size {
  height: 18px !important;
  min-height: 18px !important;
  padding: 0 4px !important;
  margin: 0 1px !important;
  font-size: .65rem !important;
  line-height: 1 !important;
}
.tabulator .tabulator-page-size {
  max-width: 64px;
}
.tabulator .tabulator-pages {
  display: inline-flex !important;
  align-items: center !important;
  gap: 1px !important;
}
.tabulator .tabulator-footer label,
.tabulator .tabulator-footer span {
  line-height: 1 !important;
}


/* V10: correzione apertura reale delle sottotabelle Tabulator.
   Le righe che contengono un dettaglio devono poter andare a capo e crescere
   in altezza; l'altezza fissa a 24px impediva di vedere la sottotabella. */
.nested-document-grid .tabulator-row,
.document-form-table .tabulator-row {
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  height: auto !important;
  min-height: 24px !important;
  overflow: visible !important;
}
.nested-document-grid .tabulator-row.nested-row-open,
.document-form-table .tabulator-row.nested-row-open {
  height: auto !important;
  min-height: 24px !important;
}
.nested-document-grid .nested-row-detail,
.document-form-table .nested-row-detail {
  order: 1000;
  flex: 0 0 100% !important;
  max-width: 100%;
  box-sizing: border-box;
}
.nested-document-grid .nested-row-detail:not(.d-none),
.document-form-table .nested-row-detail:not(.d-none) {
  display: block !important;
}
.nested-document-grid .tabulator-row .tabulator-cell,
.document-form-table .tabulator-row .tabulator-cell {
  flex-shrink: 0;
}

/* V11: sottotabelle inizializzate solo dopo l'apertura.
   Evita che Tabulator calcoli header/righe a 0px quando il contenitore è nascosto. */
.nested-row-detail:not(.d-none) .nested-document-grid,
.nested-row-detail:not(.d-none) .document-form-table {
  display: block !important;
  visibility: visible !important;
}
.nested-row-detail .tabulator-tableholder {
  min-height: 70px;
}
.nested-row-detail .tabulator-header .tabulator-headers {
  min-height: 24px;
}

/* V16: layout griglie a tutta altezza, selezione stabile e contenuti editabili */
.content-area{
  display:flex;
  flex-direction:column;
  overflow:hidden;
  min-height:0;
}
.content-area > .compact-alert{flex:0 0 auto;}
.content-area > .page-header{flex:0 0 auto;}
.content-area > .document-panel{
  flex:1 1 auto;
  height:auto !important;
  max-height:none !important;
  min-height:0 !important;
  display:flex;
  flex-direction:column;
}
.document-panel .document-toolbar{flex:0 0 auto;}
.document-panel .document-grid{
  flex:1 1 auto;
  height:auto !important;
  min-height:0 !important;
}
.document-grid .tabulator-tableholder{
  background:#fff;
}
.document-grid .tabulator-table{
  display:inline-block;
  min-width:0 !important;
}
.tabulator .tabulator-cell.tabulator-editable{cursor:text;}
.tabulator .tabulator-row.tabulator-selected .tabulator-cell.tabulator-editable{background:#fffdf3;}
.dashboard-html img{max-width:100%;height:auto;}
.app-footer small p{margin:0;display:inline;}
.js-richtext-full + .tox-tinymce,
.tox-tinymce{max-width:100%;}
@media(max-width:767.98px){
  .content-area{overflow:auto;}
  .content-area > .document-panel{min-height:420px!important;}
}

/* V16b: mantieni scroll normale sulle pagine amministrative, ma fai crescere la griglia documento. */
.content-area{overflow:auto;}
.content-area > .document-panel{
  height:calc(100vh - var(--header-height) - var(--footer-height) - 82px) !important;
  max-height:calc(100vh - var(--header-height) - var(--footer-height) - 82px) !important;
}

/* Griglie moderne: stile condiviso tra Tabulator e tabelle amministrative. */
.document-panel{
  border-color:#dfe4ea;
  box-shadow:0 1px 3px rgba(16,24,40,.05);
}
.document-grid,
.nested-document-grid,
.document-form-table{
  border-color:#dfe4ea;
  border-radius:.42rem;
  background:#fff;
}
.tabulator{
  border:0 !important;
  background:#fff !important;
  color:#252a31;
}
.tabulator .tabulator-header{
  border-bottom:1px solid #d9e0e7 !important;
  background:#f4f6f8 !important;
  color:#343a40;
  font-weight:600;
}
.tabulator .tabulator-header .tabulator-col{
  border-right:1px solid #e1e6eb !important;
  background:#f4f6f8 !important;
}
.tabulator .tabulator-header .tabulator-col:hover{
  background:#eef2f5 !important;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="ascending"],
.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="descending"]{
  background:#eaf6ff !important;
  color:#0d6efd;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content{
  padding:3px 6px !important;
}
.tabulator .tabulator-header .tabulator-col-title{
  font-size:.7rem !important;
  font-weight:600;
  line-height:1.15;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter{
  color:#7c8794;
}
.tabulator .tabulator-header .tabulator-header-filter{
  margin-top:3px !important;
}
.tabulator .tabulator-header .tabulator-header-filter input{
  width:100%;
  height:20px !important;
  min-height:20px !important;
  border:1px solid #d4dbe3;
  border-radius:.25rem;
  background:#fff;
  color:#252a31;
  padding:1px 5px !important;
  font-size:.67rem !important;
  outline:0;
  box-shadow:none;
}
.tabulator .tabulator-header .tabulator-header-filter input:focus{
  border-color:#0d6efd;
  box-shadow:0 0 0 2px rgba(13,110,253,.11);
}
.tabulator .tabulator-tableholder{
  background:#fff !important;
}
.tabulator .tabulator-row{
  border-bottom:1px solid #edf0f3 !important;
  background:#fff !important;
  color:#2d3339;
  transition:background-color .12s ease;
}
.tabulator .tabulator-row:nth-child(even){
  background:#fbfcfd !important;
}
.tabulator .tabulator-row:hover{
  background:#f1f6fb !important;
}
.tabulator .tabulator-row.tabulator-selected,
.tabulator .tabulator-row.tabulator-selected:hover{
  background:#e7f5ff !important;
  color:#17365d;
}
.tabulator .tabulator-row .tabulator-cell{
  border-right:1px solid #f0f2f4 !important;
  padding:1px 6px !important;
}
.tabulator .tabulator-row .tabulator-cell.tabulator-frozen{
  background:inherit !important;
  border-right-color:#d8e0e8 !important;
  box-shadow:2px 0 4px rgba(16,24,40,.035);
}
.tabulator .tabulator-row .tabulator-cell.tabulator-editable{
  background:#fffdf5;
}
.tabulator .tabulator-row.tabulator-selected .tabulator-cell.tabulator-editable{
  background:#fff8dc;
}
.tabulator .tabulator-placeholder{
  color:#7b8490;
  background:#fff;
}
.tabulator .tabulator-footer{
  border-top:1px solid #dfe4ea !important;
  background:#f7f8fa !important;
  color:#59616b;
}
.tabulator .tabulator-page,
.tabulator .tabulator-page-size{
  border:1px solid #d6dde5 !important;
  border-radius:.22rem !important;
  background:#fff !important;
  color:#4a535d !important;
}
.tabulator .tabulator-page:hover,
.tabulator .tabulator-page.active{
  border-color:#9fd2fb !important;
  background:#edf7ff !important;
  color:#0d6efd !important;
}
.tabulator .tabulator-page:disabled{
  opacity:.45;
}
.grid-open-btn,
.relation-open-btn,
.contact-action,
.insight-open-btn{
  border-color:transparent !important;
  background:transparent !important;
  color:#0d6efd !important;
  font-weight:600;
  box-shadow:none !important;
}
.grid-open-btn:hover,
.relation-open-btn:hover,
.contact-action:hover,
.insight-open-btn:hover{
  border-color:transparent !important;
  background:#edf7ff !important;
}
.document-toolbar{
  margin-bottom:.4rem !important;
}
.document-toolbar .grid-search{
  height:21px;
  min-height:21px;
}
.document-toolbar .grid-search .input-group-text,
.document-toolbar .grid-search .form-control{
  height:21px;
  min-height:21px;
  border-color:#d6dde5;
  padding-top:0;
  padding-bottom:0;
  font-size:.7rem;
  line-height:19px;
}
.document-toolbar .grid-search .input-group-text{
  padding-left:.38rem;
  padding-right:.32rem;
  background:#f6f7f9;
  color:#68717c;
  border-radius:.25rem 0 0 .25rem;
}
.document-toolbar .grid-search .form-control{
  border-radius:0 .25rem .25rem 0;
  box-shadow:none;
}
.document-toolbar .grid-search .form-control:focus{
  border-color:#0d6efd;
  box-shadow:0 0 0 2px rgba(13,110,253,.1);
}
.data-grid-table{
  border-collapse:separate;
  border-spacing:0;
  color:#2d3339;
}
.data-grid-table thead th{
  border-bottom:1px solid #d9e0e7;
  background:#f4f6f8;
  color:#414850;
  font-size:.7rem;
  font-weight:600;
  padding:.38rem .48rem;
  white-space:nowrap;
}
.data-grid-table tbody td{
  border-bottom:1px solid #edf0f3;
  padding:.32rem .48rem;
  font-size:.75rem;
}
.data-grid-table tbody tr:nth-child(even) td{
  background:#fbfcfd;
}
.data-grid-table.table-hover tbody tr:hover td{
  background:#f1f6fb;
}
.nested-row-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.5rem;
  margin-bottom:.2rem;
}
.nested-row-heading .nested-row-title{
  margin-bottom:0;
}
.nested-child-toolbar{
  margin:0;
  justify-content:flex-end;
}
.key-value-editable{
  background:#f9fcfe;
  border:0;
  padding:.3rem .38rem;
}
.key-value-editable .form-control,
.key-value-editable .form-select{
  min-height:24px;
  height:24px;
  padding:.08rem .32rem;
  border:0;
  border-radius:.25rem;
  background:#fff;
  font-size:.74rem;
  line-height:1.2;
}
.key-value-editable textarea.form-control{
  height:auto;
  min-height:48px;
  resize:vertical;
}
.key-value-editable .form-control:focus,
.key-value-editable .form-select:focus{
  box-shadow:0 0 0 2px rgba(13,110,253,.1);
}
.key-value-editable .form-control.is-valid,
.key-value-editable .form-select.is-valid{
  border-color:#75b798;
  background-image:none;
  padding-right:.32rem;
}
.inline-boolean{
  min-height:24px;
  display:flex;
  align-items:center;
  margin:0;
}
.inline-boolean .form-check-input{
  margin-top:0;
}
.detail-meta-row .detail-meta-editor{
  display:inline-flex;
  align-items:center;
  gap:.3rem;
  margin:0;
  background:#f4f6f8;
  border:1px solid #e5e9ed;
  border-radius:.3rem;
  padding:.12rem .35rem;
}
.detail-meta-editor .form-control,
.detail-meta-editor .form-select{
  width:150px;
  height:20px;
  min-height:20px;
  padding:0 .25rem;
  border-color:#d5dce3;
  font-size:.7rem;
}
#documentGrid:not(.grid-filters-visible) .tabulator-header-filter,
#viewGrid:not(.grid-filters-visible) .tabulator-header-filter{
  display:none !important;
}
.grid-filter-toggle{
  width:20px;
  height:20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:.25rem;
  background:transparent;
  color:#68717c;
  padding:0;
  font-size:.72rem;
}
.grid-filter-toggle:hover,
#documentGrid.grid-filters-visible .grid-filter-toggle,
#viewGrid.grid-filters-visible .grid-filter-toggle{
  background:#dceafb;
  color:#0d6efd;
}
.inline-file-field{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:.4rem;
}
.inline-file-list{
  display:flex;
  align-items:center;
  gap:.3rem;
  flex-wrap:wrap;
  min-width:0;
}
.inline-file-item{
  display:inline-flex;
  align-items:center;
  gap:.25rem;
  max-width:100%;
  min-width:0;
  position:relative;
}
.inline-file-link{
  display:inline-flex;
  align-items:center;
  gap:.2rem;
  max-width:360px;
  margin-left:20px;
  color:#34516f;
  font-size:.7rem;
  text-decoration:none;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.inline-image-link{
  display:block;
  width:54px;
  height:54px;
  border-radius:.3rem;
  overflow:hidden;
  background:#fff;
}
.inline-image-link img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.inline-file-delete{
  position:absolute;
  top:0;
  left:0;
  z-index:2;
  width:17px;
  height:17px;
  min-width:17px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 17px;
  padding:0;
  border:0;
  border-radius:50%;
  background:#fff;
  color:#b02a37;
  font-size:.58rem;
  box-shadow:0 1px 3px rgba(16,24,40,.18);
}
.inline-file-delete:hover{
  background:#f8d7da;
  color:#842029;
}
.inline-file-item .js-image-editor-open{
  position:absolute;
  bottom:2px;
  left:2px;
  z-index:3;
  width:21px;
  height:21px;
  min-width:21px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:.68rem;
  border-radius:50%;
  color:#fff;
  background:#0d6efd;
  border:2px solid #fff;
  box-shadow:0 2px 6px rgba(16,24,40,.35);
}
.inline-file-item .js-image-editor-open:hover{
  color:#fff;
  background:#0d6efd;
}
.inline-file-empty{
  font-size:.7rem;
}
.document-create-form .key-value-item{
  background:#f3f4f6;
  border:0;
}
.document-create-form .key-value-item .form-control,
.document-create-form .key-value-item .form-select{
  border:0;
  background:#fff;
  box-shadow:none;
}
.document-create-form .detail-meta-title .form-control{
  width:220px;
}
.form-file-field{
  display:flex;
  align-items:center;
  gap:.4rem;
  min-width:0;
}
.form-file-field .js-form-file-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.dashboard-display-options{
  display:flex;
  align-items:center;
  gap:1.25rem;
  flex-wrap:wrap;
}
.header-manual-button{
  width:30px;
  height:30px;
  min-width:30px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
}
.manual-page-header{
  align-items:center;
}
.manual-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.65rem;
  margin-bottom:.65rem;
}
.manual-search-wrap{
  width:min(440px,100%);
}
.manual-layout{
  display:grid;
  grid-template-columns:220px minmax(0,1fr);
  gap:.75rem;
  align-items:start;
}
.manual-index{
  position:sticky;
  top:0;
  max-height:calc(100vh - 130px);
  overflow:auto;
  background:#fff;
  border:1px solid #e0e5ea;
  border-radius:.4rem;
  padding:.35rem;
}
.manual-index nav{
  display:flex;
  flex-direction:column;
  gap:.08rem;
}
.manual-index a{
  display:flex;
  align-items:center;
  gap:.42rem;
  padding:.38rem .45rem;
  border-radius:.25rem;
  color:#263442;
  text-decoration:none;
  font-size:.76rem;
}
.manual-index a:hover{
  background:#edf4ff;
  color:#0d6efd;
}
.manual-index i{
  width:16px;
  text-align:center;
  color:#0d6efd;
}
.manual-content{
  min-width:0;
}
.manual-group-heading{
  display:flex;
  align-items:baseline;
  gap:.55rem;
  margin:0 0 .45rem;
  color:#263442;
}
.manual-group-heading span{
  font-size:1rem;
  font-weight:700;
}
.manual-group-heading small{
  color:#6c757d;
}
.manual-section{
  scroll-margin-top:.75rem;
  background:#fff;
  border:1px solid #e0e5ea;
  border-radius:.4rem;
  padding:.8rem .9rem;
  margin-bottom:.55rem;
  box-shadow:0 1px 2px rgba(16,24,40,.03);
}
.manual-section h2{
  display:flex;
  align-items:center;
  gap:.42rem;
  margin:0 0 .55rem;
  font-size:.98rem;
}
.manual-section h2 i{
  color:#0d6efd;
}
.manual-section h3{
  margin:.8rem 0 .3rem;
  font-size:.82rem;
}
.manual-section p,
.manual-section li{
  font-size:.79rem;
  line-height:1.55;
}
.manual-section p{
  margin-bottom:.5rem;
}
.manual-section ul,
.manual-section ol{
  margin:0 0 .45rem;
  padding-left:1.25rem;
}
.manual-section code{
  color:#9b2c2c;
  background:#f4f5f6;
  padding:.08rem .22rem;
  border-radius:.2rem;
  overflow-wrap:anywhere;
}
.manual-section .manual-code{
  margin:.45rem 0 .7rem;
  padding:.7rem .8rem;
  overflow:auto;
  color:#1f2937;
  background:#f4f5f6;
  border:1px solid #dfe3e8;
  border-radius:.25rem;
  font-size:.73rem;
  line-height:1.5;
  white-space:pre;
}
.manual-section .manual-code code{
  padding:0;
  color:inherit;
  background:transparent;
  border-radius:0;
  overflow-wrap:normal;
}
.app-preview-modal .modal-dialog{
  width:min(1200px,96vw);
  max-width:96vw;
  height:min(900px,94vh);
  margin:3vh auto;
}
.app-preview-modal .modal-content{
  height:100%;
}
.app-preview-modal .modal-body{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:0;
  padding:.5rem;
  overflow:auto;
  background:#f3f5f7;
}
.app-preview-loading{
  display:flex;
  align-items:center;
  gap:.45rem;
  color:#6c757d;
  font-size:.8rem;
}
.app-preview-image{
  max-width:100%;
  max-height:calc(94vh - 70px);
  object-fit:contain;
}
.app-preview-frame{
  width:100%;
  height:100%;
  min-height:calc(94vh - 70px);
  border:0;
  background:#fff;
}
.manual-back-top{
  display:inline-block;
  margin-top:.25rem;
  font-size:.7rem;
  text-decoration:none;
}
@media(max-width:767.98px){
  .manual-toolbar{align-items:stretch;flex-direction:column;}
  .manual-search-wrap{width:100%;}
  .manual-layout{grid-template-columns:1fr;}
  .manual-index{position:static;max-height:none;}
  .manual-index nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media print{
  .app-header,.desktop-sidebar,.app-footer,.manual-toolbar,.manual-index,.manual-back-top,.manual-page-header button{display:none!important;}
  html,body,.app-container,.main-content,.workspace,.content-area{height:auto!important;overflow:visible!important;}
  .content-area{padding:0!important;}
  .manual-layout{display:block;}
  [data-manual-group]{display:block!important;}
  .manual-section{break-inside:avoid;box-shadow:none;}
}
.document-create-form .form-table-box{
  border:1px solid #e5e9ed;
  border-radius:.35rem;
  overflow:hidden;
}
.key-value-file{
  grid-column:span 2;
}
.key-value-signature{
  grid-column:span 3;
  min-width:0;
}
.signature-pad{
  width:100%;
  min-width:0;
}
.signature-pad-canvas{
  display:block;
  width:100%;
  height:220px;
  border:1px solid #cbd3dc;
  border-radius:.3rem;
  background:#fff;
  box-shadow:inset 0 1px 2px rgba(16,24,40,.05);
  cursor:crosshair;
  touch-action:none;
}
.signature-pad.is-dirty .signature-pad-canvas{
  border-color:#0d6efd;
}
.signature-pad-toolbar{
  display:flex;
  align-items:center;
  gap:.45rem;
  margin-top:.45rem;
  flex-wrap:wrap;
}
.signature-pad-status{
  font-size:.72rem;
}
.signature-current{
  display:flex;
  align-items:center;
  gap:.5rem;
  flex-wrap:wrap;
  margin-bottom:.45rem;
  font-size:.72rem;
  color:#66717d;
}
.signature-current .js-signature-delete{
  margin-left:auto;
  white-space:nowrap;
}
.signature-current img{
  width:auto;
  max-width:220px;
  height:52px;
  object-fit:contain;
  border:1px solid #e1e5e9;
  background:#fff;
}
.inline-save-status{
  margin-left:.3rem;
  font-size:.67rem;
  font-weight:500;
  text-transform:none;
}
.item-attribute-field.is-dragover{
  outline:2px dashed var(--bs-primary);
  outline-offset:-3px;
  background:#eef5ff;
}
.item-attribute-files{
  display:flex;
  align-items:flex-start;
  gap:.4rem;
  flex-wrap:wrap;
  min-height:42px;
}
.item-attribute-files img{
  display:block;
  width:auto;
  max-width:150px;
  height:84px;
  object-fit:contain;
  background:#fff;
}
.image-editor-modal .modal-xl{--bs-modal-width:min(1180px,96vw);}
.image-editor-toolbar{display:flex;align-items:center;gap:.35rem;flex-wrap:wrap;margin-bottom:.55rem;}
.image-editor-toolbar .btn{white-space:nowrap;}
.image-editor-size{width:120px;}
.image-editor-text{width:min(220px,100%);}
.image-editor-check{display:inline-flex;align-items:center;gap:.22rem;margin:0;font-size:.76rem;color:#495057;white-space:nowrap;}
.image-editor-check .form-check-input{margin:0;}
.image-editor-zoom{display:inline-flex;align-items:center;gap:.25rem;width:130px;margin:0;color:#6c757d;}
.image-editor-zoom .form-range{width:100%;margin:0;}
.mobile-touch-edit-toggle{display:none!important;}
.image-editor-canvas-wrap{display:grid;place-items:center;max-height:calc(100vh - 260px);overflow:auto;background:#f1f3f5;border:1px solid #dfe4e9;border-radius:.45rem;padding:.65rem;touch-action:pan-x pan-y pinch-zoom;}
.image-editor-canvas-wrap canvas{max-width:100%;height:auto;background:linear-gradient(45deg,#ddd 25%,transparent 25%),linear-gradient(-45deg,#ddd 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ddd 75%),linear-gradient(-45deg,transparent 75%,#ddd 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0;box-shadow:0 1px 8px rgba(16,24,40,.18);touch-action:pan-x pan-y pinch-zoom;cursor:crosshair;}
.image-editor-modal.is-touch-editing .image-editor-canvas-wrap,
.image-editor-modal.is-touch-editing .image-editor-canvas-wrap canvas{touch-action:none;}
.item-attribute-field[data-attribute-type="table"]{
  grid-column:1/-1;
}
.signature-display{
  display:block;
  width:100%;
  max-width:520px;
  height:150px;
  background:#fff;
}
.signature-display img{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
}
.richtext-editor-wrap{
  position:relative;
}
.richtext-tools-toggle{
  color:#52606d;
}
.richtext-editor-wrap:not(.editor-tools-visible) .tox-editor-header{
  display:none !important;
}
.richtext-editor-wrap .tox-tinymce{
  min-height:100px;
  border:0 !important;
  border-radius:.25rem !important;
}
.richtext-editor-wrap:not(.editor-tools-visible) .tox-tinymce{
  height:100px !important;
}
.key-value-richtext{
  grid-column:span 3;
  min-width:0;
}
@media(max-width:767.98px){
  .key-value-richtext{grid-column:span 1;}
  .detail-meta-editor .form-control{width:120px;}
}
.item-icon-picker{
  display:grid;
  grid-template-columns:repeat(auto-fill,34px);
  gap:.3rem;
  max-height:238px;
  overflow:auto;
  padding:.35rem;
  border:1px solid #dfe4ea;
  border-radius:.4rem;
  background:#f6f7f9;
}
.item-icon-option{
  width:34px;
  height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border:1px solid transparent;
  border-radius:.3rem;
  background:#fff;
  color:#343a40;
  font-size:.72rem;
  text-align:center;
}
.item-icon-option i{
  width:auto;
  flex:0 0 auto;
  color:#536273;
  font-size:.95rem;
  text-align:center;
}
.item-icon-option i.text-warning{
  color:#ffc107!important;
}
.item-icon-option:hover{
  border-color:#b6d4fe;
  background:#f0f6ff;
}
.item-icon-option.is-selected{
  border-color:#0d6efd;
  background:#e7f1ff;
  color:#084298;
  box-shadow:0 0 0 1px rgba(13,110,253,.08);
}
.item-icon-option.is-selected i{
  color:#0d6efd;
}
.tree-type-dashboard{
  margin-bottom:.3rem;
  padding-bottom:.3rem;
  border-bottom:1px solid #e7eaee;
}
.tree-type-dashboard>.tree-row .tree-link{
  font-weight:700;
}
.dashboard-calendar-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  margin-bottom:.55rem;
}
.dashboard-calendar{
  min-height:416px;
  min-width:0;
}
.dashboard-calendar-panel{
  width:100%;
}
.dashboard-calendar-layout{
  display:grid;
  grid-template-columns:minmax(0,4fr) minmax(180px,1fr);
  gap:.8rem;
  align-items:start;
}
.dashboard-calendar .fc{
  --fc-border-color:#e2e6ea;
  --fc-page-bg-color:#fff;
  --fc-neutral-bg-color:#f6f7f9;
  --fc-today-bg-color:#fff8df;
  font-size:.68rem;
}
.dashboard-calendar .fc .fc-toolbar.fc-header-toolbar{
  margin-bottom:.55rem;
}
.dashboard-calendar .fc .fc-toolbar-title{
  font-size:.86rem;
  text-transform:capitalize;
}
.dashboard-calendar .fc .fc-toolbar .btn{
  font-size:.68rem;
  text-transform:none;
}
.dashboard-calendar .fc .fc-button-group{
  flex-wrap:nowrap;
}
.dashboard-calendar .fc .fc-daygrid-day-number{
  padding:.25rem .35rem;
  color:#343a40;
  text-decoration:none;
}
.dashboard-calendar .fc .fc-col-header-cell-cushion{
  padding:.3rem;
  color:#495057;
  text-decoration:none;
  font-weight:600;
}
.dashboard-calendar .fc .fc-event{
  border-radius:.2rem;
  padding:1px 3px;
  cursor:pointer;
}
.dashboard-calendar-legend{
  min-width:0;
  padding-left:.8rem;
  border-left:1px solid #e2e6ea;
}
.dashboard-calendar-legend h3{
  margin:0 0 .5rem;
  font-size:.76rem;
  text-transform:uppercase;
  color:#5d6874;
  font-weight:700;
}
.dashboard-calendar-legend>p{
  font-size:.72rem;
}
.dashboard-views{
  display:flex;
  flex-wrap:wrap;
  gap:.65rem;
  align-items:flex-start;
}
.dashboard-view-panel{
  padding:.5rem .6rem;
  /* Il gap va sottratto prima che flex-wrap componga le righe; flex-shrink
     interviene solo dopo e non impedirebbe il ritorno a capo di 50% + 50%. */
  flex:0 1 calc(var(--dashboard-view-width, 100%) - .65rem);
  max-width:calc(var(--dashboard-view-width, 100%) - .65rem);
  min-width:0;
}
.dashboard-view-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.6rem;
}
.dashboard-view-actions{
  display:flex;
  align-items:center;
  gap:.35rem;
}
.dashboard-activity-switch .btn{
  min-height:24px;
  height:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:.12rem .42rem;
  font-size:.78rem;
  line-height:1.15;
}
.dashboard-view-actions>.btn,
.dashboard-view-mode-switch .btn{
  --bs-btn-font-size:.78rem;
  width:30px;
  min-height:26px;
  height:26px;
  padding:0 .38rem;
  font-size:.78rem;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.dashboard-view-mode-switch .btn i{
  font-size:inherit;
  line-height:1;
}
.dashboard-view-mode-switch.btn-group>.btn,
.view-mode-switch.btn-group>.btn{
  border-radius:0!important;
}
.dashboard-view-mode-switch.btn-group>.btn:first-child,
.view-mode-switch.btn-group>.btn:first-child{
  border-top-left-radius:5px!important;
  border-bottom-left-radius:5px!important;
}
.dashboard-view-mode-switch.btn-group>.btn:last-child,
.view-mode-switch.btn-group>.btn:last-child{
  border-top-right-radius:5px!important;
  border-bottom-right-radius:5px!important;
}
.dashboard-view-mode-switch.btn-group>.btn:only-child,
.view-mode-switch.btn-group>.btn:only-child{
  border-radius:5px!important;
}
.dashboard-view-table-wrap{
  margin-top:.4rem;
  border:1px solid #e1e6eb;
  border-radius:.35rem;
  height:var(--dashboard-grid-height, 35vh);
  min-height:180px;
  max-height:var(--dashboard-grid-height, 35vh);
  overflow:auto;
}
.dashboard-view-tabulator{
  height:100%;
  min-height:100%;
}
.dashboard-view-tabulator .tabulator{
  border:0;
  font-size:.72rem;
}
.dashboard-view-table{
  min-width:640px;
  margin:0;
  font-size:.72rem;
}
.dashboard-view-table th{
  padding:.25rem .4rem;
  border-color:#dfe5eb;
  background:#f4f6f8;
  color:#4d5863;
  font-size:.67rem;
  font-weight:700;
  white-space:nowrap;
}
.dashboard-view-table td{
  max-width:280px;
  padding:.2rem .4rem;
  border-color:#edf0f3;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.dashboard-view-table tbody tr:nth-child(even) td{background:#fafbfc;}
.dashboard-view-table tfoot td{
  background:#eef2f6;
  border-top:1px solid #d7dee5;
  font-weight:700;
}
.dashboard-file-thumbnails{
  display:flex;
  align-items:center;
  gap:3px;
  min-height:34px;
}
.dashboard-file-thumbnails img{
  display:block;
  width:34px;
  height:34px;
  object-fit:cover;
  border:1px solid #d9dee5;
  border-radius:4px;
}
.dashboard-file-attachment{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border:1px solid #d9dee5;
  border-radius:4px;
}
.dashboard-view-more{
  margin-top:.3rem;
  color:#6c757d;
  font-size:.68rem;
  text-align:right;
}
.view-chart-config{
  padding:.6rem;
  border-top:1px solid #dfe5eb;
  background:#f8f9fa;
}
.view-chart-config .is-disabled{
  opacity:.58;
}
.view-chart-panel,
.view-map-panel,
.view-synoptic-panel,
.view-board-panel,
.view-matrix-panel,
.view-multidimensional-panel,
.view-grid-panel{
  flex:1;
  min-height:0;
  min-width:0;
}
.view-grid-panel{
  display:flex;
  overflow:hidden;
}
.view-grid-panel>.document-grid{
  width:100%;
  min-width:0;
}
.view-chart-panel,
.view-map-panel,
.view-synoptic-panel,
.view-board-panel,
.view-matrix-panel,
.view-multidimensional-panel{
  border:1px solid #e1e6eb;
  border-radius:.35rem;
  background:#fff;
  overflow:hidden;
}
.view-map-panel{display:flex;min-height:360px}
.view-synoptic-panel{display:flex;min-height:360px}
.view-board-panel{display:flex;min-height:360px}
.view-matrix-panel{display:flex;min-height:360px}
.view-multidimensional-panel{display:flex;min-height:420px}
@media(max-width:767.98px){
  .view-grid-panel{
    min-height:360px;
  }
  .view-grid-panel .tabulator-tableholder{
    overflow:auto!important;
    -webkit-overflow-scrolling:touch;
    touch-action:pan-x pan-y;
  }
}
.view-chart{
  width:100%;
  height:100%;
  min-height:320px;
}
.view-chart-empty{
  height:100%;
  min-height:inherit;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:.35rem;
  color:#6c757d;
  font-size:.78rem;
}
.view-chart-empty i{font-size:1.4rem;}
.dashboard-view-chart{
  height:var(--dashboard-chart-height, 35vh);
  min-height:220px;
  margin-top:.4rem;
  border-top:1px solid #edf0f3;
}
.view-map{position:relative;width:100%;height:100%;min-height:360px;background:#f8f9fa;flex:1}
.dashboard-view-map{height:var(--dashboard-map-height, 35vh);min-height:240px;margin-top:.4rem;border-top:1px solid #edf0f3}
.view-map-canvas{width:100%;height:100%}
.view-map-search{position:absolute;top:.5rem;left:50%;transform:translateX(-50%);z-index:2;width:min(320px,calc(100% - 1rem));box-shadow:0 2px 8px rgba(16,24,40,.12)}
.view-map-zoom-controls{position:absolute;left:.5rem;bottom:2.1rem;z-index:3;display:flex;flex-direction:column;gap:.25rem;box-shadow:0 2px 8px rgba(16,24,40,.12);border-radius:.35rem}
.view-map-zoom-controls .btn{width:28px;height:28px;padding:0;display:inline-flex;align-items:center;justify-content:center;border:1px solid #d7dee5;color:#26313d;background:#fff}
.view-map-zoom-controls .btn:hover{background:#edf7ff;color:#0d6efd}
.view-map-marker-label{text-shadow:-1px -1px 0 #fff,0 -1px 0 #fff,1px -1px 0 #fff,-1px 0 0 #fff,1px 0 0 #fff,-1px 1px 0 #fff,0 1px 0 #fff,1px 1px 0 #fff;text-align:center;line-height:1.05;white-space:nowrap;pointer-events:none}
.view-synoptic{position:relative;width:100%;height:100%;min-height:360px;background:#eef2f6;flex:1;overflow:hidden}
.dashboard-view-synoptic{height:var(--dashboard-synoptic-height, 35vh);min-height:240px;margin-top:.4rem;border-top:1px solid #edf0f3}
.view-synoptic-scroll{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:auto;touch-action:pan-x pan-y}
.view-synoptic-stage{position:relative;display:inline-block;min-width:100%;min-height:100%;line-height:0;background:#f8fafc}
.view-synoptic-background{display:block;max-width:none;user-select:none;pointer-events:none}
.view-synoptic-overlay{position:absolute;inset:0;line-height:normal}
.view-synoptic-marker{position:absolute;z-index:2;display:inline-flex;align-items:center;gap:.25rem;transform:translate(-50%,-50%);border:0;background:transparent;padding:0;cursor:pointer;touch-action:none}
.view-synoptic.is-draggable .view-synoptic-marker{cursor:grab}
.view-synoptic-marker.is-dragging{z-index:5;cursor:grabbing}
.view-synoptic.is-draggable .view-synoptic-dot{box-shadow:0 0 0 2px #fff,0 0 0 5px rgba(13,110,253,.22),0 3px 10px rgba(15,23,42,.35)}
.view-synoptic-dot{display:block;flex:0 0 auto;width:var(--synoptic-marker-size,18px);height:var(--synoptic-marker-size,18px);border-radius:50%;background:var(--synoptic-marker-color,#0d6efd);box-shadow:0 0 0 2px #fff,0 2px 8px rgba(15,23,42,.35)}
.view-synoptic-marker-label{white-space:nowrap;border:1px solid rgba(15,23,42,.16);border-radius:999px;background:rgba(255,255,255,.9);box-shadow:0 1px 3px rgba(15,23,42,.12);padding:1px 5px;color:var(--synoptic-marker-label-color,#111827);font-size:11px;font-weight:600;line-height:1.2}
.view-synoptic-drag-toggle{position:absolute;right:.6rem;top:.55rem;z-index:9;display:inline-flex;align-items:center;gap:.3rem;min-height:21px!important;padding:.18rem .45rem!important;font-size:.75rem!important;line-height:1.1}
.view-synoptic-hint{position:absolute;left:.6rem;bottom:.55rem;z-index:8;display:inline-flex;align-items:center;gap:.35rem;max-width:min(520px,calc(100% - 1.2rem));padding:.28rem .5rem;border-radius:999px;border:1px solid rgba(13,110,253,.2);background:rgba(255,255,255,.92);box-shadow:0 2px 10px rgba(15,23,42,.12);color:#334155;font-size:.75rem;line-height:1.15;pointer-events:none}
.view-synoptic-hint.is-active{color:#0d6efd}
.view-synoptic-hint.is-readonly{opacity:.72}
.public-synoptic-body{margin:0;width:100vw;height:100vh;overflow:hidden;background:#0f172a;color:#e5edf7}
.public-synoptic-totem{width:100vw;height:100vh;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#0f172a}
.public-synoptic-stage{position:relative;line-height:0;box-shadow:0 0 0 1px rgba(255,255,255,.14),0 18px 45px rgba(0,0,0,.32);background:#111827}
.public-synoptic-background{display:block;user-select:none;pointer-events:none}
.public-synoptic-overlay{position:absolute;inset:0;line-height:normal}
.public-synoptic-marker{position:absolute;display:inline-flex;align-items:center;gap:.25rem;transform:translate(-50%,-50%);pointer-events:none}
.public-synoptic-error{width:100vw;height:100vh;display:flex;align-items:center;justify-content:center;gap:.6rem;background:#0f172a;color:#e5edf7;font:600 1rem system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.view-board{
  width:100%;
  min-height:360px;
  background:#f6f8fa;
  overflow:hidden;
}
.dashboard-view-board{
  height:var(--dashboard-board-height, 35vh);
  min-height:240px;
  margin-top:.4rem;
  border-top:1px solid #edf0f3;
}
.view-matrix{
  width:100%;
  min-height:360px;
  --view-matrix-row-head-width:132px;
  --view-matrix-head-height:34px;
  background:#f6f8fa;
  overflow:hidden;
}
.dashboard-view-matrix{
  height:var(--dashboard-matrix-height, 35vh);
  min-height:240px;
  margin-top:.4rem;
  border-top:1px solid #edf0f3;
}
.view-multidimensional{
  width:100%;
  min-height:420px;
  padding:.55rem;
  overflow:auto;
  background:#f6f8fa;
  color:#273247;
}
.dashboard-view-multidimensional{
  height:var(--dashboard-multidimensional-height,55vh);
  min-height:360px;
  margin-top:.4rem;
  border-top:1px solid #edf0f3;
}
.view-multidimensional-host{min-width:720px;min-height:100%}
.view-multidimensional .pvtUi{width:100%;border-collapse:separate;border-spacing:.35rem;font:500 .74rem/1.35 Inter,system-ui,-apple-system,"Segoe UI",sans-serif;color:#273247}
.view-multidimensional .pvtUi td{padding:.35rem;vertical-align:top}
.view-multidimensional .pvtAxisContainer,
.view-multidimensional .pvtVals{padding:.45rem!important;border:1px solid #dfe5eb;border-radius:.4rem;background:#fff!important;box-shadow:0 1px 2px rgba(15,23,42,.04)}
.view-multidimensional .pvtAxisContainer li span.pvtAttr{display:inline-flex;align-items:center;min-height:28px;padding:.3rem .55rem;border:1px solid #cfd8e3;border-radius:999px;background:#f8fafc;color:#334155;box-shadow:none;font-weight:650}
.view-multidimensional .pvtAxisContainer li span.pvtAttr:hover{border-color:#86b7fe;background:#eef6ff;color:#0d6efd}
.view-multidimensional .pvtTriangle{color:#0d6efd}
.view-multidimensional select,
.view-multidimensional input{min-height:30px;padding:.25rem .45rem;border:1px solid #cfd8e3;border-radius:.35rem;background:#fff;color:#273247;font:inherit}
.view-multidimensional .pvtRendererArea{min-width:360px;padding:.55rem!important;border:1px solid #dfe5eb;border-radius:.4rem;background:#fff!important;box-shadow:0 1px 3px rgba(15,23,42,.05)}
.view-multidimensional table.pvtTable{width:100%;border-collapse:collapse;font-size:.74rem}
.view-multidimensional table.pvtTable th{padding:.42rem .5rem;border:1px solid #d9e0e7;background:#eef2f6;color:#273247;font-weight:700}
.view-multidimensional table.pvtTable td{padding:.42rem .5rem;border:1px solid #e1e6eb;background:#fff;color:#334155;font-variant-numeric:tabular-nums}
.view-multidimensional .pvt-barchart-bar{background-image:linear-gradient(to bottom,lightblue,blue)}
.view-multidimensional .pvtTotal,
.view-multidimensional .pvtGrandTotal{background:#edf7ff!important;color:#0b5ed7!important;font-weight:750}
.view-multidimensional .pvtFilterBox{z-index:1100;padding:.65rem;border:1px solid #d5dde6;border-radius:.5rem;background:#fff;box-shadow:0 12px 30px rgba(15,23,42,.18)}
.view-multidimensional .pvtSearch{margin-bottom:.4rem}
.view-multidimensional .pvtRendererArea .js-plotly-plot{width:100%!important;min-height:360px}
.view-matrix-scroll{
  height:100%;
  overflow:auto;
  padding:.25rem;
  overscroll-behavior-x:auto;
  overscroll-behavior-y:auto;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-x pan-y;
}
.view-matrix-grid{
  display:grid;
  align-items:stretch;
  gap:0;
  min-width:max-content;
}
.view-matrix-corner,
.view-matrix-column-head,
.view-matrix-row-head{
  position:sticky;
  z-index:2;
  display:flex;
  align-items:center;
  min-height:var(--view-matrix-head-height);
  padding:.25rem .35rem;
  border:1px solid #d7dee6;
  border-radius:0;
  background:#eef2f6;
  color:#26313d;
  font-size:.76rem;
  font-weight:700;
  line-height:1.1;
}
.view-matrix-corner{
  top:0;
  left:0;
  z-index:4;
}
.view-matrix-column-head{
  top:0;
  justify-content:center;
  text-align:center;
  flex-direction:column;
}
.view-matrix-row-head{
  left:0;
  z-index:3;
  align-self:stretch;
  min-height:4.5rem;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
}
.view-matrix-column-head small,
.view-matrix-row-head small{
  display:block;
  margin-top:.08rem;
  color:#647386;
  font-size:.62rem;
  font-weight:600;
  line-height:1.05;
}
.view-matrix-cell{
  display:flex;
  flex-direction:column;
  gap:.25rem;
  min-height:4.5rem;
  padding:.25rem;
  border:1px solid #dfe5eb;
  border-radius:0;
  background:#f8fafc;
  margin-left:-1px;
  margin-top:-1px;
}
.view-matrix-column-head.is-weekend,
.view-matrix-row-head.is-weekend,
.view-matrix-cell.is-weekend{
  background:#f1f7ff;
}
.view-matrix-column-head.is-holiday,
.view-matrix-row-head.is-holiday,
.view-matrix-cell.is-holiday{
  background:#fff5d9;
}
.view-matrix-column-head.is-empty-column,
.view-matrix-row-head.is-empty-row,
.view-matrix-cell.is-empty-column,
.view-matrix-cell.is-empty-row{
  background:#ffffff;
}
.view-matrix.has-date-columns .view-matrix-column-head.is-empty-column,
.view-matrix.has-date-columns .view-matrix-cell.is-empty-column{
  position:sticky;
  left:var(--view-matrix-row-head-width);
  z-index:3;
  box-shadow:1px 0 0 #cfd7df;
}
.view-matrix.has-date-columns .view-matrix-column-head.is-empty-column{
  top:0;
  z-index:5;
}
.view-matrix.has-date-rows .view-matrix-row-head.is-empty-row,
.view-matrix.has-date-rows .view-matrix-cell.is-empty-row{
  position:sticky;
  top:var(--view-matrix-head-height);
  z-index:3;
  box-shadow:0 1px 0 #cfd7df;
}
.view-matrix.has-date-rows .view-matrix-row-head.is-empty-row{
  left:0;
  z-index:5;
}
.view-matrix.has-date-columns.has-date-rows .view-matrix-cell.is-empty-column.is-empty-row{
  z-index:6;
}
.view-matrix-cell.is-drop-target{
  outline:2px dashed rgba(13,110,253,.35);
  outline-offset:-4px;
  background:rgba(13,110,253,.06);
}
.view-matrix-card{
  width:100%;
}
.view-matrix .view-board-card{
  padding:.32rem;
  border-radius:.3rem;
}
.view-matrix .view-board-card-title{
  font-size:.75rem;
}
.view-matrix .view-board-card-details{
  gap:.12rem;
  margin-top:.24rem;
  padding-top:.24rem;
}
.view-matrix .view-board-card-detail{
  grid-template-columns:minmax(56px,.75fr) minmax(0,1.25fr);
  gap:.25rem;
  font-size:.66rem;
}
.view-board-scroll{
  display:flex;
  align-items:stretch;
  gap:.65rem;
  height:100%;
  padding:.65rem;
  overflow:auto;
  overscroll-behavior-x:auto;
  overscroll-behavior-y:auto;
}
.view-board-column{
  display:flex;
  flex:0 0 clamp(210px, var(--view-board-column-width, 24%), 520px);
  flex-direction:column;
  min-height:100%;
  overflow:hidden;
  border:1px solid #dfe5eb;
  border-radius:.45rem;
  background:#eef2f6;
}
.view-board-column-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.5rem;
  padding:.45rem .55rem;
  border-bottom:1px solid #d7dee6;
  color:#26313d;
  font-size:.78rem;
  font-weight:700;
}
.view-board-column-head span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.view-board-column-head strong{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:1.45rem;
  height:1.25rem;
  padding:0 .35rem;
  border-radius:999px;
  background:#fff;
  color:#5d6874;
  font-size:.68rem;
}
.view-board-column-cards{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:.45rem;
  padding:.5rem;
  overflow:auto;
}
.view-board.is-flat .view-board-scroll{
  display:block;
  overflow:hidden;
}
.view-board.is-flat .view-board-column{
  width:100%;
  height:100%;
  min-height:0;
  border:0;
  background:transparent;
}
.view-board.is-flat .view-board-column-head{display:none}
.view-board.is-flat .view-board-column-cards{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(min(220px,100%),1fr));
  align-content:start;
  gap:.55rem;
  height:100%;
  padding:0;
}
.view-board-column.is-drop-target .view-board-column-cards{
  outline:2px dashed rgba(13,110,253,.35);
  outline-offset:-4px;
  background:rgba(13,110,253,.06);
}
.view-board-card{
  display:block;
  padding:.5rem;
  border:1px solid #dfe5eb;
  border-radius:.42rem;
  background:#fff;
  box-shadow:0 1px 2px rgba(16,24,40,.06);
}
.view-board-card[draggable=true]{
  cursor:grab;
}
.view-board-card.is-readonly{
  cursor:not-allowed;
}
.view-board-card.is-dragging{
  opacity:.55;
  cursor:grabbing;
}
.view-board-card-title{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:.35rem;
  color:#111827;
  font-size:.82rem;
  font-weight:700;
  line-height:1.25;
}
.view-board-card.has-conditional-style .view-board-card-title,
.view-board-card.has-conditional-style .view-board-card-detail span,
.view-board-card.has-conditional-style .view-board-card-detail strong{
  color:inherit;
}
.view-board-card-title span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}
.view-board-card-open{
  flex:0 0 auto;
  width:1.4rem;
  height:1.4rem;
  padding:0!important;
  border:0!important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:.78rem;
}
.view-board-card-details{
  display:flex;
  flex-direction:column;
  gap:.18rem;
  margin-top:.4rem;
  padding-top:.38rem;
  border-top:1px solid #edf0f3;
}
.view-board-card-detail{
  display:grid;
  grid-template-columns:minmax(70px,.8fr) minmax(0,1.2fr);
  gap:.4rem;
  align-items:start;
  font-size:.7rem;
  line-height:1.2;
}
.view-board-card-detail span{
  color:#6c757d;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.view-board-card-detail strong{
  color:#2f3944;
  font-weight:600;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.view-board-file-list{
  display:flex;
  align-items:center;
  gap:.25rem;
  min-width:0;
}
.view-board-file-list a{
  flex:0 0 auto;
}
.view-board-file-list img{
  display:block;
  width:42px;
  height:32px;
  object-fit:cover;
  border:1px solid #d9dee5;
  border-radius:.3rem;
  background:#fff;
}
.view-board-file-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:1.65rem;
  height:1.65rem;
  border:1px solid #d9dee5;
  border-radius:.3rem;
  color:#0d6efd;
  background:#fff;
  text-decoration:none;
}
.view-board-file-more{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:1.4rem;
  height:1.25rem;
  padding:0 .25rem;
  border-radius:999px;
  background:#e9ecef;
  color:#5d6874;
  font-size:.66rem;
  font-weight:700;
}
.color-swatch-value{display:inline-flex;align-items:center;gap:.35rem;white-space:nowrap}
.color-swatch{width:1.15rem;height:1.15rem;border:1px solid #adb5bd;border-radius:.25rem;display:inline-block;box-shadow:inset 0 0 0 1px rgba(255,255,255,.45)}
.color-picker-only{width:42px!important;min-width:42px;max-width:42px;height:28px;padding:.12rem}
.grid-color-editor{width:100%;height:100%;min-height:24px;border:0;background:transparent;padding:0}
.percent-progress{display:inline-flex;align-items:center;justify-content:flex-start;gap:.35rem;width:100%;max-width:150px;min-width:76px;vertical-align:middle}
.percent-progress-track{display:block;position:relative;flex:1 1 auto;height:.58rem;min-width:46px;overflow:hidden;background:#e9ecef;border-radius:999px;box-shadow:inset 0 0 0 1px rgba(16,24,40,.04)}
.percent-progress-bar{display:block;height:100%;background:linear-gradient(90deg,#0d6efd,#20c997);border-radius:999px}
.percent-progress-label{flex:0 0 auto;min-width:2.55rem;font-size:.72rem;font-weight:600;color:#495057;text-align:left;line-height:1}
.tabulator .tabulator-row .tabulator-cell.percent-progress-column{display:flex;align-items:center;justify-content:flex-start!important;text-align:left}
.tabulator .tabulator-row .tabulator-cell.percent-progress-column .percent-progress{margin-left:0;margin-right:auto}
.grid-boolean-value{display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:1.25rem}
.grid-boolean-checkbox{pointer-events:none;margin:0;opacity:1!important}
.contact-value{display:inline-flex;align-items:center;gap:.35rem;min-width:0;max-width:100%}
.contact-value span,.contact-value strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.contact-action{width:1.55rem!important;height:1.55rem!important;padding:0!important;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}
.grid-open-btn{width:1.55rem!important;height:1.55rem!important;padding:0!important;display:inline-flex;align-items:center;justify-content:center}
.insight-open-btn{width:1.55rem!important;height:1.55rem!important;padding:0!important;display:inline-flex;align-items:center;justify-content:center}
.cell-action-slot{display:inline-flex;align-items:center;justify-content:center;width:1.65rem;min-width:1.65rem;flex:0 0 1.65rem;overflow:visible!important}
.contact-input-group.input-group-sm .btn,
.password-input-group.input-group-sm .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:0;
  width:30px;
  height:26px;
  padding:0;
  font-size:.82rem;
  line-height:1;
}
.key-value-item .contact-input-group.input-group-sm .form-control,
.key-value-item .contact-input-group.input-group-sm .btn,
.key-value-item .password-input-group.input-group-sm .form-control,
.key-value-item .password-input-group.input-group-sm .btn{
  height:26px!important;
  min-height:26px!important;
}
.key-value-item .contact-input-group.input-group-sm .btn i,
.key-value-item .password-input-group.input-group-sm .btn i{
  font-size:.9rem;
  line-height:1;
}
.password-grid-mask{letter-spacing:.06em;color:#6c757d;font-family:var(--bs-font-monospace,monospace)}
.map-marker-info{font-size:.82rem;font-weight:600;color:#1f2937;max-width:260px;white-space:normal}
.pdf-editor-modal .modal-xl{--bs-modal-width:min(1240px,96vw)}
.pdf-editor-toolbar{display:flex;align-items:center;gap:.35rem;flex-wrap:wrap;margin-bottom:.55rem}
.pdf-editor-toolbar .btn{height:31px}
.pdf-search{width:180px}.pdf-stroke{width:90px}.pdf-text{width:160px}
.pdf-editor-wrap{display:grid;place-items:start center;max-height:calc(100vh - 230px);overflow:auto;background:#eef1f5;border:1px solid #dfe4e9;border-radius:.45rem;padding:.75rem;touch-action:pan-x pan-y pinch-zoom}
.pdf-page-layer{position:relative;box-shadow:0 2px 14px rgba(16,24,40,.18);background:#fff}
.pdf-page-layer canvas{display:block}
.pdf-page-layer [data-pdf-overlay]{position:absolute;inset:0;cursor:crosshair;touch-action:pan-x pan-y pinch-zoom}
.pdf-editor-modal.is-touch-editing .pdf-editor-wrap,
.pdf-editor-modal.is-touch-editing .pdf-page-layer [data-pdf-overlay]{touch-action:none}
.view-mode-switch .btn{
  min-height:21px;
  height:21px;
  padding:.12rem .38rem;
  font-size:.72rem;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.22rem;
}
.view-mode-switch .btn i{
  font-size:inherit;
  line-height:1;
}
@media(max-width:767.98px){
  .image-editor-modal .modal-dialog,
  .pdf-editor-modal .modal-dialog{margin:.35rem;min-height:calc(100% - .7rem)}
  .pdf-editor-toolbar{max-height:28vh;overflow:auto;align-content:flex-start}
  .image-editor-toolbar{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:.25rem;
    max-height:34dvh;
    overflow-x:hidden;
    overflow-y:auto;
    align-items:stretch;
    align-content:start;
    padding:.15rem .1rem .3rem;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
  }
  .image-editor-toolbar .btn-group{
    grid-column:1/-1;
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:.25rem;
  }
  .image-editor-toolbar .btn-group>.btn{border-radius:.25rem!important;width:100%}
  .image-editor-toolbar .btn,
  .image-editor-toolbar .form-control,
  .image-editor-toolbar .form-range,
  .image-editor-toolbar .form-check,
  .image-editor-toolbar .image-editor-zoom{
    min-width:0;
    width:100%;
  }
  .image-editor-toolbar .btn{padding:.18rem .24rem;font-size:.72rem;line-height:1.1;white-space:normal}
  .image-editor-toolbar .form-control-color{height:30px;padding:.1rem}
  .image-editor-size{grid-column:span 3;width:100%}
  .image-editor-text{grid-column:1/-1;width:100%}
  .image-editor-check{grid-column:span 2;justify-content:center}
  .image-editor-zoom{grid-column:1/-1;width:100%}
  .image-editor-canvas-wrap{max-height:calc(100dvh - 390px);min-height:180px}
  .pdf-editor-wrap{max-height:calc(100dvh - 310px);min-height:260px}
  .mobile-touch-edit-toggle{display:inline-flex!important}
  .dashboard-view-panel{flex-basis:100%;max-width:100%}
  .view-chart{min-height:260px;}
  .dashboard-view-chart{height:250px;min-height:250px;}
  .dashboard-view-map{height:260px;min-height:260px}
  .dashboard-view-synoptic{height:260px;min-height:260px}
  .dashboard-view-board{height:280px;min-height:280px}
  .dashboard-view-matrix{height:280px;min-height:280px}
  .dashboard-view-multidimensional{height:420px;min-height:360px}
  .view-board-column{flex-basis:min(78vw,520px)}
  .view-matrix-grid{grid-auto-columns:minmax(78vw,520px)}
  .dashboard-view-table-wrap{max-height:300px}
}
.calendar-legend-list{
  display:flex;
  flex-direction:column;
  gap:.45rem;
}
.calendar-legend-item{
  display:grid;
  grid-template-columns:14px 12px minmax(0,1fr);
  align-items:start;
  gap:.4rem;
  cursor:pointer;
  margin:0;
}
.calendar-legend-toggle{
  width:14px;
  height:14px;
  margin:1px 0 0;
}
.calendar-legend-item.is-hidden{
  opacity:.45;
}
.calendar-legend-color{
  width:12px;
  height:12px;
  margin-top:2px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:2px;
}
.calendar-legend-text{
  min-width:0;
}
.calendar-legend-text strong,
.calendar-legend-text small{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
}
.calendar-legend-text strong{
  font-size:.72rem;
  line-height:1.2;
}
.calendar-legend-text small{
  margin-top:1px;
  color:#6c757d;
  font-size:.66rem;
  line-height:1.2;
}
.calendar-field-group{
  margin:0 0 .8rem;
  padding:0;
  border:0;
}
.calendar-field-group legend{
  margin-bottom:.3rem;
  padding-bottom:.2rem;
  border-bottom:1px solid #e4e7eb;
  font-size:.78rem;
  font-weight:700;
  color:#4d5966;
}
.calendar-field-option{
  display:grid;
  grid-template-columns:20px minmax(120px,1fr) minmax(150px,.9fr) 38px;
  align-items:center;
  gap:.45rem;
  min-height:42px;
  padding:.35rem .2rem;
}
.calendar-field-label{
  min-width:0;
}
.calendar-field-label strong,
.calendar-field-label small{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.calendar-field-label strong{
  font-size:.8rem;
}
.calendar-field-label small{
  color:#6c757d;
}
.calendar-field-option .form-control-color{
  width:36px;
  height:30px;
  padding:.15rem;
}
.role-calendar-settings{
  padding-top:.75rem;
  border-top:1px solid #e4e7eb;
}
.role-calendar-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(440px,1fr));
  gap:.5rem 1rem;
}
.calendar-feed-url{
  display:flex;
  align-items:center;
  gap:.4rem;
}
.calendar-feed-url .form-control{
  min-width:0;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:.72rem;
}
@media(max-width:575.98px){
  .calendar-field-option{grid-template-columns:20px minmax(0,1fr) 38px;}
  .calendar-field-option [data-role-calendar-end]{grid-column:2 / 4;}
  .role-calendar-grid{grid-template-columns:1fr;}
  .dashboard-calendar-heading{align-items:flex-start;}
  .dashboard-calendar-panel{width:100%;}
  .dashboard-calendar{min-height:400px;}
  .dashboard-calendar .fc .fc-toolbar{align-items:flex-start;gap:.35rem;flex-wrap:wrap;}
  .dashboard-calendar .fc .fc-toolbar-chunk:nth-child(2){order:-1;width:100%;text-align:center;}
  .dashboard-calendar .fc .fc-toolbar-chunk:nth-child(3){margin-left:auto;}
  .dashboard-calendar .fc .fc-toolbar-title{font-size:.9rem;}
  .key-value-file{grid-column:span 1;}
  .key-value-signature{grid-column:span 1;}
}
@media(max-width:991.98px){
  .dashboard-calendar-layout{grid-template-columns:1fr;}
  .dashboard-calendar-legend{
    padding:.65rem 0 0;
    border-left:0;
    border-top:1px solid #e2e6ea;
  }
  .calendar-legend-list{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  }
}

.view-config-editor{
  border-top:1px solid #e4e8ed;
  padding-top:.65rem;
}
.query-builder-layout{
  display:grid;
  grid-template-columns:210px minmax(0,1fr);
  gap:.75rem;
  align-items:start;
}
.query-builder-summary{
  position:sticky;
  top:.75rem;
  display:flex;
  flex-direction:column;
  gap:.35rem;
  padding:.45rem;
  border:1px solid #dde4eb;
  border-radius:8px;
  background:#f8fafc;
}
.query-step{
  display:grid;
  grid-template-columns:24px 1fr;
  gap:.25rem .45rem;
  width:100%;
  min-height:44px;
  padding:.42rem .5rem;
  border:1px solid transparent;
  border-radius:6px;
  background:transparent;
  color:#334155;
  text-align:left;
}
.query-step i{
  grid-row:1 / span 2;
  align-self:center;
  font-size:1rem;
  color:#64748b;
}
.query-step span{
  font-size:.78rem;
  font-weight:700;
  line-height:1.1;
}
.query-step strong{
  min-width:0;
  overflow:hidden;
  color:#64748b;
  font-size:.7rem;
  font-weight:600;
  line-height:1.1;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.query-step.is-active{
  border-color:#bfd7ff;
  background:#eef5ff;
  color:#0d47a1;
}
.query-builder-main{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:.65rem;
}
.query-builder-step{
  padding:.7rem;
  border:1px solid #e1e7ed;
  border-radius:8px;
  background:#fff;
}
.document-row-style-list{
  display:grid;
  gap:.5rem;
}
.document-row-style-rule{
  border:1px solid #d7e2ee;
  border-radius:.45rem;
  background:#f9fcfe;
  padding:.5rem;
}
.document-row-style-rule .form-control-color{
  width:100%;
  min-width:3.2rem;
}
.view-config-heading,.view-filter-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.5rem;
}
.view-columns-table{
  min-width:760px;
}
.view-columns-table th{
  background:#f4f6f8;
  color:#59636e;
  font-size:.7rem;
  text-transform:uppercase;
}
.view-columns-table td{
  background:#fafbfc;
  border-color:#e6eaee;
}
.view-check-cell{
  width:78px;
  text-align:center;
}
.view-drag-cell{
  width:34px;
  text-align:center;
}
.view-drag-handle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  border:0;
  background:transparent;
  color:#77818c;
  cursor:grab;
}
.view-drag-handle:active{cursor:grabbing;}
.view-columns-table tbody tr{opacity:.72;}
.view-columns-table tbody tr.is-selected{opacity:1;}
.view-columns-table tbody tr.is-dragging{
  opacity:.45;
  outline:2px solid #0d6efd;
}
.order-drag-cell{
  width:34px;
  text-align:center;
}
.order-drag-handle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  padding:0;
  border:0;
  background:transparent;
  color:#77818c;
  cursor:grab;
}
.order-drag-handle:active{cursor:grabbing;}
.order-drag-table [data-order-row].is-dragging{
  opacity:.45;
  outline:2px solid #0d6efd;
}
.order-save-status{
  min-width:90px;
  text-align:right;
}
.tabulator .tabulator-row .tabulator-cell.grid-file-column{
  padding:0!important;
  overflow:hidden;
  height:58px!important;
  min-height:58px!important;
}
.grid-file-cell{
  display:flex;
  align-items:center;
  gap:4px;
  width:100%;
  height:100%;
  min-height:58px;
  padding:0;
}
.grid-file-cell.is-editable{
  cursor:default;
}
.grid-file-cell.is-dragover{
  box-shadow:inset 0 0 0 2px #0d6efd;
  background:#eef5ff;
}
.grid-file-cell.is-uploading{
  opacity:.55;
  pointer-events:none;
}
.grid-file-item{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:100%;
  min-height:58px;
  aspect-ratio:1/1;
  flex:0 0 auto;
}
.grid-file-item>a,
.grid-file-image-edit{
  display:block;
  width:100%;
  height:100%;
}
.grid-file-image-edit{
  padding:0;
  border:0;
  background:transparent;
  cursor:pointer;
}
.grid-file-item img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  border:0;
  border-radius:0;
}
.grid-file-attachment{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:48px;
  height:48px;
  padding:0;
  border:1px solid #cfd6de;
  border-radius:4px;
  background:#fff;
  color:#52606d;
  text-decoration:none;
}
.grid-file-count{
  font-size:.72rem;
  color:#65717d;
}
.document-bulk-row,
.document-archive-condition-row{
  display:grid;
  grid-template-columns:minmax(170px,1fr) minmax(220px,2fr) auto;
  gap:.4rem;
  align-items:start;
  margin-bottom:.4rem;
}
.document-archive-condition-row{
  grid-template-columns:minmax(170px,1fr) 130px minmax(220px,2fr) auto;
}
.document-archive-preview{
  max-height:260px;
  overflow:auto;
  border:1px solid #e1e6eb;
  border-radius:.45rem;
  padding:.5rem;
  background:#fff;
}
.file-library-modal-list{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(310px,1fr));
  gap:.42rem;
  max-height:58vh;
  overflow:auto;
  padding:.1rem;
}
.file-library-choice{
  display:grid;
  grid-template-columns:18px 52px minmax(0,1fr) auto;
  align-items:center;
  gap:.45rem;
  border:1px solid #e1e6eb;
  border-radius:.42rem;
  background:#fff;
  padding:.38rem;
  cursor:pointer;
  min-width:0;
}
.file-library-choice:hover{background:#f5f9ff;border-color:#b9ddfb}
.file-library-choice-preview{
  width:52px;
  height:42px;
  display:grid;
  place-items:center;
  background:#f4f6f8;
  border-radius:.32rem;
  overflow:hidden;
  color:#5d6875;
}
.file-library-choice-preview img{width:100%;height:100%;object-fit:cover}
.file-library-choice-main{min-width:0}
.file-library-choice-main strong{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:.78rem;
}
.file-library-choice-main small{
  display:block;
  color:#66717d;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.form-file-existing-inputs{display:none}
.file-library-table-wrap{max-height:none;overflow-x:auto;overflow-y:visible}
.file-library-preview{width:70px}
.file-library-preview img{
  width:52px;
  height:42px;
  object-fit:cover;
  border-radius:.32rem;
  background:#f4f6f8;
}
.file-library-dropzone{
  min-height:86px;
  border:1px dashed #b8c7d6;
  border-radius:.55rem;
  background:#f9fcfe;
  padding:.8rem;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease;
}
.file-library-dropzone.is-dragover{
  border-color:#0d6efd;
  background:#eef5ff;
  box-shadow:inset 0 0 0 1px rgba(13,110,253,.25);
}
.file-library-dropzone.is-uploading{
  opacity:.68;
  pointer-events:none;
}
.file-library-drop-controls{
  width:min(360px,100%);
  flex:0 0 min(360px,100%);
}
@media(max-width:767.98px){
  .file-library-dropzone{
    align-items:stretch;
    flex-direction:column;
  }
  .file-library-drop-controls{
    width:100%;
    flex:1 1 auto;
  }
}
@media(max-width:767.98px){
  .document-bulk-row,
  .document-archive-condition-row{
    grid-template-columns:1fr;
  }
}
.inline-file-field.is-dragover{
  outline:2px dashed #0d6efd;
  outline-offset:4px;
  background:#eef5ff;
}
.item-attribute-grid .key-value-item{
  background:#f4f6f8;
}
.item-attribute-grid .key-value-editable .form-control,
.item-attribute-grid .key-value-editable .form-select{
  border-color:transparent;
  background:#fff;
}
.item-attribute-grid .key-value-richtext{
  grid-column:span 3;
  min-width:min(100%,420px);
}
@media(max-width:991.98px){
  .item-attribute-grid .key-value-richtext{grid-column:span 2;}
}
@media(max-width:575.98px){
  .item-attribute-grid .key-value-richtext{grid-column:span 1;}
}
.view-filter-row{
  display:grid;
  grid-template-columns:minmax(130px,.65fr) minmax(180px,1.2fr) minmax(150px,.8fr) minmax(220px,1.5fr) 34px;
  gap:.4rem;
  align-items:center;
  margin-top:.4rem;
}
.view-filter-connector{
  min-height:31px;
  display:flex;
  align-items:center;
}
.view-filter-connector .form-check-label{
  font-size:.78rem;
  white-space:nowrap;
}
.view-calculated-row{
  display:grid;
  grid-template-columns:minmax(140px,.65fr) minmax(160px,.8fr) minmax(110px,.4fr) minmax(280px,1.8fr) 34px;
  gap:.4rem;
  align-items:center;
  margin-top:.4rem;
}
.view-calculated-formula{
  font-family:var(--bs-font-monospace);
}
.view-join-row{
  display:grid;
  grid-template-columns:minmax(82px,.35fr) minmax(110px,.55fr) minmax(220px,1.35fr) minmax(170px,1fr) minmax(170px,1fr) 34px;
  gap:.4rem;
  align-items:center;
  margin-top:.4rem;
}
.view-union-row{
  display:grid;
  grid-template-columns:minmax(82px,.25fr) minmax(260px,1.75fr) 34px;
  gap:.4rem;
  align-items:center;
  margin-top:.4rem;
}
.view-sorter-row{
  display:grid;
  grid-template-columns:28px minmax(220px,1fr) minmax(150px,.45fr) auto;
  gap:.4rem;
  align-items:center;
  margin-top:.4rem;
}
.view-sorter-priority{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  border-radius:50%;
  background:#eef2f6;
  color:#4d5965;
  font-size:.72rem;
  font-weight:700;
}
.view-sorter-actions{
  display:flex;
  gap:.25rem;
}
@media(max-width:767.98px){
  .query-builder-layout{grid-template-columns:1fr;}
  .query-builder-summary{
    position:static;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .view-calculated-row{grid-template-columns:1fr 1fr;}
  .view-calculated-row .view-calculated-formula{grid-column:1/-1;}
  .view-join-row{grid-template-columns:1fr 1fr;}
  .view-join-row .js-view-join-source{grid-column:1/-1;}
  .view-union-row{grid-template-columns:minmax(82px,.35fr) 1fr 34px;}
  .view-filter-row{grid-template-columns:1fr 1fr;}
  .view-filter-row .view-filter-connector{grid-column:1/-1;}
  .view-filter-row .form-control{grid-column:1/-1;}
  .view-sorter-row{grid-template-columns:28px 1fr;}
  .view-sorter-row .view-sorter-actions{grid-column:2;}
}
.public-document-body{min-height:100vh;overflow:auto;background:#eef1f4;color:#202428;}
.import-steps{display:flex;gap:1.2rem;padding-bottom:.7rem;margin-bottom:.7rem;border-bottom:1px solid #dce2e8;color:#66717d;font-size:.82rem}.import-steps strong{color:#0d6efd}.import-preview{max-height:260px}.import-map-row{display:grid;grid-template-columns:minmax(150px,.8fr) 20px minmax(180px,1fr) minmax(150px,.8fr) minmax(120px,.55fr);gap:.4rem;align-items:center;margin-top:.4rem}.import-map-row>i{text-align:center;color:#7b8793}@media(max-width:767.98px){.import-steps{flex-wrap:wrap}.import-map-row{grid-template-columns:1fr 20px 1fr}.import-map-row .js-import-key,.import-map-row .js-import-type{grid-column:auto / span 1}}
.public-document-header{min-height:48px;background:#0d6efd;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:.55rem max(1rem,calc((100vw - 1080px)/2));}
.public-document-header div{display:flex;align-items:center;gap:.55rem;}
.public-document-header span{font-size:.76rem;opacity:.85;}
.public-document-header strong{font-size:.95rem;}
.public-document-header>i{font-size:1.15rem;}

/* Assistente AI */
.header-ai-button,.header-manual-button{width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;padding:0}
.ai-assistant-panel{position:fixed;right:16px;bottom:16px;width:min(430px,calc(100vw - 24px));max-height:min(680px,calc(100vh - 72px));z-index:1080;display:none}
.ai-assistant-panel.is-open{display:block}
.ai-assistant-card{background:#fff;border:1px solid #dce3ea;border-radius:.6rem;box-shadow:0 18px 48px rgba(18,32,48,.22);display:flex;flex-direction:column;max-height:min(680px,calc(100vh - 72px));overflow:hidden}
.ai-assistant-header{height:42px;display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.45rem .55rem;border-bottom:1px solid #e6ebf0;background:#f8fafc}
.ai-assistant-header strong{display:block;font-size:.86rem;line-height:1.05}
.ai-assistant-header span{display:block;font-size:.68rem;color:#6c757d;line-height:1.05}
.ai-assistant-messages{padding:.6rem;display:flex;flex-direction:column;gap:.45rem;overflow:auto;min-height:260px}
.ai-message{border-radius:.48rem;padding:.48rem .55rem;font-size:.8rem;line-height:1.35;max-width:92%;word-break:break-word}
.ai-message-user{align-self:flex-end;background:#0d6efd;color:#fff}
.ai-message-assistant{align-self:flex-start;background:#f1f4f7;color:#1f2933}
.ai-inline-prompt{display:inline-flex;align-items:center;vertical-align:baseline;margin:.08rem .12rem;padding:.05rem .34rem;font-size:.72rem;line-height:1.35}
.ai-assistant-form{display:grid;grid-template-columns:minmax(0,1fr) 36px;gap:.4rem;padding:.55rem;border-top:1px solid #e6ebf0;background:#fff}
.ai-assistant-form textarea{resize:none;max-height:120px}
.ai-assistant-form .btn{height:32px;align-self:end}
.ai-loader{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  color:#475569;
  font-size:.82rem;
}
.ai-message-loading{
  background:#f8fafc;
  border-color:#dbe4ee;
}
.ai-main-results{
  margin-bottom:.75rem;
  border-color:#cce8fd;
  box-shadow:0 8px 24px rgba(13,110,253,.08);
}
.ai-main-results-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:.75rem;
  margin-bottom:.55rem;
}
.ai-main-results-header .section-title i{
  color:#0d6efd;
  margin-right:.3rem;
}
.ai-main-results-body{
  display:flex;
  flex-direction:column;
  gap:.7rem;
}
.ai-preview{margin-top:.5rem;background:#fff;border:1px solid #dfe5eb;border-radius:.42rem;overflow:hidden;color:#202428}
.ai-preview-main{margin-top:0;border-radius:8px}
.ai-preview-title{display:flex;align-items:center;gap:.35rem;padding:.32rem .42rem;background:#f8fafc;border-bottom:1px solid #e6ebf0;font-size:.72rem;font-weight:700}
.ai-preview-title small{margin-left:auto;color:#6c757d;font-weight:500}
.ai-preview-table-wrap{max-height:190px;overflow:auto}
.ai-preview-main .ai-preview-table-wrap{max-height:420px}
.ai-preview-richtext{
  min-width:140px;
  max-width:420px;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.ai-preview-richtext > :first-child{margin-top:0}
.ai-preview-richtext > :last-child{margin-bottom:0}
.ai-preview-richtext p{margin:0 0 .3rem}
.ai-preview-richtext img{max-width:100%;height:auto}
.ai-preview-richtext table{max-width:100%}
.ai-preview table{font-size:.7rem;white-space:nowrap}
.ai-preview-main table{font-size:.78rem}
.ai-preview th{background:#f8f9fa;position:sticky;top:0}
.ai-preview th,.ai-preview td{padding:.18rem .34rem;border-color:#edf0f2}
.ai-preview-thumbs{display:flex;align-items:center;gap:.22rem}
.ai-preview-thumbs img{width:64px;height:42px;object-fit:contain;background:#fff;border:1px solid #dfe5eb;border-radius:4px}
.ai-preview-thumbs span{font-size:.68rem;color:#6c757d}
.ai-preview-hint{font-size:.68rem;color:#6c757d;padding:.28rem .42rem;border-top:1px solid #edf0f2}
.ai-preview-actions{display:flex;gap:.3rem;align-items:center;justify-content:flex-end;padding:.32rem .42rem;border-top:1px solid #edf0f2;background:#fbfcfd}
.ai-preview-chart{height:180px;border-bottom:1px solid #edf0f2;background:#fff}
.ai-action{margin-top:.5rem;border:1px solid #b8d4ff;background:#f4f8ff;border-radius:.42rem;padding:.42rem;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.45rem .5rem;color:#202428}
.ai-action strong{font-size:.76rem}
.ai-action p{font-size:.7rem;margin:0;color:#506070}
.ai-action-summary{grid-column:1/-1;border-top:1px solid #d8efff;padding-top:.35rem;font-size:.7rem;color:#334155}
.ai-action-changes,.ai-action-records{display:flex;flex-wrap:wrap;gap:.25rem;margin-top:.28rem}
.ai-action-changes span,.ai-action-records a{display:inline-flex;align-items:center;border:1px solid #d8efff;background:#fff;border-radius:.3rem;padding:.08rem .32rem;text-decoration:none}
.ai-action-result-link{margin-top:.35rem}
@media(max-width:767.98px){.ai-assistant-panel{right:8px;bottom:8px;width:calc(100vw - 16px);max-height:calc(100vh - 58px)}.ai-assistant-card{max-height:calc(100vh - 58px)}.ai-assistant-messages{min-height:220px}}
.public-document-shell{width:min(1080px,calc(100% - 2rem));margin:1rem auto 2rem;}
.public-document-card{background:#fff;border:1px solid #dfe4e9;border-radius:.4rem;padding:1rem;box-shadow:0 2px 8px rgba(20,31,43,.06);}
.public-document-title{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;border-bottom:1px solid #e7ebef;padding-bottom:.75rem;}
.public-document-title h1{font-size:1.35rem;margin:.1rem 0 0;}
.public-document-code{font-size:.72rem;text-transform:uppercase;color:#66717d;font-weight:700;}
.public-document-meta{display:flex;gap:.45rem;flex-wrap:wrap;margin:.65rem 0;}
.public-document-meta span{font-size:.75rem;background:#f4f6f8;border:1px solid #e3e7eb;padding:.2rem .45rem;border-radius:.25rem;}
.public-field-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5rem;}
.public-field{min-width:0;background:#f5f6f8;padding:.55rem;border-radius:.25rem;}
.public-field h2,.public-table-section h2{font-size:.72rem;text-transform:uppercase;color:#66717d;margin:0 0 .3rem;}
.public-field p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;}
.public-field-signature{grid-column:span 3;}
.public-file-list{display:flex;align-items:flex-start;gap:.45rem;flex-wrap:wrap;}
.public-file-list img{display:block;max-width:240px;height:110px;object-fit:contain;background:#fff;border:1px solid #dfe4e9;}
.public-attachment{display:inline-flex;align-items:center;gap:.25rem;}
.public-signature-pad{max-width:760px;}
.public-signature-locked{margin-top:.4rem!important;font-size:.75rem;color:#66717d;}
.public-table-section{margin-top:1rem;}
.public-document-table{font-size:.8rem;}
.public-document-table .public-file-list img{height:54px;max-width:90px;}
.public-row-details{min-width:260px;padding:.3rem!important;background:#f8f9fa!important;}
.public-nested-table-section{margin:.15rem 0 .35rem;}
.public-nested-table-section:last-child{margin-bottom:0;}
.public-nested-table-section>h2{font-size:.68rem;margin-bottom:.2rem;}
.public-nested-table-section .public-document-table{font-size:.74rem;background:#fff;}
.public-nested-table-section .public-document-table th,
.public-nested-table-section .public-document-table td{padding:.2rem .3rem;vertical-align:middle;}
.public-document-message{text-align:center;padding:3rem 1rem;}
.public-document-message>i{font-size:2rem;color:#6c757d;}
.public-document-message h1{font-size:1.25rem;margin:.65rem 0 .25rem;}
@media(max-width:767.98px){.public-document-shell{width:min(100% - 1rem,1080px);margin:.5rem auto 1rem}.public-document-card{padding:.7rem}.public-field-grid{grid-template-columns:1fr}.public-field-signature{grid-column:span 1}.public-document-title{align-items:flex-start}.public-document-meta{gap:.3rem}}
.field-config-folders{display:grid;gap:.45rem;}
.field-config-box{border:1px solid #dfe4e9;border-radius:.4rem;background:#f7f8fa;overflow:hidden;}
.field-config-box>summary{display:flex;align-items:center;justify-content:space-between;gap:.75rem;min-height:42px;padding:.45rem .65rem;cursor:pointer;list-style:none;color:#27313b;}
.field-config-box>summary::-webkit-details-marker{display:none;}
.field-config-box>summary::after{content:"+";display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 24px;color:#52606d;font-size:1.1rem;font-weight:500;}
.field-config-box[open]>summary{border-bottom:1px solid #dfe4e9;background:#f2f4f7;}
.field-config-box[open]>summary::after{content:"-";}
.field-config-summary-main{display:flex;align-items:center;gap:.55rem;min-width:0;}
.field-config-summary-main>i{width:20px;text-align:center;color:#0d6efd;font-size:.95rem;}
.field-config-summary-main>span{display:flex;align-items:baseline;gap:.55rem;min-width:0;}
.field-config-summary-main strong{font-size:.82rem;}
.field-config-summary-main small{color:#6b7681;font-size:.72rem;font-weight:400;}
.field-config-box-body{padding:.65rem;background:#fff;}
@media(max-width:575.98px){.field-config-summary-main>span{align-items:flex-start;flex-direction:column;gap:.05rem;}}
.audit-log-panel{padding:0;overflow:hidden;}
.audit-log-summary{padding:.5rem .65rem;border-bottom:1px solid #e3e7eb;background:#f7f8fa;font-size:.78rem;color:#65717d;}
.audit-log-table{margin:0;font-size:.78rem;}
.audit-log-scroll{max-height:calc(100vh - 285px);min-height:220px;overflow:auto;}
.audit-log-table th{position:sticky;top:0;z-index:2;white-space:nowrap;background:#f4f6f8;}
.audit-log-table td{vertical-align:top;}
.audit-value-cell{min-width:240px;max-width:360px;}
.audit-change{padding:.25rem 0;border-bottom:1px solid #edf0f2;}
.audit-change:last-child{border-bottom:0;}
.audit-change strong{display:block;margin-bottom:.12rem;color:#53606c;font-size:.7rem;}
.audit-change pre{max-height:150px;margin:0;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;color:#20262d;}
.audit-change pre span{display:block;min-height:1.25em;padding:0 .2rem;}
.audit-change-before pre span.is-different{background:#fff0f0;color:#9f2531;}
.audit-change-after pre span.is-different{background:#eaf8ef;color:#176b3a;}
.audit-pagination{display:flex;align-items:center;justify-content:flex-end;gap:.55rem;padding:.5rem .65rem;border-top:1px solid #e3e7eb;background:#f7f8fa;font-size:.78rem;}
.field-label-row{display:flex!important;align-items:center;justify-content:space-between;gap:.25rem;}
.field-label-row>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;}
.field-label-actions{display:inline-flex;align-items:center;gap:.18rem;flex:0 0 auto;}
.field-label-actions .field-activity-btn,
.field-label-actions .field-tool-btn,
.field-label-actions .field-history-btn,
.field-label-actions .field-ai-btn{position:static;}
.field-activity-btn,
.field-tool-btn,
.field-history-btn,
.field-ai-btn{border:0;background:transparent;color:#6c757d;width:18px;height:18px;min-width:18px;padding:0;display:inline-flex;align-items:center;justify-content:center;border-radius:.2rem;}
.field-activity-btn:hover,
.field-tool-btn:hover,
.field-history-btn:hover,
.field-ai-btn:hover,
.field-tool-btn.active{color:#0d6efd;background:#eaf2ff;}
.field-history-table-wrap{max-height:min(58vh,520px);overflow:auto;}
.field-history-table th{position:sticky;top:0;background:#f8f9fa;z-index:1;}
.field-history-value{margin:0;white-space:pre-wrap;word-break:break-word;font-size:.72rem;max-height:120px;overflow:auto;background:#f8fafc;border:1px solid #edf0f2;border-radius:.28rem;padding:.25rem .35rem;}
.table-cell-with-activity{display:flex;align-items:center;gap:.25rem;width:100%;min-width:0;}
.table-cell-activity-content{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;}
.table-cell-activity-content .grid-file-cell{width:100%;}
.table-cell-with-activity .table-cell-activity-btn,
.table-cell-with-activity .table-cell-history-btn{opacity:.42;}
.tabulator-cell:hover .table-cell-with-activity .table-cell-activity-btn,
.tabulator-cell:hover .table-cell-with-activity .table-cell-history-btn,
.table-cell-with-activity .table-cell-activity-btn:focus,
.table-cell-with-activity .table-cell-history-btn:focus{opacity:1;}
.dashboard-activities-panel .table{font-size:.74rem;}
.activity-urgency{display:inline-flex;align-items:center;border-radius:999px;padding:.05rem .4rem;background:#eef1f4;color:#495057;font-size:.66rem;font-weight:700;}
.activity-urgency-high{background:#fff3cd;color:#8a5b00;}
.activity-urgency-urgent{background:#f8d7da;color:#842029;}
.activity-urgency-low{background:#e9ecef;color:#495057;}
.activity-target-highlight{outline:2px solid rgba(13,110,253,.45);box-shadow:0 0 0 4px rgba(13,110,253,.10);}
.dashboard-closed-days-input{min-width:92px;padding-right:.45rem!important;}
.dashboard-closed-days-input::-webkit-outer-spin-button,
.dashboard-closed-days-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}
.dashboard-closed-days-input[type=number]{-moz-appearance:textfield;}
.relation-cell-value,
.relation-cell-token,
.relation-detail-value,
.relation-input-group{display:flex;align-items:center;gap:.25rem;min-width:0;}
.relation-cell-value{flex-wrap:wrap;width:100%;}
.relation-cell-token span,
.relation-detail-value span{min-width:0;overflow:hidden;text-overflow:ellipsis;}
.relation-cell-token .cell-action-slot{min-width:1.65rem;overflow:visible;}
.relation-input-group .form-select{min-width:0;flex:1 1 auto;}
.relation-open-btn{width:1.55rem!important;height:1.55rem!important;padding:0!important;line-height:1.25;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;}
.insight-config-table th{font-size:.72rem;color:#5a6672;font-weight:700;}
.insight-limit-input{min-width:68px;}
.insights-section{display:flex;flex-direction:column;gap:.55rem;margin-top:.75rem;}
.document-detail-page .insights-section{margin-top:1rem;}
.insight-panel{padding:.65rem .75rem;border:1px solid #dfe4e9;border-radius:.4rem;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.04);}
.insight-heading{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.4rem;}
.insight-table-wrap{max-height:280px;overflow:auto;}
.insight-table-wrap{height:280px;border:1px solid #e1e6eb;border-radius:.35rem;}
.insight-tabulator{height:100%;min-height:100%;}
.insight-view-chart,.insight-view-map,.insight-view-synoptic,.insight-view-board,.insight-view-matrix{height:320px;min-height:260px;margin-top:.4rem;border:1px solid #e1e6eb;border-radius:.35rem;overflow:hidden;background:#fff;}
.insight-view-map{position:relative;}
.insight-table{font-size:.74rem;}
.insight-table th{position:sticky;top:0;z-index:1;background:#f5f7f9;color:#42505c;white-space:nowrap;}
.insight-table td,.insight-table th{padding:.25rem .4rem;vertical-align:middle;}
.insight-thumb{display:block;width:auto;height:36px;max-width:64px;object-fit:contain;border-radius:.25rem;}
.insight-percent{justify-content:flex-start;}

/* Rifinitura moderna per griglie e pagine documento. Non impatta la dashboard. */
.technical-json-details{
  display:none!important;
}
.content-area > .document-panel{
  padding:.45rem!important;
  border:1px solid #dfe5eb;
  border-radius:8px;
  background:#fff;
  box-shadow:none;
}
.document-panel .document-toolbar{
  min-height:30px;
  margin:0 0 .35rem!important;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
}
.document-panel .document-toolbar-left{
  gap:.28rem;
}
.document-panel .document-toolbar .btn,
.document-detail-page .toolbar-row .btn,
.document-edit-form .toolbar-row .btn{
  min-height:21px;
  border-radius:5px;
  font-weight:400;
}
.document-panel .btn-primary,
.document-detail-page .btn-primary,
.document-edit-form .btn-primary{
  border-color:#0d6efd!important;
  background:#0d6efd!important;
}
.document-panel .btn-outline-primary,
.document-detail-page .btn-outline-primary,
.document-edit-form .btn-outline-primary{
  border-color:#0d6efd!important;
  color:#0d6efd!important;
}
.document-panel .btn-outline-primary:hover,
.document-detail-page .btn-outline-primary:hover,
.document-edit-form .btn-outline-primary:hover{
  border-color:#0d6efd!important;
  background:#0d6efd!important;
  color:#fff!important;
}
.document-panel .grid-search .input-group-text{
  border-color:#d8e0e8;
  background:#fff;
  color:#73808f;
}
.document-panel .grid-search .form-control{
  height:26px;
  border-color:#d8e0e8;
  background:#fff;
  box-shadow:none;
}
.document-panel .grid-search .form-control:focus{
  border-color:#0d6efd;
  box-shadow:0 0 0 .12rem rgba(13,110,253,.14);
}
.document-panel .document-grid,
.document-panel .nested-document-grid,
.document-panel .document-form-table,
.document-detail-page .nested-document-grid,
.document-edit-form .document-form-table{
  border:1px solid #dbe3eb!important;
  border-radius:8px!important;
  overflow:hidden;
  background:#fff;
  box-shadow:none;
}
.document-panel .tabulator,
.document-detail-page .tabulator,
.document-edit-form .tabulator{
  border:0!important;
  background:#fff;
  color:#17212b;
}
.document-panel .tabulator .tabulator-header,
.document-detail-page .tabulator .tabulator-header,
.document-edit-form .tabulator .tabulator-header{
  border-bottom:1px solid #dbe3eb!important;
  background:#fff!important;
  color:#2c3845;
}
.document-panel .tabulator .tabulator-header .tabulator-col,
.document-detail-page .tabulator .tabulator-header .tabulator-col,
.document-edit-form .tabulator .tabulator-header .tabulator-col{
  border-right:1px solid #e4e9ef!important;
  background:#fff!important;
}
.document-panel .tabulator .tabulator-header .tabulator-col-title,
.document-detail-page .tabulator .tabulator-header .tabulator-col-title,
.document-edit-form .tabulator .tabulator-header .tabulator-col-title{
  color:#2e3a46;
  font-size:.7rem!important;
  font-weight:700;
}
.document-panel .tabulator .tabulator-header .tabulator-header-filter input,
.document-detail-page .tabulator .tabulator-header .tabulator-header-filter input,
.document-edit-form .tabulator .tabulator-header .tabulator-header-filter input{
  height:20px!important;
  border:1px solid #d8e0e8;
  border-radius:5px;
  background:#fff;
  color:#202a35;
  box-shadow:none;
}
.document-panel .tabulator .tabulator-row,
.document-detail-page .tabulator .tabulator-row,
.document-edit-form .tabulator .tabulator-row{
  border-bottom:1px solid #eef2f6!important;
  background:#fff!important;
}
.document-panel .tabulator .tabulator-row:hover,
.document-detail-page .tabulator .tabulator-row:hover,
.document-edit-form .tabulator .tabulator-row:hover{
  background:#f2f9ff!important;
}
.document-panel .tabulator .tabulator-row .tabulator-cell,
.document-detail-page .tabulator .tabulator-row .tabulator-cell,
.document-edit-form .tabulator .tabulator-row .tabulator-cell{
  border-right:1px solid #eef2f6!important;
  color:#1f2a37;
}
.document-panel .tabulator .tabulator-cell.tabulator-editable,
.document-detail-page .tabulator .tabulator-cell.tabulator-editable,
.document-edit-form .tabulator .tabulator-cell.tabulator-editable{
  background:#fff!important;
  box-shadow:inset 0 -1px 0 rgba(13,110,253,.35);
}
.document-panel .tabulator .tabulator-footer,
.document-detail-page .tabulator .tabulator-footer,
.document-edit-form .tabulator .tabulator-footer{
  border-top:1px solid #dbe3eb!important;
  background:#fff!important;
  color:#5c6875;
}
.document-detail-page,
.document-edit-form{
  border:1px solid #dfe5eb;
  border-radius:8px;
  background:#fff;
  box-shadow:none;
}
.document-detail-page .toolbar-row:first-child,
.document-edit-form > .toolbar-row:first-of-type{
  margin:0 0 .45rem!important;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
}
.document-detail-page .detail-meta-row,
.document-edit-form .detail-meta-row{
  gap:.4rem;
  margin-bottom:.65rem!important;
}
.document-detail-page .detail-meta-row span,
.document-detail-page .detail-meta-row label,
.document-edit-form .detail-meta-row span,
.document-edit-form .detail-meta-row label{
  min-height:26px;
  display:inline-flex;
  align-items:center;
  gap:.28rem;
  padding:.08rem .34rem;
  border:0;
  border-radius:5px;
  background:transparent;
  color:#5d6a78;
}
.document-detail-page .detail-meta-row strong,
.document-edit-form .detail-meta-row strong{
  color:#4b5563;
}
.document-detail-page .detail-meta-row .form-control,
.document-detail-page .detail-meta-row .form-select,
.document-edit-form .detail-meta-row .form-control,
.document-edit-form .detail-meta-row .form-select{
  height:24px;
  border-color:#d8e0e8;
  border-radius:5px;
  background:#fff;
}
.document-detail-page .key-value-grid,
.document-edit-form .key-value-grid{
  grid-template-columns:repeat(auto-fill,minmax(165px,1fr));
  gap:.32rem;
}
.document-detail-page .key-value-item,
.document-edit-form .key-value-item{
  min-height:62px;
  border:1px solid #e6ebf0!important;
  border-radius:6px!important;
  background:#f9fcfe!important;
  padding:.36rem .42rem!important;
  box-shadow:none;
}
.document-detail-page .key-value-item:hover,
.document-edit-form .key-value-item:hover{
  border-color:#cddce9!important;
  background:#f9fcfe!important;
}
.document-detail-page .key-value-item .field-label-row,
.document-edit-form .key-value-item .field-label-row{
  margin-bottom:.28rem;
}
.document-detail-page .key-value-item span,
.document-edit-form .key-value-item span{
  text-transform:none;
  letter-spacing:0;
}
.document-detail-page .key-value-item .field-label-actions,
.document-edit-form .key-value-item .field-label-actions{
  display:inline-flex;
}
.document-detail-page .key-value-item .field-label-row > span:first-child,
.document-edit-form .key-value-item .field-label-row > span:first-child{
  color:#718091;
  font-size:.64rem;
  font-weight:700;
  letter-spacing:.01em;
}
.document-detail-page .key-value-item strong,
.document-edit-form .key-value-item strong{
  font-size:.78rem;
  color:#17212b;
  font-weight:600;
}
.document-detail-page .key-value-item .form-control,
.document-detail-page .key-value-item .form-select,
.document-edit-form .key-value-item .form-control,
.document-edit-form .key-value-item .form-select{
  min-height:26px;
  border:0!important;
  border-radius:4px;
  background:#fff!important;
  color:#17212b;
  box-shadow:inset 0 -1px 0 #d8e0e8;
}
.document-detail-page .key-value-item textarea.form-control,
.document-edit-form .key-value-item textarea.form-control{
  min-height:64px;
}
.document-detail-page .key-value-item .form-control:focus,
.document-detail-page .key-value-item .form-select:focus,
.document-edit-form .key-value-item .form-control:focus,
.document-edit-form .key-value-item .form-select:focus{
  box-shadow:inset 0 -1px 0 #0d6efd, 0 0 0 .12rem rgba(13,110,253,.12);
}
.document-detail-page .field-activity-btn,
.document-detail-page .field-tool-btn,
.document-detail-page .field-history-btn,
.document-detail-page .field-ai-btn,
.document-edit-form .field-activity-btn,
.document-edit-form .field-tool-btn,
.document-edit-form .field-history-btn,
.document-edit-form .field-ai-btn{
  width:18px;
  height:18px;
  min-width:18px;
  border-radius:4px;
}
.document-detail-page .field-activity-btn:hover,
.document-detail-page .field-tool-btn:hover,
.document-detail-page .field-history-btn:hover,
.document-detail-page .field-ai-btn:hover,
.document-detail-page .field-tool-btn.active,
.document-edit-form .field-activity-btn:hover,
.document-edit-form .field-tool-btn:hover,
.document-edit-form .field-history-btn:hover,
.document-edit-form .field-ai-btn:hover,
.document-edit-form .field-tool-btn.active{
  color:#0d6efd;
  background:#eef7ff;
}
.document-detail-page .detail-section-heading,
.document-edit-form .detail-section-heading{
  margin:.9rem 0 .4rem;
  padding-top:.25rem;
}
.document-detail-page .detail-section-heading .section-title,
.document-edit-form .detail-section-heading .section-title{
  color:#243142;
  font-size:.9rem;
}
@media(max-width:767.98px){
  .document-detail-page .key-value-grid,
  .document-edit-form .key-value-grid{
    grid-template-columns:1fr;
  }
  .document-panel .document-toolbar{
    align-items:stretch;
  }
}
.document-panel .tabulator .tabulator-header .tabulator-header-filter input:focus,
.document-detail-page .tabulator .tabulator-header .tabulator-header-filter input:focus,
.document-edit-form .tabulator .tabulator-header .tabulator-header-filter input:focus,
.document-panel .tabulator .tabulator-row .tabulator-cell.tabulator-editing input:focus,
.document-panel .tabulator .tabulator-row .tabulator-cell.tabulator-editing select:focus,
.document-detail-page .tabulator .tabulator-row .tabulator-cell.tabulator-editing input:focus,
.document-detail-page .tabulator .tabulator-row .tabulator-cell.tabulator-editing select:focus,
.document-edit-form .tabulator .tabulator-row .tabulator-cell.tabulator-editing input:focus,
.document-edit-form .tabulator .tabulator-row .tabulator-cell.tabulator-editing select:focus{
  border-color:#0d6efd!important;
  box-shadow:0 0 0 2px rgba(13,110,253,.14)!important;
}
.document-panel .tabulator .tabulator-page:hover,
.document-panel .tabulator .tabulator-page.active,
.document-detail-page .tabulator .tabulator-page:hover,
.document-detail-page .tabulator .tabulator-page.active,
.document-edit-form .tabulator .tabulator-page:hover,
.document-edit-form .tabulator .tabulator-page.active{
  border-color:#0d6efd!important;
  background:#0d6efd!important;
  color:#fff!important;
}
.document-panel .tabulator .tabulator-row.tabulator-selected,
.document-panel .tabulator .tabulator-row.tabulator-selected:hover,
.document-detail-page .tabulator .tabulator-row.tabulator-selected,
.document-detail-page .tabulator .tabulator-row.tabulator-selected:hover,
.document-edit-form .tabulator .tabulator-row.tabulator-selected,
.document-edit-form .tabulator .tabulator-row.tabulator-selected:hover{
  background:#eef7ff!important;
}
.document-panel .tabulator .tabulator-row.tabulator-selected .tabulator-cell,
.document-detail-page .tabulator .tabulator-row.tabulator-selected .tabulator-cell,
.document-edit-form .tabulator .tabulator-row.tabulator-selected .tabulator-cell{
  border-color:#d7ebff!important;
}
.document-detail-page .form-check-input:checked,
.document-edit-form .form-check-input:checked,
.document-panel .form-check-input:checked{
  border-color:#0d6efd;
  background-color:#0d6efd;
}

/* Rifiniture compatte globali richieste. */
:root{
  --bs-primary:#0d6efd;
  --bs-primary-rgb:13,110,253;
  --fc-button-bg-color:#0d6efd;
  --fc-button-border-color:#0d6efd;
  --fc-event-bg-color:#0d6efd;
  --fc-event-border-color:#0d6efd;
}
.bg-primary{background-color:#0d6efd!important;}
.text-primary{color:#0d6efd!important;}
.border-primary{border-color:#0d6efd!important;}
.text-bg-primary{background-color:#0d6efd!important;color:#fff!important;}
.btn-primary{
  --bs-btn-bg:#0d6efd;
  --bs-btn-border-color:#0d6efd;
  --bs-btn-hover-bg:#0d6efd;
  --bs-btn-hover-border-color:#0d6efd;
  --bs-btn-active-bg:#0d6efd;
  --bs-btn-active-border-color:#0d6efd;
}
.btn-outline-primary{
  --bs-btn-color:#0d6efd;
  --bs-btn-border-color:#0d6efd;
  --bs-btn-hover-bg:#0d6efd;
  --bs-btn-hover-border-color:#0d6efd;
  --bs-btn-active-bg:#0d6efd;
  --bs-btn-active-border-color:#0d6efd;
}
.form-control:focus,
.form-select:focus,
.form-check-input:focus{
  border-color:#0d6efd;
  box-shadow:0 0 0 .12rem rgba(13,110,253,.18);
}
.form-check-input:checked{
  border-color:#0d6efd;
  background-color:#0d6efd;
}
.tabulator .tabulator-header,
.document-panel .tabulator .tabulator-header,
.document-detail-page .tabulator .tabulator-header,
.document-edit-form .tabulator .tabulator-header,
.dashboard-view-tabulator .tabulator .tabulator-header,
.insight-tabulator .tabulator .tabulator-header{
  background:#f4f6f8!important;
}
.tabulator .tabulator-header .tabulator-col,
.document-panel .tabulator .tabulator-header .tabulator-col,
.document-detail-page .tabulator .tabulator-header .tabulator-col,
.document-edit-form .tabulator .tabulator-header .tabulator-col,
.dashboard-view-tabulator .tabulator .tabulator-header .tabulator-col,
.insight-tabulator .tabulator .tabulator-header .tabulator-col{
  background:#f4f6f8!important;
}
.tabulator .tabulator-row{
  border-bottom:1px solid #edf1f5!important;
}
.tabulator .tabulator-row .tabulator-cell{
  height:100%!important;
  min-height:24px!important;
  border-right:0!important;
  border-bottom:0!important;
}
.tabulator .tabulator-row .tabulator-cell.grid-file-column,
.tabulator .tabulator-row:has(.grid-file-cell) .tabulator-cell{
  height:100%!important;
  min-height:58px!important;
  align-items:center!important;
}
.tabulator .tabulator-row:has(.grid-file-cell){
  min-height:58px!important;
}
.tabulator .tabulator-row .tabulator-cell .btn,
.tabulator .tabulator-row .tabulator-cell button,
.data-grid-table .btn,
.data-grid-table button,
.compact-panel .table .btn,
.compact-panel .table button,
.document-form-table .btn,
.document-form-table button,
.key-value-item .btn,
.key-value-item button,
.insight-table .btn,
.insight-table button,
.insight-table-wrap .btn,
.insight-table-wrap button,
.dashboard-view-tabulator .btn,
.dashboard-view-tabulator button,
.dashboard-view-panel .btn,
.dashboard-view-panel button{
  border-color:transparent!important;
  box-shadow:none!important;
}
.tabulator .tabulator-row .tabulator-cell .btn:hover,
.tabulator .tabulator-row .tabulator-cell button:hover,
.data-grid-table .btn:hover,
.data-grid-table button:hover,
.compact-panel .table .btn:hover,
.compact-panel .table button:hover,
.document-form-table .btn:hover,
.document-form-table button:hover,
.key-value-item .btn:hover,
.key-value-item button:hover,
.insight-table .btn:hover,
.insight-table button:hover,
.insight-table-wrap .btn:hover,
.insight-table-wrap button:hover,
.dashboard-view-tabulator .btn:hover,
.dashboard-view-tabulator button:hover,
.dashboard-view-panel .btn:hover,
.dashboard-view-panel button:hover{
  border-color:transparent!important;
}
.document-detail-page .key-value-item .form-control,
.document-detail-page .key-value-item .form-select,
.document-edit-form .key-value-item .form-control,
.document-edit-form .key-value-item .form-select,
.item-attribute-grid .key-value-editable .form-control,
.item-attribute-grid .key-value-editable .form-select{
  border:1px solid #d8e0e8!important;
  box-shadow:none!important;
}
.document-detail-page .key-value-item .form-control:focus,
.document-detail-page .key-value-item .form-select:focus,
.document-edit-form .key-value-item .form-control:focus,
.document-edit-form .key-value-item .form-select:focus,
.item-attribute-grid .key-value-editable .form-control:focus,
.item-attribute-grid .key-value-editable .form-select:focus{
  border-color:#0d6efd!important;
  box-shadow:0 0 0 .12rem rgba(13,110,253,.14)!important;
}

/* Correzioni griglie compatte: niente doppio bordo sui campi editabili e immagini a misura fissa. */
.tabulator .tabulator-row .tabulator-cell.tabulator-editable,
.tabulator .tabulator-row.tabulator-selected .tabulator-cell.tabulator-editable,
.document-panel .tabulator .tabulator-cell.tabulator-editable,
.document-panel .tabulator .tabulator-row.tabulator-selected .tabulator-cell.tabulator-editable,
.document-detail-page .tabulator .tabulator-cell.tabulator-editable,
.document-detail-page .tabulator .tabulator-row.tabulator-selected .tabulator-cell.tabulator-editable,
.document-edit-form .tabulator .tabulator-cell.tabulator-editable,
.document-edit-form .tabulator .tabulator-row.tabulator-selected .tabulator-cell.tabulator-editable{
  background:#fff!important;
  box-shadow:none!important;
}
.tabulator .tabulator-row .tabulator-cell.tabulator-editing{
  box-shadow:inset 0 0 0 1px #0d6efd!important;
}
.tabulator .tabulator-row:has(.grid-file-cell){
  height:58px!important;
  min-height:58px!important;
  max-height:58px!important;
}
.tabulator .tabulator-row:has(.grid-file-cell) .tabulator-cell,
.tabulator .tabulator-row .tabulator-cell.grid-file-column{
  height:58px!important;
  min-height:58px!important;
  max-height:58px!important;
  overflow:hidden!important;
}
.grid-file-cell{
  height:58px!important;
  min-height:58px!important;
  max-height:58px!important;
  overflow:hidden;
}
.grid-file-item{
  width:58px!important;
  min-width:58px!important;
  max-width:58px!important;
  height:58px!important;
  min-height:58px!important;
  max-height:58px!important;
  aspect-ratio:auto!important;
}
.grid-file-item>a,
.grid-file-image-edit,
.grid-file-item img{
  width:58px!important;
  height:58px!important;
  max-width:58px!important;
  max-height:58px!important;
}

/* I toggle devono mantenere il bordo anche quando sono dentro dashboard, insight o griglie. */
.dashboard-view-mode-switch .btn,
.view-mode-switch .btn,
.dashboard-activity-switch .btn,
.btn-group .btn[data-dashboard-view-mode],
.btn-group .btn[data-view-mode]{
  border-color:#0d6efd!important;
}
.dashboard-view-mode-switch .btn.btn-outline-secondary,
.view-mode-switch .btn.btn-outline-secondary,
.dashboard-activity-switch .btn.btn-outline-secondary{
  border-color:#6c757d!important;
}

/* Rifiniture griglia documento: underline editabile, PDF centrati, ricerca allineata. */
.tabulator .tabulator-row .tabulator-cell.tabulator-editable,
.tabulator .tabulator-row.tabulator-selected .tabulator-cell.tabulator-editable,
.document-panel .tabulator .tabulator-cell.tabulator-editable,
.document-panel .tabulator .tabulator-row.tabulator-selected .tabulator-cell.tabulator-editable,
.document-detail-page .tabulator .tabulator-cell.tabulator-editable,
.document-detail-page .tabulator .tabulator-row.tabulator-selected .tabulator-cell.tabulator-editable,
.document-edit-form .tabulator .tabulator-cell.tabulator-editable,
.document-edit-form .tabulator .tabulator-row.tabulator-selected .tabulator-cell.tabulator-editable{
  border-bottom:1px solid #cfe3ff!important;
}
.tabulator .tabulator-row:has(.grid-file-cell) .tabulator-cell.tabulator-editable{
  border-bottom:1px solid #cfe3ff!important;
}
.grid-file-item .js-pdf-editor-open,
.grid-file-attachment{
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  min-height:36px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:0!important;
  margin:auto!important;
  line-height:1!important;
}
.grid-file-item .js-pdf-editor-open i,
.grid-file-attachment i{
  display:block;
  font-size:1.1rem!important;
  line-height:1!important;
}
.document-toolbar .grid-search.input-group,
.document-panel .grid-search.input-group{
  height:28px!important;
  min-height:28px!important;
  align-items:stretch!important;
}
.document-toolbar .grid-search.input-group .input-group-text,
.document-toolbar .grid-search.input-group .form-control,
.document-panel .grid-search.input-group .input-group-text,
.document-panel .grid-search.input-group .form-control{
  height:28px!important;
  min-height:28px!important;
  display:flex!important;
  align-items:center!important;
  line-height:1.2!important;
}
.document-toolbar .grid-search.input-group .input-group-text,
.document-panel .grid-search.input-group .input-group-text{
  justify-content:center!important;
}
.document-toolbar-left > .btn[aria-label="Modifica"],
.document-toolbar-left > .btn[aria-label="Duplica"],
.document-toolbar-left > .btn[aria-label="Elimina"],
.document-toolbar-left > .btn[aria-label="Copia"],
.document-toolbar-left > .btn[aria-label="Sposta"],
.document-toolbar-left > .btn[aria-label="Archivia"],
.document-toolbar-left > .btn[aria-label="Excel"]{
  width:28px;
  padding-left:0!important;
  padding-right:0!important;
  justify-content:center;
}
.grid-filter-header-actions{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1px;
  width:100%;
}
.grid-filter-toggle,
.grid-filter-clear{
  width:18px;
  height:16px;
  padding:0;
  border:0;
  background:transparent;
  color:#0d6efd;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  border-radius:4px;
}
.grid-filter-toggle:hover,
.grid-filter-clear:hover{
  background:#eaf3ff;
}
.grid-filter-clear{
  color:#6c757d;
}
#documentGrid:not(.grid-filters-visible) .grid-filter-clear,
#viewGrid:not(.grid-filters-visible) .grid-filter-clear{
  display:none!important;
}
#documentGrid:not(.grid-filters-visible) .grid-filter-header-actions,
#viewGrid:not(.grid-filters-visible) .grid-filter-header-actions{
  flex-direction:row;
  gap:0;
}

/* Fondo richiesto per i box dei campi in modifica. */
.document-edit-form .key-value-item,
.document-create-form .key-value-item,
.document-edit-form .key-value-item:hover,
.document-create-form .key-value-item:hover{
  background:#f9fcfe!important;
}

/* Override piu specifico: i box campo del form documento non devono tornare bianchi. */
.document-detail-page.document-edit-form .key-value-grid > .key-value-item,
.document-detail-page.document-edit-form .key-value-grid > .key-value-item.key-value-editable,
.document-detail-page.document-create-form .key-value-grid > .key-value-item,
.document-detail-page.document-create-form .key-value-grid > .key-value-item.key-value-editable,
form.document-edit-form.document-detail-page .key-value-item.dynamic-field,
form.document-create-form.document-detail-page .key-value-item.dynamic-field{
  background:#f9fcfe!important;
}

/* Workflow PHP: il codice deve avere una scrollbar verticale propria. */
#eventCodePanel:not(.d-none){
  display:flex;
  flex:1 1 auto;
  min-height:0;
  height:calc(100vh - 245px);
  overflow:hidden;
}
#eventCodePanel .event-editor-layout{
  flex:1 1 auto;
  min-height:0;
  height:100%;
  align-items:stretch;
}
#eventCodePanel .event-editor-main{
  min-height:0;
  overflow:hidden;
}
#eventCodePanel .code-editor-textarea,
#eventCodePanel .CodeMirror{
  flex:1 1 auto;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
}
#eventCodePanel .CodeMirror-scroll{
  height:100%!important;
  min-height:0!important;
  overflow:auto!important;
  margin-right:0!important;
  margin-bottom:0!important;
  padding-bottom:0!important;
  scrollbar-gutter:stable;
}
@media(max-width:991.98px){
  #eventCodePanel:not(.d-none){
    display:block;
    height:auto;
    overflow:visible;
  }
  #eventCodePanel .code-editor-textarea,
  #eventCodePanel .CodeMirror{
    height:65vh!important;
    max-height:65vh!important;
  }
}

/* Insight su record: niente scrollbar verticale interna, deve scorrere la pagina. */
.document-detail-page .insight-table-wrap{
  height:auto!important;
  max-height:none!important;
  overflow-x:auto!important;
  overflow-y:visible!important;
}
.document-detail-page .insight-tabulator{
  height:auto!important;
  min-height:0!important;
}
.document-detail-page .insight-tabulator .tabulator-tableholder{
  height:auto!important;
  max-height:none!important;
  overflow-y:visible!important;
}

/* Scroll coerente: l'area interna scorre finche' puo', poi il gesto passa al contenitore padre. */
.content-area,
.treeview,
.document-detail-page,
.document-edit-form,
.document-grid,
.nested-document-grid,
.document-form-table,
.tabulator .tabulator-tableholder,
.table-responsive,
.dashboard-view-table-wrap,
.view-grid-panel,
.view-board-scroll,
.view-matrix-scroll,
.view-board-column-cards,
.workflow-palette,
.workflow-properties,
.workflow-canvas,
.file-library-modal-list,
.file-library-table-wrap,
.audit-log-scroll,
.field-history-table-wrap,
.ai-assistant-messages,
.ai-preview-table-wrap,
.pdf-editor-wrap,
.image-editor-canvas-wrap,
.pdf-editor-toolbar,
.image-editor-toolbar,
.json-box,
.audit-change pre,
.field-history-value,
#eventCodePanel .CodeMirror-scroll{
  overscroll-behavior-x:auto;
  overscroll-behavior-y:auto;
  -webkit-overflow-scrolling:touch;
}

.document-grid,
.nested-document-grid,
.document-form-table,
.tabulator .tabulator-tableholder,
.table-responsive,
.dashboard-view-table-wrap,
.view-grid-panel,
.view-board-scroll,
.view-matrix-scroll,
.file-library-table-wrap,
.audit-log-scroll,
.field-history-table-wrap,
.ai-preview-table-wrap,
#eventCodePanel .CodeMirror-scroll{
  touch-action:pan-x pan-y;
}

/* Schede area principale */
.workspace-tabs-shell{
  flex:0 0 auto;
  min-height:36px;
  margin:-.35rem -.35rem .55rem;
  padding:.24rem .32rem 0;
  border-bottom:1px solid #d9e0e7;
  background:#eef2f6;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
}
.workspace-tabs-shell.workspace-tabs-empty{
  display:none;
}
.workspace-tabs{
  display:flex;
  align-items:flex-end;
  gap:.16rem;
  min-width:0;
}
.workspace-tab{
  display:flex;
  align-items:center;
  min-width:118px;
  max-width:240px;
  height:30px;
  border:1px solid transparent;
  border-bottom:0;
  border-radius:.42rem .42rem 0 0;
  background:#e4e9ef;
  color:#3f4b57;
  overflow:hidden;
}
.workspace-tab:hover{
  background:#f4f7fa;
}
.workspace-tab.is-active{
  background:#f8f9fb;
  border-color:#d9e0e7;
  color:#0f1720;
}
.workspace-tab-link{
  display:flex;
  align-items:center;
  gap:.35rem;
  min-width:0;
  flex:1 1 auto;
  height:100%;
  padding:0 .42rem;
  color:inherit;
  text-decoration:none;
}
.workspace-tab-icon{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  margin-left:.18rem;
  padding:0;
  border:0;
  border-radius:999px;
  background:transparent;
  color:inherit;
  line-height:1;
}
.workspace-tab-icon:hover{
  background:#dce8f5;
  color:#0d6efd;
}
.workspace-tab-icon i{
  font-size:.86rem;
}
.workspace-tab-link span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:.78rem;
  font-weight:600;
}
.workspace-tab-close{
  flex:0 0 auto;
  width:24px;
  height:24px;
  margin-right:.15rem;
  border:0;
  border-radius:999px;
  background:transparent;
  color:#6b7784;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:.68rem;
}
.workspace-tab-close:hover{
  background:#dce4ec;
  color:#202832;
}
.workspace-tab-refresh-btn{
  width:22px;
  height:22px;
  margin-right:.28rem;
  border:1px solid #cfd8e3;
  border-radius:999px;
  background:#fff;
  color:#526170;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  font-size:.72rem;
  line-height:1;
  vertical-align:middle;
}
.workspace-tab-refresh-btn:hover{
  border-color:#0d6efd;
  color:#0d6efd;
  background:#edf7ff;
}
.workspace-tab-refresh-btn + .breadcrumb-wrap{
  vertical-align:middle;
}
.field-tab-group{
  grid-column:1/-1;
  min-width:0;
  border:1px solid #dfe6ee;
  border-radius:.5rem;
  background:#fff;
  overflow:hidden;
}
.field-tab-nav{
  display:flex;
  align-items:center;
  gap:.18rem;
  padding:.25rem .32rem 0;
  background:transparent;
  border-bottom:0;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
}
.field-tab-button{
  min-height:25px;
  border:1px solid transparent;
  border-bottom:0;
  border-radius:.38rem .38rem 0 0;
  background:transparent;
  color:#526170;
  padding:.18rem .58rem;
  font-size:.75rem;
  font-weight:700;
  white-space:nowrap;
}
.field-tab-button:hover{
  background:#eef6ff;
  color:#0d6efd;
}
.field-tab-button.is-active{
  background:#f3f6f9;
  border-color:#dfe6ee;
  color:#17212b;
}
.field-tab-body{
  padding:.42rem;
  background:#f3f6f9;
}
.field-tab-pane{
  grid-template-columns:repeat(12,minmax(0,1fr));
  grid-auto-flow:dense;
  grid-auto-rows:minmax(62px,auto);
  align-items:start;
}
.field-tab-pane > .key-value-item{
  min-height:62px;
}
.config-inline-table .form-control,
.config-inline-table .form-select{
  min-height:25px;
  height:25px;
  padding:.12rem .32rem;
  font-size:.78rem;
  border-color:#d6e1ec;
  background:#fff;
}
.config-inline-table .form-check-input{
  width:1rem;
  height:1rem;
  margin-top:0;
}
.config-inline-table td{
  vertical-align:middle;
}
.config-inline-table .config-inline-json{
  min-width:220px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
}
.config-inline-status{
  display:inline-block;
  min-width:48px;
}
.workspace-page-content{
  min-height:0;
}
.workspace-tab-frames{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
}
.workspace-tab-frame{
  flex:1 1 auto;
  width:100%;
  min-height:0;
  border:0;
  background:#f8f9fb;
}
.workspace-tab-frame-ai{
  overflow:auto;
  padding:.65rem;
}
.workspace-tab-frame-ai > .ai-main-results{
  min-height:100%;
}
.workspace-empty-state{
  min-height:55vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:#6c757d;
  gap:.35rem;
}
.workspace-empty-state i{
  font-size:2rem;
  color:#9aa6b2;
}
.workspace-empty-state h1{
  font-size:1.05rem;
  margin:0;
  color:#2d3742;
}
.workspace-empty-state p{
  margin:0;
}
html:has(.embedded-app-container),
body:has(.embedded-app-container){
  height:100%;
  overflow:hidden;
}
.embedded-app-container{
  height:100vh;
  min-height:0;
  display:flex;
  flex-direction:column;
  background:#f8f9fb;
}
.embedded-content-area{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
}

/* Pagine documento/vista: la griglia deve usare tutta l'altezza disponibile della scheda. */
.content-area:has(.workspace-page-content > .document-panel),
.embedded-content-area:has(> .document-panel){
  display:flex;
  flex-direction:column;
  min-height:0;
  overflow:hidden;
}
.workspace-page-content:has(> .document-panel),
.embedded-content-area:has(> .document-panel){
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.workspace-page-content:has(> .document-panel) > .item-page-header,
.embedded-content-area:has(> .document-panel) > .item-page-header,
.workspace-page-content:has(> .document-panel) > .item-attributes-panel,
.embedded-content-area:has(> .document-panel) > .item-attributes-panel{
  flex:0 0 auto;
}
.workspace-page-content:has(> .document-panel) > .document-panel,
.embedded-content-area:has(> .document-panel) > .document-panel{
  flex:1 1 auto;
  height:auto!important;
  min-height:0!important;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.document-panel > .document-grid,
.document-panel > .view-grid-panel,
.document-panel > .view-chart-panel,
.document-panel > .view-map-panel,
.document-panel > .view-synoptic-panel,
.document-panel > .view-board-panel,
.document-panel > .view-matrix-panel,
.document-panel > .view-multidimensional-panel{
  flex:1 1 auto;
  min-height:0!important;
}
.document-panel > .view-grid-panel:not(.d-none){
  display:flex;
  flex-direction:column;
}
.document-panel > .view-grid-panel > .document-grid{
  flex:1 1 auto;
  min-height:0!important;
}
.content-area.has-document-fill-panel,
.embedded-content-area.has-document-fill-panel{
  height:100%!important;
  display:flex!important;
  flex-direction:column!important;
  min-height:0!important;
  overflow:hidden!important;
}
.workspace-page-content.has-document-fill-panel,
.embedded-content-area.has-document-fill-panel{
  flex:1 1 auto!important;
  height:auto!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
.workspace-page-content.has-document-fill-panel > .item-page-header,
.embedded-content-area.has-document-fill-panel > .item-page-header,
.workspace-page-content.has-document-fill-panel > .item-attributes-panel,
.embedded-content-area.has-document-fill-panel > .item-attributes-panel{
  flex:0 0 auto!important;
}
.workspace-page-content.has-document-fill-panel > .alert,
.embedded-content-area.has-document-fill-panel > .alert{
  flex:0 0 auto!important;
}
.workspace-page-content.has-document-fill-panel > .document-detail-page,
.embedded-content-area.has-document-fill-panel > .document-detail-page{
  flex:1 1 auto!important;
  height:auto!important;
  max-height:none!important;
  min-height:0!important;
  overflow:auto!important;
}
.document-fill-panel{
  flex:1 1 auto!important;
  height:auto!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
.document-fill-panel > .document-grid,
.document-fill-panel > .view-grid-panel,
.document-fill-panel > .view-chart-panel,
.document-fill-panel > .view-map-panel,
.document-fill-panel > .view-synoptic-panel,
.document-fill-panel > .view-board-panel,
.document-fill-panel > .view-matrix-panel,
.document-fill-panel > .view-multidimensional-panel{
  flex:1 1 auto!important;
  min-height:0!important;
}
.document-fill-panel > .view-grid-panel:not(.d-none){
  display:flex!important;
  flex-direction:column!important;
}
.document-fill-panel > .view-grid-panel > .document-grid{
  flex:1 1 auto!important;
  min-height:0!important;
}
.document-panel > .d-none,
.document-fill-panel > .d-none{
  display:none!important;
}
@media(max-width:767.98px){
  .workspace-tabs-shell{
    margin:-.2rem -.2rem .45rem;
    padding:.2rem .25rem 0;
  }
  .workspace-tab{
    min-width:104px;
    max-width:72vw;
    height:31px;
  }
}

/* Compattazione area schede/contenuto: recupera spazio utile sopra al footer. */
.content-area{
  padding:.45rem .55rem .38rem!important;
}
.workspace-tabs-shell{
  min-height:29px!important;
  margin:-.28rem -.28rem .32rem!important;
  padding:.14rem .24rem 0!important;
  border-bottom:1px solid #d9e0e7!important;
  background:#eef2f6!important;
}
.workspace-tab{
  position:relative;
}
.workspace-tab.is-active{
  z-index:2;
  margin-bottom:-1px;
  border-bottom:1px solid #f8f9fb!important;
  overflow:visible;
}
.workspace-tab.is-active::after,
.workspace-tab.is-active .workspace-tab-link::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-2px;
  height:3px;
  background:#f8f9fb;
  pointer-events:none;
}
.workspace-tab.is-active .workspace-tab-link{
  position:relative;
  z-index:3;
}
.workspace-tab.is-active .workspace-tab-link::after{
  bottom:-1px;
  height:2px;
}
.workspace-tab{
  height:25px!important;
  min-width:112px;
}
.workspace-tab-link{
  padding:0 .34rem!important;
}
.workspace-tab-link span{
  font-size:.73rem!important;
  line-height:1!important;
}
.workspace-tab-icon i{
  font-size:.8rem!important;
}
.workspace-tab-close{
  width:20px!important;
  height:20px!important;
  margin-right:.08rem!important;
}
.workspace-tab-close i{
  font-size:.72rem!important;
}
.workspace-page-content.has-document-fill-panel > .item-page-header,
.embedded-content-area.has-document-fill-panel > .item-page-header{
  margin-bottom:.35rem!important;
}
.workspace-page-content.has-document-fill-panel > .document-panel,
.embedded-content-area.has-document-fill-panel > .document-panel{
  padding:.35rem!important;
}
.document-record-draggable{
  cursor:grab;
}
.document-record-draggable.is-record-dragging{
  opacity:.62;
}
.tree-row.is-record-drop-target{
  background:#eaf4ff!important;
  outline:2px solid rgba(13,110,253,.45);
  outline-offset:1px;
}
.tree-row.is-record-drop-invalid{
  background:#fff1f1!important;
  outline:2px solid rgba(220,53,69,.35);
  outline-offset:1px;
}
@media(max-width:767.98px){
  .content-area{
    padding:.35rem!important;
  }
  .workspace-tabs-shell{
    margin:-.18rem -.18rem .28rem!important;
  }
  .workspace-tab{
    height:26px!important;
    min-width:100px;
  }
}

/* Schede: niente linea globale sotto la tab attiva; le inattive restano leggibili come schede. */
.workspace-tabs-shell{
  border-bottom:0!important;
  background:#eef2f6!important;
}
.workspace-tab{
  border:1px solid #d9e0e7!important;
  border-bottom:1px solid #d9e0e7!important;
  border-radius:.38rem .38rem 0 0!important;
}
.workspace-tab.is-active{
  border-color:#d9e0e7!important;
  border-bottom-color:#f8f9fb!important;
  background:#f8f9fb!important;
  margin-bottom:0!important;
}
.workspace-tab.is-active::after,
.workspace-tab.is-active .workspace-tab-link::after{
  display:none!important;
}
.auth-card .btn.btn-sm{min-height:22px;height:22px;padding-top:0;padding-bottom:0;display:inline-flex;align-items:center;justify-content:center;gap:.35rem}
.grid-sensitive-wrap{display:inline-flex;align-items:center;gap:.25rem;min-width:0}
.grid-sensitive-btn,.field-sensitive-btn{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:0;background:transparent;color:#0d6efd;padding:0;text-decoration:none;border-radius:4px}
.grid-sensitive-btn:hover,.field-sensitive-btn:hover{background:#eaf3ff;color:#0a58ca}
.sensitive-grid-column .tabulator-cell{gap:.2rem}

.superadmin-html,
.superadmin-body{
  height:auto!important;
  min-height:100%!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
}
.superadmin-body{
  min-height:100vh;
  background:#f4f7fb;
  color:#152033;
}
.superadmin-header{
  height:48px;
  background:#0d6efd;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 .9rem;
}
.superadmin-main{
  padding:1rem;
  max-width:1680px;
  margin:0 auto;
}
.superadmin-grid{
  display:grid;
  grid-template-columns:minmax(0,1.12fr) minmax(360px,.88fr);
  gap:.9rem;
}
.superadmin-card{
  background:#fff;
  border:1px solid #dbe4ee;
  border-radius:8px;
  padding:.8rem;
  box-shadow:0 1px 2px rgba(13,35,67,.05);
}
.superadmin-card-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.8rem;
  font-weight:700;
  margin-bottom:.7rem;
}
.superadmin-mini-form{
  display:flex;
  flex-direction:column;
  gap:.45rem;
  padding:.65rem;
  border:1px solid #e2eaf2;
  border-radius:7px;
  background:#f9fcfe;
}
.superadmin-mini-form h2{
  margin:0;
  font-size:.9rem;
  font-weight:700;
}
.superadmin-scroll{
  max-height:240px;
  overflow:auto;
}
.superadmin-env-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(220px,1fr));
  gap:.55rem;
}
.superadmin-env-grid label{
  display:flex;
  flex-direction:column;
  gap:.18rem;
  min-width:0;
}
.superadmin-env-grid span{
  font-size:.72rem;
  font-weight:700;
  color:#5c6f84;
}
@media(max-width:1100px){
  .superadmin-grid{grid-template-columns:1fr}
  .superadmin-env-grid{grid-template-columns:repeat(2,minmax(220px,1fr))}
}
@media(max-width:700px){
  .superadmin-main{padding:.6rem}
  .superadmin-env-grid{grid-template-columns:1fr}
}
.multi-value-field{
  display:flex;
  flex-direction:column;
  gap:.25rem;
  min-width:0;
}
.multi-value-tabs{
  display:flex;
  align-items:center;
  gap:.12rem;
  overflow-x:auto;
  scrollbar-width:thin;
}
.multi-value-tab-button{
  border:1px solid #d6e1ec;
  background:#f3f8fd;
  color:#425466;
  border-radius:5px 5px 0 0;
  padding:.1rem .42rem;
  min-height:22px;
  font-size:.7rem;
  font-weight:500;
  white-space:nowrap;
}
.multi-value-tab-button.is-active{
  background:#fff;
  color:#0d6efd;
  border-bottom-color:#fff;
}
.multi-value-panes{
  min-width:0;
}
.multi-value-pane{
  min-width:0;
}
.multi-value-display{
  display:block;
  min-height:24px;
}
.multi-value-display.richtext-display p:last-child{
  margin-bottom:0;
}
.document-detail-page .key-value-grid,
.document-edit-form .key-value-grid{
  --field-layout-row-gap:.32rem;
  --field-layout-row-px:64px;
  grid-template-columns:repeat(12,minmax(0,1fr));
  grid-auto-flow:row;
  grid-auto-rows:var(--field-layout-row-px);
  column-gap:.32rem;
  row-gap:0;
  align-items:start;
}
.document-detail-page .key-value-grid > .key-value-item,
.document-edit-form .key-value-grid > .key-value-item{
  grid-column:span var(--field-form-col-span,2);
  grid-row:span var(--field-form-row-span,var(--field-form-grid-row-span,1));
  --field-form-box-height:max(1px,calc(var(--field-form-height,var(--field-form-auto-height,var(--field-layout-row-px))) - var(--field-layout-row-gap,.32rem)));
  align-self:start;
  min-height:var(--field-form-box-height);
  margin-bottom:var(--field-layout-row-gap);
}
.document-detail-page .key-value-grid > .key-value-item[style*="--field-form-new-line"],
.document-edit-form .key-value-grid > .key-value-item[style*="--field-form-new-line"]{
  grid-column-start:1;
}
.document-detail-page .key-value-grid > .field-tab-group,
.document-edit-form .key-value-grid > .field-tab-group{
  grid-column:1 / -1;
  grid-row:span var(--field-form-grid-row-span,1);
}
.document-detail-page .key-value-item[style*="--field-form-height"],
.document-edit-form .key-value-item[style*="--field-form-height"],
.document-detail-page .key-value-item[style*="--field-form-auto-height"],
.document-edit-form .key-value-item[style*="--field-form-auto-height"]{
  height:var(--field-form-box-height);
}
.document-detail-page .key-value-grid > .key-value-item[style*="--field-form-dominant"],
.document-edit-form .key-value-grid > .key-value-item[style*="--field-form-dominant"]{
  grid-column:1 / -1;
  width:100%!important;
  max-width:100%!important;
}
.document-detail-page .key-value-item[style*="--field-form-height"] textarea.form-control,
.document-edit-form .key-value-item[style*="--field-form-height"] textarea.form-control{
  min-height:max(60px,calc(var(--field-form-box-height) - 42px));
}
.document-detail-page .key-value-item[style*="--field-form-height"] .tox-tinymce,
.document-edit-form .key-value-item[style*="--field-form-height"] .tox-tinymce{
  min-height:max(40px,calc(var(--field-form-box-height) - 78px))!important;
}
.document-detail-page .key-value-item[style*="--field-form-height"] .richtext-editor-wrap:not(.editor-tools-visible) .tox-tinymce,
.document-edit-form .key-value-item[style*="--field-form-height"] .richtext-editor-wrap:not(.editor-tools-visible) .tox-tinymce{
  height:max(40px,calc(var(--field-form-box-height) - 78px))!important;
  min-height:max(40px,calc(var(--field-form-box-height) - 78px))!important;
}
.document-detail-page .key-value-item[style*="--field-form-height"] .signature-pad-canvas,
.document-edit-form .key-value-item[style*="--field-form-height"] .signature-pad-canvas{
  min-height:max(120px,calc(var(--field-form-box-height) - 78px));
}
.document-detail-page .key-value-file.dynamic-field-image[style*="--field-form-height"],
.document-detail-page .key-value-file.dynamic-field-gallery[style*="--field-form-height"]{
  display:flex;
  flex-direction:column;
  height:var(--field-form-box-height);
}
.document-detail-page .key-value-file.dynamic-field-image[style*="--field-form-height"] .inline-file-field,
.document-detail-page .key-value-file.dynamic-field-gallery[style*="--field-form-height"] .inline-file-field{
  flex:1 1 auto;
  min-height:0;
  align-items:stretch;
}
.document-detail-page .key-value-file.dynamic-field-image[style*="--field-form-height"] .inline-file-list,
.document-detail-page .key-value-file.dynamic-field-gallery[style*="--field-form-height"] .inline-file-list{
  flex:1 1 auto;
  width:100%;
  min-height:0;
  align-items:flex-start;
  justify-content:flex-start;
}
.document-detail-page .key-value-file.dynamic-field-image[style*="--field-form-height"] .inline-file-item,
.document-detail-page .key-value-file.dynamic-field-gallery[style*="--field-form-height"] .inline-file-item{
  height:100%;
  max-height:100%;
  align-items:flex-start;
}
.document-detail-page .key-value-file.dynamic-field-image[style*="--field-form-height"] .inline-image-link,
.document-detail-page .key-value-file.dynamic-field-gallery[style*="--field-form-height"] .inline-image-link{
  width:auto;
  min-width:96px;
  max-width:100%;
  height:100%;
  min-height:96px;
  border:1px solid #e1e8f0;
  background:#fff;
}
.document-detail-page .key-value-file.dynamic-field-image[style*="--field-form-height"] .inline-image-link img,
.document-detail-page .key-value-file.dynamic-field-gallery[style*="--field-form-height"] .inline-image-link img{
  object-fit:contain;
}
.document-detail-page .key-value-file.dynamic-field-image[style*="--field-form-dominant"] .inline-image-link,
.document-detail-page .key-value-file.dynamic-field-gallery[style*="--field-form-dominant"] .inline-image-link{
  height:100%;
  max-width:min(100%, var(--field-form-box-height));
}
.field-layout-editing .key-value-item[data-field-layout-id]{
  position:relative;
  outline:0;
}
.field-layout-editing .key-value-item[data-field-layout-id]::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:0;
  bottom:calc(-1 * var(--field-layout-row-gap,.32rem));
  border:1px dashed rgba(13,110,253,.55);
  border-radius:6px;
  pointer-events:none;
  z-index:7;
}
.field-layout-editing .key-value-item[data-field-layout-id].field-layout-dragging{
  opacity:.58;
}
.field-layout-editing .key-value-item[data-field-layout-id].field-layout-drop-target{
  outline:0;
}
.field-layout-editing .key-value-item[data-field-layout-id].field-layout-drop-target::after{
  border:2px solid #0d6efd;
}
.field-layout-tools{
  display:none;
  position:absolute;
  top:3px;
  right:3px;
  z-index:8;
  align-items:center;
  gap:2px;
  background:rgba(249,252,254,.94);
  border:1px solid #cfe2ff;
  border-radius:5px;
  padding:1px;
  box-shadow:0 2px 8px rgba(0,0,0,.08);
}
.field-layout-editing .field-layout-tools{
  display:flex;
}
.field-layout-tools button{
  width:19px;
  height:19px;
  min-height:19px;
  border:0;
  background:transparent;
  color:#0d6efd;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  font-size:.76rem;
  line-height:1;
}
.field-layout-tools button:hover{
  background:#e7f1ff;
}
.field-layout-drag-handle{
  cursor:grab;
}
.field-layout-resize-handle{
  cursor:nwse-resize;
}
.field-layout-new-line.is-active{
  background:#0d6efd!important;
  color:#fff!important;
}
.field-layout-editing .key-value-item[data-field-layout-id] input,
.field-layout-editing .key-value-item[data-field-layout-id] select,
.field-layout-editing .key-value-item[data-field-layout-id] textarea,
.field-layout-editing .key-value-item[data-field-layout-id] button:not(.field-layout-control){
  pointer-events:none;
}
@media(max-width:767.98px){
  .document-detail-page .key-value-grid > .key-value-item,
  .document-edit-form .key-value-grid > .key-value-item{
    grid-column:span 12!important;
    width:100%!important;
    max-width:100%!important;
  }
}
.catalog-admin-header{margin-bottom:.45rem}
.catalog-admin-header h1{display:flex;align-items:center;gap:.35rem}
.catalog-admin-header h1 i{font-size:1rem}
.catalog-admin-header p{font-size:.78rem}
.catalog-admin-page{align-items:start}
.catalog-admin-panel{padding:0;overflow:hidden;border-radius:.4rem}
.catalog-admin-panel>.section-title{display:flex;align-items:center;gap:.35rem;margin:0;padding:.42rem .55rem;background:#f8f9fa;border-bottom:1px solid #e4e8ed;font-size:.82rem}
.catalog-admin-panel>.section-title i{font-size:.78rem;color:#6c757d}
.catalog-admin-panel-body{padding:.5rem .55rem}
.catalog-admin-page .form-label{font-size:.74rem;margin-bottom:.1rem}
.catalog-admin-page .form-control-sm{min-height:26px;padding:.18rem .42rem;font-size:.78rem}
.catalog-admin-page textarea.form-control-sm{min-height:52px}
.catalog-admin-page .form-check-label{font-size:.76rem}
.catalog-admin-page .form-switch{min-height:1.2rem}
.catalog-admin-table{font-size:.76rem}
.catalog-admin-table>:not(caption)>*>*{padding:.25rem .4rem}
.catalog-admin-table thead th{background:#f8f9fa;font-size:.7rem;white-space:nowrap}
.catalog-admin-table code{font-size:.72rem}
.catalog-admin-table .badge{font-size:.64rem;padding:.18rem .35rem}
.catalog-row-actions .btn{width:25px;height:24px;display:inline-flex;align-items:center;justify-content:center;padding:0}
.catalog-row-actions form{display:flex}
@media(max-width:991.98px){.catalog-list-panel{margin-top:.15rem}}
.app-loading-overlay{
  position:fixed;
  inset:0;
  z-index:12000;
  display:grid;
  place-items:center;
  padding:1.5rem;
  background:rgba(239,245,255,.76);
  backdrop-filter:blur(4px);
}
.app-loading-overlay[hidden]{display:none}
.app-loading-card{
  min-width:min(22rem,calc(100vw - 3rem));
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:.45rem;
  padding:1.4rem 1.75rem;
  color:#12213a;
  background:rgba(255,255,255,.96);
  border:1px solid rgba(13,110,253,.16);
  border-radius:1rem;
  box-shadow:0 1.2rem 3rem rgba(24,56,105,.2);
}
.app-loading-card strong{font-size:1rem}
.app-loading-card small{color:#66758d}
.calypso-loader-mark{
  display:inline-flex;
  align-items:flex-end;
  gap:.25rem;
  height:2rem;
  margin-bottom:.2rem;
}
.calypso-loader-mark i{
  display:block;
  width:.48rem;
  height:1rem;
  border-radius:.2rem;
  background:linear-gradient(180deg,#53d8ff 0%,#0d6efd 65%,#0747a6 100%);
  animation:calypso-loader-wave .9s ease-in-out infinite;
}
.calypso-loader-mark i:nth-child(2){height:1.5rem;animation-delay:.12s}
.calypso-loader-mark i:nth-child(3){height:1.15rem;animation-delay:.24s}
@keyframes calypso-loader-wave{
  0%,100%{transform:translateY(0);opacity:.55}
  50%{transform:translateY(-.38rem);opacity:1}
}
.dashboard-view-panel{position:relative}
.dashboard-view-loading{
  min-height:10rem;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:.45rem;
  color:#63718a;
}
.dashboard-view-panel.is-loading [data-dashboard-view-content]{display:none!important}
@media (prefers-reduced-motion:reduce){
  .calypso-loader-mark i{animation:none}
}

/* V95: filtri nel breadcrumb, gerarchie, sottotabelle, designer stampa ed export PDF. */
.grid-filter-breadcrumbs{display:inline-flex;align-items:center;gap:.28rem;flex-wrap:wrap}
.grid-filter-crumb{display:inline-flex;align-items:center;padding:.08rem .34rem;border:1px solid #cfe2ff;border-radius:999px;background:#eef6ff;color:#084298;font-weight:600;text-decoration:none;cursor:pointer}
.grid-filter-crumb:hover{border-color:#6ea8fe;background:#dbeafe;color:#052c65;text-decoration:none}
.document-html-block{width:100%;margin:.45rem 0;padding:.65rem .8rem;border-left:4px solid #0d6efd;border-radius:.4rem;background:linear-gradient(90deg,#eef6ff,#fff);break-inside:avoid}
.document-html-block h1,.document-html-block h2,.document-html-block h3,.document-html-block p{margin-top:0;margin-bottom:.35rem}
.grid-subtable-values{display:flex;flex-direction:column;align-self:stretch;width:100%}
.grid-subtable-value{min-height:1.45rem;padding:.12rem .2rem;border-bottom:1px solid #e4e9ef;white-space:normal;overflow-wrap:anywhere}
.grid-subtable-value:last-child{border-bottom:0}
.tabulator .tabulator-group{padding:.3rem .5rem;background:#edf5ff;border-top:1px solid #b9d4f5;color:#172b4d}
.tabulator .tabulator-group .tabulator-arrow{display:none}
.grid-hierarchy-toggle{display:inline-grid;place-items:center;width:1.1rem;height:1.1rem;margin-right:.35rem;border:1px solid #7aa7df;border-radius:.18rem;background:#fff;color:#0d6efd;font-size:.82rem;font-weight:800;line-height:1}
.grid-hierarchy-toggle::before{content:'+'}.tabulator-group.tabulator-group-visible>.grid-hierarchy-toggle::before{content:'−'}
.grid-hierarchy-count{margin-left:.45rem;padding:.05rem .35rem;border-radius:999px;background:#dbeafe;color:#174ea6;font-size:.68rem}
.print-template-designer{display:grid;grid-template-columns:minmax(210px,24%) minmax(0,1fr);gap:.75rem;align-items:start}
.print-field-palette{position:sticky;top:.5rem;max-height:560px;overflow:auto;padding:.6rem;border:1px solid #dfe5ec;border-radius:.5rem;background:#f8fafc}
.print-field-palette>strong,.print-field-palette>small{display:block}.print-field-palette>small{color:#6c757d;margin-bottom:.45rem}
.print-field-list{display:flex;flex-direction:column;gap:.3rem}
.print-field-token{display:grid;grid-template-columns:18px 1fr auto;gap:.35rem;align-items:center;width:100%;padding:.35rem .45rem;border:1px solid #cfd8e3;border-radius:.35rem;background:#fff;text-align:left;cursor:grab}
.print-field-token:hover{border-color:#0d6efd;background:#eef6ff}.print-field-token:active{cursor:grabbing}.print-field-token code{font-size:.65rem;color:#6c757d}
.pdf-export-staging{position:fixed;left:-100000px;top:0;width:1120px;background:#fff;z-index:-1}
.pdf-content-export,.pdf-grid-document{padding:10mm;background:#fff;color:#111;font-size:10pt}
.pdf-content-export.document-detail-page,.pdf-content-export.document-edit-form,.pdf-content-export.compact-panel{height:auto!important;max-height:none!important;overflow:visible!important}
.pdf-content-export .key-value-grid{height:auto!important;max-height:none!important;overflow:visible!important}
.pdf-content-export .key-value-item,.pdf-content-export .document-html-block,.pdf-content-export .detail-meta-row{break-inside:avoid;page-break-inside:avoid}
.pdf-grid-document h1{font-size:16pt;margin:0 0 5mm}
.pdf-grid-table{width:100%;border-collapse:collapse;font-size:7.5pt}.pdf-grid-table th,.pdf-grid-table td{padding:1.5mm;border:1px solid #aeb7c2;vertical-align:top;overflow-wrap:anywhere}.pdf-grid-table th{background:#eaf2fb}
.pdf-control-value{display:block;min-height:1.35rem;padding:.12rem .25rem;border-bottom:1px solid #dfe5ec}
@media(max-width:767.98px){.print-template-designer{grid-template-columns:1fr}.print-field-palette{position:static;max-height:240px}}
