.finpro-table-card,
.js-finpro-table-card {
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.finpro-xscroll-top,
.js-finpro-xscroll-top {
    display: none;
    overflow-x: auto;
    overflow-y: hidden;
    height: 15px;
    margin: 0 0 5px 0;
    padding: 0;
    background: transparent;
}

.finpro-xscroll-top.is-active,
.js-finpro-xscroll-top.is-active {
    display: block;
}

.finpro-xscroll-inner,
.js-finpro-xscroll-inner {
    height: 1px;
}

.finpro-table-scroll,
.js-finpro-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 320px); /* tinggi area data */
    min-height: 220px;
    border-radius: 12px;
    box-sizing: border-box;
}

/* scrollbar kanan */
.finpro-table-scroll::-webkit-scrollbar,
.js-finpro-table-scroll::-webkit-scrollbar {
    width: 10px;
    height: 0;
}

.finpro-table-scroll::-webkit-scrollbar-track,
.js-finpro-table-scroll::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 10px;
}

.finpro-table-scroll::-webkit-scrollbar-thumb,
.js-finpro-table-scroll::-webkit-scrollbar-thumb {
    background: #718096;
    border-radius: 10px;
}

.finpro-table-scroll::-webkit-scrollbar-thumb:hover,
.js-finpro-table-scroll::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

.finpro-xscroll-top::-webkit-scrollbar,
.js-finpro-xscroll-top::-webkit-scrollbar {
    height: 10px;
}

.finpro-xscroll-top::-webkit-scrollbar-track,
.js-finpro-xscroll-top::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 999px;
}

.finpro-xscroll-top::-webkit-scrollbar-thumb,
.js-finpro-xscroll-top::-webkit-scrollbar-thumb {
    background: #718096;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
}

.finpro-xscroll-top::-webkit-scrollbar-thumb:hover,
.js-finpro-xscroll-top::-webkit-scrollbar-thumb:hover {
    background: #4a5568;
}

.app-table,
.js-finpro-table {
    min-width: 1400px;
    border-collapse: separate;
    border-spacing: 0;
}

@media (max-width: 1366px) {
    .app-table,
    .js-finpro-table {
        min-width: 1500px;
    }
}

@media (max-width: 1024px) {
    .app-table,
    .js-finpro-table {
        min-width: 1650px;
    }
}

/* =========================================================
   FINPRO - Table bottom safe spacing
   Mencegah table mentok / tertutup area bawah layar
========================================================= */

.finpro-table-card,
.finpro-scroll-card,
.table-scroll-card {
    padding-bottom: 18px;
}

.finpro-table-wrap,
.finpro-table-scroll,
.table-scroll-wrap {
    max-height: calc(100vh - 360px);
    overflow: auto;
    padding-bottom: 24px;
    box-sizing: border-box;
}

/* Untuk halaman select/create invoice yang header informasinya lebih tinggi */
.finpro-select-po-page .finpro-table-wrap,
.finpro-select-po-page .finpro-table-scroll,
.finpro-select-po-page .table-scroll-wrap {
    max-height: calc(100vh - 430px);
}

/* Beri ruang bawah supaya baris terakhir tidak ketutup */
.finpro-table-wrap table,
.finpro-table-scroll table,
.table-scroll-wrap table {
    margin-bottom: 28px;
}
/* =========================================================
   FINPRO - Admin Log Table Scroll
   Audit Log dan Sync Log mengikuti pola scroll table global,
   dengan bottom spacer agar record terakhir tetap terlihat.
========================================================= */

.admin-log-table-wrap,
.audit-log-table-wrap,
.sync-log-table-wrap {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 430px) !important;
    min-height: 260px !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    border-radius: 12px;
    box-sizing: border-box;
    scrollbar-gutter: stable;
}

@media (max-height: 760px) {
    .admin-log-table-wrap,
    .audit-log-table-wrap,
    .sync-log-table-wrap {
        max-height: calc(100vh - 390px) !important;
        min-height: 220px !important;
    }
}

.admin-log-table-wrap table,
.audit-log-table-wrap table,
.sync-log-table-wrap table {
    margin-bottom: 0 !important;
}

