/* ==========================================================================
 * NOC IP Address Management — visual layer
 * Layered under the Dez Bootstrap theme. Uses --bs-* tokens so dark mode comes
 * for free. Scoped under .noc-ip-page to avoid bleeding into the rest of the
 * portal. Keep every colour expressed as a CSS variable; theme parity is the
 * whole point of the layout.
 * ========================================================================== */

/**
 * Colour system: defer entirely to the Deznav / Bootstrap tokens the rest of
 * the NOC portal uses. No bespoke indigo / pastel palette — the "tacky as
 * fuck, different colour schema" feedback on the previous version was about
 * this page bringing its own brand instead of inheriting the portal's.
 *
 *   --ip-accent      → theme primary (orange in the default Deznav theme)
 *   --ip-ok/warn/bad → Bootstrap semantic colours
 *   --ip-card-*      → Deznav card tokens so cards/tables sit flush with the
 *                      rest of the portal in both light and dark modes.
 */
.noc-ip-page {
	--ip-accent: var(--bs-primary);
	--ip-accent-soft: rgba(var(--bs-primary-rgb), 0.10);
	--ip-ok: var(--bs-success);
	--ip-ok-soft: rgba(var(--bs-success-rgb), 0.10);
	--ip-warn: var(--bs-warning);
	--ip-warn-soft: rgba(var(--bs-warning-rgb), 0.12);
	--ip-bad: var(--bs-danger);
	--ip-bad-soft: rgba(var(--bs-danger-rgb), 0.10);
	--ip-info: var(--bs-info);
	--ip-info-soft: rgba(var(--bs-info-rgb), 0.10);

	--ip-card-bg: var(--bs-body-bg);
	--ip-card-border: var(--bs-border-color);
	--ip-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	--ip-card-radius: 0.5rem;

	--ip-muted: var(--bs-secondary-color);
	--ip-text: var(--bs-body-color);
	--ip-line: var(--bs-border-color);
	--ip-row-hover: rgba(var(--bs-primary-rgb), 0.04);
	--ip-row-selected: rgba(var(--bs-primary-rgb), 0.08);
}

/* ---------- Hero KPI strip ---------- */

.noc-ip-hero {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 10px;
	margin-bottom: 16px;
}
@media (max-width: 1200px) { .noc-ip-hero { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .noc-ip-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/**
 * KPI strip. Background stays transparent — the previous "dark panel on
 * dark page" stacking was the specific thing that killed the last design —
 * but each chip now gets the same thin border the rest of the portal uses
 * for Bootstrap cards, so the five sections read as proper chips instead of
 * looking like bare text dumped on the page. Only the active chip escalates
 * to the accent colour.
 */
.noc-ip-chip {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-radius: 0.5rem;
	background: transparent;
	border: 1px solid var(--ip-line);
	color: var(--ip-text);
	text-align: left;
	cursor: pointer;
	transition: background-color 0.12s ease, border-color 0.12s ease;
}
.noc-ip-chip:hover { background-color: var(--ip-row-hover); border-color: var(--ip-card-border); }
.noc-ip-chip[aria-pressed="true"] { border-color: var(--ip-accent); background-color: var(--ip-accent-soft); }

.noc-ip-chip-icon {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var(--ip-accent-soft);
	color: var(--ip-accent);
	display: grid;
	place-items: center;
	flex: 0 0 auto;
}
.noc-ip-chip-icon svg { width: 22px; height: 22px; }

.noc-ip-chip--warn .noc-ip-chip-icon { background: var(--ip-warn-soft); color: var(--ip-warn); }
.noc-ip-chip--info .noc-ip-chip-icon { background: var(--ip-info-soft); color: var(--ip-info); }

.noc-ip-chip-body { min-width: 0; display: grid; gap: 2px; }
.noc-ip-chip-label {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ip-muted);
	font-weight: 600;
}
.noc-ip-chip-value {
	font-size: 1.6rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
}
.noc-ip-chip-meta { font-size: 0.72rem; color: var(--ip-muted); }

/* ---------- Shell: rail + main ---------- */

.noc-ip-shell {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 16px;
	align-items: start;
}
@media (max-width: 992px) {
	.noc-ip-shell { grid-template-columns: 1fr; }
}

/**
 * Flat rail: no card chrome, no shadow. Divider on the right side separates
 * it from the table area. Sticky positioning is preserved so long service
 * lists still hug the top of the viewport.
 */
.noc-ip-rail {
	background: transparent;
	border: 0;
	border-right: 1px solid var(--ip-line);
	border-radius: 0;
	box-shadow: none;
	padding-right: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	max-height: 78vh;
	position: sticky;
	top: 16px;
}
.noc-ip-rail-header {
	padding: 4px 4px 8px;
	border-bottom: 1px solid var(--ip-line);
}
.noc-ip-rail-title {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ip-muted);
	font-weight: 600;
}
.noc-ip-rail-sub { font-size: 0.78rem; color: var(--ip-muted); }

