/* ========================================
   SOURCES PAGE
   Table styling, column widths, and disabled rows.
   ======================================== */

td {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

td:has(.dropdown) {
    overflow: visible !important;
    max-width: none;
    position: relative;
    z-index: 10;
}

td:not(:has(.dropdown)) {
    overflow: hidden;
    text-overflow: ellipsis;
}

th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

tr.row-disabled td:not(:has(.dropdown)) {
    color: var(--bs-gray-600) !important;
    opacity: 0.7;
}

tr.row-disabled {
    background-color: var(--bs-gray-100);
}

tr.row-disabled:hover {
    background-color: var(--bs-gray-200) !important;
}

/* Ensure dropdown in disabled rows appears normal */
tr.row-disabled td:has(.dropdown) {
    opacity: 1;
}

/* Ensure row with open dropdown has higher z-index */
tr:has(.dropdown-menu.show) {
    position: relative;
    z-index: 1000;
}

td:nth-child(1) {
    max-width: 180px;
}

td:nth-child(2) {
    max-width: 120px;
}

td:nth-child(3) {
    max-width: 250px;
}

td:nth-child(4) {
    max-width: 120px;
}

td:nth-child(5) {
    max-width: 150px;
}

td:nth-child(6) {
    max-width: 150px;
}

td:nth-child(7) {
    max-width: none;
    width: 50px;
    text-align: center;
    overflow: visible !important;
    position: relative;
}

td[colspan] {
    max-width: none;
}

.dropdown {
    position: relative !important;
}

.dropdown .dropdown-menu {
    position: absolute !important;
    right: 0;
    left: auto !important;
    z-index: 9999 !important;
    background-color: white !important;
    opacity: 1 !important;
}

/* Hide dropdown caret/triangle */
.dropdown .dropdown-toggle::after {
    display: none !important;
}

div[disabled] {
    pointer-events: none;
    opacity: 0.7;
}
