/* App layout on top of WowDash's bootstrap + remixicon assets. Self-contained
   so it renders cleanly regardless of the template's exact DOM structure. */
* { box-sizing: border-box; }

/* min-width:0 is what makes a wide table scroll inside its own container: a
   flex item defaults to min-width:auto, which lets the content push the whole
   page wider instead of letting the grid's own overflow take over. */

/* Organization switcher — top-left, at the sidebar edge */

.nx-card { background: var(--nx-card); border: 1px solid var(--nx-border); border-radius: 4px; padding: 20px; margin-bottom: 20px; min-width: 0; }
.nx-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.nx-card-head h3 { margin: 0; font-size: 16px; }
.nx-stat { background: var(--nx-surface-raised); border: 1px solid var(--nx-border); border-radius: 4px; padding: 18px;
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.nx-stat:hover { border-color: var(--nx-border); }
.nx-stat.active { border-color: var(--nx-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nx-primary) 12%, transparent); }
.nx-stat .v { font-size: 26px; font-weight: 700; }
.nx-stat .l { color: var(--nx-muted); font-size: 13px; margin-top: 4px; }

/* --- data tables ------------------------------------------------------- */
.nx-table-note { padding: 34px; text-align: center; color: var(--nx-muted); font-size: 14px; }

.nx-table-wrap { overflow: auto; max-height: calc(100vh - 340px); border: 1px solid var(--nx-border); border-radius: 4px; }
/* Only tables that open a detail panel advertise the row as clickable. */
th.k-num, td.k-num, th.k-cvss, td.k-cvss, th.k-risk, td.k-risk { text-align: right; }

/* Severity is visible while scanning, without reading the severity column. */
tr.sev-crit td:first-child { box-shadow: inset 3px 0 0 var(--nx-err); }
tr.sev-err  td:first-child { box-shadow: inset 3px 0 0 var(--nx-err); }
tr.sev-warn td:first-child { box-shadow: inset 3px 0 0 var(--nx-warn); }
tr.sev-info td:first-child { box-shadow: inset 3px 0 0 var(--nx-primary); }

.nx-num { font-variant-numeric: tabular-nums; }
.nx-mono, .nx-path { font-family: var(--nx-font-mono); font-size: 12.5px; color: var(--nx-text-secondary); }
.nx-path, .nx-text { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.nx-empty { color: var(--nx-text-disabled); }
.nx-quiet { color: var(--nx-text-muted); }
.nx-flag { font-size: 12.5px; font-weight: 600; }
.nx-flag.on { color: var(--nx-ok-subtle-text); }
.nx-flag.off { color: var(--nx-text-muted); }
.nx-more { border: 0; background: var(--nx-surface-sunken); color: var(--nx-text-secondary); border-radius: 3px; padding: 2px 8px; font-size: 11.5px; cursor: pointer; }
.nx-more:hover { background: var(--nx-surface-hover); color: var(--nx-primary); }

.nx-btn { display: inline-flex; align-items: center; gap: 7px; border: none; border-radius: 4px; padding: 9px 16px; font-size: 14px; cursor: pointer; background: var(--nx-primary); color: var(--nx-text-on-accent); }
.nx-btn:hover { filter: brightness(1.05); }
.nx-btn.ghost { background: var(--nx-surface-sunken); color: var(--nx-text); }
.nx-btn.danger { background: var(--nx-err); }
.nx-btn.sm { padding: 6px 11px; font-size: 13px; }

.nx-badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.nx-badge.ok { background: var(--nx-ok-subtle-bg); color: var(--nx-ok-subtle-text); }
.nx-badge.warn { background: var(--nx-warn-subtle-bg); color: var(--nx-warn); }
.nx-badge.err { background: var(--nx-err-subtle-bg); color: var(--nx-err); }
.nx-badge.info { background: var(--nx-surface-sunken); color: var(--nx-primary); }
.nx-badge.crit { background: var(--nx-err-subtle-bg); color: var(--nx-err-subtle-text); }
.nx-badge.none, .nx-badge.muted { background: var(--nx-surface-sunken); color: var(--nx-text-muted); }

/* CVE chips in the analysis tables */
.nx-cve-list { display: inline-flex; gap: 4px; align-items: center; }
.nx-cve { display: inline-block; padding: 2px 7px; border-radius: 3px; background: var(--nx-surface-sunken);
  color: var(--nx-text-secondary); font-family: var(--nx-font-mono); font-size: 12px;
  text-decoration: none; white-space: nowrap; }
.nx-cve:hover { background: var(--nx-surface-sunken); color: var(--nx-primary); }

.nx-input, .nx-select { width: 100%; padding: 10px 12px; border: 1px solid var(--nx-border); border-radius: 4px; font-size: 14px; background:var(--nx-surface-raised); }
.nx-field { margin-bottom: 14px; }
.nx-field label { display: block; font-size: 13px; color: var(--nx-muted); margin-bottom: 6px; }

.nx-modal-bg { position: fixed; inset: 0; background: color-mix(in srgb, var(--nx-neutral-950) 55%, transparent); display: flex; align-items: flex-start; justify-content: center; padding-top: 6vh; z-index: 50; }
.nx-modal { background: var(--nx-surface-raised); border-radius: 4px; width: min(760px, 94vw); max-height: 86vh; overflow-y: auto; }
.nx-modal-head { padding: 16px 22px; border-bottom: 1px solid var(--nx-border); display: flex; justify-content: space-between; align-items: center; }
.nx-modal-body { padding: 22px; }
.nx-modal-foot { padding: 16px 22px; border-top: 1px solid var(--nx-border); display: flex; justify-content: flex-end; gap: 10px; }
.nx-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; }
.kv { display:flex; gap:8px; font-size:13px; margin:4px 0; }
.kv .k { color: var(--nx-muted); min-width: 130px; }
code.nx-code { background:var(--nx-neutral-950); color:var(--nx-ok); padding:10px 12px; border-radius:4px; display:block; overflow-x:auto; font-size:12.5px; }
.muted { color: var(--nx-muted); }