.noc-ip-rail-search {
	padding: 8px 10px;
	display: flex;
	align-items: center;
	gap: 8px;
	border-bottom: 1px solid var(--ip-line);
	color: var(--ip-muted);
}
.noc-ip-rail-search input { border: none; background: transparent; padding: 0; font-size: 0.82rem; box-shadow: none; }
.noc-ip-rail-search input:focus { box-shadow: none; background: transparent; }

.noc-ip-rail-list { overflow-y: auto; padding: 6px; display: grid; gap: 2px; }

.noc-ip-rail-item {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 6px;
	align-items: center;
	padding: 8px 10px;
	border-radius: 10px;
	border: 1px solid transparent;
	background: transparent;
	color: inherit;
	text-align: left;
	font-size: 0.85rem;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.noc-ip-rail-item:hover { background: var(--ip-row-hover); }
.noc-ip-rail-item.is-active { background: var(--ip-row-selected); border-color: var(--ip-accent); color: var(--ip-text); font-weight: 600; }
.noc-ip-rail-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.noc-ip-rail-item-badges { display: inline-flex; align-items: center; gap: 4px; }
.noc-ip-rail-item .noc-ip-count {
	background: var(--ip-line);
	color: var(--ip-muted);
	font-size: 0.72rem;
	font-weight: 600;
	padding: 2px 7px;
	border-radius: 999px;
}
.noc-ip-rail-item.is-active .noc-ip-count { background: var(--ip-accent); color: #fff; }
.noc-ip-rail-item .noc-ip-badge-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
}
.noc-ip-rail-item .noc-ip-badge-dot.is-bad { background: var(--ip-bad); }
.noc-ip-rail-item .noc-ip-badge-dot.is-warn { background: var(--ip-warn); }

/* ---------- Main column ---------- */

/**
 * Flat main column. No card chrome — the search bar and table sit directly
 * on the page background. This is the single biggest source of the "dark
 * boxes stacked on dark boxes" complaint, so it gets no background, no
 * border, and no shadow at all.
 */
.noc-ip-main {
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
	min-width: 0;
}

.noc-ip-toolbar {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}
.noc-ip-search-wrap {
	position: relative;
	flex: 1 1 280px;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	border: 1px solid var(--ip-line);
	border-radius: 0.375rem;
	background: transparent;
	color: var(--ip-muted);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.noc-ip-search-wrap:focus-within {
	border-color: var(--ip-accent);
	box-shadow: 0 0 0 3px var(--ip-accent-soft);
}
.noc-ip-search-wrap input {
	border: none;
	background: transparent;
	padding: 0;
	flex: 1;
	font-size: 0.88rem;
	box-shadow: none;
	color: var(--ip-text);
}
.noc-ip-search-wrap input:focus { outline: none; box-shadow: none; background: transparent; }
.noc-ip-kbd {
	display: inline-flex;
	align-items: center;
	padding: 2px 7px;
	border-radius: 6px;
	background: var(--ip-line);
	color: var(--ip-muted);
	font-size: 0.68rem;
	font-weight: 600;
	font-family: inherit;
}
.noc-ip-toolbar-right { display: flex; gap: 8px; }

/* ---------- Table ---------- */

.noc-ip-table-wrap {
	border: 0;
	border-top: 1px solid var(--ip-line);
	border-radius: 0;
	overflow: visible;
}
.noc-ip-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-size: 0.88rem;
}
.noc-ip-table thead th {
	text-align: left;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-weight: 600;
	color: var(--ip-muted);
	padding: 10px 14px;
	background: rgba(15, 23, 42, 0.02);
	border-bottom: 1px solid var(--ip-line);
	position: sticky;
	top: 0;
}
[data-bs-theme="dark"] .noc-ip-table thead th { background: rgba(255, 255, 255, 0.02); }
.noc-ip-table tbody tr {
	cursor: pointer;
	transition: background 0.12s ease;
}
.noc-ip-table tbody tr:not(.noc-ip-row-expanded):not(.noc-ip-row-skeleton) + tr:not(.noc-ip-row-detail) { border-top: 1px solid var(--ip-line); }
.noc-ip-table tbody td { padding: 10px 14px; vertical-align: middle; border-top: 1px solid var(--ip-line); }
.noc-ip-table tbody tr:first-child td { border-top: none; }
.noc-ip-table tbody tr:hover:not(.noc-ip-row-detail) { background: var(--ip-row-hover); }
.noc-ip-table tbody tr.is-selected { background: var(--ip-row-selected); }
.noc-ip-table tbody tr.is-selected td { border-top-color: var(--ip-accent); }

.noc-ip-col-service { min-width: 140px; }
.noc-ip-col-ip      { width: 160px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.noc-ip-col-ptr     { min-width: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.noc-ip-col-status  { width: 140px; }
.noc-ip-col-updated { width: 120px; color: var(--ip-muted); font-size: 0.8rem; }
.noc-ip-col-actions { width: 180px; text-align: right; }

.noc-ip-ip-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 3px 8px;
	background: var(--ip-line);
	border-radius: 8px;
	font-weight: 600;
}
.noc-ip-ip-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ip-ok); }
.noc-ip-ip-chip.is-flagged .dot { background: var(--ip-bad); animation: pulse 1.6s ease-in-out infinite; }
.noc-ip-ip-chip.is-warn .dot    { background: var(--ip-warn); }
.noc-ip-ip-chip.is-block {
	background: var(--ip-info-soft);
	color: var(--ip-info);
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.82rem;
}
.noc-ip-ip-chip.is-block .dot { background: var(--ip-info); }

