/* ============================================================================
   FILE: report-templates.portal.css
   PROJECT: Homyn API / SecureWrap Reporting Fabric
   DESCRIPTION:
     Admin report-template governance/designer/permissions UI.
============================================================================ */

.report-template-page {
    display: grid;
    gap: 1rem;
}

.report-template-header {
    border-left: 5px solid #f58220;
}

.report-template-card,
.report-status {
    overflow: hidden;
}

.report-status-ok {
    border-left: 5px solid #2e9e44;
}

.report-status-error {
    border-left: 5px solid #b42318;
}

.report-metric-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
}

.report-metric-card {
    background: #ffffff;
    border: 1px solid rgba(13, 45, 71, .12);
    border-radius: 16px;
    padding: .95rem 1rem;
    box-shadow: 0 12px 28px rgba(0, 18, 38, .08);
}

.report-metric-card span {
    display: block;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(13, 45, 71, .68);
}

.report-metric-card strong {
    display: block;
    margin-top: .25rem;
    font-size: 1.4rem;
    color: #0d2d47;
}

.report-template-grid .dxbl-grid-header-row,
.report-template-grid .dxbl-grid-header-cell,
.report-template-grid .dxbl-grid-header-content {
    background: #0d2d47 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.report-template-grid .dxbl-grid-header-row *,
.report-template-grid .dxbl-grid-header-cell *,
.report-template-grid .dxbl-grid-header-content * {
    color: #ffffff !important;
    fill: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.report-designer-shell {
    display: grid;
    grid-template-columns: minmax(340px, .42fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.report-designer-left,
.report-designer-main {
    min-width: 0;
}

.report-side-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(13, 45, 71, .14);
}

.report-side-section h3 {
    margin: 0 0 .65rem;
    font-size: .9rem;
    color: #0d2d47;
}

.report-designer-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1rem;
    align-items: start;
}

.report-section-title {
    font-weight: 900;
    color: #0d2d47;
    margin-bottom: .5rem;
}

.report-layout-memo textarea,
.report-layout-memo .dxbl-text-edit-input {
    font-family: Consolas, "Courier New", monospace !important;
    font-size: .82rem !important;
}

.report-editor-note {
    margin: .5rem 0 1rem;
    font-size: .82rem;
    color: rgba(13, 45, 71, .74);
}

.report-inline-label {
    display: block;
    margin-bottom: .35rem;
    font-weight: 800;
    color: #0d2d47;
}

.report-field-map {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.report-field-pill {
    border: 1px solid rgba(13, 45, 71, .16);
    background: #f8fafc;
    color: #0d2d47;
    border-radius: 999px;
    padding: .35rem .65rem;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
}

.report-field-pill:hover {
    background: rgba(245, 130, 32, .12);
    border-color: rgba(245, 130, 32, .45);
}

.report-preview-card {
    border: 1px solid rgba(13, 45, 71, .14);
    border-radius: 16px;
    padding: 1rem;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(0, 18, 38, .08);
}

.receipt-preview-head {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    border-bottom: 1px solid rgba(13, 45, 71, .12);
    padding-bottom: .65rem;
    margin-bottom: .65rem;
}

.receipt-preview-head strong {
    color: #0d2d47;
}

.receipt-preview-head span {
    color: #f58220;
    font-size: .76rem;
    font-weight: 900;
}

.receipt-preview-line,
.receipt-preview-total {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .35rem 0;
}

.receipt-preview-table {
    display: grid;
    grid-template-columns: 1fr 1.3fr .8fr;
    gap: .35rem;
    margin: .7rem 0;
    font-size: .78rem;
}

.receipt-preview-table > div {
    padding: .35rem;
    background: #f8fafc;
    border-radius: 8px;
}

.receipt-preview-total {
    border-top: 1px solid rgba(13, 45, 71, .12);
    margin-top: .5rem;
    padding-top: .75rem;
    color: #0d2d47;
}

.report-popup-scroll {
    max-height: min(68vh, 680px);
    overflow-y: auto;
    padding-right: .25rem;
}

.report-permission-rules {
    display: grid;
    gap: .55rem;
    color: #0d2d47;
}

@media (max-width: 1100px) {
    .report-metric-strip,
    .report-designer-shell,
    .report-designer-stage {
        grid-template-columns: 1fr;
    }
}


/* ============================================================================
   Report Fabric dense-page scroll + visibility patch
   Scoped to report admin surfaces only.
============================================================================ */

.report-template-page,
.report-fabric-page,
.report-designer-page,
.report-designer-host-page {
    min-height: 0;
    min-width: 0;
    padding-bottom: 6rem;
    scroll-margin-top: 1rem;
}

.portal-main,
.portal-content,
.portal-page,
.portal-body {
    min-height: 0;
}

.report-template-page .portal-card,
.report-fabric-page .portal-card,
.report-designer-page .portal-card,
.report-designer-host-page .portal-card {
    min-height: 0;
    min-width: 0;
}

.report-template-grid-shell,
.report-fabric-grid-shell,
.report-template-tab-body,
.report-fabric-tab-body {
    min-height: 0;
    max-height: calc(100vh - 345px);
    overflow: auto;
}

.report-admin-popup .dxbl-popup-content,
.report-template-page .dxbl-popup-content,
.report-fabric-page .dxbl-popup-content,
.report-designer-page .dxbl-popup-content,
.report-designer-host-page .dxbl-popup-content {
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
}

.report-template-page input,
.report-template-page select,
.report-template-page textarea,
.report-fabric-page input,
.report-fabric-page select,
.report-fabric-page textarea,
.report-designer-page input,
.report-designer-page select,
.report-designer-page textarea,
.report-designer-host-page input,
.report-designer-host-page select,
.report-designer-host-page textarea,
.report-template-page .dxbl-text-edit-input,
.report-fabric-page .dxbl-text-edit-input,
.report-designer-page .dxbl-text-edit-input,
.report-designer-host-page .dxbl-text-edit-input {
    color: #102a43 !important;
    background-color: #ffffff !important;
    -webkit-text-fill-color: #102a43 !important;
}

.report-template-page .dxbl-combobox,
.report-template-page .dxbl-combobox *,
.report-fabric-page .dxbl-combobox,
.report-fabric-page .dxbl-combobox * {
    color: #102a43 !important;
    -webkit-text-fill-color: #102a43 !important;
}
