/* LSG tables: Bootstrap's table in the portal colours, for list pages (admin Users, sales orders). Linked before main.css in Views/_Layout.cshtml.
   Use with Bootstrap's own classes: <table class="table table-striped table-hover align-middle lsg-table">. Paging uses .pagination (lsg.utility.css). */

/* Odd rows a visible grey (with Bootstrap's table-striped), from the portal's border colour; the row under the mouse
   (with table-hover: body rows only, not the header or totals footer) a clear step darker, the border colour itself */
.lsg-table {
    --bs-table-striped-bg: color-mix(in srgb, var(--lsg-color-border) 40%, var(--lsg-color-surface));
    --bs-table-hover-bg: var(--lsg-color-border);
}

/* Header and footer rows (e.g. an order's totals) darker than the stripes so they stay apart (Bootstrap's table background),
   headers on one line */
.lsg-table > thead,
.lsg-table > tfoot {
    --bs-table-bg: color-mix(in srgb, var(--lsg-color-border) 70%, var(--lsg-color-surface));
}

.lsg-table > thead > tr > th {
    white-space: nowrap;
}

/* Long list: the page scrolls and the header row stays at the top of the window. Sticky needs no scrolling box around the
   table, so it pairs with Bootstrap's wrapper at the same size, as Bootstrap names them: .lsg-table-sticky-lg inside
   .table-responsive-lg sticks from lg up and scrolls sideways below it. .lsg-table-sticky (every size) has no wrapper. */
.lsg-table-sticky > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 1;
}

@media (min-width: 576px) {
    .lsg-table-sticky-sm > thead > tr > th { position: sticky; top: 0; z-index: 1; }
}

@media (min-width: 768px) {
    .lsg-table-sticky-md > thead > tr > th { position: sticky; top: 0; z-index: 1; }
}

@media (min-width: 992px) {
    .lsg-table-sticky-lg > thead > tr > th { position: sticky; top: 0; z-index: 1; }
}

@media (min-width: 1200px) {
    .lsg-table-sticky-xl > thead > tr > th { position: sticky; top: 0; z-index: 1; }
}

@media (min-width: 1400px) {
    .lsg-table-sticky-xxl > thead > tr > th { position: sticky; top: 0; z-index: 1; }
}

/* Sortable column header: the whole header is the link (the header's text, no underline); its icon is muted until the column
   is the sorted one */
.lsg-table-sort {
    color: inherit;
    text-decoration: none;
}

.lsg-table-sort:hover {
    color: var(--lsg-color-primary);
}

.lsg-table-sort .fa-sort {
    color: var(--lsg-color-text-muted);
}

/* A column only as wide as its widest content (e.g. the status tags), so the other columns take the rest; on its <th> */
.lsg-table-fit {
    width: 1%;
    white-space: nowrap;
}

/* A row's item link (the order number, the Users list's username) in the portal accent and bold, as on the live site; other links keep the default */
.lsg-table-link {
    --bs-link-color-rgb: var(--lsg-color-primary-rgb);
    --bs-link-hover-color-rgb: var(--lsg-color-primary-dark-rgb);
    font-weight: 600;
}