.noc-ip-block-badge {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 7px;
	font-size: 0.7rem;
	font-weight: 600;
	background: var(--ip-info-soft);
	color: var(--ip-info);
	border-radius: 999px;
	letter-spacing: 0.02em;
	vertical-align: middle;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Per-IP rows that came out of a customer-owned CIDR get a subtle left accent
 * so ops can visually group the 8 IPs of a /29 without reading every row. */
.noc-ip-row--block-member td.noc-ip-col-ip { box-shadow: inset 2px 0 0 0 var(--ip-info); }
.noc-ip-muted { color: var(--ip-muted); }

@keyframes pulse {
	0%, 100% { box-shadow: 0 0 0 0 var(--ip-bad-soft); }
	50%      { box-shadow: 0 0 0 4px transparent; }
}

.noc-ip-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 0.72rem;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--ip-line);
	color: var(--ip-text);
}
.noc-ip-pill--ok   { background: var(--ip-ok-soft);   color: var(--ip-ok); }
.noc-ip-pill--warn { background: var(--ip-warn-soft); color: var(--ip-warn); }
.noc-ip-pill--bad  { background: var(--ip-bad-soft);  color: var(--ip-bad); }
.noc-ip-pill--info { background: var(--ip-info-soft); color: var(--ip-info); }
.noc-ip-pill i {
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

.noc-ip-row-actions {
	display: inline-flex;
	gap: 4px;
	opacity: 0;
	transition: opacity 0.12s ease;
}
.noc-ip-table tbody tr:hover .noc-ip-row-actions,
.noc-ip-table tbody tr.is-selected .noc-ip-row-actions,
.noc-ip-table tbody tr:focus-within .noc-ip-row-actions { opacity: 1; }
.noc-ip-row-action-btn {
	width: 28px; height: 28px;
	display: grid; place-items: center;
	border-radius: 7px;
	border: 1px solid var(--ip-line);
	background: var(--bs-body-bg);
	color: var(--ip-muted);
	transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.noc-ip-row-action-btn:hover { color: var(--ip-accent); border-color: var(--ip-accent); background: var(--ip-accent-soft); }
.noc-ip-row-action-btn svg { width: 14px; height: 14px; }
.noc-ip-expand-caret {
	display: inline-grid; place-items: center;
	width: 20px; height: 20px;
	transition: transform 0.2s ease;
	color: var(--ip-muted);
}
.is-selected .noc-ip-expand-caret { transform: rotate(90deg); color: var(--ip-accent); }

.noc-ip-row-skeleton td { padding: 12px 14px; }
.noc-ip-skeleton-bar {
	display: inline-block;
	height: 12px;
	border-radius: 6px;
	background: linear-gradient(90deg, var(--ip-line), transparent, var(--ip-line));
	background-size: 200% 100%;
	animation: skelShimmer 1.4s linear infinite;
	width: 80%;
}
@keyframes skelShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.noc-ip-empty {
	padding: 48px 16px;
	text-align: center;
	color: var(--ip-muted);
}

/* ---------- Detail row (inline expand) ---------- */

/**
 * Inline detail row. Previously had an indigo-tinted background plus nested
 * panel cards for each section (Reverse DNS, Live Health, etc.) — reads as
 * "box inside box inside box" on dark mode. Flattened: the row itself gets
 * only a thin accent rule on top, and each section is separated by a simple
 * bottom divider instead of being wrapped in its own card.
 */
.noc-ip-row-detail td {
	padding: 0;
	background: transparent;
	border-top: 1px solid var(--ip-accent) !important;
}

.noc-ip-detail {
	padding: 14px 4px 18px;
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: 20px 28px;
}
@media (max-width: 900px) { .noc-ip-detail { grid-template-columns: 1fr; } }

.noc-ip-detail-section {
	background: transparent;
	border: 0;
	border-radius: 0;
	padding: 0;
}
.noc-ip-detail-section-title {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ip-muted);
	font-weight: 600;
	margin: 0 0 10px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.noc-ip-status-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.noc-ip-meta {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 4px 14px;
	font-size: 0.82rem;
	align-items: baseline;
}
.noc-ip-meta dt { color: var(--ip-muted); font-weight: 500; }
.noc-ip-meta dd { margin: 0; word-break: break-all; }
.noc-ip-meta .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.noc-ip-ptr-row {
	display: grid;
	grid-template-columns: 1fr auto auto;
	gap: 6px;
	align-items: center;
	margin-top: 10px;
}
.noc-ip-ptr-row .form-control { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.noc-ip-ping {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
	align-items: center;
	margin-top: 12px;
}
.noc-ip-ping-value {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}
.noc-ip-ping-chart { width: 120px; height: 36px; }

.noc-ip-rbl-list {
	display: grid;
	grid-template-columns: 1fr auto auto;
	gap: 4px 10px;
	font-size: 0.82rem;
	margin-top: 6px;
}
.noc-ip-rbl-list > div {
	display: contents;
}
.noc-ip-rbl-list .name { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; color: var(--ip-text); }
.noc-ip-rbl-list .status { justify-self: end; }
.noc-ip-rbl-list .retest { justify-self: end; }

.noc-ip-actions-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin-top: 12px;
}

.noc-ip-raw {
	margin-top: 10px;
	font-size: 0.78rem;
}
.noc-ip-raw summary {
	cursor: pointer;
	color: var(--ip-muted);
	user-select: none;
}
.noc-ip-raw pre {
	background: var(--ip-line);
	padding: 10px 12px;
	border-radius: 8px;
	max-height: 260px;
	overflow: auto;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.76rem;
	margin-top: 6px;
}

.noc-ip-alert-email {
	margin-top: 10px;
	display: grid;
	gap: 6px;
}
.noc-ip-alert-email .noc-ip-alert-input-row {
	display: grid;
	grid-template-columns: 1fr auto auto;
	gap: 6px;
	align-items: center;
}
.noc-ip-alert-email .form-check-input { margin-top: 0; }
.noc-ip-alert-state {
	font-size: 0.74rem;
	color: var(--ip-muted);
}

.noc-ip-inline-log {
	margin-top: 10px;
	max-height: 120px;
	overflow: auto;
	font-size: 0.78rem;
	display: grid;
	gap: 4px;
}
.noc-ip-inline-log-line {
	padding: 4px 8px;
	border-radius: 6px;
	background: var(--ip-line);
}
.noc-ip-inline-log-line.is-ok   { background: var(--ip-ok-soft);   color: var(--ip-ok); }
.noc-ip-inline-log-line.is-err  { background: var(--ip-bad-soft);  color: var(--ip-bad); }
.noc-ip-inline-log-line.is-info { background: var(--ip-info-soft); color: var(--ip-info); }

.noc-ip-validation { font-size: 0.78rem; margin-top: 4px; min-height: 18px; }
.noc-ip-validation.ok    { color: var(--ip-ok); }
.noc-ip-validation.error { color: var(--ip-bad); }

/* ---------- PTR modal ---------- */

.noc-ip-modal { border: 1px solid var(--ip-card-border); border-radius: var(--ip-card-radius); box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35); }
.noc-ip-ptr-info {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--ip-line);
}
.noc-ip-ptr-info > div { display: grid; gap: 2px; font-size: 0.82rem; }
.noc-ip-ptr-info span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ip-muted); }
.noc-ip-ptr-info code { font-size: 0.82rem; color: var(--ip-text); word-break: break-all; background: transparent; padding: 0; }

