/* Custom scrollbar styling to ensure visibility. */
.custom-scrollbar {
    overflow-x: auto; /* Horizontal scrollbar */
    overflow-y: auto; /* Vertical scrollbar */
    max-height: 75vh; /* LIMIT HEIGHT: Forces the container to fit within the viewport */
    padding-bottom: 5px;
    border-bottom: 1px solid #dee2e6;
}

/* STICKY HEADERS: Keep column names visible while scrolling down */
.custom-scrollbar thead th {
    position: sticky;
    top: 0;
    background-color: #fff; /* Headers need a background to hide scrolling content */
    z-index: 1; /* Ensure headers sit above content */
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1); /* Subtle shadow to distinguish header */
}

/* WebKit (Chrome, Safari, Edge) */
.custom-scrollbar::-webkit-scrollbar {
    height: 16px; /* Thicker horizontal scrollbar */
    width: 16px;  /* Thicker vertical scrollbar */
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #888; /* Darker grey for visibility */
    border-radius: 4px;
    border: 4px solid #f1f1f1; /* Creates padding effect */
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

/* Firefox */
.custom-scrollbar {
    scrollbar-width: auto; /* Default width (usually thicker than thin) */
    scrollbar-color: #888 #f1f1f1;
}

/* the part below serves to unify appearance of sortable column headers (Nowe, Oczekujące, Nieliczone do prowizji) and normal ones (Rozliczone, Do weryfikacji) */

.table-sortable-headers thead th {
    position: relative; 
    padding-top: 0.3rem !important; /* analogous to table-sm that usually uses 0.3rem*/
    padding-bottom: 0.3rem !important; 
    vertical-align: middle !important; 
}

.table-sortable-headers thead th form {
    display: block;
    margin: 0;
    padding: 0;
}

.table-sortable-headers thead .btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    
    color: inherit;
    font-weight: bold;
    text-align: left;
    text-decoration: none !important;
    
    display: inline-block !important; 
    width: 100%;
    
    
    line-height: 1.2 !important; /* Vertical Alignment matches the TH */
    vertical-align: middle !important;
    
    padding-right: 15px !important; /* Space for the icon */
    position: relative;
}

.table-sortable-headers thead .btn i {
    position: absolute;
    right: 0;
    
    /* vertical centering */
    /* This puts the icon exactly in the middle of the cell, regardless of padding */
    top: 50%;
    transform: translateY(-50%);
    
    font-size: 0.8em;
    line-height: 0;
    margin: 0 !important;
}

.table-sortable-headers thead .btn:focus {
    outline: none;
    box-shadow: none;
}