/* =====================================================================
   ATENA · Master per sezioni (infrastrutture nostre · datacenter · clienti)
   e schermo Albero — 2026-11-18. Caricato dopo theme.css.
   ===================================================================== */
.matrix { display: flex; flex-direction: column; gap: 18px; overflow-y: auto; padding-right: 2px; }
.msec { display: flex; flex-direction: column; gap: 10px; }
.msec-h { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.msec-ico {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent);
}
.msec-datacenter .msec-ico { background: color-mix(in srgb, #8b5cf6 16%, transparent); color: #a78bfa; }
:root[data-theme="light"] .msec-datacenter .msec-ico { color: #7c3aed; }
.msec-customer .msec-ico { background: color-mix(in srgb, #14b8a6 16%, transparent); color: #2dd4bf; }
:root[data-theme="light"] .msec-customer .msec-ico { color: #0f766e; }
.msec-ico svg, .tn-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.msec-t { min-width: 0; }
.msec-t h3 { margin: 0; font-size: 15px; font-weight: 650; }
.msec-t span { font-size: 12px; color: var(--muted); }
.msec-sum { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.msec-sum b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.mc-state { --c: var(--unknown); }
.mc-state.s-up { --c: var(--up); } .mc-state.s-warn { --c: var(--warn); } .mc-state.s-down { --c: var(--down); }
.msec-sum .mc-state { color: var(--c); }
.msec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.msec-empty { padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: 8px; color: var(--muted); font-size: 13px; }
.mc-res { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 7px; background: var(--bg-2); }
:root[data-theme="light"] .mc-res { background: var(--panel-2); }
.mr-row { display: grid; grid-template-columns: minmax(0, 1.1fr) repeat(3, minmax(0, 1fr)); gap: 10px; align-items: center; }
.mr-host { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-host small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.mr-host small.t-down { color: var(--down-text); font-weight: 600; }
.mr-host .sdot { background: var(--unknown); }
.mr-host .sdot.s-up { background: var(--up); } .mr-host .sdot.s-warn { background: var(--warn); } .mr-host .sdot.s-down { background: var(--down); }
.mr { display: grid; grid-template-columns: 30px 1fr 32px; gap: 5px; align-items: center; font-size: 11px; }
.mr-l { color: var(--muted); }
.mr-t { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.mr-v { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Albero ---------- */
body.view-tree #view-tree { display: grid; }
#view-tree.tree-view { grid-template-rows: minmax(0, 1fr); padding: 12px 18px 18px; }
.tree-panel { min-height: 0; }
.tree-panel .panel-h .legend { margin-left: 16px; }
.tree-tools { display: flex; gap: 8px; margin-bottom: 12px; }
.tree-tools input { flex: 1 1 280px; max-width: 460px; height: 34px; }
.tree-wrap { overflow-y: auto; min-height: 0; flex: 1; padding: 2px 4px 8px 0; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 21px; padding-left: 14px; border-left: 1px solid var(--line-2); }
.tn { position: relative; }
.tree ul > .tn::before { content: ""; position: absolute; left: -14px; top: 19px; width: 12px; border-top: 1px solid var(--line-2); }
.tn-row {
  --c: var(--unknown);
  display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 5px 10px; margin: 2px 0;
  border-radius: 8px; cursor: pointer; border: 1px solid transparent;
}
.tn-row:hover { background: var(--hover); }
.tn-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.tn-row.s-up { --c: var(--up); } .tn-row.s-warn { --c: var(--warn); } .tn-row.s-down { --c: var(--down); } .tn-row.s-paused { --c: var(--paused); }
.tn-row.s-down { background: var(--down-soft); border-color: color-mix(in srgb, var(--down) 30%, transparent); }
.tn-row.s-warn { background: var(--warn-soft); }
.tn-caret { width: 14px; height: 14px; flex: none; display: grid; place-items: center; color: var(--muted); }
.tn-caret::before { content: ""; width: 6px; height: 6px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.tn.open > .tn-row .tn-caret::before { transform: rotate(45deg) translate(-2px, -2px); }
.tn-caret.none::before { content: none; }
.tn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.tn-row.s-down .tn-dot { animation: ring 1.6s infinite; }
.tn-ico { color: var(--muted); display: flex; flex: none; }
.tn-ico svg { width: 17px; height: 17px; }
.tn-logo { width: 26px; height: auto; }
.tn-color { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.tn-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-title small { font-weight: 400; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.tn-root > .tn-row .tn-title { font-size: 16px; letter-spacing: .04em; }
.tn-kind > .tn-row .tn-title { font-size: 15px; }
.tn-leaf .tn-title { font-weight: 500; flex: 0 1 auto; }
.tn-chips { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.tn-chip { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.tn-chip.s-down { color: var(--down-text); background: var(--down-soft); }
.tn-chip.s-warn { color: var(--warn-text); background: var(--warn-soft); }
.tn-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.tn-msg { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 380px; text-align: right; }
.tn-row.s-down .tn-msg { color: var(--down-text); } .tn-row.s-warn .tn-msg { color: var(--warn-text); }
.tn-pill { --c: var(--unknown); flex: none; width: 86px; text-align: center; font-size: 11.5px; font-weight: 600; padding: 2px 0; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.tn-pill.s-up { --c: var(--up-text); } .tn-pill.s-warn { --c: var(--warn-text); } .tn-pill.s-down { --c: var(--down-text); }
.tn-empty { color: var(--dim); font-size: 12.5px; padding: 6px 10px; }

@media (max-width: 1279px), (max-height: 719px) {
  .tree-wrap { overflow: visible; }
  #view-tree.tree-view { grid-template-rows: auto; }
}
@media (max-width: 700px) {
  #view-tree.tree-view { padding: 12px 16px; }
  .tree ul { margin-left: 10px; padding-left: 10px; }
  .tree ul > .tn::before { left: -10px; width: 8px; }
  .tn-msg, .tn-title small, .tree-panel .panel-h .legend { display: none; }
  .tn-pill { width: auto; padding: 2px 8px; }
  .msec-h { flex-wrap: wrap; }
  .msec-sum { margin-left: 0; flex-wrap: wrap; gap: 10px; }
  .msec-grid { grid-template-columns: 1fr; }
  .mr-row { grid-template-columns: 1fr 1fr 1fr; }
  .mr-host { grid-column: 1 / -1; }
}