/* ---------- Bulk wizard modal ---------- */

.noc-ip-bulk .modal-content { overflow: hidden; min-height: 600px; }
.noc-ip-bulk .modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.noc-ip-bulk-head { display: flex; align-items: center; gap: 18px; }
.noc-ip-bulk-steps { display: flex; align-items: center; gap: 8px; }
.noc-ip-bulk-steps span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.78rem;
	color: var(--ip-muted);
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--ip-line);
	transition: background 0.15s ease, color 0.15s ease;
}
.noc-ip-bulk-steps i {
	width: 20px; height: 20px;
	display: inline-grid; place-items: center;
	background: var(--ip-muted);
	color: var(--bs-body-bg);
	border-radius: 50%;
	font-size: 0.7rem;
	font-weight: 700;
	font-style: normal;
}
.noc-ip-bulk-steps span.is-active { background: var(--ip-accent-soft); color: var(--ip-accent); }
.noc-ip-bulk-steps span.is-active i { background: var(--ip-accent); color: #fff; }
.noc-ip-bulk-steps span.is-done { background: var(--ip-ok-soft); color: var(--ip-ok); }
.noc-ip-bulk-steps span.is-done i { background: var(--ip-ok); color: #fff; }

.noc-ip-bulk-body { position: relative; min-height: 440px; }
.noc-ip-bulk-step { display: none; padding: 14px 18px; }
.noc-ip-bulk-step.is-active { display: block; animation: bulkFade 0.2s ease; }
@keyframes bulkFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Step 1 — compose (v2: full-width code-editor style) */
.noc-ip-bulk-compose-v2 {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-height: 440px;
}

.noc-ip-bulk-toolbar {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	align-items: flex-start;
	padding: 4px 2px;
}
.noc-ip-bulk-toolbar-title {
	font-weight: 600;
	font-size: 0.92rem;
	color: var(--ip-text);
	margin-bottom: 2px;
}
.noc-ip-bulk-toolbar-hint {
	font-size: 0.78rem;
	color: var(--ip-muted);
}
.noc-ip-bulk-toolbar-hint kbd {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.72rem;
	padding: 1px 6px;
	border-radius: 4px;
	background: var(--ip-line);
	color: var(--ip-text);
	border: 1px solid transparent;
	margin: 0 1px;
}
.noc-ip-bulk-toolbar-hint code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.74rem;
	padding: 1px 6px;
	border-radius: 4px;
	background: var(--ip-line);
	color: var(--ip-text);
	margin-left: 4px;
}
.noc-ip-bulk-toolbar-right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.noc-ip-bulk-toolbar-right .btn svg { margin-right: 4px; vertical-align: -2px; }

/* Editor frame: gutter + textarea + per-line status column, all perfectly aligned */
.noc-ip-bulk-editor-frame {
	--bulk-line-height: 22px;
	--bulk-font-size: 13px;
	--bulk-pad-y: 10px;
	position: relative;
	display: grid;
	grid-template-columns: 46px minmax(0, 1fr) 52px;
	background: var(--ip-card-bg, var(--bs-body-bg));
	border: 1px solid var(--ip-line);
	border-radius: 12px;
	overflow: hidden;
	min-height: 340px;
	max-height: 56vh;
	transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.noc-ip-bulk-editor-frame:focus-within {
	border-color: var(--ip-accent);
	box-shadow: 0 0 0 3px var(--ip-accent-soft);
}
.noc-ip-bulk-gutter,
.noc-ip-bulk-status {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: var(--bulk-font-size);
	line-height: var(--bulk-line-height);
	padding: var(--bulk-pad-y) 0;
	overflow: hidden;
	user-select: none;
	background: rgba(127, 127, 127, 0.06);
	color: var(--ip-muted);
}
.noc-ip-bulk-gutter {
	text-align: right;
	padding-right: 10px;
	border-right: 1px solid var(--ip-line);
	font-variant-numeric: tabular-nums;
}
.noc-ip-bulk-status {
	border-left: 1px solid var(--ip-line);
	padding-left: 8px;
	padding-right: 8px;
}
.noc-ip-bulk-gutter .ln,
.noc-ip-bulk-status .st {
	display: block;
	height: var(--bulk-line-height);
	white-space: nowrap;
}
.noc-ip-bulk-status .st {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 0.72rem;
	font-weight: 600;
}
.noc-ip-bulk-status .st-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--ip-muted);
	flex-shrink: 0;
}
.noc-ip-bulk-status .st-txt { letter-spacing: 0.02em; text-transform: uppercase; font-size: 0.64rem; }
.noc-ip-bulk-status .st.is-ok    .st-dot { background: var(--ip-ok); }
.noc-ip-bulk-status .st.is-ok    .st-txt { color: var(--ip-ok); }
.noc-ip-bulk-status .st.is-warn  .st-dot { background: var(--ip-warn); }
.noc-ip-bulk-status .st.is-warn  .st-txt { color: var(--ip-warn); }
.noc-ip-bulk-status .st.is-err   .st-dot { background: var(--ip-bad); }
.noc-ip-bulk-status .st.is-err   .st-txt { color: var(--ip-bad); }
.noc-ip-bulk-status .st.is-info  .st-dot { background: var(--ip-info); }
.noc-ip-bulk-status .st.is-info  .st-txt { color: var(--ip-info); }
.noc-ip-bulk-status .st.is-empty .st-dot { background: transparent; }