/* --- DataGrid ----------------------------------------------------------- */
.nx-grid-root { display: flex; flex-direction: column; min-width: 0; }
.nx-grid-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

/* Active filters, one chip each, removable individually or all at once. */
.nx-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--nx-surface-sunken); color: var(--nx-text-link);
  border: 1px solid var(--nx-border); border-radius: 20px; padding: 3px 6px 3px 11px; font-size: 12.5px; max-width: 340px; }
.nx-chip button { border: 0; background: none; cursor: pointer; color: var(--nx-text-muted); font-size: 15px; line-height: 1; padding: 0 4px; }
.nx-chip button:hover { color: var(--nx-err); }

.nx-grid-scroll { overflow: auto; max-height: calc(100vh - 360px); min-height: 160px;
  border: 1px solid var(--nx-border); border-radius: 4px; background: var(--nx-surface-raised); }
/* The horizontal scrollbar has to be visible, not an overlay that fades out. */
.nx-grid-scroll { scrollbar-width: thin; scrollbar-color: var(--nx-text-disabled) var(--nx-text-disabled); }
.nx-grid-scroll::-webkit-scrollbar { height: 13px; width: 13px; }
.nx-grid-scroll::-webkit-scrollbar-track { background: var(--nx-surface-sunken); }
.nx-grid-scroll::-webkit-scrollbar-thumb { background: var(--nx-surface-hover); border-radius: 4px; border: 3px solid var(--nx-border); }
.nx-grid-scroll::-webkit-scrollbar-thumb:hover { background: var(--nx-neutral-500); }
.nx-grid-scroll::-webkit-scrollbar-corner { background: var(--nx-surface-sunken); }

/* table-layout:fixed + an explicit colgroup keeps the header locked to the
   body no matter how far the grid is scrolled or how a column is resized. */
table.nx-grid { table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.nx-grid th { position: sticky; top: 0; z-index: 3; background: var(--nx-surface-sunken); text-align: left;
  padding: 9px 10px; color: var(--nx-text-secondary); font-weight: 600; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .4px; border-bottom: 1px solid var(--nx-border); border-right: 1px solid var(--nx-border);
  white-space: nowrap; overflow: hidden; cursor: pointer; user-select: none; }
table.nx-grid th:hover, table.nx-grid th.sorted { color: var(--nx-primary); }
.nx-th-label { display: inline-block; max-width: calc(100% - 38px); overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
/* Right-aligned headers must not slide under the filter button. */
table.nx-grid th.k-num, table.nx-grid th.k-cvss, table.nx-grid th.k-risk { padding-right: 30px; }
table.nx-grid th .nx-sort { margin-left: 4px; font-size: 12px; opacity: .3; }
table.nx-grid th .nx-sort.on { opacity: 1; }
.nx-th-filter { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); border: 0;
  background: none; cursor: pointer; color: var(--nx-text-muted); font-size: 13px; padding: 2px; }
.nx-th-filter:hover, .nx-th-filter.on { color: var(--nx-primary); }
.nx-col-resize { position: absolute; right: 0; top: 0; bottom: 0; width: 5px; cursor: col-resize; }
.nx-col-resize:hover { background: var(--nx-primary); opacity: .4; }

table.nx-grid td { padding: 8px 10px; background: var(--nx-surface-raised); border-bottom: 1px solid var(--nx-border);
  border-right: 1px solid var(--nx-border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.nx-grid tbody tr:nth-child(even) td { background: var(--nx-surface-raised); }
table.nx-grid tbody tr:hover td { background: var(--nx-surface-sunken); }
table.nx-grid.clickable tbody tr:hover td { cursor: pointer; }
table.nx-grid td.primary { font-weight: 600; color: var(--nx-text-primary); }
table.nx-grid th.k-num, table.nx-grid td.k-num,
table.nx-grid th.k-cvss, table.nx-grid td.k-cvss,
table.nx-grid th.k-risk, table.nx-grid td.k-risk { text-align: right; }

/* The first column stays put while the rest scrolls, so a row keeps its name. */
table.nx-grid th.pin, table.nx-grid td.pin { position: sticky; left: 0; z-index: 2; }
table.nx-grid th.pin { z-index: 5; }
table.nx-grid td.pin, table.nx-grid th.pin { box-shadow: 1px 0 0 var(--nx-border); }
table.nx-grid tr.sev-crit td.pin { box-shadow: inset 3px 0 0 var(--nx-err), 1px 0 0 var(--nx-border); }
table.nx-grid tr.sev-err  td.pin { box-shadow: inset 3px 0 0 var(--nx-err), 1px 0 0 var(--nx-border); }
table.nx-grid tr.sev-warn td.pin { box-shadow: inset 3px 0 0 var(--nx-warn), 1px 0 0 var(--nx-border); }
table.nx-grid tr.sev-info td.pin { box-shadow: inset 3px 0 0 var(--nx-primary), 1px 0 0 var(--nx-border); }
.nx-input.sm, .nx-select.sm { width: auto; padding: 5px 9px; font-size: 13px; }
.nx-btn:disabled { opacity: .4; cursor: default; }

/* --- column filter popover ---------------------------------------------- */
.nx-filter-pop { position: fixed; z-index: 70; background: var(--nx-surface-raised); border: 1px solid var(--nx-border);
  border-radius: 4px; box-shadow: 0 14px 40px color-mix(in srgb, var(--nx-neutral-950) 16%, transparent); padding: 12px; }
.nx-filter-pop .nx-input { width: 100%; }
.nx-filter-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--nx-muted); }
.nx-filter-row { display: flex; align-items: center; gap: 7px; }
.nx-filter-row .nx-input { width: 100%; }
.nx-filter-col { display: flex; flex-direction: column; gap: 8px; }
.nx-filter-col label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--nx-muted); }
.nx-filter-opts { max-height: 220px; overflow-y: auto; margin-top: 8px; }
.nx-filter-opt { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 13px; cursor: pointer; }
.nx-filter-opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-filter-foot { display: flex; gap: 8px; margin-top: 9px; }

