/* ── modal-wide: large width for netmon dashboard ── */
.nm-modal {
  max-width: 1280px;
  min-width: 800px;
  min-height: min(80vh, 620px);
  max-height: min(90vh, 850px);
  display: flex;
  flex-direction: column;
}
.nm-modal > .mon-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.nm-modal > .mon-pane > .modal-b {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#mon-network > .modal-b {
  overflow: hidden;
  padding-bottom: 6px;
}
#mon-network .nm-toolbar {
  flex-shrink: 0;
  margin: -18px -18px 8px -18px;
}
#mon-network .nm-cards {
  flex-shrink: 0;
  max-height: 130px;
  overflow-y: auto;
  margin: 2px 0 6px 0;
}
#mon-network .nm-panel {
  flex-shrink: 0;
  max-height: 180px;
  overflow-y: auto;
}
#mon-network .nm-filters {
  flex-shrink: 0;
}
#mon-network .tbl-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid var(--bg4);
  border-radius: var(--rad);
  background: var(--bg2);
}
#mon-network .pag {
  flex-shrink: 0;
  margin-top: 6px;
}

/* Toolbar in modal header — flex between text and controls */
.modal-b > .nm-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
  margin: -18px -18px 14px -18px;
  border-bottom: 1px solid var(--bg4);
  background: var(--bg-glass);
}
.nm-toolbar .hint {
  font-size: .7rem;
  color: var(--fg3);
  line-height: 1.4;
  flex: 1 1 320px;
}
.nm-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  min-height: 30px;
  padding: 0 11px;
  font-size: .74rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.nm-toolbar button .btn-icon,
.nm-toolbar button svg {
  width: 14px;
  height: 14px;
  flex: none;
}
.nm-toolbar button .menu-card-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 2px;
  flex: none;
}
.nm-toolbar button .menu-card-icon svg {
  width: 12px;
  height: 12px;
}


/* ── text/flag helpers (not present in base.css) ── */
.fg-danger { color: var(--r); }
.fg-warn  { color: var(--y); }
.fg-ok    { color: var(--g); }
.fg-muted { color: var(--fg3); }

/* ── Attractive Capture Toggle Switch ── */
.nm-toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  cursor: pointer;
  user-select: none;
  padding: 0 10px 0 6px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: all var(--tr);
}
.nm-toggle-switch:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(129, 140, 248, .45);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25), 0 0 0 2px rgba(99, 102, 241, .1);
}
.nm-toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.nm-toggle-track {
  position: relative;
  width: 32px;
  height: 18px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 999px;
  transition: all .24s cubic-bezier(.4, 0, .2, 1);
  flex-shrink: 0;
}
.nm-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: #94a3b8;
  border-radius: 50%;
  transition: transform .24s cubic-bezier(.4, 0, .2, 1), background .2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.nm-toggle-switch input:checked + .nm-toggle-track {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: rgba(52, 211, 153, .65);
  box-shadow: 0 0 12px rgba(16, 185, 129, .45);
}
.nm-toggle-switch input:checked + .nm-toggle-track .nm-toggle-thumb {
  transform: translateX(14px);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35), 0 0 6px rgba(255, 255, 255, .8);
}
.nm-toggle-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--fg2);
  line-height: 1;
}
.nm-toggle-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
  transition: all .2s ease;
}
.nm-toggle-switch input:checked ~ .nm-toggle-text .nm-toggle-dot {
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: nmPulse 1.6s infinite;
}
.nm-toggle-state {
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .06);
  color: var(--fg3);
  letter-spacing: .5px;
  transition: all .2s ease;
}
.nm-toggle-switch input:checked ~ .nm-toggle-text .nm-toggle-state {
  background: rgba(16, 185, 129, .18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, .3);
}

@keyframes nmPulse {
  0% { transform: scale(.9); opacity: .7; }
  50% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 10px #34d399; }
  100% { transform: scale(.9); opacity: .7; }
}

/* ── stat cards ── */
.nm-cards {
  display: grid; gap: 8px; margin: 10px 0;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
}
.nm-card {
  background: var(--bg2); border: 1px solid var(--bg4);
  border-radius: var(--rad); padding: 8px 10px; min-width: 0;
}
.nm-card-v {
  font-family: var(--mono); font-size: 1.15rem; font-weight: 700;
  line-height: 1.2; color: var(--fg);
}
.nm-card-l {
  font-size: .63rem; text-transform: uppercase; letter-spacing: .6px;
  color: var(--fg3); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nm-card-danger { border-color: rgba(244, 63, 94, .45); background: rgba(244, 63, 94, .07); }
.nm-card-danger .nm-card-v { color: var(--r); }
.nm-card-warn { border-color: rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .07); }
.nm-card-warn .nm-card-v { color: var(--y); }
.nm-card-ok { border-color: rgba(16, 185, 129, .40); background: rgba(16, 185, 129, .06); }
.nm-card-ok .nm-card-v { color: var(--g); }
.nm-card-wide { grid-column: 1 / -1; }
.nm-card-wide .nm-card-l { margin-bottom: 5px; }

