table {
    position: relative;
    margin: 0 0 0 0;
    table-layout: fixed;
    /* need to leave this a separate otherwise collapse shows bleeding at the top of tbl when scrolling down */
    border-collapse: separate;
    /* border-collapse: collapse; */
    /* helps avoid sticky/border seams */
    /* border-spacing: 1px; */
    /* border-color: blue; */
    border-spacing: 0 1px;
}

table thead {
    /* the following doesnt work due to table element model not respecting thead min-height */
    /* min-height: 260px; */
    /* height does work */
    height: 40px;
}


td {
    border-bottom: 1px solid var(--color-table-cell-border);
}


th {
    position: sticky;
    top: 0;
    /* the following padding is overriden by the full-border-cells class */
    padding: 3px 5px;
    /* the following doesnt work due to table element model not respecting thead min-height */
    /* min-height: 60px; */
    background: var(--color-table-col-headers-background);
    color: var(--color-table-col-headers-text);
    /* font-weight: 400; */
    font-weight: var(--color-table-col-headers-fontweight);
    user-select: none;
    text-align: left;
    font-size: 0.8rem;
    z-index: 10;

    border-top: DarkGray 1px solid !important;
    border-bottom: DarkGray 1px solid;

}

/* the row of grouping captions above the column headers - built by table2.js from the
   superHeader of each column. both rows are sticky, so the column headers stop below the
   super header row instead of on top of it. --super-header-height is measured and set on
   the table once the row is built */
table.has-super-headers th {
    top: var(--super-header-height, 0px);
}

table.has-super-headers th.super-header-th {
    top: 0;
}

.super-header-th {
    /* the sides tell one group from the next - a group with no color of its own has only
       these to show where it starts and ends */
    border-left: 1px solid var(--color-table-cell-border-side);
    border-right: 1px solid var(--color-table-cell-border-side);
    font-size: 0.78rem;
}


th.center, td.left {
    text-align: left;
}

th.center, td.center {
    text-align: center;
}

th.right, td.right {
    text-align: right;
}

th.grayed, td.grayed {
    color: silver;
    font-size: 0.8rem;
}

th div {
    color: var(--color-table-col-headers-text);
}


tr:hover {
    background-color: var(--color-table-row-hover);
}

tr:hover td {
    /* 2025-11-12 - adding in following line - if the row is being highlted for hover then also change the fore color for text to black otherwise we cant see the grayed out columns: ; */
    /* took about the !important since it was overriding the special colors for the sliding editor which is always dark in all modes */
    color: var(--color-table-row-hover-forecolor);
}

tr {
    background-color: var(--color-table-row);
}

tr.selected {
    background-color: var(--color-table-row-selected);
}

tr.selected td {
    color: var(--color-table-row-selected-forecolor);
}

/* tr.row-grayed>td {
    color: pink;
} */

table tbody {
    overflow-y: auto;
    max-height: 800px;

}

/* includes tbl and body so as not to affect the headers row */
table tbody tr:nth-child(even) {
    /* background-color: silver;  */
    /* var(--color-table-row-alt); */
}

table tbody tr:nth-child(odd) {
    /* background-color: var(--color-table-row); */
}



/* td.td-warning {
    color: var(--color-table-cell-warning);
    word-wrap: break-word;
    white-space: normal;
    max-width: 180px;
} */



tr.totals {}

tr.totals>td {
    font-weight: 600;
    line-height: 32px;
    /* background-color: var(--color-table-row-totals-background); */
    color: var(--color-table-row-totals);
    font-weight: 600;
    /*400*/
    border-top: DarkGray 1px solid;
    border-bottom: DarkGray 2px solid;
}


td {
    font-size: 0.85rem;
    padding: 2px 6px 2px 12px;
    text-align: left;
    line-height: 200%;
    color: var(--color-table-text);
    white-space: nowrap;
    user-select: none;
}

.full-border-cells th, td {
    border-right: calc(var(--table-border-side-width) * 1px) solid var(--color-table-cell-border-side);
    font-size: 0.8rem;
    padding: calc(var(--table-row-spacing) * 1px) calc(var(--table-col-spacing) * 1px + 3px);
}

/* .simple-table {
    height: fit-content;
    background-color: white;
    padding: 60px;
} */

.event-log-image {
    padding-top: 0px;
    padding-bottom: 5px;
    margin-right: 5px;
    vertical-align: bottom;
}


th.hide {
    /* display: none; */
    display: var(--toggle-hide-columns);
}

td.hide {
    /* display: none; */
    display: var(--toggle-hide-columns);
}


#butDelete svg {
    margin-left: 6px;
}


.sortable-th {
    /* position: relative;  */
}

.sortable-th::after {
    content: "\25B2\A\25BC";
    /* Up and down arrows stacked */
    white-space: pre;
    color: var(--color-table-col-headers-updown-arrows);
    display: inline-block;
    font-size: 8px;
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.sortable-th:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.sortable-th:hover::after {
    opacity: 1;
}

/* draggable column-resize grip on the right edge of each header */
.col-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    z-index: 2;
    background-color: transparent;
    opacity: 0;
    /* fade-out (returning to this state) is immediate */
    transition: background-color 0.15s ease 0s, opacity 0.15s ease 0s;
}

.col-resize-handle:hover {
    background-color: var(--color-table-col-headers-updown-arrows);
    opacity: 0.5;
    /* the grip only appears after 1s of hovering the edge */
    transition: background-color 0.15s ease 1s, opacity 0.15s ease 1s;
}

/* while hovering the resize grip, hide the sort arrows/underline immediately */
.sortable-th:has(.col-resize-handle:hover)::after {
    opacity: 0;
    transition: opacity 0.15s ease 0s;
}

.sortable-th:has(.col-resize-handle:hover) {
    text-decoration: none;
}

.multi-lines-th::after {
    right: 4px;
}


.table-height-normal {
    /* this overrides auto fill 100% of height */
    height: max-content;
    /* or */
}


.selected-row {
    background-color: yellow;
}


.frozen-column-header {
    position: sticky;
    left: 0;
    z-index: 11;
    /* to prevent bleed-thru;*/
    /* background-color: rgb(230, 230, 230);     */
    background-color: var(--color-table-col-headers-background);
}


.frozen-column-cell {
    position: sticky;
    left: 0;
    z-index: 1;
    /* to prevent bleed-thru;*/
    /* background-color: rgb(230, 230, 230);     */
    background-color: var(--color-table-row);
}

.frozen-column-cell:hover {
    background-color: var(--color-table-row-hover);
}

tr:hover .frozen-column-cell {
    background-color: var(--color-table-row-hover);
}

tr.selected .frozen-column-cell {
    background-color: var(--color-table-row-selected);
}


tr.disabled-row td {
    opacity: 25%;
}

td.highlight-in-yellow {
    background-color: lightyellow;
}

td.highlight-in-pink {
    color: firebrick;
    background-color: pink;
}

tr.table-row-highlight{
    background-color:var(--color-table-row-highlight);
}