.admin-scroll-bottom-safe {
    height: 140px !important;
    min-height: 140px !important;
    width: 100%;
    display: block;
}

.sync-log-table-wrap .admin-message,
.audit-log-table-wrap .admin-note {
    max-height: 88px;
    overflow-y: auto;
    white-space: normal;
    line-height: 1.35;
}


/* =========================================================
   FINPRO - Admin Settings Table Scroll
   Khusus tabel Editable Settings di Super Admin > Settings.
   Tidak mempengaruhi modul lain karena memakai class khusus.
========================================================= */

.admin-settings-table-wrap {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 430px) !important;
    min-height: 260px !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    border-radius: 12px;
    box-sizing: border-box;
    scrollbar-gutter: stable;
}

@media (max-height: 760px) {
    .admin-settings-table-wrap {
        max-height: calc(100vh - 390px) !important;
        min-height: 220px !important;
    }
}

.admin-settings-table-wrap table {
    margin-bottom: 0 !important;
}

.admin-settings-table-wrap table {
    overflow: visible !important;
}

.admin-settings-table-wrap thead,
.admin-settings-table-wrap thead tr,
.admin-settings-table-wrap thead th {
    position: sticky !important;
    top: 0;
    z-index: 20;
}

.admin-settings-table-wrap thead th {
    background: #f1f5f9 !important;
    box-shadow: 0 1px 0 #d7e3f0;
}

.admin-settings-scroll-bottom-safe {
    height: 120px !important;
    min-height: 120px !important;
    width: 100%;
    display: block;
}

/* =========================================================
   FINPRO - Compact Admin Standard
   Reusable for admin pages that need dense operational tables.
========================================================= */

