/* Lanbrogio — asset inventory, SLA/exposure/patch views, dynamic groups, steps of the report builder,
   confirmation dialog, shortcut overlay. Uses only the variables of app.css (light/dark themes). */

/* ---------- asset inventory ---------- */
.asset-inv-head { gap: 10px; flex-wrap: wrap; }
.asset-inv-search { flex: 1 1 280px; max-width: 460px; }
.tagbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 var(--s-4) 10px; }
.chip-btn { border: 1px solid transparent; cursor: pointer; font: inherit; font-size: var(--fs-xs); color: var(--text-2); }
.chip-btn:hover { border-color: var(--border-strong); color: var(--text); }
.chip-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.asset-inv .bulkbar { align-items: flex-end; }
.asset-inv .bulkbar .field { gap: 2px; min-width: 140px; flex: 1 1 140px; }
.asset-inv .bulkbar .field > label { font-size: var(--fs-xs); }
.bulkbar-count { align-self: center; white-space: nowrap; color: var(--text-2); }
.bulkbar.has-sel { background: var(--accent-soft); }
.asset-inv .bulkbar:not(.has-sel) > .field, .asset-inv .bulkbar:not(.has-sel) [data-summary] { display: none; }
.asset-inv .bulkbar:not(.has-sel) { align-items: center; }
.bulkbar-actions { display: flex; gap: 6px; margin-left: auto; align-self: flex-end; }
.asset-table td { vertical-align: top; }
.asset-table th.sel, .asset-table td.sel { width: 28px; }
.asset-host { white-space: nowrap; }
.asset-alias { font-weight: var(--fw-semi); margin-left: 4px; }
.asset-hn { max-width: 240px; }
/* 3.0 (layout gate): a long host name wraps anywhere (it broke only at its hyphens and set the width of the Host column,
   pushing Compliance and Source behind the sideways scroll); a state badge of Inventory and Source wraps inside itself */
.asset-table td .asset-hn { overflow-wrap: anywhere; }
.t.asset-table td.wrap .badge { white-space: normal; height: auto; min-height: 18px; padding-block: 2px; line-height: 1.2;
                                text-align: left; }
.asset-tags { max-width: 200px; white-space: normal !important; }
.asset-table td.wrap { white-space: normal; min-width: 130px; }
.asset-table td .small { white-space: normal; max-width: 260px; }
.asset-tags .chip { margin: 0 0 3px; }
.asset-open { display: inline-flex; align-items: baseline; gap: 6px; color: var(--text); }
.asset-open .sevdot { align-self: center; }
.show-lg { display: none; }
@media (max-width: 1500px) { .asset-table .hide-lg { display: none; } .asset-table .show-lg { display: inline; } }
.asset-open:hover { text-decoration: none; color: var(--accent); }
.sevdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
tr.rf-hide { display: none; }

/* ---------- confirmation dialog with summary and shortcuts ---------- */
dialog.modal.confirm-dialog { width: min(480px, calc(100vw - 24px)); }
.confirm-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.confirm-list:empty { display: none; }
dialog.modal.keys-dialog { width: min(520px, calc(100vw - 24px)); }
.keys-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.keys-list dt { white-space: nowrap; }
.keys-list dd { margin: 0; color: var(--text-2); }

/* ---------- views: KPIs, bars, compact tables ---------- */
.vkpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); }
/* the KPI tile of the views: the same type as .kpi of app.css (F-051), with its own border because it is not in a card */
.vkpi { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 13px 15px; background: var(--surface); box-shadow: var(--shadow-sm); }
.vkpi .k { font-size: var(--fs-xs); color: var(--muted); font-weight: var(--fw-medium); }
.vkpi .v { font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 4px; }
.vkpi .s { font-size: var(--fs-xs); color: var(--muted); }
.vgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.vgrid > *, .vkpis > * { min-width: 0; }
.vgrid .card-head, .asset-inv-head { flex-wrap: wrap; }
.vgrid .card-head .hint { white-space: normal; }
/* single progress meter of the views (SLA). Not .hbar: that is the labelled bar chart of app.css (Trends), which this
   rule used to override (F-052) */
.meterbar { display: flex; align-items: center; gap: 8px; }
.meterbar .track { flex: 1; height: 8px; border-radius: var(--r-xs); background: var(--surface-3, var(--surface-2)); overflow: hidden; min-width: 60px; }
.meterbar .track > i { display: block; height: 100%; background: var(--accent); }
.meterbar .track > i.ok { background: var(--ok); } .meterbar .track > i.err { background: var(--err); } .meterbar .track > i.warn { background: var(--warn); }
.view-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--s-3); }
@media (max-width: 900px) { .vkpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .vgrid { grid-template-columns: 1fr; } }

/* ---------- dynamic groups ---------- */
.group-rule { font-size: var(--fs-xs); color: var(--text-2); }
.group-rule code { font-size: var(--fs-xs); }

/* ---------- numbered steps (report builder, _rbuild.html) ---------- */
.wizard-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 var(--s-4); flex-wrap: wrap; counter-reset: st; }
.wizard-steps li { counter-increment: st; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-sm); }
.wizard-steps li::before { content: counter(st); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border-strong); font-size: var(--fs-xs); font-weight: var(--fw-semi); }
.wizard-steps li + li::after { order: -1; content: ""; width: 18px; height: 1px; background: var(--border-strong); }

