/* Shared screen presentation. Loaded after page styles to prevent theme conflicts. */
:root {
    --aspl-font: 'Segoe UI', Arial, sans-serif;
    --aspl-text-size: 14px;
    --aspl-table-size: 13px;
    --aspl-header-bg: #123766;
    --aspl-header-text: #fff;
    --aspl-sort-muted: #b8cce3;
    --aspl-sort-active: #ffdf70;
}
@media screen {
    html body { font-family: var(--aspl-font); font-size: var(--aspl-text-size); line-height: 1.5; }
    body :is(input,select,textarea,button,.form-control,.select2-container) { font-family: var(--aspl-font); }
    body .content-header h1 { font-family: var(--aspl-font); font-size: 24px !important; font-weight: 600; line-height: 1.3; }
    body :is(.content-wrapper,.oxm-shell,main) :is(.card-title,.ox-page-title h2) { font-family: var(--aspl-font); font-size: 17px !important; font-weight: 600; line-height: 1.4; }
    body :is(.content-wrapper,.oxm-shell,main) :is(label,.form-control,.btn,.select2-container) { font-size: 14px; }
    body :is(.content-wrapper,.oxm-shell,main) .table { font-family: var(--aspl-font); font-size: var(--aspl-table-size) !important; line-height: 1.45; }
    html body :is(.content-wrapper,.oxm-shell,main) .table thead th {
        background: var(--aspl-header-bg) !important; color: var(--aspl-header-text) !important;
        font-size: var(--aspl-table-size) !important; font-weight: 600 !important;
        vertical-align: middle; line-height: 1.45; border-color: #456487;
    }
    body :is(.content-wrapper,.oxm-shell,main) .table :is(th,td) { padding: 8px 10px; vertical-align: middle; }
    /* Shared proportions for ordinary lists; grouped calendar tables keep their layout. */
    html body .table.aspl-readable-table > tbody > tr > td {
        padding: 10px 12px !important; line-height: 1.55; border-color: #dde4ec;
    }
    html body .table.aspl-readable-table > thead > tr > th { padding-top: 11px; padding-bottom: 11px; }
    html body .table.aspl-readable-table > tbody > tr:not([class*="bg-"]):not([class*="status-"]) { background-color: #fff; }
    html body .table.aspl-readable-table > tbody > tr:nth-child(even):not([class*="bg-"]):not([class*="status-"]) { background-color: #f3f6fa; }
    html body .table.aspl-readable-table.table-hover > tbody > tr:hover:not([class*="bg-"]):not([class*="status-"]) { background-color: #e8f1fa; }
    html body .table.aspl-readable-table .aspl-col-text { min-width: 180px; width: 240px; max-width: 320px; white-space: normal !important; overflow-wrap: anywhere; }
    html body .table.aspl-readable-table .aspl-col-short { min-width: 90px; white-space: nowrap; }
    html body .table.aspl-readable-table .aspl-col-date { min-width: 110px; white-space: nowrap; font-variant-numeric: tabular-nums; }
    html body .table.aspl-readable-table .aspl-col-number { min-width: 85px; font-variant-numeric: tabular-nums; }
    html body .table.aspl-readable-table td.aspl-col-number { text-align: right; white-space: nowrap; }
    html body .table.aspl-readable-table th.aspl-col-number { max-width: 160px; white-space: normal !important; }
    html body .table.aspl-readable-table .aspl-col-actions { min-width: 100px; white-space: nowrap; }
    html body .table.aspl-readable-table th .aspl-sort-button { white-space: inherit; }
    body :is(.content-wrapper,.oxm-shell,main) .table thead th :is(a,button) { color: inherit; }
    body .aspl-table-scroll { max-height: 65vh; overflow: auto; position: relative; isolation: isolate; }
    body .aspl-table-scroll > .table { border-collapse: separate; border-spacing: 0; margin-top: 0 !important; }
    html body .aspl-table-scroll > .table > thead > tr > th {
        position: sticky; top: var(--aspl-header-top,0px); z-index: 4; box-shadow: 0 1px 0 #456487;
    }
    /* DataTables owns its split header/body alignment. Never stick its sizing header. */
    html body .dataTables_scrollHead .table { margin-top: 0 !important; margin-bottom: 0 !important; }
    html body .dataTables_scrollHead { background: var(--aspl-header-bg); z-index: 6; }
    html body .dataTables_scrollBody thead th { position: static !important; }
    html body .table.dataTable thead th:is(.sorting,.sorting_asc,.sorting_desc) {
        padding-right: 34px !important; cursor: pointer; background-image: none !important;
    }
    html body .table.dataTable thead th:is(.sorting,.sorting_asc,.sorting_desc)::before,
    html body .table.dataTable thead th:is(.sorting,.sorting_asc,.sorting_desc)::after {
        position: absolute; right: 10px; bottom: auto; display: block;
        width: 10px; font-family: Arial,sans-serif; font-size: 9px; line-height: 10px;
        color: var(--aspl-sort-muted); opacity: 1 !important; pointer-events: none;
    }
    html body .table.dataTable thead th:is(.sorting,.sorting_asc,.sorting_desc)::before { content: '\25B2'; top: calc(50% - 10px); }
    html body .table.dataTable thead th:is(.sorting,.sorting_asc,.sorting_desc)::after { content: '\25BC'; top: 50%; }
    html body .table.dataTable thead th.sorting_asc::before,
    html body .table.dataTable thead th.sorting_desc::after { color: var(--aspl-sort-active); }
    html body .table.dataTable thead th.sorting_asc_disabled::before,
    html body .table.dataTable thead th.sorting_desc_disabled::after { display: none; }
    html body .dataTables_scrollBody .table.dataTable thead th::before,
    html body .dataTables_scrollBody .table.dataTable thead th::after { display: none !important; }
    body .aspl-sort-button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 0; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
    body .aspl-sort-arrows { display: inline-flex; flex-direction: column; color: var(--aspl-sort-muted); font: 9px/10px Arial,sans-serif; }
    body th[aria-sort=ascending] .aspl-sort-up,body th[aria-sort=descending] .aspl-sort-down { color: var(--aspl-sort-active); }
    body .dataTables_wrapper :is(.dataTables_filter,.dataTables_length,.dataTables_info,.dataTables_paginate) { font-size: 13px; padding-top: 8px; padding-bottom: 8px; }
    body :is(.report-table-toolbar,.local-table-tools) { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
    body .pagination { flex-wrap: wrap; gap: 3px; margin-top: 10px; }
    body .pagination .page-link { min-width: 36px; min-height: 36px; padding: 7px 11px; font-size: 13px; line-height: 20px; border-radius: 4px; }
    body .pagination .page-item.active .page-link { color: #fff !important; }
    body .pagination .page-item.disabled .page-link { color: #667085 !important; background: #f1f4f6; }
    body .aspl-local-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 10px; }
    body .aspl-local-pagination :is(label,nav) { display: flex; align-items: center; gap: 8px; margin: 0; }
    body .aspl-local-pagination select { width: auto; }
    body .aspl-local-pagination button { min-height: 36px; }
    body .aspl-page-hidden { display: none !important; }
    html body :is(.content-wrapper,.oxm-shell,main) :is(th,button,a,select,input):focus-visible { outline: 2px solid #d38a00; outline-offset: -2px; }
}
@media screen and (max-width:767.98px) {
    body .content-header h1 { font-size: 21px !important; }
    body :is(.content-wrapper,.oxm-shell,main) .table { font-size: 13px !important; }
    body .dataTables_wrapper .dataTables_filter { text-align: left; }
    body .aspl-local-pagination { align-items: flex-start; flex-direction: column; }
}
@media print {
    .aspl-local-pagination { display: none !important; }
    .aspl-page-hidden { display: table-row !important; }
    .aspl-table-scroll { max-height: none !important; overflow: visible !important; }
    .aspl-table-scroll > .table > thead > tr > th { position: static !important; }
    .aspl-sort-arrows { display: none !important; }
}
