/* ── Investigate (revamp I1-I6, version D) ──────────────────────────────────
   Lists as underline tabs with counts and a subtitle (I4), one toolbar row
   whose overflow lives in a More menu (I1), the bulk bar under it with a
   count, and the device table on the shared table look (table.css: class
   "dt" on #deviceTable) with one-line rows (I2) and neutral source chips
   (I3). Density: html[data-table-density] (I5). */

.inv-tabs-row { margin-bottom: 0; }
.inv-tabs-row .tabs-actions { padding-bottom: 6px; }
.list-subtab-custom { margin-left: auto; color: var(--text-3); }
.list-subtab-custom svg { width: 14px; height: 14px; }
.inv-desc { display: none; margin: 6px 0 var(--sp-3); font-size: var(--fs-13); color: var(--text-3); }
.inv-desc.visible { display: block; }

/* One toolbar row: search grows, the selects keep their size, the column
   picker and More sit at the end. Wraps instead of clipping (bug 4). */
.filters-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-2);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.filters-toolbar .f-select { width: auto; max-width: 170px; }
.toolbar-search-wrap { position: relative; flex: 1 1 200px; min-width: 160px; max-width: 320px; }
.toolbar-search-wrap svg.i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.toolbar-search-wrap input { width: 100%; padding-left: 32px; }
.inv-toolbar-end { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex: 0 1 auto; min-width: 0; }
.filter-pills .filter-pill { flex: none; }
.filter-pills:empty { display: none; }
.excluded-bar .restore-link { padding: 0; border: 0; background: none; font: inherit; color: var(--accent-text); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* Bulk bar: in place under the toolbar, with the count first. */
.bulk-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-2);
    padding: 6px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--accent-dim);
    font-size: var(--fs-13);
}
.bulk-bar[hidden] { display: none; }
.bulk-count { margin-right: 6px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.bulk-clear { margin-left: auto; }

.result-count-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 14px;
    font-size: var(--fs-13);
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    border-bottom: 1px solid var(--border-sub);
    flex-shrink: 0;
}
.result-help { font-size: var(--fs-12); color: var(--text-3); white-space: nowrap; }
.result-help kbd { margin: 0 1px; }

/* The device table on the shared look. Rows are one line (I2); a cell
   never grows the row: long values truncate with the full value in the
   tooltip (DESIGN.md §3). */
#deviceTable.dt thead th { top: 0; }
#deviceTable.dt tbody td { white-space: nowrap; }
#deviceTable.dt td.c-serial { font-family: var(--mono); font-weight: var(--mono-font-weight); font-size: var(--fs-12); color: var(--text); }
#deviceTable.dt td.c-hostname { font-family: var(--mono); font-weight: var(--mono-font-weight); font-size: var(--fs-12); color: var(--text); max-width: 240px; }
#deviceTable.dt td.c-model { max-width: 200px; }
#deviceTable.dt td.col-issues { max-width: 320px; }
#deviceTable.dt td.col-confidence { text-align: right; }
#deviceTable.dt th.cb-col, #deviceTable.dt td.cb-col { width: 36px; padding: 0 0 0 14px; text-align: left; }
#deviceTable.dt tbody tr.table-render-cap-row td { height: auto; padding: 12px; text-align: center; }
#deviceTable.dt tbody tr.row-focused td { background: var(--hover); }
#deviceTable.dt tbody tr.row-focused td.cb-col { box-shadow: inset 3px 0 0 var(--accent); }
#deviceTable .dt-sort { pointer-events: auto; }

/* I2: the conflict stays on the row's one line. */
.cc-inline { overflow: hidden; text-overflow: ellipsis; }
.conflict-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 20px;
    margin-left: 6px;
    padding: 0 7px;
    border-radius: var(--radius-pill);
    font-family: var(--sans);
    font-size: var(--fs-12);
    font-weight: 500;
    color: var(--conflict);
    background: var(--conflict-dim);
    vertical-align: 1px;
    cursor: help;
}

/* Issues: the first one and how many more (all of them in the tooltip). */
.issue-line { display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; }
.issue-line .issue-item { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.issue-more { flex: none; padding: 0 6px; border-radius: var(--radius-pill); font-size: var(--fs-12); color: var(--text-2); background: var(--sunken); font-variant-numeric: tabular-nums; }

/* I3: sources as neutral initials chips, named in the tooltip. */
.src-chips { position: relative; display: inline-flex; gap: 3px; }
.src-chip {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 20px;
    padding: 0 4px;
    border-radius: var(--radius-xs);
    font-family: var(--sans);
    font-size: var(--fs-11);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-2);
    background: var(--sunken);
    box-shadow: inset 0 0 0 1px var(--border);
    cursor: default;
}

/* Sticky checkbox and serial columns while the wide table scrolls
   sideways (desktop only: on phones the pinned pair would eat the view). */
@media (min-width: 769px) {
    #deviceTable.dt th.cb-col, #deviceTable.dt td.cb-col { position: sticky; left: 0; z-index: 3; min-width: 36px; max-width: 36px; }
    #deviceTable.dt th.col-serial, #deviceTable.dt td.col-serial { position: sticky; left: 36px; z-index: 3; box-shadow: inset -1px 0 0 var(--border-sub); }
    #deviceTable.dt thead th.cb-col, #deviceTable.dt thead th.col-serial { z-index: 5; }
}
.drawer-pad { padding: 8px 20px 16px; }
.drawer-pad > .dt-wrap { margin: 0; }
.drawer-note { margin: 0 0 8px; font-size: var(--fs-13); color: var(--text-3); }
.drawer-note b { color: var(--text-2); }
.drawer-warn, .drawer-ok, .waste-n { display: inline-flex; align-items: center; gap: 6px; }
.drawer-warn, .waste-n { color: var(--warn); }
.drawer-ok { color: var(--success); }
.drawer-chip {
    display: inline-flex; align-items: center;
    height: 22px; padding: 0 9px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-12); font-weight: 500;
    color: var(--text-2);
    background: var(--sunken);
    box-shadow: inset 0 0 0 1px var(--border);
    font-variant-numeric: tabular-nums;
}
#drawerBody .btn.flash { color: var(--success); }
/* Narrow screens: the title and its buttons wrap instead of widening the
   drawer (a person's email with two buttons overflowed at 390px). */
.drawer-device-header { flex-wrap: wrap; }
.drawer-device-header > div:first-child { min-width: 0; }
.drawer-serial { overflow-wrap: anywhere; }
.drawer-actions { flex-wrap: wrap; }

@media (max-width: 900px) {
    .inv-tabs-row { flex-wrap: wrap; }
    .inv-tabs-row .tabs-actions { padding-bottom: 6px; }
    .filters-toolbar .f-select { flex: 1 1 120px; max-width: none; }
    .toolbar-search-wrap { flex-basis: 100%; max-width: none; }
    .inv-toolbar-end { margin-left: 0; }
}
