#regTable_wrapper,
#callbackSum_wrapper {
    margin-top: 20px;
    overflow-x: auto;
}

#regTable tfoot input,
#regTable tfoot select,
#callbackSum tfoot input,
#callbackSum tfoot select {
    width: 100%;
    padding: 3px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.9em;
}

#regTable tfoot .total-display,
#callbackSum tfoot .total-display {
    font-weight: bold;
    text-align: right;
    padding: 3px;
    box-sizing: border-box;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 3px;
}

#regTable thead th,
#callbackSum thead th {
    position: relative;
    padding-right: 60px;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}

#regTable thead th:last-child,
#callbackSum thead th:last-child {
    padding-right: 8px;
    cursor: default;
}

/* ===================================================== */
/*  FILTER + SORT ICON ALIGNMENT                         */
/* ===================================================== */
#regTable th {
    position: relative;
}

#regTable th .dt-column-order,
#regTable th .filter-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    color: #999;
}

#regTable th .filter-btn {
    right: 6px; /* filter icon far right */
}

#regTable th .dt-column-order {
    right: 24px; /* sort arrow left of filter */
}

#regTable th .filter-btn i,
#regTable th .dt-column-order i {
    font-size: 13px;
}

#regTable th .filter-btn:hover i {
    color: #000;
}

/* ===================================================== */
/* FILTER MENU POPUP (Bootstrap-like modern style)        */
/* ===================================================== */
.filter-menu {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 10px;
    min-width: 220px;
    z-index: 9999;
    display: none;
    font-size: 0.9em;
}

/* Select dropdown inside filter */
.filter-menu .form-group {
    margin-bottom: 8px;
}

.filter-menu .input-group.input-group-sm select.form-control.custom-select {
    font-size: 0.9em;
    border-radius: 4px;
    height: auto;
    padding: 4px 6px;
}

/* Text input below select */
.filter-menu input.form-control-sm {
    font-size: 0.9em;
    border-radius: 4px;
    padding: 5px 8px;
}

/* Divider above sort section */
.filter-menu::after {
    content: "";
    display: block;
    width: 100%;
    border-bottom: 1px solid #eee;
    margin: 8px 0;
}

/* Sort option buttons */
.filter-menu button.btn-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #333;
    font-size: 0.9em;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
}

.filter-menu button.btn-link:hover {
    color: #000;
    background: #f5f5f5;
    border-radius: 4px;
}

/* Icon inside buttons */
.filter-menu button.btn-link i {
    font-size: 13px;
    width: 14px;
    text-align: center;
}

/* ===================================================== */
/* LEGACY FILTER POPOVER (kept for backward compatibility)*/
/* ===================================================== */
.filter-popover {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 15px;
    z-index: 1001;
    min-width: 200px;
    max-width: 280px;
    box-sizing: border-box;
    text-align: left;
}

.filter-popover label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
    color: #555;
}

.filter-popover input[type="text"],
.filter-popover input[type="number"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.9em;
}

.filter-popover .range-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.filter-popover .range-group input {
    flex-grow: 1;
    margin-bottom: 0;
}

.filter-popover .checkbox-group {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 5px 10px;
    margin-bottom: 10px;
    background-color: #fcfcfc;
    border-radius: 4px;
}

.filter-popover .checkbox-group label {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-weight: normal;
    font-size: 0.9em;
    cursor: pointer;
}

.filter-popover .checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.filter-popover .filter-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.filter-popover .filter-buttons button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background-color 0.2s ease;
}

.filter-popover .btn-apply {
    background-color: #007bff;
    color: white;
}

.filter-popover .btn-apply:hover {
    background-color: #0056b3;
}

.filter-popover .btn-clear {
    background-color: #dc3545;
    color: white;
}

.filter-popover .btn-clear:hover {
    background-color: #c82333;
}

/* ===================================================== */
/* DataTables "Show X entries" spacing                    */
/* ===================================================== */
.dataTables_length {
    display: flex !important;
    align-items: center;
    gap: 8px;
}
.dataTables_length label {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

/* ===================================================== */
/* General Table Alignment                                */
/* ===================================================== */
#regTable th,
#regTable td,
#callbackSum th,
#callbackSum td {
    text-align: center !important;
    vertical-align: middle;
}


/* ===================================================== */
/* FORCE TALLER TABLE ROWS */
/* ===================================================== */
#regTable td,
#callbackSum td {
    padding-top: 15px !important; 
    padding-bottom: 15px !important;
    /* You can adjust '15px' to any desired value */
}