/* ── host chips ── */
.nm-hosts { display: flex; flex-wrap: wrap; gap: 5px; max-height: 140px; overflow-y: auto; }
.nm-hostchip {
  font-family: var(--mono); font-size: .66rem;
  background: var(--bg3); color: var(--fg2);
  border: 1px solid var(--bg4); border-radius: 999px;
  padding: 2px 8px; cursor: pointer; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nm-hostchip b { color: var(--fg3); font-weight: 600; margin-left: 3px; }
button.nm-hostchip:hover { border-color: var(--acc); color: var(--fg); }
.nm-hostchip-err { border-color: rgba(244, 63, 94, .40); color: var(--r); }
.nm-hostchip-err b { color: var(--r); }
span.nm-hostchip { cursor: default; }

/* ── filters (single line, compact width, no wrap) ── */
.nm-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
  overflow-x: auto;
  flex-shrink: 0;
}
.nm-filters input, .nm-filters select {
  background: var(--bg2);
  color: var(--fg);
  border: 1px solid var(--bg4);
  border-radius: var(--rad);
  padding: 4px 8px;
  font-size: .72rem;
  min-width: 0;
  flex: none;
  width: auto;
}
.nm-filters input {
  font-family: var(--mono);
}
.nm-filters input:focus, .nm-filters select:focus {
  outline: none;
  border-color: var(--acc);
}
#nm-search { width: 170px; flex: none; }
#nm-flag { width: 110px; flex: none; }
#nm-outcome { width: 115px; flex: none; }
#nm-method { width: 95px; flex: none; }
#nm-host { width: 110px; flex: none; }
#nm-email { width: 130px; flex: none; }

/* ── request table ── */
.nm-tbl { width: 100%; border-collapse: collapse; font-size: .72rem; }
.nm-tbl th {
  text-align: left; font-size: .62rem; text-transform: uppercase;
  letter-spacing: .6px; color: var(--fg3); font-weight: 600;
  padding: 6px 7px; border-bottom: 1px solid var(--bg4);
  position: sticky; top: 0; background: var(--bg2); z-index: 1;
}
.nm-tbl td {
  padding: 5px 7px; border-bottom: 1px solid rgba(40, 50, 78, .45);
  vertical-align: top; color: var(--fg2);
}
.nm-tbl tbody tr:hover { background: rgba(99, 102, 241, .06); }
.nm-flagged { background: rgba(244, 63, 94, .055); }
.nm-flagged:hover { background: rgba(244, 63, 94, .10) !important; }
.nm-time { color: var(--fg3); white-space: nowrap; }
.nm-email { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-host { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-path { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-type { font-size: .64rem; white-space: nowrap; }

.nm-verb {
  font-family: var(--mono); font-size: .62rem; font-weight: 700;
  padding: 1px 5px; border-radius: 4px; border: 1px solid var(--bg4);
}
.nm-get    { color: var(--g); border-color: rgba(16, 185, 129, .35); }
.nm-post    { color: var(--acc2); border-color: rgba(129, 140, 248, .35); }
.nm-put    { color: var(--y); border-color: rgba(245, 158, 11, .35); }
.nm-delete { color: var(--r); border-color: rgba(244, 63, 94, .35); }
.nm-options   { color: var(--fg3); }

/* ── flag chips ── */
.nm-flag {
  display: inline-block; font-family: var(--mono);
  font-size: .6rem; font-weight: 600; line-height: 1.5;
  padding: 1px 5px; margin: 1px 3px 1px 0; border-radius: 4px;
  border: 1px solid var(--bg4); background: var(--bg3); color: var(--fg3);
}
.nm-flag.fg-danger { border-color: rgba(244, 63, 94, .45); background: rgba(244, 63, 94, .10); }
.nm-flag.fg-warn  { border-color: rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .10); }

/* ── report panels ── */
.nm-panel {
  background: var(--bg2); border: 1px solid var(--bg4);
  border-radius: var(--rad2); margin: 10px 0; overflow: hidden;
}
.nm-panel-h {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid var(--bg4); background: var(--bg3);
}
.nm-panel-h h4 { margin: 0; font-size: .8rem; font-weight: 600; color: var(--fg); }
.nm-panel-h button {
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  border-radius: 6px;
}
.nm-panel-h button svg {
  width: 13px;
  height: 13px;
}
.nm-panel-b { padding: 10px 12px; max-height: 62vh; overflow: auto; }

.nm-leak-group { margin-bottom: 14px; }
.nm-leak-group:last-child { margin-bottom: 0; }
.nm-leak-group h5 {
  margin: 0 0 4px; font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .6px; color: var(--fg2);
}
.nm-leak-explain {
  font-size: .7rem; color: var(--fg3); line-height: 1.5;
  margin-bottom: 7px; max-width: 900px;
}
.nm-warn, .nm-ok {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .76rem;
  font-weight: 600;
  padding: 8px 12px;
  margin-bottom: 9px;
  border-radius: var(--rad);
}
.nm-warn {
  color: var(--y);
  border: 1px solid rgba(245, 158, 11, .40);
  background: rgba(245, 158, 11, .08);
}
.nm-ok {
  color: var(--g);
  border: 1px solid rgba(16, 185, 129, .35);
  background: rgba(16, 185, 129, .07);
}
.inline-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
  vertical-align: middle;
  flex: none;
}
.inline-status-icon svg {
  width: 15px;
  height: 15px;
}

/* ── request detail modal ── */
.nm-detail-sec { margin-bottom: 12px; }
.nm-detail-sec h5 {
  margin: 0 0 4px; font-size: .66rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .6px; color: var(--fg3);
}
.nm-pre {
  margin: 0; padding: 8px 10px; overflow: auto; max-height: 34vh;