/* --- row action menu ---------------------------------------------------- */
.dd { padding: 11px 15px; cursor: pointer; font-size: 14px; display: flex; gap: 9px; align-items: center;
  border-bottom: 1px solid var(--nx-border); }
.dd:last-child { border-bottom: 0; }
.dd:hover { background: var(--nx-surface-sunken); }
.dd.danger { color: var(--nx-err); }

/* --- row detail drawer -------------------------------------------------- */
.nx-drawer-bg { position: fixed; inset: 0; background: color-mix(in srgb, var(--nx-neutral-950) 35%, transparent); z-index: 60; display: flex; justify-content: flex-end; }
.nx-drawer { width: min(560px, 96vw); height: 100vh; background: var(--nx-surface-raised); overflow-y: auto; box-shadow: -12px 0 44px color-mix(in srgb, var(--nx-neutral-950) 20%, transparent); }
.nx-drawer-section { margin-bottom: 26px; }
.nx-drawer-section h5 { margin: 0 0 10px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--nx-muted); }
.nx-vuln { border: 1px solid var(--nx-border); border-radius: 4px; padding: 11px 13px; margin-bottom: 9px; }
.nx-vuln-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nx-vuln-text { margin: 8px 0 0; font-size: 13px; color: var(--nx-text-secondary); line-height: 1.5; }
.nx-vuln-vector { display: block; margin-top: 7px; font-size: 11.5px; color: var(--nx-text-muted);
  font-family: var(--nx-font-mono); word-break: break-all; }
.nx-kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--nx-border); font-size: 13px; }
.nx-kv .k { color: var(--nx-muted); }
.nx-kv .v { overflow-wrap: anywhere; }
/* Nothing is clipped in the detail panel — that is what it is for. */
.nx-drawer .nx-path, .nx-drawer .nx-text { max-width: none; white-space: normal; }
.nx-drawer .nx-cve-list { flex-wrap: wrap; }

/* --- process lineage ----------------------------------------------------- */
.nx-pt-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.nx-pt-actions { margin-left: auto; display: flex; gap: 8px; }

.nx-pt { border: 1px solid var(--nx-border); border-radius: 4px; overflow: auto; max-height: calc(100vh - 400px); }
.nx-pt-row { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 0;
  border-bottom: 1px solid var(--nx-border); font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.nx-pt-row:last-child { border-bottom: 0; }
.nx-pt-row:hover { background: var(--nx-surface-sunken); }
.nx-pt-row.selected { background: var(--nx-surface-sunken); }
.nx-pt-row.dim { opacity: .55; }
/* A flagged process is found by scanning the left edge, not by reading badges. */
.nx-pt-row.flagged.crit { box-shadow: inset 4px 0 0 var(--nx-err); background: var(--nx-err-subtle-bg); }
.nx-pt-row.flagged.err  { box-shadow: inset 4px 0 0 var(--nx-err); background: var(--nx-err-subtle-bg); }
.nx-pt-row.flagged.warn { box-shadow: inset 4px 0 0 var(--nx-warn); }

.nx-pt-caret { width: 20px; height: 20px; flex: none; border: 0; background: none; cursor: pointer;
  color: var(--nx-text-muted); font-size: 16px; line-height: 1; padding: 0; }
.nx-pt-caret.leaf { cursor: default; }
.nx-pt-name { font-weight: 600; color: var(--nx-text-primary); }
.nx-pt-pid { font-family: var(--nx-font-mono); font-size: 12px;
  color: var(--nx-text-muted); background: var(--nx-surface-sunken); border-radius: 3px; padding: 1px 6px; }
.nx-pt-badges { display: inline-flex; gap: 5px; align-items: center; }
.nx-pt-badges .nx-badge { padding: 1px 8px; font-size: 11px; }
.nx-pt-cmd { flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--nx-font-mono); font-size: 12px; color: var(--nx-text-muted); }
.nx-pt-hash { font-family: var(--nx-font-mono); font-size: 11.5px; color: var(--nx-text-muted); }