/* ---------- accessibility: visible focus everywhere ---------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.chip-btn:focus-visible, .colhead-btn:focus-visible { outline-offset: 1px; }
@media (max-width: 640px) {
  .asset-inv .bulkbar:not(.has-sel) > .field { display: none; }
  .bulkbar-actions { margin-left: 0; width: 100%; }
  .asset-inv-search { max-width: none; }
}

/* PKG-19 reports */
/* Reports hub, report builder, Inventory sources page (R-ui, DESIGN §7.3 / §5.4). Tokens of app.css only. */
.rh-tabs { margin-bottom: var(--s-4); }
.rh-presets { list-style: none; margin: 0; padding: var(--s-3) var(--s-4) var(--s-4); display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s-3); }
.rh-preset-link { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--r); color: var(--text); background: var(--surface); }
.rh-preset-link:hover { border-color: var(--accent); text-decoration: none; }
.rh-preset-t { font-weight: var(--fw-semi); }
.rd-acts, .src-acts { justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.show-sm-only { display: none; }
.rbuild { max-width: 1100px; }
.rb-nav { padding: var(--s-3) var(--s-4) 0; }
.rb-steps { margin: 0; }
.rb-stepbtn { font: inherit; color: inherit; background: none; border: 0; padding: 2px 0; cursor: pointer; }
.rb-stepbtn:hover { color: var(--accent); }
.rb-steps li.cur { color: var(--text); font-weight: var(--fw-semi); }
.rb-steps li.cur::before { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.rb-errs { margin: 4px 0 0; padding-left: 18px; }
.rb-foot { justify-content: space-between; }
.rb-fs { border: 1px solid var(--border); border-radius: var(--r); padding: 10px 14px; margin: 0; min-width: 0; }
.rb-fs > legend { font-weight: var(--fw-semi); padding: 0 6px; }
.rb-fs-flat { border: 0; padding: 6px 0 0; }
.rb-choices, .rb-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.rb-choice { display: inline-flex; align-items: flex-start; gap: 7px; cursor: pointer; }
.rb-choice > span { display: flex; flex-direction: column; gap: 2px; }
.rb-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 8px; }
.rb-preset { border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; }
.rb-preset:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.rb-details > summary, .rb-cols > summary { cursor: pointer; font-weight: var(--fw-medium); }
.rb-sections { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rb-sec { border: 1px solid var(--border); border-radius: var(--r); padding: 8px 12px; background: var(--surface); }
.rb-sec.off { background: var(--surface-2); }
.rb-sec.off .rb-sec-opts, .rb-sec.off .rb-cols { opacity: .7; }
.rb-sec-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rb-sec-opts { margin-top: 6px; align-items: flex-end; }
.rb-sec-opts .field { flex: 0 1 180px; min-width: 120px; }
.rb-toc { align-self: center; }
.rb-cols { margin-top: 6px; }
.rb-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin: 0; }
.rb-summary > div { border-top: 1px solid var(--border); padding-top: 6px; min-width: 0; }
.rb-summary dt { font-size: var(--fs-xs); color: var(--muted); font-weight: var(--fw-semi); }
.rb-summary dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.rb-sum-wide { grid-column: 1 / -1; }
.rb-estimate { border: 1px solid var(--border); border-radius: var(--r); padding: 10px 14px; background: var(--surface-2); }
.rb-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.asset-inv .bulkbar:not(.has-sel) [data-report-sel] { display: none; }
.asset-report-foot { justify-content: flex-end; }
.src-head { gap: 10px; flex-wrap: wrap; }
.src-search { flex: 1 1 280px; max-width: 460px; }
.src-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 var(--s-4) 10px; }
.src-chips a.chip-btn { text-decoration: none; }
.src-chips a[aria-current="true"] { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.src-sort { color: inherit; white-space: nowrap; }
.src-hn { max-width: 240px; }
.src-table td { vertical-align: top; }
.src-cov { min-width: 160px; max-width: 280px; }
/* 1.4.1: manual exclusion from the inventory (Inventory sources row, inventory panel of the host) */
.src-excl-d > summary { list-style: none; } .src-excl-d > summary::-webkit-details-marker { display: none; }
.src-excl-d[open] { flex-basis: 100%; }
.src-excl-d form { text-align: left; gap: 4px; margin-top: 6px; min-width: 12em; }
.inv-excl { display: flex; flex-direction: column; gap: 4px; border-top: 1px dashed var(--border); padding-top: 6px; }
@media (max-width: 640px) {
  .show-sm-only { display: block; }
  .rb-summary { grid-template-columns: 1fr; }
  .rb-sec-opts .field { flex: 1 1 100%; }
  .rb-foot .btn, .rb-actions .btn { flex: 1 1 auto; }
  .src-search { max-width: none; }
}

/* 1.7.0 170:P10 notes (REP-20): the builder shows only the field of the scope chosen; the schedule form hides the
   channel and the recipients for «Only me» and the recipients for a webhook; the «Generate this week's report»
   button under its layout card. No script: :has() on the checked radio / selected option. */
.rb-when { display: none; }
.rb-body:has(input[name="scope_kind"][value="asset_group"]:checked) .rb-when-asset_group,
.rb-body:has(input[name="scope_kind"][value="tag"]:checked) .rb-when-tag { display: grid; }
.rb-body:has(input[name="scope_kind"][value="host"]:checked) .rb-when-host,
.rb-body:has(input[name="scope_kind"][value="hosts"]:checked) .rb-when-hosts { display: block; }
form:has(input[name="send_to"][value="me"]:checked) .sf-others { display: none; }
form:has(select[name="delivery"] option[value="webhook"]:checked) .sf-email { display: none; }
.rh-preset { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rh-preset > .rh-preset-link { flex: 1 1 auto; height: auto; }
.rh-preset-go { margin: 0; display: flex; }
.rh-preset-go .btn { max-width: 100%; white-space: normal; height: auto; min-height: var(--btn-h-sm); text-align: left; }