.noc-ip-bulk-editor-v2 {
	grid-column: 2;
	border: 0;
	padding: var(--bulk-pad-y) 12px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: var(--bulk-font-size);
	line-height: var(--bulk-line-height);
	background: transparent;
	color: var(--ip-text);
	resize: none;
	outline: none;
	min-height: 340px;
	white-space: pre;
	overflow: auto;
	tab-size: 4;
}
.noc-ip-bulk-editor-v2::placeholder {
	color: var(--ip-muted);
	opacity: 0.65;
	font-style: italic;
}

.noc-ip-bulk-footerbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	padding: 2px 2px 4px;
}
.noc-ip-bulk-stat-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.noc-ip-bulk-stat-chips .chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.76rem;
	font-weight: 500;
	background: var(--ip-line);
	color: var(--ip-muted);
}
.noc-ip-bulk-stat-chips .chip b {
	font-weight: 700;
	color: var(--ip-text);
	font-variant-numeric: tabular-nums;
}
.noc-ip-bulk-stat-chips .chip.is-ok   { background: var(--ip-ok-soft);   color: var(--ip-ok); }
.noc-ip-bulk-stat-chips .chip.is-ok b { color: var(--ip-ok); }
.noc-ip-bulk-stat-chips .chip.is-warn { background: var(--ip-warn-soft); color: var(--ip-warn); }
.noc-ip-bulk-stat-chips .chip.is-warn b { color: var(--ip-warn); }
.noc-ip-bulk-stat-chips .chip.is-err  { background: var(--ip-bad-soft);  color: var(--ip-bad); }
.noc-ip-bulk-stat-chips .chip.is-err b { color: var(--ip-bad); }
.noc-ip-bulk-stat-chips .chip.is-info { background: var(--ip-info-soft); color: var(--ip-info); }
.noc-ip-bulk-stat-chips .chip.is-info b { color: var(--ip-info); }