.nx-pt-reasons { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--nx-text-secondary); line-height: 1.6; }
.nx-pt-chain-node { border-left: 2px solid var(--nx-border); padding: 8px 0 10px 12px; margin-bottom: 6px; }
.nx-pt-chain-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.nx-pt-chain-step { font-size: 11px; color: var(--nx-muted); }
.nx-pt-chain-hashes { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 11.5px; word-break: break-all; }

/* --- Remote Connect ------------------------------------------------------ */
.nx-card-head.sub { padding: 0 0 10px; }
.nx-card-head.sub h4 { margin: 0; font-size: 14px; }
.mono { font-family: var(--nx-font-mono); font-size: 12px; }
.spin { display: inline-block; animation: nx-spin 1s linear infinite; }
@keyframes nx-spin { to { transform: rotate(360deg); } }

.nx-remote > .nx-card { margin-bottom: 16px; }
.nx-preflight h4 { margin: 0 0 14px; font-size: 14px; }
.nx-checks { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.nx-checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.nx-checks li i { font-size: 16px; line-height: 1.35; }
.nx-checks li.ok i { color: var(--nx-ok-subtle-text); }
.nx-checks li.bad i { color: var(--nx-err); }
.nx-checks .muted { font-size: 12.5px; }

.nx-stepup { border-top: 1px solid var(--nx-border); padding-top: 16px; max-width: 460px; }
.nx-stepup label { display: block; font-size: 12.5px; color: var(--nx-muted); margin-bottom: 8px; }
.nx-stepup input { display: block; width: 100%; margin-top: 5px; padding: 9px 11px;
  border: 1px solid var(--nx-border); border-radius: 4px; font-size: 13px; }
.nx-stepup p { font-size: 12px; margin: 0 0 14px; }

.nx-session-head { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.nx-session-id { display: flex; align-items: center; gap: 9px; font-size: 13px; flex-wrap: wrap; }
.nx-session-actions { display: flex; align-items: center; gap: 10px; }
.nx-clock { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--nx-muted); }
.nx-clock.low { color: var(--nx-err); font-weight: 600; }

/* terminal */
.nx-term { border: 1px solid var(--nx-border-strong); border-radius: 4px; overflow: hidden; background: var(--nx-neutral-950); }
.nx-term-out { height: 460px; overflow-y: auto; padding: 14px 16px;
  font-family: var(--nx-font-mono); font-size: 12.5px; line-height: 1.55; }
.nx-term-hint { color: var(--nx-text-muted); font-family: inherit; }
.nx-term-block { margin-bottom: 14px; }
.nx-term-cmd { color: var(--nx-text-disabled); display: flex; gap: 8px; }
.nx-term-prompt { color: var(--nx-ok); white-space: nowrap; }
.nx-term-body { margin: 4px 0 0; color: var(--nx-primary); white-space: pre-wrap;
  word-break: break-word; font: inherit; }
.nx-term-status { margin-top: 4px; font-size: 11.5px; }
.nx-term-status.ok { color: var(--nx-ok); }
.nx-term-status.err { color: var(--nx-err); }
.nx-term-status.running { color: var(--nx-warn); }
.nx-term-input { display: flex; align-items: center; gap: 9px; padding: 10px 14px;
  background: var(--nx-neutral-950); border-top: 1px solid var(--nx-border-strong); }
.nx-term-input .nx-term-prompt { font-family: var(--nx-font-mono); font-size: 12px; }
.nx-term-input input { flex: 1; background: transparent; border: 0; outline: none; color: var(--nx-text-disabled);
  font-family: var(--nx-font-mono); font-size: 12.5px; }
.nx-term-input input::placeholder { color: var(--nx-text-secondary); }

/* desktop */
.nx-desktop-bar { display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 8px; font-size: 12.5px; }
.nx-desktop-stage { position: relative; background: var(--nx-neutral-950); border-radius: 4px;
  overflow: hidden; display: flex; justify-content: center; }
.nx-desktop-stage canvas { max-width: 100%; height: auto; display: block; outline: none; cursor: crosshair; }
.nx-desktop-stage canvas.focused { box-shadow: inset 0 0 0 2px var(--nx-primary); }
.nx-desktop-wait { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; gap: 8px; color: var(--nx-text-muted); font-size: 13px; }

/* audit */
.nx-audit-cell { background: var(--nx-surface-sunken); padding: 12px 14px; }

/* --- Rule Manager ------------------------------------------------------- */
.nx-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.nx-filters .nx-select { width: auto; min-width: 160px; }

/* Enable/disable is a state, not a form field, so it reads as a switch. */

.nx-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.nx-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.nx-section-label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--nx-muted); margin: 22px 0 10px; }
.nx-hint { display: block; font-size: 12px; color: var(--nx-muted); margin-top: 5px; }
/* A hint that says the form will be refused, rather than explaining the field. */
.nx-hint.warn { color: var(--nx-warn); }
.nx-field label .req { color: var(--nx-err); }
.nx-switch { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }

