/* M26-D3: performance and large-data usability layer */
:root {
  --nx-fast-border: #dbe7ef;
  --nx-fast-muted: #64748b;
  --nx-fast-bg: #f8fafc;
}

/*
 * Read-only cards/tables can skip off-screen paint work. Interactive picker
 * surfaces are explicitly removed from this containment by the JS marker below;
 * otherwise absolutely-positioned dropdowns are clipped at the card/table edge.
 */
.nx-perf-lite .card,
.nx-perf-lite .table,
.nx-perf-lite .modal-content {
  content-visibility: auto;
  contain-intrinsic-size: 1px 460px;
}

.nx-perf-lite .nx-overlay-surface {
  content-visibility: visible !important;
  contain: none !important;
  contain-intrinsic-size: auto !important;
}

.nx-perf-lite .nx-overlay-surface--open {
  position: relative;
  z-index: 1030;
  overflow: visible !important;
}

.nx-perf-lite .nx-overlay-host {
  position: relative;
  overflow: visible !important;
}

.nx-perf-lite .nx-overlay-host--open {
  z-index: 1032;
}

.nx-perf-lite .nx-overlay-host--open > .dropdown-menu,
.nx-perf-lite .nx-overlay-host--open .combo-panel,
.nx-perf-lite .nx-overlay-host--open + .select2-container,
.nx-perf-lite .nx-overlay-host--open .select2-dropdown {
  z-index: 1033 !important;
}

.nx-perf-lite .nx-overlay-scroll-open {
  overflow: visible !important;
}

.table-responsive,
.nx-table-scroll {
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.nx-large-table {
  min-width: 860px;
}

.nx-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 30;
  background: rgba(248, 250, 252, .95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--nx-fast-border);
  padding: .75rem;
}

.nx-page-skeleton {
  border-radius: 18px;
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: nxPulse 1.25s ease infinite;
  min-height: 92px;
}

@keyframes nxPulse {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.nx-readable-empty {
  background: #fff;
  border: 1px solid var(--nx-fast-border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.nx-document-frame iframe,
.nx-document-frame object,
.nx-document-frame embed {
  min-height: 70vh;
}

.nx-document-frame img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

@media (max-width: 768px) {
  .nx-large-table { min-width: 720px; }
  .nx-sticky-actions { left: 0; right: 0; }
  .page-actions,
  .voucher-actions,
  .action-toolbar { gap: .45rem; }
  .page-actions .btn,
  .voucher-actions .btn,
  .action-toolbar .btn {
    min-height: 42px;
    min-width: 42px;
  }
  .hide-on-mobile-performance { display: none !important; }
}
