/* ── Insights pages: Security, OS versions, Compliance (revamp O6, I6) ──────
   Version D: a strip of counts, charts in equal-height cards, then the
   table (static/lib/table.js) as the page's primary element. */

.sec-layout, .osv-layout { display: flex; flex-direction: column; gap: var(--sp-3); padding: 0 0 var(--sp-4); }
.sec-layout > .tabs, .osv-layout > .tabs { margin-bottom: var(--sp-1); }
.sec-layout .strip, .osv-layout .strip { margin-bottom: 0; }
.s1-view { display: flex; flex-direction: column; gap: var(--sp-3); }
.s1-view[hidden] { display: none; }

/* O6: charts sit side by side at one height; the canvas fills its card. */
.sec-charts-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); align-items: stretch; }
.sec-chart-card { display: flex; flex-direction: column; min-width: 0; padding: 14px 16px; }
.sec-chart-card .section-title { margin-bottom: var(--sp-2); }
.sec-chart-card .chart-canvas { display: block; width: 100%; height: 170px; }

/* The table head and the tabs over a table sit tight against it. */
.sec-layout .dt-head, .osv-layout .dt-head { margin: var(--sp-2) 0 0; }
.sec-layout .tabs-sm, .osv-layout .tabs-sm { margin: 0; }
.sec-layout .dt-desc, .osv-layout .dt-desc { margin: 0; color: var(--text-3); font-size: var(--fs-13); }

/* OS versions: the chart scrolls inside its card; adoption is a list of
   version buttons with a bar for their share (no literal colours). */
.osv-chart-scroll { overflow: hidden; }
#osvChart { display: block; width: 100%; }
.osv-heatmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; align-content: start; overflow: auto; max-height: 220px; }
.osv-heat-cell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 2px 8px;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--sunken);
    font: inherit;
    font-size: var(--fs-13);
    text-align: left;
    color: var(--text);
    cursor: pointer;
}
.osv-heat-cell:hover { background: var(--hover); }
.osv-heat-cell[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--accent); }
.osv-heat-cell .v { font-family: var(--mono); font-size: var(--fs-12); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.osv-heat-cell .c { font-weight: 600; font-variant-numeric: tabular-nums; }
.osv-heat-cell .kpi-bar { grid-column: 1 / -1; margin-top: 4px; height: 4px; }
.osv-heat-empty { margin: 0; }

/* Compliance: bars use the shared 6px progress bar (kpi.css). */
.compliance-cell { display: flex; align-items: center; gap: var(--sp-2); }
.compliance-cell .kpi-bar { flex: 1 1 60px; min-width: 60px; margin: 0; }
.compliance-unknown { margin-left: 6px; font-size: var(--fs-12); color: var(--text-3); }
.compliance-table-wrap { max-height: none; }
.compliance-row { cursor: pointer; }
.compliance-row .compliance-chev svg.i { transition: transform var(--dur-med) var(--ease-out); }
/* Expandable rows (revamp finish): the head is the shared sort buttons;
   a division opens in place, its departments and devices are shared
   tables nested in the detail row. */
.compliance-toggle {
    display: inline-flex; align-items: center;
    padding: 0; border: 0; background: none;
    font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.compliance-toggle:focus-visible { outline-offset: 2px; border-radius: var(--radius-xs); }
.compliance-row .compliance-chev { display: inline-flex; width: 14px; margin-right: 6px; color: var(--text-3); vertical-align: -2px; }
.compliance-row.is-open .compliance-chev svg.i { transform: rotate(90deg); }
.compliance-row.is-open .compliance-chev { color: var(--accent-text); }
.compliance-row.is-open > td { background: var(--surface-2); }
.dt tbody tr.compliance-detail-row > td { height: auto; padding: 0; max-width: none; white-space: normal; background: var(--surface-2); }
.compliance-detail-inner { display: grid; gap: var(--sp-2); padding: 10px 14px 14px 34px; border-bottom: 1px solid var(--border-sub); }
.compliance-detail-inner .dt-wrap { max-height: 320px; }
.compliance-teams-wrap .dt-wrap { max-height: 220px; }
.compliance-team-row.is-active td { background: var(--accent-dim); color: var(--text); }
.compliance-detail-title { margin: 0; font-size: var(--fs-13); color: var(--text-2); }
.serial-link.mono { font-family: var(--mono); font-size: var(--fs-12); }
.multi-host { margin-right: 12px; font-size: var(--fs-12); color: var(--text-3); }

@media (max-width: 900px) {
    .sec-charts-row { grid-template-columns: minmax(0, 1fr); }
}