/* Artifact type picker: the rule's subject is chosen before anything else. */
.nx-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.nx-type { display: flex; align-items: flex-start; gap: 11px; text-align: left; padding: 14px;
  border: 1px solid var(--nx-border); border-radius: 4px; background: var(--nx-surface-raised); cursor: pointer;
  font: inherit; color: inherit; }
.nx-type:hover { border-color: var(--nx-border); }
.nx-type.active { border-color: var(--nx-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nx-primary) 12%, transparent); }
.nx-type i { font-size: 20px; color: var(--nx-primary); }
.nx-type strong { display: block; font-size: 14px; }
.nx-type em { display: block; font-style: normal; font-size: 12px; color: var(--nx-muted); margin-top: 3px; }

/* Condition builder: nesting depth is shown by the left rail, so an operator
   can see at a glance which conditions belong to which group. */
.nx-cb-group { border: 1px solid var(--nx-border); border-radius: 4px; padding: 12px;
  margin-bottom: 12px; background: var(--nx-surface-raised); }
.nx-cb-group.has-issue { border-color: var(--cui-danger-border-subtle); }
.nx-cb-grouphead { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 10px; }
.nx-cb-logic { display: flex; align-items: center; gap: 6px; }
.nx-cb-actions { display: flex; gap: 6px; }
.nx-cb-children { display: flex; flex-direction: column; gap: 8px; }
.nx-cb-row { display: grid; grid-template-columns: auto minmax(160px, 1.4fr) minmax(140px, 1fr) minmax(160px, 1.4fr) auto;
  gap: 8px; align-items: center; background: var(--nx-surface-raised); border: 1px solid var(--nx-border);
  border-radius: 4px; padding: 8px; }
.nx-cb-row.has-issue { border-color: var(--cui-danger-border-subtle); }
.nx-cb-row .nx-select, .nx-cb-row .nx-input { padding: 7px 9px; font-size: 13px; }
.nx-cb-pair { display: flex; gap: 6px; }
.nx-cb-novalue { font-size: 12px; color: var(--nx-muted); font-style: italic; }
.nx-cb-empty { padding: 14px; text-align: center; color: var(--nx-muted); font-size: 13px;
  border: 1px dashed var(--nx-border); border-radius: 4px; background: var(--nx-surface-raised); }
.nx-cb-issue { grid-column: 1 / -1; font-size: 12.5px; padding: 6px 8px; border-radius: 4px; }
.nx-cb-issue.error { background: var(--nx-err-subtle-bg); color: var(--nx-err); }
.nx-cb-issue.warning { background: var(--nx-warn-subtle-bg); color: var(--nx-warn-subtle-text); }

/* The rule read back as a sentence, so nobody has to reconstruct it from the form. */
.nx-rule-sentence { margin-top: 14px; padding: 12px 14px; border-radius: 4px; background: var(--nx-neutral-950);
  color: var(--nx-text-disabled); font-family: var(--nx-font-mono); font-size: 12.5px;
  line-height: 1.7; overflow-wrap: anywhere; }
.nx-rule-sentence.big { font-size: 13px; }
.nx-rule-sentence .k { color: var(--nx-ok); font-weight: 700; margin-right: 8px; }

/* Action list */
.nx-actions { display: flex; flex-direction: column; gap: 12px; }
.nx-action { border: 1px solid var(--nx-border); border-radius: 4px; padding: 12px; background: var(--nx-surface-raised); }
.nx-action-head { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.nx-action-head .spacer { flex: 1; }
.nx-action-idx { width: 22px; height: 22px; border-radius: 50%; background: var(--nx-primary);
  color: var(--nx-text-on-accent); font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; }
.nx-action-params { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-top: 12px; }
.nx-action-params .nx-field { margin-bottom: 0; }
.nx-action-params .nx-field.wide { grid-column: 1 / -1; }
.nx-action-picker { border: 1px solid var(--nx-border); border-radius: 4px; padding: 12px; background: var(--nx-surface-raised);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.nx-action-group { font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--nx-muted); margin-bottom: 6px; }
.nx-action-choice { display: flex; gap: 9px; align-items: flex-start; width: 100%; text-align: left;
  border: 0; background: none; padding: 7px; border-radius: 4px; cursor: pointer; font: inherit; color: inherit; }
.nx-action-choice:hover { background: var(--nx-surface-sunken); }
.nx-action-choice i { color: var(--nx-primary); font-size: 16px; }
.nx-action-choice strong { display: block; font-size: 13px; }
.nx-action-choice em { display: block; font-style: normal; font-size: 11.5px; color: var(--nx-muted); }

.nx-tag-suggest { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.nx-tag-chip { border: 1px solid var(--nx-border); background: var(--nx-surface-sunken); color: var(--nx-text-secondary);
  border-radius: 20px; padding: 2px 9px; font-size: 11.5px; cursor: pointer; }
.nx-tag-chip:hover { background: var(--nx-surface-sunken); color: var(--nx-primary); }

.nx-run-row { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 10px; align-items: center;
  width: 100%; text-align: left; border: 1px solid var(--nx-border); border-radius: 4px;
  background: var(--nx-surface-raised); padding: 8px 10px; margin-bottom: 7px; font: inherit; color: inherit;
  font-size: 12.5px; cursor: pointer; }
.nx-run-row:hover { background: var(--nx-surface-sunken); }
.nx-run-row.active { border-color: var(--nx-primary); }
.nx-pt-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px; color: var(--nx-muted); font-size: 13px; }
.nx-pt-summary .nx-badge { padding: 2px 9px; font-size: 11.5px; }
.nx-pt-host { color: var(--nx-text-primary); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }

/* Single-page rule editor: the definition scrolls on the left, the summary and
   the dry-run result stay pinned on the right so the rule can be read back and
   tested without leaving the form. */
.nx-rule-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.nx-rule-main { min-width: 0; }
.nx-rule-rail { position: sticky; top: 84px; }
.nx-rule-rail .nx-card { margin-bottom: 0; }
@media (max-width: 1180px) { .nx-rule-layout { grid-template-columns: 1fr; } .nx-rule-rail { position: static; } }

/* Settings most rules never change stay one click away instead of on their own screen. */
.nx-advanced { border: 1px solid var(--nx-border); border-top: 0; border-radius: 0 0 10px 10px;
  padding: 16px; background: var(--nx-surface-raised); }

.nx-mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 10px; }
.nx-mini-stats div { background: var(--nx-surface-sunken); border-radius: 4px; padding: 10px; text-align: center; }
.nx-mini-stats b { display: block; font-size: 17px; }
.nx-mini-stats span { font-size: 11px; color: var(--nx-muted); }

