/* App layout on top of WowDash's bootstrap + remixicon assets. Self-contained
   so it renders cleanly regardless of the template's exact DOM structure. */
:root {
  --nx-bg: #f4f6fa;
  --nx-sidebar: #12172b;
  --nx-sidebar-2: #1b2340;
  --nx-primary: #4b6cf5;
  --nx-text: #2b2f3a;
  --nx-muted: #8a94a6;
  --nx-border: #e6e9f0;
  --nx-card: #ffffff;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, sans-serif; background: var(--nx-bg); color: var(--nx-text); }
a { text-decoration: none; }

.nx-shell { display: flex; min-height: 100vh; }
.nx-sidebar { width: 250px; background: var(--nx-sidebar); color: #cfd6e6; display: flex; flex-direction: column; position: fixed; height: 100vh; }
.nx-brand { padding: 20px 22px; font-size: 20px; font-weight: 700; color: #fff; letter-spacing: .5px; border-bottom: 1px solid var(--nx-sidebar-2); }
.nx-brand span { color: var(--nx-primary); }
.nx-nav { padding: 14px 10px; overflow-y: auto; }
.nx-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 4px; color: #aeb7cd; font-size: 14.5px; margin-bottom: 4px; }
.nx-nav a i { font-size: 18px; }
.nx-nav a:hover { background: var(--nx-sidebar-2); color: #fff; }
.nx-nav a.active { background: var(--nx-primary); color: #fff; }
.nx-nav .nx-section { font-size: 11px; text-transform: uppercase; color: #5c6684; padding: 14px 14px 6px; letter-spacing: 1px; }

/* 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. */
.nx-main { margin-left: 250px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nx-topbar { height: 64px; background: #fff; border-bottom: 1px solid var(--nx-border); display: flex; align-items: center; justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 5; }
.nx-topbar .nx-title { font-weight: 600; font-size: 17px; }
.nx-topbar-left { display: flex; align-items: center; gap: 18px; }

/* Organization switcher — top-left, at the sidebar edge */
.nx-orgsw { position: relative; }
.nx-orgsw-btn { display: flex; align-items: center; gap: 9px; max-width: 260px; padding: 8px 12px; border: 1px solid var(--nx-border); border-radius: 4px; background: #f6f8fd; color: #1f2740; font-size: 14px; font-weight: 600; cursor: pointer; }
.nx-orgsw-btn:hover { border-color: var(--nx-primary); }
.nx-orgsw-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-orgsw-bg { position: fixed; inset: 0; z-index: 20; }
.nx-orgsw-menu { position: absolute; left: 0; top: 46px; z-index: 21; width: 290px; max-height: 340px; overflow-y: auto; background: #fff; border: 1px solid var(--nx-border); border-radius: 4px; box-shadow: 0 12px 32px rgba(0,0,0,.14); }
.nx-orgsw-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--nx-border); font-size: 14px; }
.nx-orgsw-item:last-child { border-bottom: 0; }
.nx-orgsw-item:hover { background: #f6f8fd; }
.nx-orgsw-item.active { color: var(--nx-primary); }
.nx-topbar .nx-user { color: var(--nx-muted); font-size: 14px; display:flex; align-items:center; gap:14px; }
.nx-content { padding: 26px; }

.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-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.nx-stat { background: #fff; 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: #c6d1ee; }
.nx-stat.active { border-color: var(--nx-primary); box-shadow: 0 0 0 3px rgba(75,108,245,.12); }
.nx-stat .v { font-size: 26px; font-weight: 700; }
.nx-stat .l { color: var(--nx-muted); font-size: 13px; margin-top: 4px; }

.nx-alert { padding: 11px 14px; border-radius: 4px; font-size: 13.5px; margin-bottom: 14px; }
.nx-alert.err { background: #fde3e5; color: #b3222f; }

/* --- data tables ------------------------------------------------------- */
.nx-table-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.nx-search { position: relative; display: flex; align-items: center; }
.nx-search i { position: absolute; left: 11px; color: var(--nx-muted); font-size: 15px; }
.nx-search input { width: 290px; padding: 8px 28px 8px 32px; border: 1px solid var(--nx-border); border-radius: 4px; font-size: 13.5px; background: #fbfcfe; color: var(--nx-text); }
.nx-search input:focus { outline: none; border-color: var(--nx-primary); background: #fff; }
.nx-search-x { position: absolute; right: 7px; border: 0; background: none; cursor: pointer; color: var(--nx-muted); font-size: 17px; line-height: 1; }
.nx-table-count { display: flex; align-items: center; gap: 10px; color: var(--nx-muted); font-size: 13px; }
.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; }
table.nx-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.nx-table th { position: sticky; top: 0; z-index: 2; background: #f7f9fc; text-align: left; padding: 10px 12px;
  color: #5a6376; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px;
  border-bottom: 1px solid var(--nx-border); white-space: nowrap; cursor: pointer; user-select: none; }
table.nx-table th:hover, table.nx-table th.sorted { color: var(--nx-primary); }
table.nx-table th .nx-sort { margin-left: 5px; font-size: 12px; opacity: .3; }
table.nx-table th .nx-sort.on { opacity: 1; }
table.nx-table td { padding: 9px 12px; border-bottom: 1px solid #f0f2f7; white-space: nowrap; }
table.nx-table tbody tr:nth-child(even) td { background: #fcfdff; }
table.nx-table tbody tr:hover td { background: #f2f6ff; }
/* Only tables that open a detail panel advertise the row as clickable. */
table.nx-table.clickable tbody tr:hover td { cursor: pointer; }
table.nx-table tbody tr:last-child td { border-bottom: 0; }
table.nx-table td.primary { font-weight: 600; color: #1f2740; }
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 #c62b40; }
tr.sev-err  td:first-child { box-shadow: inset 3px 0 0 #ef6a4d; }
tr.sev-warn td:first-child { box-shadow: inset 3px 0 0 #e0a52a; }
tr.sev-info td:first-child { box-shadow: inset 3px 0 0 #4b6cf5; }

.nx-num { font-variant-numeric: tabular-nums; }
.nx-mono, .nx-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: #4d5568; }
.nx-path, .nx-text { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.nx-empty { color: #c8cfdb; }
.nx-quiet { color: #6b7488; }
.nx-flag { font-size: 12.5px; font-weight: 600; }
.nx-flag.on { color: #1a9d5a; }
.nx-flag.off { color: #bcc4d2; }
.nx-more { border: 0; background: #eef1f8; color: #5a6376; border-radius: 3px; padding: 2px 8px; font-size: 11.5px; cursor: pointer; }
.nx-more:hover { background: #e0e6f5; 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: #fff; }
.nx-btn:hover { filter: brightness(1.05); }
.nx-btn.ghost { background: #eef1f8; color: var(--nx-text); }
.nx-btn.danger { background: #ef4d5a; }
.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: #e3f7ec; color: #1a9d5a; }
.nx-badge.warn { background: #fff2dd; color: #c9820a; }
.nx-badge.err { background: #fde3e5; color: #d13341; }
.nx-badge.info { background: #e7ecfe; color: #3a5bd9; }
.nx-badge.crit { background: #f6c9ce; color: #8b0f1d; }
.nx-badge.none, .nx-badge.muted { background: #f1f3f9; color: #8a94a6; }

/* 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: #f1f3f9;
  color: #3a4256; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  text-decoration: none; white-space: nowrap; }
.nx-cve:hover { background: #e7ecfe; color: #3a5bd9; }

.nx-input, .nx-select { width: 100%; padding: 10px 12px; border: 1px solid var(--nx-border); border-radius: 4px; font-size: 14px; background:#fff; }
.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: rgba(17,23,43,.55); display: flex; align-items: flex-start; justify-content: center; padding-top: 6vh; z-index: 50; }
.nx-modal { background: #fff; 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-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--nx-border); margin-bottom: 18px; flex-wrap: wrap; }
.nx-tab { padding: 9px 15px; cursor: pointer; border-radius: 4px 8px 0 0; font-size: 14px; color: var(--nx-muted); }
.nx-tab.active { color: var(--nx-primary); border-bottom: 2px solid var(--nx-primary); font-weight: 600; }

.nx-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 20% 0%, #1b2340, #0c1020); }
.nx-login-card { background: #fff; border-radius: 4px; padding: 34px; width: min(400px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.nx-login-card h1 { font-size: 24px; margin: 0 0 4px; }
.nx-login-card p { color: var(--nx-muted); margin: 0 0 22px; font-size: 14px; }
.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:#0c1020; color:#7fe3a3; padding:10px 12px; border-radius:4px; display:block; overflow-x:auto; font-size:12.5px; }
.rule-row { display:grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap:10px; margin-bottom:10px; align-items:center; }
.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; }
.nx-grid-bar-right { display: flex; align-items: center; gap: 12px; }
.nx-grid-count { color: var(--nx-muted); font-size: 13px; white-space: nowrap; }
.nx-grid-note { padding: 34px; text-align: center; color: var(--nx-muted); font-size: 14px; white-space: normal; }

/* Active filters, one chip each, removable individually or all at once. */
.nx-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 12px; }
.nx-chip { display: inline-flex; align-items: center; gap: 4px; background: #eef2ff; color: #3a4a7a;
  border: 1px solid #dde4fb; 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: #6b78a8; font-size: 15px; line-height: 1; padding: 0 4px; }
.nx-chip button:hover { color: #d13341; }

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

/* 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: #f7f9fc; text-align: left;
  padding: 9px 10px; color: #5a6376; font-weight: 600; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .4px; border-bottom: 1px solid var(--nx-border); border-right: 1px solid #eef1f7;
  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: #b3bbca; 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: #fff; border-bottom: 1px solid #f0f2f7;
  border-right: 1px solid #f7f8fc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.nx-grid tbody tr:nth-child(even) td { background: #fcfdff; }
table.nx-grid tbody tr:hover td { background: #f2f6ff; }
table.nx-grid.clickable tbody tr:hover td { cursor: pointer; }
table.nx-grid td.primary { font-weight: 600; color: #1f2740; }
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 #c62b40, 1px 0 0 var(--nx-border); }
table.nx-grid tr.sev-err  td.pin { box-shadow: inset 3px 0 0 #ef6a4d, 1px 0 0 var(--nx-border); }
table.nx-grid tr.sev-warn td.pin { box-shadow: inset 3px 0 0 #e0a52a, 1px 0 0 var(--nx-border); }
table.nx-grid tr.sev-info td.pin { box-shadow: inset 3px 0 0 #4b6cf5, 1px 0 0 var(--nx-border); }

.nx-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; flex-wrap: wrap; }
.nx-pager-left, .nx-pager-right { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.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: #fff; border: 1px solid var(--nx-border);
  border-radius: 4px; box-shadow: 0 14px 40px rgba(0,0,0,.16); 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 ---------------------------------------------------- */
.nx-rowmenu { position: fixed; z-index: 70; background: #fff; border: 1px solid var(--nx-border);
  border-radius: 4px; box-shadow: 0 12px 34px rgba(0,0,0,.16); overflow: hidden; }
.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: #f6f8fd; }
.dd.danger { color: #d13341; }

/* --- row detail drawer -------------------------------------------------- */
.nx-drawer-bg { position: fixed; inset: 0; background: rgba(17,23,43,.35); z-index: 60; display: flex; justify-content: flex-end; }
.nx-drawer { width: min(560px, 96vw); height: 100vh; background: #fff; overflow-y: auto; box-shadow: -12px 0 44px rgba(0,0,0,.2); }
.nx-drawer-head { position: sticky; top: 0; background: #fff; z-index: 1; display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--nx-border); }
.nx-drawer-head h4 { margin: 0 0 3px; font-size: 16px; word-break: break-word; }
.nx-drawer-head .muted { font-size: 13px; }
.nx-drawer-body { padding: 18px 22px 40px; }
.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: #4d5568; line-height: 1.5; }
.nx-vuln-vector { display: block; margin-top: 7px; font-size: 11.5px; color: #6b7488;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.nx-kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f2f4f9; 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-picker { width: auto; min-width: 320px; }
.nx-pt-toggle { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: #5a6376; cursor: pointer; }
.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 #f2f4f9; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.nx-pt-row:last-child { border-bottom: 0; }
.nx-pt-row:hover { background: #f2f6ff; }
.nx-pt-row.selected { background: #e7ecfe; }
.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 #8b0f1d; background: #fff5f6; }
.nx-pt-row.flagged.err  { box-shadow: inset 4px 0 0 #d13341; background: #fff7f8; }
.nx-pt-row.flagged.warn { box-shadow: inset 4px 0 0 #e0a52a; }

.nx-pt-caret { width: 20px; height: 20px; flex: none; border: 0; background: none; cursor: pointer;
  color: #8a94a6; font-size: 16px; line-height: 1; padding: 0; }
.nx-pt-caret.leaf { cursor: default; }
.nx-pt-name { font-weight: 600; color: #1f2740; }
.nx-pt-pid { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  color: #8a94a6; background: #f1f3f9; 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: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #6b7488; }
.nx-pt-hash { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: #a6adbd; }

.nx-pt-reasons { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: #4d5568; 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-rowmenu .dd.disabled { opacity: .5; cursor: not-allowed; }
.nx-card-head.sub { padding: 0 0 10px; }
.nx-card-head.sub h4 { margin: 0; font-size: 14px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; 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: #16a34a; }
.nx-checks li.bad i { color: #dc2626; }
.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: #dc2626; font-weight: 600; }

/* terminal */
.nx-term { border: 1px solid #1b2338; border-radius: 4px; overflow: hidden; background: #0c1020; }
.nx-term-out { height: 460px; overflow-y: auto; padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.55; }
.nx-term-hint { color: #7c88a8; font-family: inherit; }
.nx-term-block { margin-bottom: 14px; }
.nx-term-cmd { color: #e6edff; display: flex; gap: 8px; }
.nx-term-prompt { color: #7fe3a3; white-space: nowrap; }
.nx-term-body { margin: 4px 0 0; color: #c7d2e8; 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: #4b8f68; }
.nx-term-status.err { color: #d97a7a; }
.nx-term-status.running { color: #cfa14a; }
.nx-term-input { display: flex; align-items: center; gap: 9px; padding: 10px 14px;
  background: #131a2e; border-top: 1px solid #1b2338; }
.nx-term-input .nx-term-prompt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.nx-term-input input { flex: 1; background: transparent; border: 0; outline: none; color: #e6edff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.nx-term-input input::placeholder { color: #5a6785; }

/* 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: #0c1020; 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 #4f7cff; }
.nx-desktop-wait { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; gap: 8px; color: #7c88a8; font-size: 13px; }

/* audit */
.nx-audit-cell { background: #f7f9fd; padding: 12px 14px; }
.nx-audit { font-size: 12px; }
.nx-audit td { padding: 5px 8px; }

/* --- 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-toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--nx-border);
  background: #f6f8fd; color: var(--nx-muted); border-radius: 20px; padding: 4px 12px 4px 6px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; }
.nx-toggle span { width: 10px; height: 10px; border-radius: 50%; background: #c8cfdb; }
.nx-toggle.on { background: #e3f7ec; color: #1a9d5a; border-color: #bfe9d2; }
.nx-toggle.on span { background: #1a9d5a; }

.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; }
.nx-hint-inline { font-size: 11.5px; color: var(--nx-muted); font-weight: 400; }
/* A hint that says the form will be refused, rather than explaining the field. */
.nx-hint.warn { color: #b7791f; }
.nx-field label .req { color: #d13341; }
.nx-switch-row { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 16px; }
.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: #fff; cursor: pointer;
  font: inherit; color: inherit; }
.nx-type:hover { border-color: #c6d1ee; }
.nx-type.active { border-color: var(--nx-primary); box-shadow: 0 0 0 3px rgba(75,108,245,.12); }
.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: #fbfcfe; }
.nx-cb-group.depth-1 { background: #f6f8fd; border-left: 3px solid #c6d1ee; }
.nx-cb-group.depth-2 { background: #f2f5fc; border-left: 3px solid #a9b9e8; }
.nx-cb-group.depth-3 { background: #eef2fb; border-left: 3px solid #8ea3e0; }
.nx-cb-group.has-issue { border-color: #f0b6bc; }
.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-op { border: 1px solid var(--nx-border); background: #fff; color: var(--nx-muted);
  border-radius: 4px; padding: 5px 11px; font-size: 12px; font-weight: 700; cursor: pointer; }
.nx-cb-op.active { background: var(--nx-primary); border-color: var(--nx-primary); color: #fff; }
.nx-cb-op.not.active { background: #ef4d5a; border-color: #ef4d5a; }
.nx-cb-op.sm { padding: 4px 8px; font-size: 11px; }
.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: #fff; border: 1px solid var(--nx-border);
  border-radius: 4px; padding: 8px; }
.nx-cb-row.has-issue { border-color: #f0b6bc; }
.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: #fff; }
.nx-cb-issue { grid-column: 1 / -1; font-size: 12.5px; padding: 6px 8px; border-radius: 4px; }
.nx-cb-issue.error { background: #fde3e5; color: #b3222f; }
.nx-cb-issue.warning { background: #fff2dd; color: #9a6a08; }

/* 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: #0c1020;
  color: #cfd6e6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  line-height: 1.7; overflow-wrap: anywhere; }
.nx-rule-sentence.big { font-size: 13px; }
.nx-rule-sentence .k { color: #7fe3a3; 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: #fbfcfe; }
.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: #fff; font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; }
.nx-action-desc { margin: 7px 0 0; font-size: 12.5px; color: var(--nx-muted); }
.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: #fff;
  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: #f2f6ff; }
.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: #f1f3f9; color: #5a6376;
  border-radius: 20px; padding: 2px 9px; font-size: 11.5px; cursor: pointer; }
.nx-tag-chip:hover { background: #e7ecfe; color: var(--nx-primary); }

.nx-tab-count { margin-left: 7px; background: #eef1f8; border-radius: 4px; padding: 1px 7px; font-size: 11.5px; }
.nx-alert.warn { background: #fff2dd; color: #9a6a08; }

.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: #fff; padding: 8px 10px; margin-bottom: 7px; font: inherit; color: inherit;
  font-size: 12.5px; cursor: pointer; }
.nx-run-row:hover { background: #f2f6ff; }
.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: #1f2740; 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; } }

.nx-step { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600;
  margin-bottom: 14px; }
.nx-step span { width: 24px; height: 24px; border-radius: 50%; background: var(--nx-primary);
  color: #fff; font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center; }
.nx-step em { font-style: normal; font-size: 12.5px; font-weight: 400; color: var(--nx-muted); }

/* Settings most rules never change stay one click away instead of on their own screen. */
.nx-disclose { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 18px;
  border: 1px dashed var(--nx-border); background: #fbfcfe; border-radius: 4px; padding: 10px 12px;
  font: inherit; font-size: 13.5px; color: var(--nx-text); cursor: pointer; text-align: left; }
.nx-disclose:hover { border-color: #c6d1ee; }
.nx-disclose .muted { margin-left: auto; font-size: 12.5px; }
.nx-advanced { border: 1px solid var(--nx-border); border-top: 0; border-radius: 0 0 10px 10px;
  padding: 16px; background: #fbfcfe; }

.nx-alert.ok { background: #e3f7ec; color: #1a7f4b; }

.nx-mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 10px; }
.nx-mini-stats div { background: #f6f8fd; 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: #fff; }
.nx-cb-joint i { font-size: 12px; opacity: .45; }
.nx-cb-joint.and { color: var(--nx-primary); border-color: #c6d1ee; background: #eef2ff; }
.nx-cb-joint.or { color: #b26a00; border-color: #f0d6a8; background: #fff6e6; }
.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: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; resize: vertical; }

.nx-xfer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--nx-border); }
.nx-xfer-row { display: flex; gap: 14px; align-items: flex-end; margin-bottom: 12px; flex-wrap: wrap; }
.nx-xfer-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.nx-xfer-field.grow { flex: 1; min-width: 260px; }
.nx-xfer-field > span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--nx-muted); }
.nx-xfer-field em { text-transform: none; letter-spacing: 0; font-style: normal; opacity: .8; }
.nx-xfer-field input[type="text"], .nx-xfer-field input:not([type]) {
  border: 1px solid var(--nx-border); border-radius: 4px; padding: 8px 10px; font-size: 12.5px; }
.nx-xfer-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  padding: 8px 11px; border-radius: 4px; background: #f2f5fb; }
.nx-xfer-status.ok { background: #eefaf2; color: #24714a; }
.nx-xfer-status.err { background: #fdf0f0; color: #a53434; }

/* --- 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-plan { display: flex; flex-direction: column; }
.nx-hd-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--nx-border); padding: 13px 18px; cursor: pointer; }
.nx-hd-row:hover { background: #f7f9ff; }
.nx-hd-row:last-child { border-bottom: 0; }
.nx-hd-rank { flex: 0 0 34px; height: 34px; border-radius: 4px; background: #eef2ff; color: #3a4a7a;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.nx-hd-main { flex: 1 1 auto; min-width: 0; }
.nx-hd-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.nx-hd-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 5px;
  color: var(--nx-muted); font-size: 12px; }
.nx-hd-meta i { margin-right: 4px; }
.nx-hd-meta code { font-size: 11px; }
.nx-hd-frameworks { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.nx-hd-frameworks .nx-badge { font-size: 11px; padding: 2px 8px; }
.nx-hd-chevron { color: #b9c1d4; font-size: 20px; }
.nx-hd-products { display: flex; flex-wrap: wrap; gap: 4px; }
.nx-hd-products .nx-badge { font-size: 11px; padding: 2px 8px; }
.nx-hd-clauselist { display: flex; flex-wrap: wrap; gap: 4px; max-width: 340px; }
.nx-hd-clauselist .nx-badge { font-size: 10.5px; padding: 2px 7px; }
.nx-hd-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nx-hd-kv { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; font-size: 12.5px; }
.nx-hd-kv .muted { flex: 0 0 66px; }
.nx-hd-bad { color: #a3222f; background: #fdeef0; padding: 2px 7px; border-radius: 3px; word-break: break-all; }
.nx-hd-good { color: #14804a; background: #e7f7ee; padding: 2px 7px; border-radius: 3px; word-break: break-all; }
.nx-hd-step { margin-bottom: 12px; }
.nx-hd-step-label { font-size: 12px; font-weight: 600; color: #3a4a7a; margin-bottom: 5px; }
.nx-hd-step-label i { margin-right: 5px; }
.nx-hd-code { margin: 0; padding: 10px 12px; background: #f5f7fc; border: 1px solid var(--nx-border);
  border-radius: 4px; font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.nx-hd-clause { display: flex; gap: 10px; margin-top: 9px; font-size: 12.5px; }
.nx-hd-clause code { flex: 0 0 auto; background: #f1f3f9; padding: 2px 7px; border-radius: 3px; height: fit-content; }

/* --- 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-flash { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 4px;
  font-size: 13.5px; margin-bottom: 16px; }
.nx-smtp-flash.err { background: #fde3e5; color: #a3212e; }
.nx-smtp-flash.ok { background: #e3f7ec; color: #147a45; }

.nx-smtp-hero { display: flex; gap: 24px; align-items: flex-start; }
.nx-smtp-hero-main { flex: 1; min-width: 0; }
.nx-smtp-hero-side { flex: 0 0 auto; }
.nx-smtp-hero-head { display: flex; gap: 14px; align-items: flex-start; }
.nx-smtp-hero-head > i { font-size: 30px; line-height: 1; margin-top: 2px; }
.nx-smtp-hero-head > i.on { color: #1a9d5a; }
.nx-smtp-hero-head > i.off { color: #8a94a6; }
.nx-smtp-state { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nx-smtp-problems { margin: 12px 0 0; padding: 10px 14px; list-style: none; background: #fff8ec;
  border: 1px solid #f5e0bd; border-radius: 4px; font-size: 13px; color: #8a5c07; }
.nx-smtp-problems li { display: flex; gap: 7px; align-items: center; padding: 2px 0; }
.nx-smtp-hero-kv { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  column-gap: 26px; }
.nx-smtp-lasterr { color: #a3212e; 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: #fff2dd; color: #8a5c07; }
.nx-smtp-pw { display: flex; gap: 8px; align-items: center; }
.nx-smtp-pwnote { margin-top: 7px; font-size: 12px; color: var(--nx-muted); line-height: 1.6; }
.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: #f2fbf6; border-color: #bfe8d1; }
.nx-smtp-result.err { background: #fef5f6; border-color: #f3ccd1; }
.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: #e3f7ec; color: #1a9d5a; }
.nx-smtp-stage.fail { background: #fde3e5; color: #d13341; }
.nx-smtp-stage.skip { background: #f1f3f9; color: #a8b0c0; }
.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: #5b6478; 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-req { color: #d13341; }
.nx-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nx-inline .nx-field { margin-bottom: 0; flex: 1 1 200px; }
.nx-pm-actions { white-space: normal; min-width: 240px; }
.nx-ellipsis { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: bottom; }
.nx-hash { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px;
  overflow-wrap: anywhere; color: #47506a; }

/* 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-steps { display: flex; gap: 6px; padding: 0 22px 14px; border-bottom: 1px solid var(--nx-border);
  flex-wrap: wrap; }
.nx-step { display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 4px;
  border: 1px solid var(--nx-border); background: #fff; font-size: 13px; color: var(--nx-muted);
  cursor: pointer; }
.nx-step.active { border-color: var(--nx-primary); color: var(--nx-primary); font-weight: 600; }
.nx-step.done { color: #2f855a; border-color: #cfe8d9; }
.nx-step-n { display: inline-flex; align-items: center; justify-content: center; width: 20px;
  height: 20px; border-radius: 50%; background: #eef1f8; font-size: 11.5px; font-weight: 700; }
.nx-step.active .nx-step-n { background: var(--nx-primary); color: #fff; }

/* A picker row: a checkbox and what it selects, on one line. */
.nx-pick { display: flex; align-items: center; gap: 10px; padding: 7px 2px; font-size: 13.5px;
  border-bottom: 1px solid #f2f4f9; cursor: pointer; }
.nx-pick input { margin: 0; }
.nx-pick .muted { margin-left: auto; }

/* 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-rulelist { margin-bottom: 18px; }
.nx-rulelist-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 8px; }
.nx-rulelist-head h5, .nx-rulelist-head h6 { margin: 0; font-size: 13.5px; }
.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: #fbfcfe; }
.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, .nx-strategy { margin-top: 4px; }

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

.nx-preview { margin-top: 16px; }
.nx-timeline-row { display: flex; align-items: baseline; gap: 10px; padding: 6px 0;
  border-bottom: 1px solid #f2f4f9; font-size: 13px; flex-wrap: wrap; }
.nx-log { background: #0c1020; color: #d7dcea; padding: 12px 14px; border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; line-height: 1.6;
  max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.nx-drawer-actions { display: flex; align-items: center; gap: 10px; padding: 16px 22px;
  border-top: 1px solid var(--nx-border); background: #fff; position: sticky; bottom: 0; }

/* --- Settings · Agent Settings ------------------------------------------- */
/* One row per collection family, so the whole schedule is readable at once
   rather than through a form per family. */
.nx-ags-intro { display: flex; gap: 14px; align-items: flex-start; }
.nx-ags-intro > i { font-size: 26px; line-height: 1; color: var(--nx-primary); margin-top: 2px; }

.nx-ags-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.nx-tab { border: 1px solid var(--nx-border); background: #fff; border-radius: 999px;
  padding: 7px 15px; font-size: 13px; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.nx-tab.on { background: var(--nx-primary); border-color: var(--nx-primary); color: #fff; }
.nx-tab.on .nx-badge { background: rgba(255,255,255,.22); color: #fff; }

.nx-ags-table { width: 100%; border-collapse: collapse; }
.nx-ags-table td { padding: 11px 10px; border-top: 1px solid var(--nx-border); vertical-align: top; }
.nx-ags-table tr:first-child td { border-top: none; }
.nx-ags-name { font-weight: 600; font-size: 13.5px; }
.nx-ags-note { font-size: 12px; line-height: 1.5; margin-top: 2px; max-width: 62ch; }
.nx-ags-input { width: 130px; }
.nx-ags-input .nx-input { width: 100%; }
.nx-ags-meta { width: 150px; font-size: 12px; white-space: nowrap; }

.nx-ags-limits { display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-start;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--nx-border); }
.nx-ags-limits > label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; max-width: 46ch; }
.nx-ags-limits em { font-style: normal; font-size: 12px; line-height: 1.5; }
.nx-ags-limits .nx-input { width: 130px; }
.nx-ags-toggle { flex-direction: row !important; align-items: center; gap: 9px !important; }

.nx-ags-rollout .nx-card-head { align-items: baseline; }
.nx-ags-versions { list-style: none; margin: 10px 0 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.nx-ags-versions li { display: inline-flex; gap: 8px; align-items: center;
  border: 1px solid var(--nx-border); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; }

/* --- 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; }

.nx-dash-filters { display: flex; align-items: center; gap: 10px; }
.nx-seg { display: inline-flex; background: #eef1f8; border-radius: 4px; padding: 3px; gap: 2px; }
.nx-seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
  background: none; color: var(--nx-muted); font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 4px; }
.nx-seg button:hover { color: var(--nx-text); }
.nx-seg button.on { background: #fff; color: var(--nx-primary); box-shadow: 0 1px 3px rgba(20,30,60,.12); }

/* 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. */
.nx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 16px; margin-bottom: 20px; }
.nx-kpi { text-align: left; background: #fff; border: 1px solid var(--nx-border);
  border-inline-start: 4px solid var(--kpi, var(--nx-border)); border-radius: 4px;
  padding: 15px 17px; cursor: pointer; font: inherit; color: inherit; }
.nx-kpi:hover { border-color: #c6d1ee; border-inline-start-color: var(--kpi, var(--nx-border)); }
.nx-kpi.on { box-shadow: 0 0 0 3px rgba(75,108,245,.12); border-color: var(--nx-primary);
  border-inline-start-color: var(--kpi, var(--nx-primary)); }
.nx-kpi.static { cursor: default; border-inline-start-color: var(--nx-border); }
.nx-kpi .k { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600;
  color: var(--kpi, var(--nx-muted)); }
.nx-kpi.static .k { color: var(--nx-muted); }
.nx-kpi .v { font-size: 27px; font-weight: 700; line-height: 1.25; margin-top: 4px; }
.nx-kpi .l { color: var(--nx-muted); font-size: 12px; }

.nx-dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.nx-dash-grid.main { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
@media (max-width: 1180px) { .nx-dash-grid, .nx-dash-grid.main { grid-template-columns: 1fr; } }

/* 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: #1b2340; color: #fff; border-radius: 4px; padding: 7px 10px; font-size: 12px;
  line-height: 1.5; white-space: nowrap; box-shadow: 0 8px 20px rgba(15,20,40,.28);
  display: flex; flex-direction: column; }
.nx-tip .nx-tip-v { font-size: 15px; font-weight: 700; }
.nx-tip .nx-tip-n { color: #a9b3cd; }

/* 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: #eef1f6;
  border-radius: 4px; overflow: hidden; }
.nx-bar.empty { background: #f3f5f9; }
.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: #f6f8fd; }
.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: #eef1f6; 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: #f6f8fd; }
.nx-legend-item.on { background: #eef2fe; }
.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 #f2f4f9; border-radius: 0; }
.nx-arow.clickable:hover { background: #f6f8fd; }
.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: #b6bdcb; font-weight: 500; }
.nx-cnt.zero .nx-dot { opacity: .35; }
.nx-cnt.on { background: #eef2fe; }
.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: #1a9d5a; 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; }
}
