/* Financial Report Builder — Tabulator theme overrides matching Corvenia styles */

.tabulator {
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    border: 1px solid #dee2e6;
}

.tabulator .tabulator-header .tabulator-col {
    background: #e5e5e5;
    color: #495057;
    border-right: 1px solid #dee2e6;
    font-weight: 600;
    font-size: 12px;
    text-transform: none;
}

.tabulator-row {
    border-bottom: 1px solid #dee2e6;
}

.tabulator-row:hover {
    background: #f8f9fa !important;
}

.tabulator-row.tabulator-section-row {
    background: #F3F6F6 !important;
}
.tabulator-row.tabulator-section-row .tabulator-cell {
    font-weight: 700;
    color: #495057;
}

.tabulator-row.tabulator-subtotal-row {
    background: #eaefef !important;
    border-top: 2px solid #c9c9c9;
}
.tabulator-row.tabulator-subtotal-row .tabulator-cell {
    font-weight: 700;
    color: #495057;
}

.tabulator-row.tabulator-total-row {
    background: #DDE6E6 !important;
    border-top: 2px solid #aaa;
}
.tabulator-row.tabulator-total-row .tabulator-cell:first-child {
    border-left: 3px solid #009688;
}
.tabulator-row.tabulator-total-row .tabulator-cell {
    font-weight: 700;
    color: #495057;
}

.tabulator-row.tabulator-spacer-row {
    height: 8px !important;
    min-height: 8px !important;
}
.tabulator-row.tabulator-spacer-row .tabulator-cell {
    padding: 0;
    border: none;
}

/* Frozen bottom row (grand total via bottomCalc) */
.tabulator .tabulator-calcs-bottom {
    background: #DDE6E6 !important;
    border-top: 2px solid #aaa;
}
.tabulator .tabulator-calcs-bottom .tabulator-row .tabulator-cell {
    font-weight: 700;
    color: #495057;
}
.tabulator .tabulator-calcs-bottom .tabulator-row .tabulator-cell:first-child {
    border-left: 3px solid #c62828;
}
.tabulator .tabulator-calcs-bottom .tabulator-row {
    background: #DDE6E6 !important;
    border-top: 2px solid #c62828;
}

/* Ensure Tabulator fills its wrapper */
.tabulator-container {
    flex: 1 1 0;
    min-height: 0;
}

/* Number cells right-aligned */
.tabulator .tabulator-cell.tabulator-number-cell {
    text-align: right;
}

/* Frozen label column */
.tabulator .tabulator-frozen.tabulator-frozen-left {
    border-right: 2px solid #dee2e6;
}

/* Report Builder hub page header (parity with ExchangeRates.razor / Corvenia tools) */
.report-builder-page .report-builder-page-header {
    padding-bottom: 7px;
    margin-bottom: 0.75rem;
    position: relative;
}

.report-builder-page .report-builder-page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 0;
    height: 1px;
    background-color: #E4E4E7;
    width: 100vw;
    margin-left: -50vw;
}

.report-builder-page .report-builder-page-header h5 {
    margin: 0;
    color: #1f2937;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
}

.report-builder-page .report-builder-page-header .text-muted {
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
}

/* Report builder page layout */
.report-builder-hub .report-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 0;
}

.report-viewer-container {
    height: 100%;
    max-height: calc(100vh - 2rem);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.report-viewer-container .tabulator-wrapper {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* padding: 0 16px 16px 16px; */
}

/* Adjusted column highlight */
.tabulator .tabulator-cell.adjusted-col {
    background: #fefce8;
}

.report-viewer-footer {
    padding: 12px 24px;
    font-size: 11px;
    color: #9e9e9e;
    border-top: 1px solid #e0e0e0;
    background: #fff;
}

/* AccountPalette (row editor): don’t stretch MudTabs — avoids empty gap above tab bar */
.account-palette-root .mud-tabs {
    flex: 0 1 auto;
    min-height: 0;
}

.account-palette-root .mud-tabs-panels {
    flex: 0 1 auto !important;
    min-height: 0 !important;
}

.account-palette-tab-panel {
    overflow-y: visible;
}