.nx-sample-list { max-height: 320px; overflow-y: auto; margin-top: 6px; }
.nx-sample { border: 1px solid var(--nx-border); border-radius: 4px; padding: 9px 11px; margin-bottom: 7px;
  font-size: 12.5px; }
.nx-sample strong { display: block; overflow-wrap: anywhere; }
.nx-sample div { display: flex; gap: 4px; flex-wrap: wrap; margin: 5px 0; }
.nx-sample em { font-style: normal; color: var(--nx-muted); overflow-wrap: anywhere; }

/* The join between two sibling conditions is the group's operator, shown where
   it applies and editable in place — one click flips the whole group. */
.nx-cb-connector { display: flex; align-items: center; gap: 10px; margin: -2px 0; padding-left: 6px; }
.nx-cb-connector::after { content: ""; flex: 1; height: 1px; background: var(--nx-border); }
.nx-cb-joint { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--nx-border);
  border-radius: 20px; padding: 3px 11px; font-size: 11.5px; font-weight: 700; letter-spacing: .4px;
  cursor: pointer; background: var(--nx-surface-raised); }
.nx-cb-joint i { font-size: 12px; opacity: .45; }
.nx-cb-joint.and { color: var(--nx-primary); border-color: var(--nx-border); background: var(--nx-surface-sunken); }
.nx-cb-joint.or { color: var(--nx-warn-subtle-text); border-color: var(--cui-warning-border-subtle); background: var(--nx-warn-subtle-bg); }
.nx-cb-joint:hover { filter: brightness(.97); }

/* --- clipboard bridge + file transfer ----------------------------------- */
.nx-clip { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--nx-border); }
.nx-clip-half { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.nx-clip-half > span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--nx-muted); }
.nx-clip-half textarea { width: 100%; border: 1px solid var(--nx-border); border-radius: 4px;
  padding: 8px 10px; font-family: var(--nx-font-mono);
  font-size: 12px; resize: vertical; }

.nx-xfer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--nx-border); }
.nx-xfer-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  padding: 8px 11px; border-radius: 4px; background: var(--nx-surface-sunken); }
.nx-xfer-status.ok { background: var(--nx-ok-subtle-bg); color: var(--nx-ok-subtle-text); }
.nx-xfer-status.err { background: var(--nx-err-subtle-bg); color: var(--nx-err); }

/* --- Hardening ---------------------------------------------------------- */
/* The plan is an ordered list of changes, so the rank is the first thing on
   the row and the row itself is a button: everything about one control opens
   in the same drawer the rest of the console uses. */
.nx-hd-code { margin: 0; padding: 10px 12px; background: var(--nx-surface-sunken); border: 1px solid var(--nx-border);
  border-radius: 4px; font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

/* --- SMTP Settings ------------------------------------------------------- */
/* Corporate and sectioned: the status of the configuration leads, the form is
   split into server / authentication / sender, and the test result names the
   stage that failed so the fix maps to a section. */
.nx-smtp-problems { margin: 12px 0 0; padding: 10px 14px; list-style: none; background: var(--nx-warn-subtle-bg);
  border: 1px solid var(--cui-warning-border-subtle); border-radius: 4px; font-size: 13px; color: var(--nx-warn-subtle-text); }
.nx-smtp-problems li { display: flex; gap: 7px; align-items: center; padding: 2px 0; }
.nx-smtp-lasterr { color: var(--nx-err); font-size: 12.5px; }

.nx-smtp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 20px; }
.nx-smtp-grid > .nx-card { margin-bottom: 0; }
.nx-smtp-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; }
.nx-smtp-note { display: flex; gap: 8px; padding: 10px 12px; border-radius: 4px; font-size: 12.5px; line-height: 1.5; }
.nx-smtp-note.warn { background: var(--nx-warn-subtle-bg); color: var(--nx-warn-subtle-text); }
.nx-smtp-pw { display: flex; gap: 8px; align-items: center; }
.nx-linkbtn { background: none; border: none; padding: 0; color: var(--nx-primary); font-size: 12px;
  cursor: pointer; text-decoration: underline; }

