/* Only the main window's root DetailView opts in. Popups/nested editors do not. */
.proc-app.np-detail-active > .proc-header,
.proc-app.np-detail-active > .proc-nav-shell { flex-shrink: 0; }
.proc-app .np-detail-workspace {
    padding: 20px;
    gap: 22px;
    background: var(--portal-surface-soft, #f4f7fd);
    align-items: stretch;
}
.proc-app .np-detail-workspace.with-tree { grid-template-columns: 280px minmax(0, 1fr); }
.proc-app .np-detail-workspace > .np-list-sidebar {
    border: 1px solid var(--portal-border, #e0e8f4);
    border-radius: var(--portal-radius, 10px);
    box-shadow: var(--portal-shadow, 0 2px 8px #17365d03);
}
.proc-app .np-detail-page {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    min-width: 0;
    color: var(--portal-primary, #112650);
}
.proc-app .np-detail-header { flex: 0 0 auto; min-width: 0; padding: 0 0 18px; }
.proc-app .np-detail-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; color: var(--portal-muted, #627494); font-size: 13px; overflow-wrap: anywhere; }
.proc-app .np-detail-breadcrumb span + span::before { content: "/"; margin-right: 8px; color: var(--portal-muted, #8695ad); }
.proc-app .np-detail-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; min-width: 0; }
.proc-app .np-detail-title { flex: 1 1 200px; min-width: 0; margin: 0; color: var(--portal-primary, #10234a); font-size: 28px; font-weight: var(--portal-weight-strong, 700); line-height: 1.25; overflow-wrap: anywhere; }
.proc-app .np-detail-actions { display: flex; flex: 1 1 480px; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; max-width: 100%; margin-left: auto; }
.proc-app .np-detail-main-actions { flex: 1 1 420px; min-width: 0; }
.proc-app .np-detail-auxiliary-actions { display: flex; flex: 0 1 auto; min-width: 0; gap: 8px; }
.proc-app .np-detail-back-action { flex: 0 0 auto; }
.proc-app .np-detail-actions .dxbl-toolbar {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
}
.proc-app .np-detail-actions .dxbl-btn { min-height: 38px; border-radius: var(--portal-radius, 6px); }
.proc-app .np-detail-content { flex: 1 1 auto; min-width: 0; min-height: 0; overflow-y: auto; overflow-x:hidden; background: transparent; }

/* Document regions remain native XAF/DxFormLayout groups and PropertyEditors. */
.proc-app .np-document-page .np-detail-header { padding-bottom: 0; }
/* Keep the root row inside the scroll viewport so its negative gutters do not clip the card corners. */
.proc-app .np-document-page .np-detail-content > layout-editor > .detail-view-content > .dxbl-fl > .dxbl-row {
    margin-inline: 0;
}
.np-document-heading,
.np-document-information { min-width: 0; align-items: start; }
.np-document-identity,
.np-document-summary,
.np-document-information-column { min-width: 0; align-self: start; }
.np-document-heading .dxbl-fl-group,
.np-document-information .dxbl-fl-group { border: 0; background: transparent; }
.np-document-heading .dxbl-fl-group-content,
.np-document-information .dxbl-fl-group-content { padding-block: 0; }
.np-document-number { font-size: 26px; font-weight: var(--portal-weight-strong, 700); line-height: 1.3; }
.np-document-name { font-size: 15px; }
.np-document-status { color: var(--portal-primary, #1762a8); }
.np-document-status .np-document-value { display: inline-block; padding: 4px 8px; border-radius: 4px; background: var(--portal-surface-soft, #e8f2fd); }
.np-document-summary { text-align: right; }
.np-document-total { font-size: 25px; font-weight: var(--portal-weight-strong, 600); }
.np-document-total .dxbl-fl-cpt { font-size: 13px; font-weight: 400; color: var(--portal-muted, #627494); }
.np-document-summary > .dxbl-row { display: grid; grid-template-columns: minmax(0, auto) auto; justify-content: end; align-items: end; }
.np-document-summary > .dxbl-row > .dxbl-fl-item { width: auto; max-width: 100%; }
.np-document-currency { font-size: 25px; font-weight: var(--portal-weight-strong, 600); }
.np-document-actions { padding-block: 12px; }
.np-document-actions:not(:has(.np-detail-actions)) { display: none; }
.proc-app .np-document-actions .np-detail-actions { justify-content: flex-start; margin-left: 0; }
.proc-app .np-document-page .np-document-card {
    min-width: 0;
    background: var(--portal-surface, #fff);
    border: 1px solid var(--portal-border, #e0e8f4);
    border-radius: var(--portal-radius, 9px);
    box-shadow: var(--portal-shadow, 0 2px 10px #17365d03);
    padding: 4px 20px 20px;
}
.np-plain-text-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.np-document-information { padding-block: 16px; }
.np-document-information .np-document-field.dxbl-fl-item-horizontal { flex-direction: row; align-items: flex-start; }
.np-document-information .np-document-field.dxbl-fl-item-horizontal > .dxbl-fl-cpt {
    flex: 0 0 10.5rem; width: 10.5rem; min-height: 0; padding-block: 0;
    align-items: flex-start; color: var(--portal-muted, #627494); white-space: normal;
}
.np-document-information .np-document-field.dxbl-fl-item-horizontal > .dxbl-fl-ctrl { min-width: 0; flex: 1 1 0; }
.np-document-field,
.np-document-heading .dxbl-fl-ctrl { min-width: 0; overflow-wrap: anywhere; }
.np-document-field .dxbl-text,
.np-document-field a,
.np-document-field span,
.np-document-heading .dxbl-text { white-space: normal; overflow-wrap: anywhere; }
.np-document-value,
.np-document-value a { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.np-document-heading .dxbl-fl-item,
.np-document-information .dxbl-fl-item { min-height: 0; }
.np-document-information > .dxbl-row { align-items: start; }
.np-document-information-column:empty,
.np-document-information:not(:has(.np-document-field)) { display: none; padding: 0; margin: 0; }
@media (max-width: 767.98px) {
    .proc-app .np-document-page .np-document-card { padding-inline: 12px; }
    .np-document-summary { text-align: left; }
    .np-document-summary > .dxbl-row { justify-content: start; }
    .np-document-information .np-document-field.dxbl-fl-item-horizontal > .dxbl-fl-cpt { flex-basis: 8.5rem; width: 8.5rem; }
}

@media (max-width: 1000px) {
    .proc-app .np-detail-workspace { padding: 12px; gap: 12px; }
    .proc-app .np-detail-workspace.with-tree { grid-template-columns: 260px minmax(0, 1fr); }
    .proc-app .np-detail-title { font-size: 24px; }
}
@media (max-width: 800px) {
    .proc-app .np-detail-workspace.with-tree { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .proc-app .np-detail-heading { align-items: flex-start; }
    .proc-app .np-detail-title { flex-basis: 100%; }
    .proc-app .np-detail-actions { flex-basis: 100%; margin-left: 0; }
    .proc-app .np-detail-breadcrumb { margin-bottom: 10px; }
}