.finpro-compact-admin {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.finpro-compact-admin .toolbar {
    margin-bottom: 6px;
    padding-bottom: 8px;
}

.finpro-compact-admin .toolbar h2,
.finpro-compact-admin .toolbar h3 {
    line-height: 1.15;
}

.finpro-compact-admin .text-muted {
    margin-top: 2px;
    font-size: 12px;
}

.finpro-compact-filter {
    flex-shrink: 0;
    margin-bottom: 6px !important;
    padding: 10px !important;
}

.finpro-compact-filter .form-grid {
    gap: 8px 10px;
}

.finpro-compact-filter .form-row {
    margin-bottom: 0;
}

.finpro-compact-filter .form-row label {
    margin-bottom: 4px;
    font-size: 12px;
}

.finpro-compact-filter input,
.finpro-compact-filter select {
    padding: 7px 9px;
    font-size: 12px;
    border-radius: 8px;
}

.finpro-compact-filter .form-actions {
    margin-top: 8px;
}

.finpro-compact-table-card {
    flex: 1;
    min-height: 0;
    padding-bottom: 8px;
}

.finpro-compact-table-scroll {
    max-height: none !important;
    height: 100%;
    min-height: 260px;
    border-radius: 10px;
    scrollbar-gutter: stable both-edges;
    padding-bottom: 34px;
}

.finpro-compact-table-scroll table {
    margin-bottom: 56px !important;
}

.finpro-compact-table {
    min-width: 1320px !important;
}

.finpro-compact-table thead th {
    padding: 7px 7px !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
    letter-spacing: .2px !important;
}

.finpro-compact-table tbody td {
    padding: 5px 7px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

.finpro-table-nowrap {
    white-space: nowrap;
}

.finpro-table-ellipsis {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finpro-table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.finpro-table-actions form {
    display: inline;
    margin: 0;
}

.finpro-table-action-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font: inherit;
}

.user-management-table-scroll .app-table {
    overflow: visible !important;
}

.user-management-table-scroll thead,
.user-management-table-scroll thead tr,
.user-management-table-scroll thead th {
    position: sticky !important;
    top: 0;
    z-index: 20;
}

.user-management-table-scroll thead th {
    background: linear-gradient(180deg, #eef4fb 0%, #e4edf8 100%) !important;
    box-shadow: 0 1px 0 #d7e3f0;
}

.role-management-table-scroll .app-table {
    overflow: visible !important;
}

.role-management-table-scroll thead,
.role-management-table-scroll thead tr,
.role-management-table-scroll thead th {
    position: sticky !important;
    top: 0;
    z-index: 20;
}

.role-management-table-scroll thead th {
    background: linear-gradient(180deg, #eef4fb 0%, #e4edf8 100%) !important;
    box-shadow: 0 1px 0 #d7e3f0;
}

.vendor-management-table-scroll .app-table {
    overflow: visible !important;
}

.vendor-management-table-scroll thead,
.vendor-management-table-scroll thead tr,
.vendor-management-table-scroll thead th {
    position: sticky !important;
    top: 0;
    z-index: 20;
}

.vendor-management-table-scroll thead th {
    background: linear-gradient(180deg, #eef4fb 0%, #e4edf8 100%) !important;
    box-shadow: 0 1px 0 #d7e3f0;
}

.finpro-permission-summary-card {
    flex: 0 0 auto;
    max-height: 240px;
}

.finpro-permission-summary-scroll {
    max-height: 160px !important;
    min-height: 120px;
}

.finpro-permission-list-scroll {
    min-height: 260px;
}

.finpro-permission-summary-scroll thead th,
.finpro-permission-list-scroll thead th {
    position: sticky !important;
    top: 0;
    z-index: 5;
    background: linear-gradient(180deg, #eef4fb 0%, #e4edf8 100%) !important;
    box-shadow: 0 1px 0 #d7e3f0;
}

.finpro-permission-summary-scroll .app-table,
.finpro-permission-list-scroll .app-table {
    overflow: visible !important;
}

.finpro-permission-summary-scroll thead,
.finpro-permission-list-scroll thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

.finpro-permission-summary-scroll thead tr,
.finpro-permission-list-scroll thead tr {
    position: sticky;
    top: 0;
    z-index: 20;
}

.finpro-permission-summary-scroll tbody,
.finpro-permission-list-scroll tbody {
    position: relative;
    z-index: 1;
}

.finpro-permission-assign-form {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px !important;
    scrollbar-gutter: stable;
}

.finpro-permission-group {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
}

.finpro-permission-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.finpro-permission-item {
    padding: 7px 8px;
    border-radius: 9px;
}

.finpro-permission-item .permission-name {
    font-size: 12px;
    line-height: 1.2;
}

.finpro-permission-item .permission-desc {
    font-size: 11px;
    line-height: 1.25;
    margin-top: 2px;
}

.finpro-sticky-actions {
    position: sticky;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
}

/* =========================================================
   FINPRO - Compact module table frame
   Menyeragamkan area scroll tabel agar tidak keluar dari
   bingkai page-card pada resolusi monitor berbeda.
========================================================= */

.finpro-compact-page {
    min-height: 0;
}

.finpro-compact-page .finpro-mini-topbar,
.finpro-compact-page .finpro-filter-card,
.finpro-compact-page .finpro-summary-grid,
.finpro-compact-page .finpro-export-row,
.finpro-compact-page .toolbar,
.finpro-compact-page form {
    flex-shrink: 0;
}

.finpro-compact-page .finpro-table-card,
.finpro-compact-page .js-finpro-table-card {
    min-height: 0;
    max-width: 100%;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.finpro-compact-page .finpro-xscroll-top,
.finpro-compact-page .js-finpro-xscroll-top {
    flex: 0 0 auto !important;
    margin-bottom: 0 !important;
    border-bottom: 1px solid #dbe3ef;
    background: #eef3f8;
}

.finpro-compact-page .finpro-table-scroll,
.finpro-compact-page .js-finpro-table-scroll {
    overflow-x: auto !important;
    overflow-y: auto !important;
    border-radius: 0 0 12px 12px !important;
    box-sizing: border-box !important;
    scrollbar-gutter: stable;
}

.finpro-compact-page .finpro-table-scroll::-webkit-scrollbar,
.finpro-compact-page .js-finpro-table-scroll::-webkit-scrollbar {
    width: 10px;
    height: 0;
}

.finpro-compact-page .finpro-table-scroll table,
.finpro-compact-page .js-finpro-table-scroll table {
    margin-bottom: 0 !important;
}

@media (max-width: 1180px) {
    .finpro-permission-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .finpro-permission-grid {
        grid-template-columns: 1fr;
    }
}