.nx-smtp-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 20px; }
.nx-smtp-testrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.nx-smtp-testrow .nx-input { flex: 1 1 260px; width: auto; }

.nx-smtp-result { margin-top: 16px; padding: 14px 16px; border-radius: 4px; border: 1px solid var(--nx-border); }
.nx-smtp-result.ok { background: var(--nx-ok-subtle-bg); border-color: var(--cui-success-border-subtle); }
.nx-smtp-result.err { background: var(--nx-err-subtle-bg); border-color: var(--cui-danger-border-subtle); }
.nx-smtp-stages { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 11px; }
.nx-smtp-stage { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 20px;
  font-size: 12px; font-weight: 600; }
.nx-smtp-stage.pass { background: var(--nx-ok-subtle-bg); color: var(--nx-ok-subtle-text); }
.nx-smtp-stage.fail { background: var(--nx-err-subtle-bg); color: var(--nx-err); }
.nx-smtp-stage.skip { background: var(--nx-surface-sunken); color: var(--nx-text-muted); }
.nx-smtp-result-msg { font-size: 13.5px; line-height: 1.6; }
.nx-smtp-hint { display: flex; gap: 7px; margin-top: 9px; font-size: 12.5px; color: var(--nx-text-secondary); line-height: 1.6; }


/* --- Patch Management ------------------------------------------------------
   The module has three screens over one engine, and the shapes below are the
   ones none of the existing pages needed: a step wizard, a rollout-ring editor,
   a target rule builder and the stacked progress bar that summarises a
   deployment in one row. */

.nx-drawer.wide { width: min(920px, 98vw); }
.nx-ellipsis { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: bottom; }
.nx-hash { font-family: var(--nx-font-mono); font-size: 11.5px;
  overflow-wrap: anywhere; color: var(--nx-text-secondary); }

/* The wizard's step rail. Steps are clickable both ways: an operator who wants
   to change the package after seeing the preview should not have to start over. */
.nx-step-n { display: inline-flex; align-items: center; justify-content: center; width: 20px;
  height: 20px; border-radius: 50%; background: var(--nx-surface-sunken); font-size: 11.5px; font-weight: 700; }

/* A picker row: a checkbox and what it selects, on one line. */

/* Target rules and rollout rings share the same boxed-row look, because they
   are the same kind of thing: one line of a plan being edited. */
.nx-rule { display: flex; align-items: flex-start; gap: 8px; padding: 10px; margin-bottom: 8px;
  border: 1px solid var(--nx-border); border-radius: 4px; background: var(--nx-surface-raised); }
.nx-rule .nx-select, .nx-rule .nx-input { flex: 1 1 160px; width: auto; }
.nx-ring { border: 1px solid var(--nx-border); border-radius: 4px; padding: 14px; margin-bottom: 12px; }
.nx-ring-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.nx-ring-head .nx-input { flex: 1; }
.nx-detect, .nx-target { margin-top: 4px; }

/* The stacked deployment bar: succeeded, skipped, failed, running, waiting. */
.nx-bar { display: flex; height: 8px; border-radius: 3px; overflow: hidden; background: var(--nx-surface-sunken);
  min-width: 110px; }
.nx-bar-seg { height: 100%; }
.nx-bar-seg.ok { background: var(--nx-ok); }
.nx-bar-seg.err { background: var(--nx-err); }
.nx-bar-seg.warn { background: var(--nx-warn); }
.nx-bar-seg.info { background: var(--nx-primary); }
.nx-bar-seg.muted { background: var(--nx-surface-hover); }

.nx-preview { margin-top: 16px; }
.nx-timeline-row { display: flex; align-items: baseline; gap: 10px; padding: 6px 0;
  border-bottom: 1px solid var(--nx-border); font-size: 13px; flex-wrap: wrap; }
