/* ==========================================================
   ERP GRID
========================================================== */

.erp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #FFFFFF;
    border: 1px solid #90AAA7;
}

/* ==========================================================
   GLOBAL ERP GRID HEADER STANDARD
   Applies to standard Bootstrap, ERP, transaction and report tables.
========================================================== */

.table > thead,
.erp-table > thead,
.erp-grid > thead,
.tally-cargo-grid > thead,
.book-table > thead,
.report-grid table > thead {
    --bs-table-bg: var(--erp-grid-header-bg, #0D6EFD);
    --bs-table-color: var(--erp-grid-header-text, #FFFFFF);
    color: var(--erp-grid-header-text, #FFFFFF);
    background: var(--erp-grid-header-bg, #0D6EFD);
}

.table > thead > tr > th,
.erp-table > thead > tr > th,
.erp-grid > thead > tr > th,
.tally-cargo-grid > thead > tr > th,
.book-table > thead > tr > th,
.report-grid table > thead > tr > th {
        color: var(--erp-grid-header-text, #FFFFFF);
        background: var(--erp-grid-header-bg, #0D6EFD);
        border-color: var(--erp-grid-header-border, #0A58CA);
        font-weight: 600;
    }

    .erp-table > thead > tr > th {
        position: sticky;
        top: 0;
        z-index: 2;
        padding: 7px 10px;
        min-height: 26px;
        font-size: 14px;
        border-right: 1px solid var(--erp-grid-header-border, #0A58CA);
        border-bottom: 2px solid var(--erp-grid-header-border, #0A58CA);
        text-align: left;
        white-space: nowrap;
        vertical-align: middle;
    }

    /* ==========================================================
   GRID BODY
========================================================== */

    .erp-table > tbody > tr > td {
        padding: 7px 10px;
        min-height: 20px;
        border-right: 1px solid #C2D3D1;
        border-bottom: 1px solid #B4C9C6;
        font-size: 14px;
        vertical-align: middle;
    }

    .erp-table > tbody > tr:nth-child(even) {
        background: #F0F7F6;
    }

    .erp-table > tbody > tr:hover {
        background: #E4F2F0;
    }

    .erp-table > thead > tr > th:last-child,
    .erp-table > tbody > tr > td:last-child {
        border-right: 0;
    }

/* ==========================================================
   SHARED INDEX STANDARD
   Use these classes for all new module Index pages.
========================================================== */

.erp-index-panel,
.tally-recent {
    margin-top: 16px;
    padding: 16px;
    background: #F8FBFA;
    border: 1px solid #B9D3D0;
    border-radius: 10px;
}

.erp-index-toolbar,
.tally-recent > .d-flex:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.tally-search {
    display: flex;
    width: min(100%, 560px);
    margin: 0 0 12px;
}

.tally-search input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    background: #FFFFFF;
    border: 1px solid #809F9B;
    border-radius: 6px 0 0 6px;
}

.tally-search button {
    border-radius: 0 6px 6px 0;
}

.tally-recent .tally-cargo-grid {
    background: #FFFFFF;
    border: 1px solid #90AAA7;
}

.tally-recent .tally-cargo-grid th {
    padding: 9px 10px;
    border: 0;
    border-right: 1px solid var(--erp-grid-header-border, #0A58CA);
    border-bottom: 2px solid var(--erp-grid-header-border, #0A58CA);
}

.tally-recent .tally-cargo-grid td {
    padding: 8px 10px;
    background: #FFFFFF;
    border: 0;
    border-right: 1px solid #C2D3D1;
    border-bottom: 1px solid #B4C9C6;
}

.tally-recent .tally-cargo-grid th:last-child,
.tally-recent .tally-cargo-grid td:last-child {
    border-right: 0;
}

.tally-recent .tally-cargo-grid tbody tr:nth-child(even) td {
    background: #F0F7F6;
}

.tally-recent .tally-cargo-grid tbody tr:hover td {
    background: var(--erp-grid-row-hover, #EFF6FF);
}

@media print {
    .table > thead,
    .erp-table > thead,
    .erp-grid > thead,
    .tally-cargo-grid > thead,
    .book-table > thead,
    .report-grid table > thead {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

.tally-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 12px;
}

/* ==========================================================
   ACTION BUTTONS
========================================================== */

.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

    .action-buttons .btn {
        min-width: 82px;
    }

/* ==========================================================
   MENU PARENT
========================================================== */

.menu-parent {
    background: #EAF7F5;
    font-weight: 600;
}

    .menu-parent td {
        padding: 10px;
        color: #1E4F4A;
    }

/* ==========================================================
   CHECKBOX
========================================================== */

.permission-checkbox {
    width: 18px;
    height: 18px;
}

/* ==========================================================
   PAGINATION
========================================================== */

.erp-pagination {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
}

    .erp-pagination .pagination {
        margin: 0;
    }

    .erp-pagination .page-link {
        min-width: 38px;
        text-align: center;
        color: #1E4F4A;
        border-color: #D3E8E5;
    }

    .erp-pagination .page-item.active .page-link {
        background: #1E4F4A;
        border-color: #1E4F4A;
        color: #FFFFFF;
    }

    .erp-pagination .page-link:hover {
        background: #E8F5F3;
    }

/* ==========================================================
   COMMON
========================================================== */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.col-status {
    width: 110px;
}

.col-action {
    width: 190px;
}

/* ==========================================================
   TEST DUE REPORT (page-scoped)
   Applied only via the .test-due-page root class on
   Pages/CTMS/Reports/TestDue. Does not affect other pages.
========================================================== */

.test-due-page .td-count {
    display: inline-flex;
    align-items: center;
    margin-left: 2px;
    padding: 4px 12px;
    background: #E6F4F1;
    border: 1px solid #BFE0DA;
    border-radius: 999px;
    color: #176D67;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.test-due-page .tally-recent {
    padding: 14px;
    border-radius: 12px;
}

.test-due-page .tally-recent .tally-cargo-grid {
    width: 100%;
    table-layout: auto;
}

.test-due-page .tally-recent .tally-cargo-grid th {
    padding: 8px 12px;
    letter-spacing: .4px;
}

.test-due-page .tally-recent .tally-cargo-grid td {
    height: 34px;
    padding: 6px 12px;
}

/* proportional column hints (auto layout keeps content readable) */
.test-due-page .tally-cargo-grid th:nth-child(1) { width: 14%; }  /* Cylinder */
.test-due-page .tally-cargo-grid th:nth-child(2) { width: 28%; }  /* Item */
.test-due-page .tally-cargo-grid th:nth-child(3) { width: 17%; }  /* Owner */
.test-due-page .tally-cargo-grid th:nth-child(4) { width: 12%; }  /* Status */
.test-due-page .tally-cargo-grid th:nth-child(5) { width: 16%; }  /* Test Date */
.test-due-page .tally-cargo-grid th:nth-child(6) { width: 13%; }  /* Days Left */

/* long free-text columns may wrap; short label columns stay on one line */
.test-due-page .tally-cargo-grid td:nth-child(2),
.test-due-page .tally-cargo-grid td:nth-child(3) {
    white-space: normal;
    overflow-wrap: break-word;
}

.test-due-page .module-empty-td {
    padding: 24px 12px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

/* ==========================================================
   CYLINDER STOCKS REPORT (page-scoped)
   Applied only via the .cylinder-stocks-page root class on
   Pages/CTMS/Reports/CylinderStocks. Does not affect other pages.
========================================================== */

.cylinder-stocks-page .cyl-summary {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    background: #E6F4F1;
    border: 1px solid #BFE0DA;
    border-radius: 999px;
    color: #176D67;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.cylinder-stocks-page .cyl-item-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #EDF6F3;
    border: 1px solid #CDE5DF;
    border-radius: 999px;
    color: #255E58;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.cylinder-stocks-page .tally-recent {
    padding: 14px;
    border-radius: 12px;
}

.cylinder-stocks-page .tally-recent .tally-cargo-grid {
    width: 100%;
    table-layout: auto;
}

.cylinder-stocks-page .tally-recent .tally-cargo-grid th {
    padding: 8px 12px;
    letter-spacing: .4px;
}

.cylinder-stocks-page .tally-recent .tally-cargo-grid td {
    height: 34px;
    padding: 6px 12px;
}

/* proportional column hints (auto layout keeps content readable) */
.cylinder-stocks-page .tally-cargo-grid th:nth-child(1) { width: 15%; }  /* Cylinder */
.cylinder-stocks-page .tally-cargo-grid th:nth-child(2) { width: 14%; }  /* Details */
.cylinder-stocks-page .tally-cargo-grid th:nth-child(3) { width: 30%; }  /* Item */
.cylinder-stocks-page .tally-cargo-grid th:nth-child(4) { width: 15%; }  /* Capacity */
.cylinder-stocks-page .tally-cargo-grid th:nth-child(5) { width: 9%; }   /* Unit */
.cylinder-stocks-page .tally-cargo-grid th:nth-child(6) { width: 17%; }  /* Owner */

/* long free-text columns may wrap; short label columns stay on one line */
.cylinder-stocks-page .tally-cargo-grid td:nth-child(2),
.cylinder-stocks-page .tally-cargo-grid td:nth-child(3),
.cylinder-stocks-page .tally-cargo-grid td:nth-child(6) {
    white-space: normal;
    overflow-wrap: break-word;
}

.cylinder-stocks-page .module-empty-td {
    padding: 24px 12px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

/* ==========================================================
   CYLINDER HISTORY REPORT (page-scoped)
   Applied only via the .cylinder-history-page root class on
   Pages/CTMS/Reports/CylinderHistory. Does not affect other pages.
========================================================== */

.cylinder-history-page .cyl-history-hint {
    margin-top: 12px;
    padding: 24px 12px;
    text-align: center;
    color: #888;
    font-size: 13px;
    background: #F8FBFA;
    border: 1px dashed #B9D3D0;
    border-radius: 12px;
}

.cylinder-history-page .tally-recent {
    padding: 14px;
    border-radius: 12px;
}

.cylinder-history-page .tally-recent h4 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1E4F4A;
}

.cylinder-history-page .tally-recent .tally-cargo-grid {
    width: 100%;
    table-layout: auto;
}

.cylinder-history-page .tally-recent .tally-cargo-grid th {
    padding: 8px 12px;
    letter-spacing: .4px;
}

.cylinder-history-page .tally-recent .tally-cargo-grid td {
    height: 34px;
    padding: 6px 12px;
}

/* proportional column hints (auto layout keeps content readable) */
.cylinder-history-page .tally-cargo-grid th:nth-child(1) { width: 13%; }  /* Date */
.cylinder-history-page .tally-cargo-grid th:nth-child(2) { width: 12%; }  /* Ref No */
.cylinder-history-page .tally-cargo-grid th:nth-child(3) { width: 11%; }  /* Move */
.cylinder-history-page .tally-cargo-grid th:nth-child(4) { width: 16%; }  /* Party */
.cylinder-history-page .tally-cargo-grid th:nth-child(5) { width: 11%; }  /* Truck */
.cylinder-history-page .tally-cargo-grid th:nth-child(6) { width: 11%; }  /* Rate */
.cylinder-history-page .tally-cargo-grid th:nth-child(7) { width: 13%; }  /* Billing Qty */
.cylinder-history-page .tally-cargo-grid th:nth-child(8) { width: 13%; }  /* Remarks */

/* long free-text columns may wrap; short label columns stay on one line */
.cylinder-history-page .tally-cargo-grid td:nth-child(4),
.cylinder-history-page .tally-cargo-grid td:nth-child(8) {
    white-space: normal;
    overflow-wrap: break-word;
}

.cylinder-history-page .module-empty-td {
    padding: 24px 12px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

/* ==========================================================
   AGEING REPORT (page-scoped)
   Applied only via the .ageing-page root class on
   Pages/CTMS/Outstanding/Ageing. Does not affect other pages.
========================================================== */

.ageing-page .ageing-summary {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    background: #E6F4F1;
    border: 1px solid #BFE0DA;
    border-radius: 999px;
    color: #176D67;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ageing-page .tally-recent {
    padding: 14px;
    border-radius: 12px;
}

.ageing-page .tally-recent .tally-cargo-grid {
    width: 100%;
    table-layout: auto;
}

.ageing-page .tally-recent .tally-cargo-grid th {
    padding: 8px 12px;
    letter-spacing: .4px;
}

.ageing-page .tally-recent .tally-cargo-grid td {
    height: 34px;
    padding: 6px 12px;
}

/* proportional column hints (auto layout keeps content readable) */
.ageing-page .tally-cargo-grid th:nth-child(1) { width: 14%; }  /* Cylinder */
.ageing-page .tally-cargo-grid th:nth-child(2) { width: 12%; }  /* Party */
.ageing-page .tally-cargo-grid th:nth-child(3) { width: 13%; }  /* Owner */
.ageing-page .tally-cargo-grid th:nth-child(4) { width: 25%; }  /* Outstanding Since */
.ageing-page .tally-cargo-grid th:nth-child(5) { width: 9%; }   /* Days */
.ageing-page .tally-cargo-grid th:nth-child(6) { width: 13%; }  /* Daily Rate */
.ageing-page .tally-cargo-grid th:nth-child(7) { width: 14%; }  /* Rental Due */

/* long free-text columns may wrap; short label columns stay on one line */
.ageing-page .tally-cargo-grid td:nth-child(2),
.ageing-page .tally-cargo-grid td:nth-child(3) {
    white-space: normal;
    overflow-wrap: break-word;
}

.ageing-page .module-empty-td {
    padding: 24px 12px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

/* ==========================================================
   RENTAL REPORT (page-scoped)
   Applied only via the .rental-page root class on
   Pages/CTMS/Outstanding/Rental. Does not affect other pages.
========================================================== */

.rental-page .rental-summary {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    background: #E6F4F1;
    border: 1px solid #BFE0DA;
    border-radius: 999px;
    color: #176D67;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.rental-page .tally-recent {
    padding: 14px;
    border-radius: 12px;
}

.rental-page .tally-recent .tally-cargo-grid {
    width: 100%;
    table-layout: auto;
}

.rental-page .tally-recent .tally-cargo-grid th {
    padding: 8px 12px;
    letter-spacing: .4px;
}

.rental-page .tally-recent .tally-cargo-grid td {
    height: 34px;
    padding: 6px 12px;
}

/* proportional column hints (auto layout keeps content readable) */
.rental-page .tally-cargo-grid th:nth-child(1) { width: 14%; }  /* Party */
.rental-page .tally-cargo-grid th:nth-child(2) { width: 16%; }  /* Cylinder */
.rental-page .tally-cargo-grid th:nth-child(3) { width: 26%; }  /* Outstanding Since */
.rental-page .tally-cargo-grid th:nth-child(4) { width: 10%; }  /* Days */
.rental-page .tally-cargo-grid th:nth-child(5) { width: 15%; }  /* Daily Rate */
.rental-page .tally-cargo-grid th:nth-child(6) { width: 19%; }  /* Rental Due */

/* long free-text columns may wrap; short label columns stay on one line */
.rental-page .tally-cargo-grid td:nth-child(1),
.rental-page .tally-cargo-grid td:nth-child(2) {
    white-space: normal;
    overflow-wrap: break-word;
}

.rental-page .module-empty-td {
    padding: 24px 12px;
    text-align: center;
    color: #888;
    font-size: 13px;
}
