/* Shared table geometry. Palette values remain owned by app.css. */
.dt-wrap {
    /* Keep absolutely positioned accessible labels inside the scrollport. */
    position: relative;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    isolation: isolate;
}

.dt {
    --dt-row-height: 40px;
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--text);
    background: var(--table-body-bg);
    font-size: var(--text-sm);
}
.dt[data-density="dense"] { --dt-row-height: 36px; }
/* A quiet header rule shows pending work without adding a status row or
   changing sticky-cell geometry. The owning page supplies the live message. */
.dt-wrap[aria-busy="true"] > .dt > thead > tr > th,
.dt-wrap[data-page-feedback="true"] > .dt > thead > tr > th,
.dt[aria-busy="true"] > thead > tr > th {
    background-image: linear-gradient(var(--brand-accent), var(--brand-accent));
    background-position: bottom;
    background-repeat: no-repeat;
    background-size: 100% 2px;
}
.dt-pager-placeholder { height: 35px; box-sizing: border-box; justify-content: space-between; }
.screening-workbench .dt-pager-placeholder { height: 37px; }
.dt-pager-placeholder .dt-skeleton { display: block; width: 156px; height: 12px; border-radius: var(--radius-pill); background: var(--line); }
.dt-pager-placeholder .dt-skeleton:last-child { width: 100px; }