/* Dim zero-count chips so eye focuses on real numbers */
.noc-ip-bulk-stat-chips .chip.is-zero { opacity: 0.55; }

/* Step 2 — queue */
.noc-ip-bulk-queue-head {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 14px;
	align-items: center;
	margin-bottom: 12px;
}
.noc-ip-bulk-queue-progress { display: flex; align-items: center; gap: 10px; min-width: 0; }
.noc-ip-bulk-queue-bar {
	flex: 1;
	height: 8px;
	border-radius: 999px;
	background: var(--ip-line);
	overflow: hidden;
}
.noc-ip-bulk-queue-bar span {
	display: block;
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, var(--ip-accent), var(--ip-info));
	border-radius: 999px;
	transition: width 0.25s ease;
}
.noc-ip-bulk-queue-progress-text { font-size: 0.82rem; color: var(--ip-muted); white-space: nowrap; }
.noc-ip-bulk-queue-counters { display: flex; gap: 10px; font-size: 0.78rem; }
.noc-ip-bulk-queue-counters span { display: inline-flex; align-items: center; gap: 6px; color: var(--ip-muted); font-weight: 500; }
.noc-ip-bulk-queue-counters i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.noc-ip-bulk-queue-counters .is-queued { color: var(--ip-muted); }
.noc-ip-bulk-queue-counters .is-running { color: var(--ip-info); }
.noc-ip-bulk-queue-counters .is-ok     { color: var(--ip-ok); }
.noc-ip-bulk-queue-counters .is-fail   { color: var(--ip-bad); }
.noc-ip-bulk-queue-counters b { color: var(--ip-text); font-variant-numeric: tabular-nums; }

