/* Sticky Column CSS for Filament Tables - Cashbook System */

/* Cố định cột đầu tiên với width linh hoạt theo nội dung, tối đa 50 ký tự */
.fi-ta-table-container table thead tr th:first-child,
.fi-ta-table-container table tbody tr td:first-child,
table.fi-ta-table thead tr th:first-child,
table.fi-ta-table tbody tr td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 10 !important;
    background-color: white !important;
    border-right: 2px solid #e5e7eb !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1) !important;
    min-width: 150px !important;
    max-width: 400px !important;
    /* Khoảng 50 ký tự */
    width: auto !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Dark mode support */
.dark .fi-ta-table-container table thead tr th:first-child,
.dark .fi-ta-table-container table tbody tr td:first-child,
.dark table.fi-ta-table thead tr th:first-child,
.dark table.fi-ta-table tbody tr td:first-child {
    background-color: #1f2937 !important;
    border-right-color: #374151 !important;
}

/* Hover effect cho sticky column */
.fi-ta-table-container table tbody tr:hover td:first-child,
table.fi-ta-table tbody tr:hover td:first-child {
    background-color: #f9fafb !important;
}

.dark .fi-ta-table-container table tbody tr:hover td:first-child,
.dark table.fi-ta-table tbody tr:hover td:first-child {
    background-color: #111827 !important;
}

/* Responsive - ẩn sticky trên mobile */
@media (max-width: 768px) {

    .fi-ta-table-container table thead tr th:first-child,
    .fi-ta-table-container table tbody tr td:first-child,
    table.fi-ta-table thead tr th:first-child,
    table.fi-ta-table tbody tr td:first-child {
        position: static !important;
        box-shadow: none !important;
        min-width: auto !important;
        max-width: none !important;
    }
}

/* Ẩn c
ột checkbox trong Advance Payment Resource */
.fi-resource-advance-payment-resource .fi-ta-table-container table thead tr th:first-child,
.fi-resource-advance-payment-resource .fi-ta-table-container table tbody tr td:first-child,
.fi-resource-advance-payment-resource table.fi-ta-table thead tr th:first-child,
.fi-resource-advance-payment-resource table.fi-ta-table tbody tr td:first-child {
    display: none !important;
}

/* Điều chỉnh sticky cho cột đầu tiên thực tế (sau khi ẩn checkbox) */
.fi-resource-advance-payment-resource .fi-ta-table-container table thead tr th:nth-child(2),
.fi-resource-advance-payment-resource .fi-ta-table-container table tbody tr td:nth-child(2),
.fi-resource-advance-payment-resource table.fi-ta-table thead tr th:nth-child(2),
.fi-resource-advance-payment-resource table.fi-ta-table tbody tr td:nth-child(2) {
    position: sticky !important;
    left: 0 !important;
    z-index: 10 !important;
    background-color: white !important;
    border-right: 2px solid #e5e7eb !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1) !important;
    min-width: 150px !important;
    max-width: 400px !important;
    width: auto !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Dark mode cho Advance Payment */
.dark .fi-resource-advance-payment-resource .fi-ta-table-container table thead tr th:nth-child(2),
.dark .fi-resource-advance-payment-resource .fi-ta-table-container table tbody tr td:nth-child(2),
.dark .fi-resource-advance-payment-resource table.fi-ta-table thead tr th:nth-child(2),
.dark .fi-resource-advance-payment-resource table.fi-ta-table tbody tr td:nth-child(2) {
    background-color: #1f2937 !important;
    border-right-color: #374151 !important;
}

/* Hover effect cho Advance Payment */
.fi-resource-advance-payment-resource .fi-ta-table-container table tbody tr:hover td:nth-child(2),
.fi-resource-advance-payment-resource table.fi-ta-table tbody tr:hover td:nth-child(2) {
    background-color: #f9fafb !important;
}

.dark .fi-resource-advance-payment-resource .fi-ta-table-container table tbody tr:hover td:nth-child(2),
.dark .fi-resource-advance-payment-resource table.fi-ta-table tbody tr:hover td:nth-child(2) {
    background-color: #111827 !important;
}

/* Ẩn
 cột checkbox trong Fund Category Resource */
.fi-resource-fund-category-resource .fi-ta-table-container table thead tr th:first-child,
.fi-resource-fund-category-resource .fi-ta-table-container table tbody tr td:first-child,
.fi-resource-fund-category-resource table.fi-ta-table thead tr th:first-child,
.fi-resource-fund-category-resource table.fi-ta-table tbody tr td:first-child {
    display: none !important;
}

/* Điều chỉnh sticky cho cột đầu tiên thực tế (sau khi ẩn checkbox) */
.fi-resource-fund-category-resource .fi-ta-table-container table thead tr th:nth-child(2),
.fi-resource-fund-category-resource .fi-ta-table-container table tbody tr td:nth-child(2),
.fi-resource-fund-category-resource table.fi-ta-table thead tr th:nth-child(2),
.fi-resource-fund-category-resource table.fi-ta-table tbody tr td:nth-child(2) {
    position: sticky !important;
    left: 0 !important;
    z-index: 10 !important;
    background-color: white !important;
    border-right: 2px solid #e5e7eb !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1) !important;
    min-width: 150px !important;
    max-width: 400px !important;
    width: auto !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Dark mode cho Fund Category */
.dark .fi-resource-fund-category-resource .fi-ta-table-container table thead tr th:nth-child(2),
.dark .fi-resource-fund-category-resource .fi-ta-table-container table tbody tr td:nth-child(2),
.dark .fi-resource-fund-category-resource table.fi-ta-table thead tr th:nth-child(2),
.dark .fi-resource-fund-category-resource table.fi-ta-table tbody tr td:nth-child(2) {
    background-color: #1f2937 !important;
    border-right-color: #374151 !important;
}

/* Hover effect cho Fund Category */
.fi-resource-fund-category-resource .fi-ta-table-container table tbody tr:hover td:nth-child(2),
.fi-resource-fund-category-resource table.fi-ta-table tbody tr:hover td:nth-child(2) {
    background-color: #f9fafb !important;
}

.dark .fi-resource-fund-category-resource .fi-ta-table-container table tbody tr:hover td:nth-child(2),
.dark .fi-resource-fund-category-resource table.fi-ta-table tbody tr td:nth-child(2) {
    background-color: #111827 !important;
}