/* Reports opt in explicitly. Data entry, posting and permission visibility are untouched. */
.erp-report-workspace {
    --report-ink: #203449;
    --report-muted: #52647a;
    --report-line: #d4dee9;
    --report-accent: #245b78;
    --report-soft: #eef3f8;
    --report-total: #e8f1ed;
    min-width: 0;
    color: var(--report-ink);
}

@media screen {
    body.erp-approved-design #report-workspace .report-workspace-header {
        display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
        gap: 1rem; padding: 1rem 1.15rem !important; margin-bottom: 1rem !important;
        background: #fff !important; border: 1px solid var(--report-line) !important;
        border-inline-start: 4px solid var(--report-accent) !important; border-radius: 12px !important;
        box-shadow: 0 3px 12px #20344905 !important;
    }
    body.erp-approved-design #report-workspace .erp-page-title { font-size: 1.4rem !important; line-height: 1.5; color: var(--report-ink) !important; }
    body.erp-approved-design #report-workspace .erp-page-subtitle { margin: .2rem 0 0; color: var(--report-muted) !important; font-size: .85rem !important; line-height: 1.7; }
    body.erp-approved-design #report-workspace .page-icon-wrapper { background: var(--report-soft) !important; color: var(--report-accent) !important; width: 44px; height: 44px; border: 1px solid var(--report-line); border-radius: 10px; box-shadow: none !important; }
    body.erp-approved-design #report-workspace .report-filter-panel {
        border: 1px solid var(--report-line) !important; border-radius: 12px !important;
        box-shadow: none !important; margin-bottom: 1rem !important; background: #fff !important;
    }
    body.erp-approved-design #report-workspace .report-filter-panel > .card-body { padding: 1rem !important; }
    .erp-report-workspace .report-panel-heading { display: flex; align-items: center; gap: .5rem; margin: 0 0 .85rem; color: var(--report-ink); font-size: .93rem; font-weight: 700; }
    .erp-report-workspace .report-panel-heading i { color: var(--report-accent); }
    .erp-report-workspace .report-filter-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; margin-bottom: .85rem; }
    .erp-report-workspace .report-filter-heading h2 { margin: 0; font-size: .94rem; font-weight: 700; }
    .erp-report-workspace :is(.report-filter-heading p, .report-help-text) { margin: 0; font-size: .8rem; color: var(--report-muted); line-height: 1.65; }
    body.erp-approved-design #report-workspace .report-filter-grid {
        display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: .8rem 1rem !important; margin: 0 !important; align-items: end;
    }
    body.erp-approved-design #report-workspace .report-filter-grid > [class*="col-"] { width: auto !important; max-width: none; padding: 0 !important; margin: 0 !important; min-width: 0; }
    body.erp-approved-design #report-workspace .report-filter-grid > .col-12,
    .erp-report-workspace .report-filter-grid > .report-actions { grid-column: 1 / -1; }
    body.erp-approved-design #report-workspace .form-label { font-size: .83rem !important; color: #40546b !important; margin-bottom: .3rem !important; font-weight: 600; }
    body.erp-approved-design #report-workspace :is(.form-control, .form-select, .erp-select-trigger) {
        min-height: 36px !important; font-size: .9rem !important; border-radius: 7px !important;
        border-color: #bdcbd9 !important; background-color: #fff; box-shadow: none;
    }
    body.erp-approved-design #report-workspace :is(.form-control, .form-select):focus { border-color: var(--report-accent) !important; box-shadow: 0 0 0 3px #245b7820 !important; }
    .erp-report-workspace .report-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
    .erp-report-workspace .report-filter-grid > .report-actions { padding-top: .8rem !important; border-top: 1px solid #e5ebf1; }
    body.erp-approved-design #report-workspace .btn { min-height: 36px; border-radius: 7px !important; font-size: .86rem !important; padding: .4rem .8rem !important; box-shadow: none !important; }
    body.erp-approved-design #report-workspace .btn-primary { color: #fff !important; background: var(--report-accent) !important; border-color: var(--report-accent) !important; }
    body.erp-approved-design #report-workspace :is(.btn-outline-primary, .btn-outline-dark) { color: var(--report-accent) !important; background: #fff !important; border-color: #b5c8d7 !important; }
    body.erp-approved-design #report-workspace :is(.btn-outline-primary, .btn-outline-dark):hover { background: var(--report-soft) !important; }
    .erp-report-workspace :is(button, a, input, select, summary):focus-visible { outline: 2px solid #245b78 !important; outline-offset: 3px; }
    body.erp-approved-design #report-workspace :is(.report-results-panel, .internal-report-viewer) { border: 1px solid var(--report-line) !important; border-radius: 12px !important; box-shadow: 0 4px 16px #20344906 !important; overflow: hidden; background: #fff; }
    body.erp-approved-design #report-workspace :is(.report-results-toolbar, .report-document-heading, .internal-report-viewer__header) { padding: .85rem 1rem !important; background: #fff !important; border-bottom: 1px solid var(--report-line) !important; color: var(--report-ink) !important; }
    .erp-report-workspace .report-document-heading { display: flex; flex-wrap: wrap; gap: .5rem 1rem; justify-content: space-between; align-items: center; }
    .erp-report-workspace .report-document-heading h2 { margin: 0; font-size: 1.05rem; font-weight: 700; line-height: 1.6; }
    .erp-report-workspace .report-document-heading p { margin: 0; color: var(--report-muted); font-size: .8rem; line-height: 1.7; }
    .erp-report-workspace .report-results-toolbar { display: flex; flex-wrap: wrap; gap: .7rem 1rem; align-items: center; }
    .erp-report-workspace .report-results-toolbar > div:last-child { flex: 1 1 340px; min-width: 0; }
    .erp-report-workspace .report-results-toolbar .operational-search { width: 100%; flex: 1; min-width: 160px; }
    body.erp-approved-design #report-workspace :is(.operational-metrics, .report-summary-grid) { gap: .7rem; margin-bottom: 1rem !important; }
    body.erp-approved-design #report-workspace :is(.operational-metric, .report-summary-grid .card) { min-height: 0; padding: .8rem 1rem; border: 1px solid var(--report-line) !important; border-radius: 10px !important; box-shadow: none !important; background: #fff; }
    .erp-report-workspace .operational-metric strong { font-size: 1.22rem; margin-top: .35rem; font-variant-numeric: tabular-nums; }
    body.erp-approved-design #report-workspace .table-responsive { border-radius: 0; overflow: auto; max-height: 68vh; scrollbar-width: thin; scrollbar-color: #a6b8c9 #f1f5f9; }
    body.erp-approved-design #report-workspace :is(.inventory-item-card-group, .internal-report-viewer__body) .table-responsive { max-height: none; }
    body.erp-approved-design #report-workspace .table { margin-bottom: 0; min-width: 780px; width: 100%; border-collapse: separate; border-spacing: 0; table-layout: auto; }
    body.erp-approved-design #report-workspace .table:not(:has(thead th:nth-child(7))) { min-width: 580px; }
    body.erp-approved-design #report-workspace .table thead { position: sticky; top: 0; z-index: 2; }
    body.erp-approved-design #report-workspace .table > :not(caption) > * > :is(th, td) {
        padding: .57rem .7rem !important; font-size: .94rem !important; line-height: 1.65 !important;
        border-bottom: 1px solid #dce4ed !important; border-inline-end: 1px solid #e3eaf1 !important;
        white-space: normal !important; overflow-wrap: anywhere; vertical-align: middle;
    }
    body.erp-approved-design #report-workspace .table thead th { color: #203449 !important; background: #e9eff6 !important; font-size: .88rem !important; font-weight: 700 !important; border-bottom: 2px solid #b6c8da !important; }
    body.erp-approved-design #report-workspace .table tbody tr:not([class*="table-"]):not([class*="report-row--"]):not(.report-status-row):nth-child(even) > td { background-color: #f6f8fb !important; }
    body.erp-approved-design #report-workspace .table tbody tr:hover > td { box-shadow: inset 0 0 0 9999px #245b780a; }
    body.erp-approved-design #report-workspace .table :is(.operational-numeric, .font-monospace, .report-number) { font-family: inherit !important; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; white-space: nowrap !important; }
    body.erp-approved-design #report-workspace .table tfoot > tr > :is(td, th) { background: var(--report-total) !important; color: #1d493b !important; font-weight: 700 !important; border-top: 2px solid #a9c3b8 !important; }
    body.erp-approved-design #report-workspace .table .badge { font-size: .76rem !important; white-space: normal; line-height: 1.5; }
    .erp-report-workspace .report-template-options { border: 1px dashed #c5d1de; border-radius: 9px; background: #f8fafc; margin-top: 1rem; }
    .erp-report-workspace .report-template-options summary { cursor: pointer; padding: .65rem 1rem; font-size: .85rem; font-weight: 600; color: #52647a; }
    .erp-report-workspace .report-template-options > div { padding: .8rem 1rem; border-top: 1px solid #e1e7ef; }
    .erp-report-workspace .report-template-options small { color: var(--report-muted); }
    body.erp-approved-design #report-workspace :is(.operational-report-link, .report-catalog-card) { border: 1px solid var(--report-line) !important; border-radius: 11px !important; box-shadow: none !important; background: #fff; min-height: 96px; }
    body.erp-approved-design #report-workspace :is(.operational-report-link, .report-catalog-card):hover { border-color: #759bb8 !important; box-shadow: 0 5px 14px #2034490c !important; transform: none; }
    .erp-report-workspace .report-catalog-card .card-body { padding: 1rem; }
    .erp-report-workspace .report-catalog-card h5 { font-size: 1rem; line-height: 1.5; }
    body.erp-approved-design #report-workspace .internal-report-viewer__body { padding: 1rem; background: #fff; }
    body.erp-approved-design #report-workspace .internal-report-viewer__eyebrow { color: var(--report-accent); }
    body.erp-approved-design #report-workspace .internal-report-viewer__header p { color: var(--report-muted); line-height: 1.7; }
    body.erp-approved-design #report-workspace .internal-report-branch > h3 { padding: .65rem .85rem; margin: 0; background: #e4edf5; color: var(--report-ink); border-radius: 5px; font-size: 1rem; }
    body.erp-approved-design #report-workspace .internal-report-account > h4 { padding: .6rem .85rem; margin: .7rem 0 0; background: #f0f4f8; color: var(--report-ink); font-size: .95rem; }
    body.erp-approved-design #report-workspace .internal-report-subaccount__header { padding: .75rem .85rem; background: #f8fafc; color: var(--report-ink); border-block: 1px solid #dce4ed; }
    body.erp-approved-design #report-workspace .internal-report-balances { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
    body.erp-approved-design #report-workspace .internal-report-balances span { min-width: 100px; color: var(--report-muted); font-size: .8rem; }
    body.erp-approved-design #report-workspace .internal-report-balances b { font-size: .95rem; color: var(--report-ink); font-variant-numeric: tabular-nums; }
    body.erp-approved-design #report-workspace .operational-report-link__icon { background: #eef3f8 !important; color: var(--report-accent) !important; border-color: var(--report-line) !important; border-radius: 9px; }
    .erp-report-workspace .operational-report-link__arrow { color: var(--report-accent); }
    .erp-report-workspace .operational-report-link__body small { display: block; overflow: visible; -webkit-line-clamp: unset; color: var(--report-muted); }
    .erp-report-workspace .operational-report-search { border-radius: 10px; }
    .erp-report-workspace .report-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
    .erp-report-workspace .report-empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--report-muted); background: #f8fafc; border: 1px dashed var(--report-line); border-radius: 10px; }
    .erp-report-workspace .report-print-only { display: none; }
    @media (max-width: 1100px) { body.erp-approved-design #report-workspace .report-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
    @media (max-width: 850px) { body.erp-approved-design #report-workspace .report-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
    @media (max-width: 575.98px) {
        body.erp-approved-design #report-workspace .report-filter-grid { grid-template-columns: 1fr; }
        body.erp-approved-design #report-workspace .report-workspace-header { padding: .8rem !important; }
        body.erp-approved-design #report-workspace .report-workspace-header { flex-direction: column !important; align-items: stretch !important; }
        body.erp-approved-design #report-workspace .report-workspace-header > div { width: 100%; min-width: 0; }
        body.erp-approved-design #report-workspace .report-workspace-header > .report-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
        body.erp-approved-design #report-workspace .report-workspace-header > .report-actions .btn { width: 100%; }
        .erp-report-workspace .report-actions { width: 100%; }
        .erp-report-workspace .report-actions .btn { flex: 1 1 auto; }
        body.erp-approved-design #report-workspace :is(.form-control, .form-select, .erp-select-trigger) { min-height: 44px !important; font-size: 16px !important; }
        body.erp-approved-design #report-workspace .btn { min-height: 44px; }
        body.erp-approved-design #report-workspace .table-responsive { max-height: none; }
        .erp-report-workspace .report-results-toolbar > div:last-child { flex-basis: 100%; }
    }
    @media (pointer: coarse) { body.erp-approved-design #report-workspace .btn { min-height: 44px; } }
    @media (prefers-reduced-motion: reduce) { .erp-report-workspace * { transition: none !important; scroll-behavior: auto !important; } }
}

/* Browser printing uses the same document hierarchy, never viewport scroll boxes. */
@media print {
    @page erp-report {
        size: A4 landscape; margin: 12mm;
        @bottom-center { content: counter(page) " / " counter(pages); font-family: Tahoma, Arial, sans-serif; font-size: 8pt; color: #52647a; }
    }
    html:has(.erp-report-workspace), body:has(.erp-report-workspace) { background: #fff !important; }
    body:has(.erp-report-workspace) :is(.erp-sidebar, .erp-top-header, .erp-sidebar-overlay) { display: none !important; }
    body:has(.erp-report-workspace) :is(.erp-layout, .erp-main-workspace, .erp-content-scroll) { display: block !important; width: 100% !important; height: auto !important; min-height: 0 !important; max-height: none !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
    body:has(.erp-report-workspace) .erp-content-scroll > article.content { margin: 0 !important; padding: 0 !important; }
    .erp-report-workspace { page: erp-report; color: #172a3b; font-family: Tahoma, Arial, sans-serif; font-size: 10pt; }
    .erp-report-workspace:has(.report-results-panel) > .report-workspace-header { display: none !important; }
    .erp-report-workspace :is(.report-filter-panel, .report-actions, .report-template-options, .report-tabs, .no-print, .d-print-none) { display: none !important; }
    .erp-report-workspace :is(.report-results-panel, .internal-report-viewer, .card) { box-shadow: none !important; border-radius: 0 !important; overflow: visible !important; break-inside: auto; }
    .erp-report-workspace .table-responsive { overflow: visible !important; max-height: none !important; height: auto !important; }
    .erp-report-workspace .table { width: 100% !important; min-width: 0 !important; border-collapse: collapse; table-layout: auto; }
    .erp-report-workspace .table > :not(caption) > * > :is(th, td) { padding: 2.1mm 1.5mm !important; font-size: 10pt !important; line-height: 1.45 !important; white-space: normal !important; overflow-wrap: break-word; word-break: normal; border: .2mm solid #bdcbd9 !important; }
    .erp-report-workspace .table thead { display: table-header-group; position: static !important; }
    .erp-report-workspace .table thead th { background: #e9eff6 !important; color: #172a3b !important; font-weight: bold; }
    .erp-report-workspace .table tbody { display: table-row-group; }
    .erp-report-workspace .table tfoot { display: table-row-group; break-before: avoid; }
    .erp-report-workspace .table tfoot > tr > :is(td, th) { background: #e8f1ed !important; color: #173d30 !important; font-weight: bold; }
    .erp-report-workspace .table tr { break-inside: avoid; }
    .erp-report-workspace :is(h2, h3, h4, h5, .report-document-heading) { break-after: avoid; }
    .erp-report-workspace .report-document-heading { border-bottom: .5mm solid #245b78; padding: 0 0 3mm; margin-bottom: 4mm; }
    .erp-report-workspace .report-document-heading h2 { font-size: 16pt; margin: 0 0 2mm; }
    .erp-report-workspace .report-document-heading p { font-size: 9pt; margin: 0; }
    .erp-report-workspace .internal-report-viewer__header { background: #fff !important; color: #172a3b !important; }
    .erp-report-workspace :is(.internal-report-viewer__header p, .internal-report-viewer__eyebrow) { color: #40546b !important; }
    .erp-report-workspace .report-print-only { display: block; }
    .erp-report-workspace * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