.noc-ip-bulk-queue {
	max-height: 58vh;
	overflow-y: auto;
	display: grid;
	gap: 6px;
	padding-right: 4px;
}
.noc-ip-bulk-queue-item {
	display: grid;
	grid-template-columns: 28px 140px minmax(0, 1fr) auto;
	gap: 10px;
	align-items: center;
	padding: 8px 10px;
	border-radius: 10px;
	border: 1px solid var(--ip-line);
	background: var(--bs-body-bg);
	font-size: 0.84rem;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.noc-ip-bulk-queue-item .qstate {
	width: 20px; height: 20px;
	display: grid; place-items: center;
	border-radius: 50%;
	background: var(--ip-line);
	color: var(--ip-muted);
}
.noc-ip-bulk-queue-item.is-running { border-color: var(--ip-info); background: var(--ip-info-soft); }
.noc-ip-bulk-queue-item.is-running .qstate { background: var(--ip-info); color: #fff; animation: qspin 1s linear infinite; }
.noc-ip-bulk-queue-item.is-ok     { border-color: var(--ip-ok); }
.noc-ip-bulk-queue-item.is-ok .qstate     { background: var(--ip-ok); color: #fff; }
.noc-ip-bulk-queue-item.is-failed { border-color: var(--ip-bad); }
.noc-ip-bulk-queue-item.is-failed .qstate { background: var(--ip-bad); color: #fff; }
.noc-ip-bulk-queue-item.is-cancelled { opacity: 0.6; }
.noc-ip-bulk-queue-item .qip { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: 600; }
.noc-ip-bulk-queue-item .qptr { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; color: var(--ip-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.noc-ip-bulk-queue-item .qtime { font-size: 0.74rem; color: var(--ip-muted); font-variant-numeric: tabular-nums; }
.noc-ip-bulk-queue-item.is-failed .qptr { color: var(--ip-bad); }

@keyframes qspin { to { transform: rotate(360deg); } }

/* Step 3 — summary */
.noc-ip-bulk-summary { display: grid; gap: 12px; }
.noc-ip-bulk-summary-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .noc-ip-bulk-summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.noc-ip-bulk-summary-card {
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid var(--ip-line);
	background: var(--bs-body-bg);
}
.noc-ip-bulk-summary-card .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ip-muted); font-weight: 600; }
.noc-ip-bulk-summary-card .value { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.noc-ip-bulk-summary-card.is-ok   .value { color: var(--ip-ok); }
.noc-ip-bulk-summary-card.is-fail .value { color: var(--ip-bad); }
.noc-ip-bulk-summary-card.is-skip .value { color: var(--ip-muted); }

.noc-ip-bulk-summary-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--ip-line); padding: 0 2px; }
.noc-ip-bulk-summary-tabs button {
	background: transparent;
	border: none;
	padding: 10px 12px;
	font-size: 0.86rem;
	font-weight: 600;
	color: var(--ip-muted);
	border-bottom: 2px solid transparent;
	cursor: pointer;
}
.noc-ip-bulk-summary-tabs button.is-active { color: var(--ip-accent); border-bottom-color: var(--ip-accent); }

.noc-ip-bulk-summary-list {
	display: grid;
	gap: 6px;
	max-height: 44vh;
	overflow-y: auto;
	padding: 2px;
}
.noc-ip-bulk-summary-row {
	display: grid;
	grid-template-columns: 140px minmax(0, 1fr) auto;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 10px;
	border: 1px solid var(--ip-line);
	background: var(--bs-body-bg);
	font-size: 0.84rem;
}
.noc-ip-bulk-summary-row .ip { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: 600; }
.noc-ip-bulk-summary-row .msg { color: var(--ip-muted); word-break: break-word; }

.noc-ip-bulk-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-top: 1px solid var(--ip-line);
	padding: 12px 18px;
	background: var(--bs-body-bg);
}
.noc-ip-bulk-footer-right { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- API log modal ---------- */

.noc-ip-log-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 14px;
	border-bottom: 1px solid var(--ip-line);
	gap: 10px;
	flex-wrap: wrap;
}
.noc-ip-log-counters { display: flex; gap: 12px; font-size: 0.82rem; color: var(--ip-muted); }
.noc-ip-log-counters b { color: var(--ip-text); font-variant-numeric: tabular-nums; }
.noc-ip-log-counters .is-ok b   { color: var(--ip-ok); }
.noc-ip-log-counters .is-fail b { color: var(--ip-bad); }
.noc-ip-log-filters { flex: 1 1 240px; max-width: 340px; }

.noc-ip-log-table-wrap { max-height: 66vh; overflow: auto; }
.noc-ip-log-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.85rem; }
.noc-ip-log-table thead th {
	position: sticky; top: 0;
	background: var(--ip-card-bg);
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ip-muted);
	padding: 10px 14px;
	border-bottom: 1px solid var(--ip-line);
	text-align: left;
}
.noc-ip-log-table tbody tr { cursor: pointer; }
.noc-ip-log-table tbody tr:hover { background: var(--ip-row-hover); }
.noc-ip-log-table tbody td {
	padding: 8px 14px;
	border-top: 1px solid var(--ip-line);
	vertical-align: top;
}
.noc-ip-log-table tr.is-expanded + tr td { background: var(--ip-line); }
.noc-ip-log-raw {
	padding: 10px 14px;
	background: var(--ip-line);
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.76rem;
	white-space: pre-wrap;
	word-break: break-all;
	border-top: 1px dashed var(--ip-accent);
}
.noc-ip-log-action { display: inline-flex; align-items: center; gap: 6px; }
.noc-ip-log-action .icon {
	width: 20px; height: 20px; border-radius: 6px; background: var(--ip-accent-soft); color: var(--ip-accent);
	display: inline-grid; place-items: center; flex: 0 0 auto;
}
.noc-ip-log-action .icon svg { width: 12px; height: 12px; }

/* ---------- Command palette ---------- */