.nx-log { background: var(--nx-neutral-950); color: var(--nx-text-disabled); padding: 12px 14px; border-radius: 4px;
  font-family: var(--nx-font-mono); font-size: 11.5px; line-height: 1.6;
  max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* --- Settings · Agent Settings ------------------------------------------- */
/* One row per collection family, so the whole schedule is readable at once
   rather than through a form per family. */

/* --- Risk dashboard ------------------------------------------------------
   Severity is the only thing colour encodes on this screen, and every mark
   that carries a colour also carries its number: amber sits below 3:1 contrast
   on white, so nothing here may rest on the swatch alone. */
.nx-card-head.sm { margin-bottom: 12px; align-items: baseline; }
.nx-card-head.sm h4 { margin: 0; font-size: 14.5px; }
.nx-card-head.sm .muted { font-size: 12.5px; }

/* KPI tiles double as the severity filter, so they are buttons. --kpi is the
   severity fill; the tile wears it as an edge, never as a background — a solid
   red card is an alarm, and four of them side by side are noise. */

/* Charts ---------------------------------------------------------------- */
.nx-chart { position: relative; }
.nx-chart-empty { padding: 28px 4px; text-align: center; color: var(--nx-muted); font-size: 13.5px; }

.nx-tip { position: absolute; z-index: 30; pointer-events: none; transform: translate(-50%, -130%);
  background: var(--nx-neutral-950); color: var(--nx-text-on-accent); border-radius: 4px; padding: 7px 10px; font-size: 12px;
  line-height: 1.5; white-space: nowrap; box-shadow: 0 8px 20px color-mix(in srgb, var(--nx-neutral-950) 28%, transparent);
  display: flex; flex-direction: column; }
.nx-tip .nx-tip-v { font-size: 15px; font-weight: 700; }
.nx-tip .nx-tip-n { color: var(--nx-text-muted); }

/* A 2px surface gap between fills and 4px rounded outer ends: one quantity
   split, not four bars pushed together. */
.nx-bar { display: flex; gap: 2px; width: 100%; background: var(--nx-surface-sunken);
  border-radius: 4px; overflow: hidden; }
.nx-bar.empty { background: var(--nx-surface-sunken); }
.nx-bar-seg { min-width: 3px; transition: filter .12s; }
.nx-bar-seg:hover { filter: brightness(1.12); }
.nx-bar-rest { background: transparent; }

.nx-barrows { display: flex; flex-direction: column; gap: 2px; }
.nx-barrow { display: grid; grid-template-columns: minmax(140px, 262px) minmax(0, 1fr) 62px;
  align-items: center; gap: 14px; padding: 9px 10px; border-radius: 4px; }
.nx-barrow.clickable { cursor: pointer; }
.nx-barrow.clickable:hover { background: var(--nx-surface-sunken); }
.nx-barrow-label { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 13.5px; }
.nx-barrow-label i { color: var(--nx-muted); }
.nx-barrow-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.nx-barrow-note { color: var(--nx-muted); font-size: 11.5px; white-space: nowrap; }
.nx-barrow-total { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; }

.nx-donut { display: flex; justify-content: center; padding: 6px 0 14px; }
.nx-donut svg { width: 172px; height: 172px; }
.nx-donut-track { fill: none; stroke: var(--nx-border); stroke-width: 15; }
.nx-donut circle[stroke]:hover { filter: brightness(1.1); }
.nx-donut-hero { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none; padding-bottom: 8px; }
.nx-donut-hero .v { font-size: 30px; font-weight: 700; line-height: 1.1; }
.nx-donut-hero .l { color: var(--nx-muted); font-size: 12px; }

.nx-legend { display: flex; flex-direction: column; gap: 2px; }
.nx-legend-item { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 9px;
  border: 0; background: none; font: inherit; color: inherit; text-align: left;
  padding: 6px 8px; border-radius: 4px; }
.nx-legend-item.clickable { cursor: pointer; }
.nx-legend-item.clickable:hover { background: var(--nx-surface-sunken); }
.nx-legend-item.on { background: var(--nx-surface-sunken); }
.nx-swatch { width: 11px; height: 11px; border-radius: 3px; }
.nx-legend-l { font-size: 13px; }
.nx-legend-v { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13.5px; }

/* Ranked artifact list --------------------------------------------------- */
.nx-arow { display: grid; align-items: center; gap: 14px; padding: 10px;
  grid-template-columns: minmax(210px, 1.6fr) minmax(80px, 1fr) 236px 66px 20px; border-radius: 4px; }
.nx-arow.head { padding: 0 10px 8px; color: var(--nx-muted); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--nx-border); }
/* The single-letter severity headings sit over right-aligned numbers, so they
   are right-aligned too, inset by the count pill's own padding. */
.nx-arow.head .nx-arow-counts span { text-align: right; padding-right: 6px; }
.nx-arow.clickable { cursor: pointer; border-bottom: 1px solid var(--nx-border); border-radius: 0; }
.nx-arow.clickable:hover { background: var(--nx-surface-sunken); }
.nx-arow-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.nx-arow-name i { color: var(--nx-muted); }
/* The artifact name is what the row is; the attack-surface label is context.
   When the column is tight the context gives way first — a truncated "Bro…" is
   a row an analyst cannot identify. */
.nx-arow-name .t { flex: 0 1 auto; font-weight: 600; font-size: 13.5px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.nx-arow-name .c { flex: 0 5 auto; min-width: 0; color: var(--nx-muted); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-arow-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.nx-cnt { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px;
  font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; padding: 2px 6px;
  border-radius: 3px; }
.nx-cnt.zero { color: var(--nx-text-muted); font-weight: 500; }
.nx-cnt.zero .nx-dot { opacity: .35; }
.nx-cnt.on { background: var(--nx-surface-sunken); }
.nx-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.nx-arow-total { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; }
.nx-arow-go { color: var(--nx-muted); text-align: right; }
.nx-arisk-clean { padding: 12px 10px 2px; color: var(--nx-muted); font-size: 12.5px; }
.nx-arisk-clean i { color: var(--nx-ok-subtle-text); margin-right: 5px; }
@media (max-width: 900px) {
  /* Counts/total widths kept identical to the >900px layout (236px/66px,
     see the unqualified .nx-arow rule above) rather than a narrower 200px/
     56px: at 200px, four severity counts with 3-4 digit values (e.g.
     "19"/"116"/"604"/"3,918") need ~230px combined and the last cell
     overflowed into .nx-arow-total — measured via getComputedStyle on the
     live dashboard, not a guess. This query's only real job is dropping the
     severity-mix bar column; the counts/total widths never needed to
     shrink with it. */
  .nx-arow { grid-template-columns: minmax(0, 1fr) 236px 66px 20px; }
  .nx-arow .nx-arow-bar { display: none; }
}
