/* ── Overview (revamp O1-O7, version D) ─────────────────────────────────────
   A 12-column grid: the hero row (summary, laptops-in-sync ring, top
   actions), the coverage tiles (kpi.css), "Needs attention" as one action
   list with costs as a tile beside it (O3), then the details in cards of
   equal height per row (O6). Nothing on this page moves on hover (§8). */

.ov-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--sp-3);
    align-items: stretch;
}
#tab-home > .ov-grid { margin-bottom: var(--sp-4); }

/* Row 1: the hero. */
.ov-hero {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--sp-5);
    padding: 20px 24px;
}
.ov-hero-text { display: grid; gap: 6px; min-width: 0; }
.briefing-sentence { margin: 0; font-size: var(--fs-18); line-height: 1.45; font-weight: 600; color: var(--text); max-width: 72ch; }
.briefing-meta { margin: 0; font-size: var(--fs-13); color: var(--text-3); font-variant-numeric: tabular-nums; }
.briefing-meta:empty { display: none; }
.ov-hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.ov-hero-actions:empty { display: none; }
.ov-hero-actions .btn .mk { margin-right: 2px; }

.ov-ring-wrap { display: flex; align-items: center; gap: var(--sp-4); }
.sync-ring {
    position: relative;
    display: grid;
    place-items: center;
    width: 112px;
    height: 112px;
    flex: none;
    border-radius: 50%;
    background: conic-gradient(var(--success) 0deg, var(--sunken) 0deg);
}
.sync-ring::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: var(--surface);
}
.sync-ring-label {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    font-size: var(--fs-20);
    font-weight: 650;
    line-height: 1.1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.sync-ring-label small { font-size: var(--fs-12); font-weight: 500; color: var(--text-3); }
.ov-ring-facts { display: grid; gap: 4px; margin: 0; min-width: 150px; }
.ov-ring-facts > div { display: flex; justify-content: space-between; gap: var(--sp-4); font-size: var(--fs-13); }
.ov-ring-facts dt { color: var(--text-2); }
.ov-ring-facts dd { margin: 0; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* Row 2: coverage tiles, one anatomy (O4), equal heights. */
.ov-coverage { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); }

/* Row 3: needs attention (O2) and, beside it, a column with costs (O3)
   and the devices savings tile; attention takes the row when both are hidden. */
.ov-attention { grid-column: span 8; padding: 14px 16px; }
.ov-side { grid-column: span 4; display: grid; gap: var(--sp-3); align-content: start; }
.ov-grid:not(:has(.ov-side > :not([hidden]))) .ov-attention { grid-column: 1 / -1; }
.ov-grid:not(:has(.ov-side > :not([hidden]))) .ov-side { display: none; }
.ov-attention .section-title { margin-bottom: var(--sp-2); }
.ov-att-list { list-style: none; margin: 0; padding: 0; display: grid; }
.ov-att-list:empty { display: none; }
.ov-att-row {
    display: grid;
    grid-template-columns: 12px 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--sp-3);
    width: 100%;
    min-height: 44px;
    padding: 4px 8px;
    border: 0;
    border-top: 1px solid var(--border-sub);
    border-radius: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    color: var(--text);
    cursor: pointer;
}
.ov-att-list li:first-child .ov-att-row { border-top: 0; }
.ov-att-row:hover { background: var(--hover); }
.ov-att-row:focus-visible { outline-offset: -2px; border-radius: var(--radius-sm); }
.ov-att-count { font-size: var(--fs-16); font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.ov-att-text { display: grid; min-width: 0; }
.ov-att-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.ov-att-hint { font-size: var(--fs-12); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-att-go { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-13); color: var(--text-3); }
.ov-att-row:hover .ov-att-go, .ov-att-row:focus-visible .ov-att-go { color: var(--accent-text); }
.ov-att-clear { display: flex; align-items: center; gap: var(--sp-2); padding: 8px; color: var(--text-2); font-size: var(--fs-13); }
.ov-att-clear[hidden] { display: none; }

/* Page header actions: Customize opens its panel under itself. */
.ov-customize { position: relative; }
#overviewCustomizer { top: calc(100% + 6px); right: 0; left: auto; width: 240px; padding: 12px 14px; }
#overviewCustomizer .section-title { margin-bottom: var(--sp-2); }

/* Details: cards of one height per row; charts fill their card. */
.home-details-section { margin: 0; }
.home-details-toggle { display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--sp-3); cursor: pointer; list-style: none; font-size: var(--fs-14); font-weight: 600; color: var(--text); }
.home-details-toggle::-webkit-details-marker { display: none; }
.home-details-toggle::before { content: none; }
.home-details-toggle svg.i { color: var(--text-3); transform: rotate(-90deg); transition: transform var(--dur-med) var(--ease-out); }
.home-details-section[open] > .home-details-toggle svg.i { transform: none; }
.ov-details .ov-card { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 14px 16px; }
.ov-span-4 { grid-column: span 4; }
.ov-span-6 { grid-column: span 6; }
.ov-card .section-title { margin-bottom: var(--sp-2); }
.ov-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.ov-card-head .section-title { margin: 0; }
.ov-card-head .donut-tab-bar { margin: 0; }
.ov-details .chart-canvas { display: block; width: 100%; height: 170px; }
.ov-source-list { display: grid; gap: 2px; margin: 0; }
.ov-source-list > div { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 7px 0; border-top: 1px solid var(--border-sub); font-size: var(--fs-13); }
.ov-source-list > div:first-child { border-top: 0; }
.ov-source-list dt { color: var(--text-2); }
.ov-source-list dd { margin: 0; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
/* Detail lists: rows on hairlines, no card inside the card (G4). */
.home-list-card .section-title { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.drift-all-btn { font-size: var(--fs-12); min-height: 26px; padding: 2px 8px; }
.home-action-list { display: grid; }
.home-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--sp-3);
    width: 100%;
    min-height: 44px;
    padding: 6px 4px;
    border: 0;
    border-top: 1px solid var(--border-sub);
    border-radius: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    color: var(--text);
    cursor: pointer;
}
.home-action-row:first-child { border-top: 0; }
.home-action-row:hover { background: var(--hover); }
.home-action-row:focus-visible { outline-offset: -2px; }
.home-action-copy { display: grid; min-width: 0; }
.home-action-label { font-size: var(--fs-13); color: var(--text); }
.home-action-meta { font-size: var(--fs-12); color: var(--text-3); }
.home-action-count { font-size: var(--fs-14); font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
/* "What changed" (insight modal): five equal fixed columns cut the
   "In sync -> Disagree" pair to "In sync -> ...". The status pair gets the
   room; on a narrow screen the table scrolls instead of clipping. */
.drift-table { min-width: 720px; }
.drift-col-serial { width: 14%; }
.drift-col-host { width: 20%; }
.drift-col-status { width: 32%; }
.drift-col-user { width: 22%; }
.drift-col-when { width: 12%; }
.heatmap-scroll { overflow-x: auto; }
.heatmap-card canvas { display: block; }

@media (max-width: 1200px) {
    .ov-coverage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ov-span-4 { grid-column: span 6; }
    .ov-span-6 { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    .ov-attention, .ov-side { grid-column: 1 / -1; }
    .ov-hero { grid-template-columns: minmax(0, 1fr); }
    .ov-span-4 { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .ov-coverage { grid-template-columns: minmax(0, 1fr); }
    .ov-ring-wrap { flex-wrap: wrap; }
    .ov-hero { padding: 16px; }
    .briefing-sentence { font-size: var(--fs-16); }
    .ov-att-row { grid-template-columns: 12px 40px minmax(0, 1fr); }
    .ov-att-go { display: none; }
}

/* ── Customize (revamp finish): which sections show, per person ──────────
   A section the person hid carries data-overview-hidden (not el.style, not
   [hidden], which other code also sets). The panel is a fieldset of
   checkboxes; Escape closes it and returns focus to its button. */
[data-overview-hidden] { display: none !important; }
.overview-fields { display: grid; gap: 2px; min-width: 220px; margin: 0; padding: 4px 4px 2px; border: 0; }
.overview-fields legend { padding: 0; margin-bottom: var(--sp-2); }
.overview-toggle { display: flex; align-items: center; gap: var(--sp-2); min-height: 32px; font-size: var(--fs-13); color: var(--text); cursor: pointer; }
.overview-toggle input { margin: 0; }