.noc-ip-palette { position: fixed; inset: 0; z-index: 1080; }
.noc-ip-palette[hidden] { display: none; }
.noc-ip-palette-backdrop {
	position: absolute; inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	animation: paletteFade 0.15s ease;
}
.noc-ip-palette-panel {
	position: relative;
	width: min(620px, 92vw);
	margin: 12vh auto 0;
	background: var(--bs-body-bg);
	border: 1px solid var(--ip-card-border);
	border-radius: 14px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
	overflow: hidden;
	animation: paletteIn 0.18s ease;
}
@keyframes paletteFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes paletteIn   { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.noc-ip-palette-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--ip-line);
	color: var(--ip-muted);
}
.noc-ip-palette-head input {
	flex: 1;
	border: none;
	background: transparent;
	font-size: 1rem;
	color: var(--ip-text);
	padding: 0;
}
.noc-ip-palette-head input:focus { outline: none; }
.noc-ip-palette-head kbd {
	padding: 2px 7px; border-radius: 6px;
	background: var(--ip-line); color: var(--ip-muted);
	font-size: 0.7rem; font-weight: 600;
}
.noc-ip-palette-list {
	list-style: none;
	max-height: 50vh;
	overflow-y: auto;
	margin: 0;
	padding: 6px;
}
.noc-ip-palette-item {
	padding: 8px 10px;
	border-radius: 8px;
	display: grid;
	grid-template-columns: 160px minmax(0, 1fr) auto;
	gap: 10px;
	align-items: center;
	font-size: 0.86rem;
	cursor: pointer;
}
.noc-ip-palette-item:hover, .noc-ip-palette-item.is-active {
	background: var(--ip-row-selected);
}
.noc-ip-palette-item .ip { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: 600; }
.noc-ip-palette-item .svc { color: var(--ip-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.noc-ip-palette-item .badge-pill {
	font-size: 0.7rem; padding: 2px 7px; border-radius: 999px;
	background: var(--ip-line); color: var(--ip-muted);
}
.noc-ip-palette-item.is-flagged .badge-pill { background: var(--ip-bad-soft); color: var(--ip-bad); }
.noc-ip-palette-foot {
	display: flex;
	gap: 12px;
	padding: 8px 14px;
	border-top: 1px solid var(--ip-line);
	font-size: 0.72rem;
	color: var(--ip-muted);
}
.noc-ip-palette-foot kbd {
	padding: 1px 6px; border-radius: 5px;
	background: var(--ip-line); color: var(--ip-muted);
	font-size: 0.68rem; margin-right: 3px;
}

/* ---------- Helpers ---------- */

.noc-ip-spinner {
	width: 12px; height: 12px;
	border: 2px solid var(--ip-line);
	border-top-color: var(--ip-accent);
	border-radius: 50%;
	animation: qspin 0.7s linear infinite;
}

.noc-ip-hint {
	margin: 10px 2px 0;
	font-size: 0.8rem;
	color: var(--ip-muted);
}
.noc-ip-hint kbd {
	padding: 1px 6px;
	border-radius: 5px;
	background: var(--ip-line);
	color: var(--ip-muted);
	font-size: 0.72rem;
	font-weight: 600;
}

/* ---------- Toasts (PTR / unblock / f2hdns feedback) ---------- */

.noc-ip-toast-host {
	position: fixed;
	right: 18px;
	bottom: 18px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	z-index: 2000;
	pointer-events: none;
	max-width: min(420px, calc(100vw - 36px));
}
.noc-ip-toast {
	pointer-events: auto;
	position: relative;
	min-width: 260px;
	padding: 12px 40px 12px 14px;
	border-radius: 12px;
	background: var(--ip-card, #fff);
	color: var(--ip-fg, #111);
	border: 1px solid var(--ip-line, #e4e6eb);
	box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
	transform: translateX(24px);
	opacity: 0;
	transition: transform 0.22s ease, opacity 0.22s ease;
	border-left: 4px solid var(--ip-accent, #4f46e5);
}
.noc-ip-toast.is-visible { transform: translateX(0); opacity: 1; }
.noc-ip-toast--success { border-left-color: var(--ip-ok, #16a34a); }
.noc-ip-toast--error { border-left-color: var(--ip-bad, #dc2626); }
.noc-ip-toast--warn { border-left-color: var(--ip-warn, #d97706); }
.noc-ip-toast-title {
	font-weight: 600;
	font-size: 0.88rem;
	letter-spacing: 0.01em;
}
.noc-ip-toast-detail {
	margin-top: 3px;
	font-size: 0.78rem;
	color: var(--ip-muted, #6b7280);
	word-break: break-word;
}
.noc-ip-toast-close {
	position: absolute;
	top: 6px;
	right: 8px;
	border: 0;
	background: transparent;
	color: var(--ip-muted, #6b7280);
	font-size: 1.2rem;
	line-height: 1;
	padding: 4px 8px;
	cursor: pointer;
	border-radius: 6px;
}
.noc-ip-toast-close:hover { background: var(--ip-line, #e4e6eb); color: var(--ip-fg, #111); }

/* Row flash when an action mutates a row */
@keyframes noc-ip-row-flash {
	0%   { background-color: rgba(22, 163, 74, 0.18); }
	100% { background-color: transparent; }
}
tr.noc-ip-row.is-flash {
	animation: noc-ip-row-flash 1.6s ease-out 1;
}