/* One shared pager rhythm: tabs, optional filters/page range, then headers. */
.dt-pager-top .pager-row { margin: 0 0 10px; padding: 0 0 10px; border-top: 0; border-bottom: 1px solid var(--line); }
.dt-pager-top .dt-pager-placeholder { height: 37px; }
.dt-pager-top[hidden], .dt-pager-bottom[hidden] { display: none; }
.dt-context-note { margin: 12px 0 0; font-size: var(--text-xs); line-height: 1.5; color: var(--muted); }
.dt > thead > tr > th,
.dt > tbody > tr > td {
    box-sizing: border-box;
    padding: calc((var(--dt-row-height) - 21px) / 2) 12px;
    border: 0;
    border-bottom: 1px solid var(--row-sep);
    line-height: 20px;
    text-align: left;
    vertical-align: middle;
    background: var(--dt-row-bg, var(--table-body-bg));
}
.dt > thead > tr > th {
    height: var(--dt-row-height);
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    background: var(--table-header-bg);
}
.dt[data-sticky-header="true"] > thead > tr > th { position: sticky; top: 0; z-index: 3; }
.dt .dt-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 20px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
}
.dt .dt-value {
    display: block;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.dt .dt-empty-value,
.dt td[data-type="text"] { color: var(--muted); }
/* Classification cells show one complete pill and a reserved +N control.
   Unlike single values, long labels may wrap and increase the row's height. */
.dt .dt-cell:has(> .dt-pill-list) { height: auto; min-height: 20px; overflow: visible; white-space: normal; }
.dt .dt-pill-list { display: flex; flex-wrap: nowrap; align-items: center; gap: 2px 4px; min-width: 0; max-width: 100%; }
.dt .dt-pill-list > .badge {
    display: block; flex: 0 1 auto; min-width: 0; max-width: 100%;
    white-space: normal; overflow-wrap: anywhere; line-height: 18px; padding: 0 8px;
}
.dt .dt-pill-more {
    flex: 0 0 auto; border: 1px solid var(--accent); border-radius: var(--radius-pill);
    background: transparent; color: var(--accent); cursor: pointer; padding-inline: 6px;
}
.dt td[data-type="identity"] a { color: var(--accent); }
.dt td[data-type="number"], .dt th[data-type="number"],
.dt td[data-type="date"], .dt th[data-type="date"],
.dt td[data-type="actions"], .dt th[data-type="actions"] { text-align: right; }
.dt [data-type="number"] .dt-cell, .dt [data-type="date"] .dt-cell,
.dt [data-type="actions"] .dt-cell,
.dt th[data-type="number"] .table-column-header-controls,
.dt th[data-type="date"] .table-column-header-controls { justify-content: flex-end; }
.dt [data-type="number"], .dt [data-type="date"] { font-variant-numeric: tabular-nums; }
.dt [data-type="flag"], .dt [data-type="icon"], .dt [data-type="select"] { text-align: center; padding-inline: 6px; }
.dt [data-type="flag"] .dt-cell, .dt [data-type="icon"] .dt-cell,
.dt [data-type="select"] .dt-cell { justify-content: center; }
.dt [data-type="spacer"] { padding-inline: 0; }
.dt td[data-type="badge"] .dt-value {
    box-sizing: border-box;
    border: 1px solid var(--line);
    line-height: 18px;
    border-radius: var(--radius-pill);
    background: var(--panel-2);
    padding-inline: 8px;
    font-size: var(--text-xs);
}
.dt abbr { text-decoration: none; }
.dt .dt-cell :is(button, input, select) {
    box-sizing: border-box;
    max-height: 20px;
    margin-block: 0;
    padding-block: 0;
    font: inherit;
    line-height: 18px;
}
.dt input[type="checkbox"] { width: 16px; height: 16px; margin: 0; vertical-align: middle; accent-color: var(--accent); }
.dt .dt-cell > input:not([type="checkbox"]), .dt .dt-cell > select { min-width: 0; max-width: 100%; }
.dt .dt-cell img, .dt .dt-cell svg { max-height: 20px; flex-shrink: 0; }
.dt .dt-cell:has(> .dt-stack) { height: auto; min-height: 20px; }
.dt .dt-stack { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.dt .dt-review-note { white-space: normal; overflow-wrap: anywhere; color: var(--muted); font-size: var(--text-xs); }
/* Review queues keep their existing inline editors and evidence. These are
   explicitly taller rows; ordinary shared tables retain their compact cells. */
.admin-review-table.dt-editable .dt-cell { height: auto; min-height: 20px; white-space: normal; align-items: flex-start; }
.admin-review-table.dt-editable .dt-cell :is(input, select, button) { max-height: none; min-height: 28px; }
.admin-review-table.dt-editable .dt-cell textarea { box-sizing: border-box; min-width: 0; width: 100%; }
.admin-review-table.dt-editable .dt-cell > div { min-width: 0; max-width: 100%; }
.admin-review-table.dt-editable .dt > tbody > tr > td { vertical-align: top; }
.admin-table-fields { min-width: 0; padding: 0; margin: 0; border: 0; }
.security-tables { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.security-tables :is(.home-col-left, .home-col-right, .card) { min-width: 0; }
.person-link-detail, .person-link-list, .lp-investor-enrich-body { min-width: 0; }
.linkedin-enrich-queue-header { border-bottom: 2px solid transparent; }
#linkedin-enrich-body[aria-busy="true"] .linkedin-enrich-queue-header { border-bottom-color: var(--brand-accent); }
.dt .lpr-row-in-db { --dt-row-bg: var(--list-selected); }
.dt .lpr-row-hidden { opacity: .6; font-style: italic; }
.dt .dt-cell img { max-width: 20px; object-fit: contain; }
.dt .table-column-header-controls { display: flex; align-items: center; gap: 4px; min-width: 0; }
/* Flag values are centred even when supporting columns grow to fill the host. */
.dt th[data-type="flag"] .table-column-header-controls { justify-content: center; }
.dt .table-sort-arrow { display: inline-flex; align-items: center; }
.dt .table-column-header-controls button { height: 20px; min-height: 0; max-height: 20px; padding-block: 0; line-height: 20px; }
.dt .table-sort-button { min-width: 0; white-space: nowrap; }
/* Keep sort hints and filter controls on the leading side of numeric labels. */
.dt th:is([data-type="number"], [data-type="date"]) .table-column-header-controls {
    flex-direction: row-reverse;
    justify-content: flex-start;
}
.dt th:is([data-type="number"], [data-type="date"]) .table-sort-button { flex-direction: row-reverse; }
.dt .table-sort-button > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.dt .table-sort-button:not(.is-active) .table-sort-arrow { opacity: 0; }
.dt .table-sort-button:is(:hover, :focus) .table-sort-arrow { opacity: 1; }
.dt > tbody > tr[data-row-kind="data"]:hover { --dt-row-bg: var(--row-hover); }
.dt > tbody > tr[aria-selected="true"] { --dt-row-bg: var(--list-selected); }
.dt > tbody > tr[aria-selected="true"]:hover { --dt-row-bg: var(--list-selected-hover); }
.dt :is(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}
.dt > tbody > tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* A painted sticky-cell border can change Chrome's text rasterisation between
   rows. Retain its space, but paint the separator independently of the cell. */
.dt > tbody > tr > td[data-pin] {
    position: sticky;
    z-index: 1;
    border-bottom-color: transparent;
}
.dt > tbody > tr > td[data-pin]::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: var(--row-sep);
    pointer-events: none;
}
.dt > thead > tr > th[data-pin] { position: sticky; z-index: 4; }
.dt-wrap[data-scroll-left="true"] .dt [data-pin="left"][data-pin-edge] { box-shadow: 3px 0 0 var(--line); }
.dt-wrap[data-scroll-right="true"] .dt [data-pin="right"][data-pin-edge] { box-shadow: -3px 0 0 var(--line); }
.dt > tbody > tr:is([data-row-kind="empty"], [data-row-kind="error"], [data-row-kind="expansion"], [data-row-kind="pager"]) > td {
    white-space: normal;
    overflow-wrap: anywhere;
    padding-block: 16px;
}
.dt > tbody > tr[data-row-kind="section"] > td { background: var(--panel-2); font-weight: 600; }
.dt > tbody > tr[data-row-kind="error"] > td { color: var(--danger); }
.dt .dt-skeleton { display: block; width: 75%; height: 12px; border-radius: var(--radius-pill); background: var(--line); }
.dt-disclosure-popover {
    position: fixed;
    z-index: 10000;
    max-width: min(420px, calc(100vw - 16px));
    max-height: calc(100vh - 16px);
    overflow: auto;
    overflow-wrap: anywhere;
    white-space: normal;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: var(--floating-panel-bg);
    font-size: var(--text-sm);
    line-height: 20px;
}
