/* NETLoom — wygląd inspirowany LibreNMS (Bootstrap 5.3) */
:root {
  --nr-up: #5cb85c;
  --nr-down: #d9534f;
  --nr-warn: #f0ad4e;
  --nr-unknown: #9aa0a6;
  --nr-disabled: #c4c8cc;
  --nr-in: #2e9e47;
  --nr-out: #2f6fb7;
  --nr-page-bg: #eef0f2;
  --nr-panel-head: #f5f5f5;
  --nr-border: #dcdfe3;
  --nr-navbar-bg: #ffffff;
}
[data-bs-theme="dark"] {
  --nr-page-bg: #16181b;
  --nr-panel-head: #262a2e;
  --nr-border: #33383d;
  --nr-navbar-bg: #1f2226;
  --nr-in: #5cc977;
  --nr-out: #63a4ec;
}

body { background: var(--nr-page-bg); font-size: 0.875rem; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* Pasek nawigacji */
.nr-navbar { background: var(--nr-navbar-bg); border-bottom: 1px solid var(--nr-border); box-shadow: 0 1px 3px rgba(0, 0, 0, .06); padding-top: .25rem; padding-bottom: .25rem; }
.nr-navbar .navbar-brand { font-weight: 700; letter-spacing: .3px; }
.nr-navbar .nav-link { padding-left: .75rem !important; padding-right: .75rem !important; }
.nr-navbar .nav-link.active { color: var(--bs-primary); font-weight: 600; }
.nr-navbar .nav-link:hover { text-decoration: none; }
.dropdown-item:hover { text-decoration: none; }
.dropdown-item .bi { width: 1.25rem; display: inline-block; }

/* Panele */
.nr-panel { border-color: var(--nr-border); border-radius: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.nr-panel > .card-header { background: var(--nr-panel-head); border-bottom-color: var(--nr-border); font-weight: 600; padding: .5rem .75rem; }
.nr-panel > .card-footer { background: var(--nr-panel-head); border-top-color: var(--nr-border); }
.nr-subpanel { border: 1px solid var(--nr-border); border-radius: 3px; padding: .75rem; background: var(--bs-tertiary-bg); }

/* Tabele */
.nr-table { --bs-table-bg: transparent; }
.nr-table > thead th { font-weight: 600; font-size: .8rem; color: var(--bs-secondary-color); border-bottom-width: 1px; white-space: nowrap; }
.nr-table td, .nr-table th { padding-left: .6rem; padding-right: .6rem; }
.nr-kv th { width: 40%; font-weight: 600; color: var(--bs-secondary-color); padding-left: .75rem; }
.nr-kv td { word-break: break-word; }

/* Pasek statusu po lewej (jak w LibreNMS) */
.nr-row > td:first-child { border-left: 5px solid var(--nr-unknown); }
.nr-row.nr-st-up > td:first-child { border-left-color: var(--nr-up); }
.nr-row.nr-st-down > td:first-child { border-left-color: var(--nr-down); }
.nr-row.nr-st-disabled > td:first-child { border-left-color: var(--nr-disabled); }
.nr-row.nr-st-unknown > td:first-child { border-left-color: var(--nr-unknown); }
.nr-row.nr-st-down { --bs-table-bg: rgba(217, 83, 79, .06); }
.nr-row.nr-st-warn > td:first-child { border-left-color: var(--nr-warn); }
.nr-row.nr-st-warn { --bs-table-bg: rgba(240, 173, 78, .07); }
.nr-device-header.nr-st-warn { border-left-color: var(--nr-warn); }

.nr-device-header { border-left: 5px solid var(--nr-unknown); }
.nr-device-header.nr-st-up { border-left-color: var(--nr-up); }
.nr-device-header.nr-st-down { border-left-color: var(--nr-down); }
.nr-device-header.nr-st-disabled { border-left-color: var(--nr-disabled); }

/* Ikony urządzeń */
.nr-device-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; font-size: 1.05rem; color: #fff; background: #7b8794; }
.nr-device-icon-sm { width: 22px; height: 22px; font-size: .75rem; border-radius: 5px; vertical-align: middle; }
.nr-device-icon-lg { width: 52px; height: 52px; font-size: 1.6rem; border-radius: 8px; }
.nr-vendor-cisco { background: #049fd9; }
.nr-vendor-tplink { background: #4acbd6; }
.nr-vendor-ubiquiti { background: #006fff; }
.nr-vendor-proxmox { background: #e57000; }
.nr-vendor-linux { background: #333; }
.nr-vendor-windows { background: #00a4ef; }
.nr-vendor-mikrotik { background: #293239; }
.nr-vendor-generic { background: #7b8794; }

/* Kafelki przeglądu */
.nr-tile { display: block; height: 100%; background: var(--bs-body-bg); border: 1px solid var(--nr-border); border-top: 3px solid var(--bs-primary); border-radius: 3px; padding: .75rem 1rem; color: inherit; }
a.nr-tile:hover { text-decoration: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
.nr-tile-ok { border-top-color: var(--nr-up); }
.nr-tile-danger { border-top-color: var(--nr-down); }
.nr-tile-warning { border-top-color: var(--nr-warn); }
.nr-tile-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; color: var(--bs-secondary-color); font-weight: 600; }
.nr-tile-value { font-size: 1.9rem; font-weight: 700; line-height: 1.2; }
.nr-tile-sub { font-size: .8rem; color: var(--bs-secondary-color); }

/* Ruch */
.nr-in { color: var(--nr-in); }
.nr-out { color: var(--nr-out); }

/* Zakładki urządzenia */
.nr-tabs { border-bottom-color: var(--nr-border); }
.nr-tabs .nav-link { color: var(--bs-secondary-color); }
.nr-tabs .nav-link:hover { text-decoration: none; }
.nr-tabs .nav-link.active { color: var(--bs-body-color); font-weight: 600; background: var(--bs-body-bg); border-color: var(--nr-border) var(--nr-border) var(--bs-body-bg); }

/* Wykresy */
.nr-graph { min-height: 120px; position: relative; }
.nr-graph-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; pointer-events: none;
  background: rgba(15, 23, 42, .82); color: #fff; font-size: .8rem; padding: .4rem .75rem; border-radius: 6px;
  opacity: 0; transition: opacity .2s; white-space: nowrap; }
.nr-graph-hint.show { opacity: 1; }
.nr-graph .nr-graph-empty { display: flex; align-items: center; justify-content: center; color: var(--bs-secondary-color); }
.nr-range .btn { font-size: .75rem; }
.apexcharts-tooltip { font-size: .8rem; }

/* Ustawienia */
.nr-side .list-group-item { border-color: var(--nr-border); }
.nr-side .list-group-item:hover { text-decoration: none; }
.nr-side .list-group-item .bi { width: 1.25rem; display: inline-block; }

/* Edytor szablonów */
.nr-code { font-size: .8rem; line-height: 1.45; tab-size: 2; white-space: pre; }
.nr-help dt { font-family: var(--bs-font-monospace); font-size: .8rem; margin-top: .5rem; }
.nr-help dd { margin-bottom: 0; }
.table thead.sticky-top th { background: var(--bs-body-bg); }

/* Wyszukiwarka */
.nr-search { position: relative; width: 300px; }
.nr-search-results { position: absolute; right: 0; top: calc(100% + 4px); width: 440px; max-height: 70vh; overflow-y: auto;
  background: var(--bs-body-bg); border: 1px solid var(--nr-border); border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
  z-index: 1060; padding: .25rem 0; }
.nr-sq-head { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--bs-secondary-color);
  padding: .5rem .75rem .2rem; }
.nr-sq-item { display: flex; align-items: center; gap: .6rem; padding: .35rem .75rem; color: var(--bs-body-color); text-decoration: none !important; }
.nr-sq-item:hover, .nr-sq-item.active, .nr-sq-all.active { background: var(--bs-tertiary-bg); }
.nr-sq-item.active { box-shadow: inset 3px 0 0 var(--bs-primary); }
.nr-sq-icon .nr-device-icon { width: 28px; height: 28px; font-size: .85rem; border-radius: 6px; }
.nr-sq-glyph { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 6px;
  background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); }
.nr-sq-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.nr-sq-text > span { font-weight: 600; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-sq-text small { color: var(--bs-secondary-color); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-sq-text mark, .nr-sq-text small mark { padding: 0 1px; background: rgba(255, 193, 7, .35); color: inherit; border-radius: 2px; }
.nr-sq-all { display: block; border-top: 1px solid var(--nr-border); margin-top: .25rem; padding: .5rem .75rem; font-size: .8rem; text-decoration: none !important; }
.nr-sq-empty { padding: .75rem; font-size: .8rem; color: var(--bs-secondary-color); }
@media (max-width: 991px) { .nr-search { width: 100%; } .nr-search-results { width: 100%; } }

/* Radio / LTE */
.nr-signal { border-top-color: var(--nr-unknown); }
.nr-signal-success { border-top-color: var(--nr-up); }
.nr-signal-primary { border-top-color: var(--bs-primary); }
.nr-signal-warning { border-top-color: var(--nr-warn); }
.nr-signal-danger { border-top-color: var(--nr-down); }

/* VLAN */
.nr-vlan { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 700; line-height: 1;
  padding: .28rem .45rem; border-radius: 4px; background: var(--vc); color: #fff; border: 1.5px solid var(--vc); margin: 1px 2px 1px 0; }
.nr-vlan-tagged { background: transparent; color: var(--vc); }
[data-bs-theme="dark"] .nr-vlan-tagged { filter: brightness(1.5); }
.nr-vlan-name { font-weight: 500; opacity: .95; }
.nr-port-chip { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; padding: .15rem .45rem; margin: 2px 3px 2px 0;
  border: 1px solid var(--nr-border); border-radius: 10px; color: var(--bs-body-color); background: var(--bs-body-bg); text-decoration: none !important; }
.nr-port-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--nr-disabled); }
.nr-port-chip.nr-st-up::before { background: var(--nr-up); }
.nr-port-chip-tagged { border-style: dashed; }
.nr-port-chip:hover { border-color: var(--bs-primary); }
.nr-dev-chip { display: inline-flex; align-items: center; gap: .35rem; margin: 2px 8px 2px 0; text-decoration: none !important; color: var(--bs-body-color); font-size: .85rem; }
.nr-dev-chip .nr-device-icon { width: 22px; height: 22px; font-size: .7rem; border-radius: 5px; }

/* Wi-Fi */
.nr-key { display: inline-block; width: 9px; height: 9px; border-radius: 2px; vertical-align: middle; }

/* Tryb edycji */
.nr-edit-banner { background: #f0ad4e; color: #3b2a07; font-size: .85rem; padding: .3rem 0; }
[data-bs-theme="dark"] .nr-edit-banner { background: #8a5a12; color: #fff3df; }
.nr-tabs .nav-link.nr-edit-tab { color: #b06d00; }
[data-bs-theme="dark"] .nr-tabs .nav-link.nr-edit-tab { color: #f0ad4e; }

/* Ikony urządzeń */
.nr-device-icon-img { background: transparent !important; overflow: hidden; }
.nr-device-icon-img img { width: 100%; height: 100%; object-fit: contain; }
.nr-vendor-external { background: #adb5bd; }
.nr-icon-grid { display: flex; flex-wrap: wrap; gap: .35rem; }
.nr-icon-grid .btn { width: 38px; height: 38px; padding: 0; font-size: 1.1rem; }
.nr-icon-grid .btn.nr-icon-pick-img { width: 46px; height: 46px; padding: 3px; }
.nr-icon-grid .btn.nr-icon-pick-img img { width: 100%; height: 100%; }
.nr-icon-option { cursor: pointer; }
.nr-icon-option input { display: none; }
.nr-icon-option img { width: 40px; height: 40px; object-fit: contain; border: 2px solid var(--nr-border); border-radius: 6px; padding: 2px; background: var(--bs-body-bg); }
.nr-icon-option input:checked + img { border-color: var(--bs-primary); box-shadow: 0 0 0 2px rgba(13, 110, 253, .25); }
.nr-icon-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
.nr-icon-tile { border: 1px solid var(--nr-border); border-radius: 4px; padding: .5rem; text-align: center; }
.nr-icon-tile img { width: 56px; height: 56px; object-fit: contain; margin-bottom: .25rem; }

/* Wybór relacji połączenia */
.nr-relation { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.nr-relation .btn { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .45rem .3rem; line-height: 1.15; }
.nr-relation .btn .bi { font-size: 1.3rem; }
.nr-relation .btn span { font-weight: 600; font-size: .85rem; }
.nr-relation .btn small { font-size: .7rem; opacity: .8; }

/* Mapa sieci */
.nr-topo-stage { position: relative; height: calc(100vh - 250px); min-height: 480px; }
.nr-topo-card:fullscreen { display: flex; flex-direction: column; background: var(--nr-page-bg); }
.nr-topo-card:fullscreen .nr-topo-stage { flex: 1; height: auto; }
.nr-topo-wrap { position: absolute; inset: 0; overflow: hidden; touch-action: none;
  background: radial-gradient(circle, var(--nr-border) 1px, transparent 1px) 0 0 / 18px 18px; }
.nr-topo { display: block; width: 100%; height: 100%; cursor: grab; user-select: none; -webkit-user-select: none; }
.nr-topo.nr-topo-panning { cursor: grabbing; }
.nr-topo.nr-topo-dragging-node, .nr-topo.nr-topo-dragging-node * { cursor: move !important; }
.nr-topo-bar { position: absolute; top: .5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .3rem .55rem;
  background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent); border: 1px solid var(--nr-border); border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08); font-size: .85rem; z-index: 2; }
.nr-topo-bar-left { left: .5rem; }
.nr-topo-bar-right { right: .5rem; }
.nr-topo-hint { position: absolute; left: .75rem; bottom: .4rem; pointer-events: none; opacity: .8; }
.nr-topo-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--nr-up); animation: nr-pulse 2s infinite; }
@keyframes nr-pulse { 50% { opacity: .3; } }

.nr-topo-edge { fill: none; stroke-width: 2.5; stroke-linecap: round; transition: stroke .6s, stroke-width .6s; }
.nr-topo-edge.nr-edge-up { stroke: var(--nr-up); }
.nr-topo-edge.nr-edge-down { stroke: var(--nr-down); stroke-dasharray: 6 4; }
.nr-topo-edge.nr-edge-unknown { stroke: var(--nr-unknown); }
.nr-topo-edge.nr-topo-dashed { stroke-dasharray: 2 7; }
.nr-topo-edge.nr-topo-peer { opacity: .85; }
.nr-topo-edge.nr-topo-extra { stroke-width: 1.5px; stroke-dasharray: 3 4; opacity: .7; }
.nr-topo-flow { fill: none; stroke: rgba(255, 255, 255, .9); stroke-linecap: round; stroke-dasharray: 1 20;
  animation: nr-flow 1.5s linear infinite; pointer-events: none; opacity: .8; }
@keyframes nr-flow { from { stroke-dashoffset: 42; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .nr-topo-flow { animation: none; } }
.nr-topo-hit { fill: none; stroke: transparent; stroke-width: 16; cursor: pointer; }
.nr-topo-section { font-size: 13px; font-weight: 600; fill: var(--bs-secondary-color); }
.nr-topo-no-orphans .nr-topo-orphan { display: none; }
.nr-topo-tip { position: absolute; z-index: 3; max-width: 340px; padding: .5rem .65rem; font-size: .8rem; pointer-events: none;
  background: var(--bs-body-bg); border: 1px solid var(--nr-border); border-radius: 6px; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }
.nr-util-scale i { display: inline-block; width: 14px; height: 6px; border-radius: 2px; margin: 0 .2rem 0 .5rem; vertical-align: middle; }
.nr-topo-node { display: flex; align-items: center; gap: .5rem; height: 100%; padding: .35rem .5rem; background: var(--bs-body-bg);
  border: 1px solid var(--nr-border); border-left: 5px solid var(--nr-unknown); border-radius: 6px; color: var(--bs-body-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08); text-decoration: none !important; overflow: hidden; transition: background .4s; }
.nr-topo-node img { pointer-events: none; -webkit-user-drag: none; }
a.nr-topo-node:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.nr-topo-node.nr-topo-up { border-left-color: var(--nr-up); }
.nr-topo-node.nr-topo-down { border-left-color: var(--nr-down); background: rgba(217, 83, 79, .12); }
.nr-topo-node.nr-topo-disabled { border-left-color: var(--nr-disabled); opacity: .7; }
.nr-topo-node.nr-topo-external { border-style: dashed; border-left-style: solid; border-left-color: var(--nr-disabled); }
.nr-topo-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.nr-topo-label { font-weight: 600; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-topo-sub { font-size: .7rem; color: var(--bs-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-legend { display: inline-block; width: 22px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: .25rem; }
.nr-legend.nr-edge-up { border-color: var(--nr-up); }
.nr-legend.nr-edge-down { border-color: var(--nr-down); border-top-style: dashed; }
.nr-legend.nr-edge-unknown { border-color: var(--nr-unknown); }
.nr-legend.nr-legend-peer { border-color: var(--nr-up); border-top-style: dashed; opacity: .85; }
.nr-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--nr-unknown); }
.nr-dot-up { background: var(--nr-up); }
.nr-dot-down { background: var(--nr-down); }
.nr-dot-disabled, .nr-dot-external { background: var(--nr-disabled); }
.nr-tree-list, .nr-tree-list ul { list-style: none; padding-left: 1.6rem; margin: 0; }
.nr-tree-list { padding-left: 0; }
.nr-tree-list ul { border-left: 1px dashed var(--nr-border); margin-left: .6rem; }
.nr-tl-node { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .3rem 0; }
.nr-tl-icon .nr-device-icon { width: 24px; height: 24px; font-size: .8rem; border-radius: 4px; }
.nr-tl-edge { font-size: .75rem; border: 1px solid var(--nr-border); border-radius: 10px; padding: 0 .45rem; color: var(--bs-secondary-color); }
.nr-tl-edge.nr-edge-up { border-color: var(--nr-up); }
.nr-tl-edge.nr-edge-down { border-color: var(--nr-down); color: var(--nr-down); }

/* Logowanie */
.nr-login { max-width: 380px; margin: 8vh auto 0; }

/* HTMX */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }

.nr-footer { border-top: 1px solid var(--nr-border); }
.nr-topo-uplink { display: flex; gap: .3rem; align-items: baseline; font-size: .68rem; white-space: nowrap; overflow: hidden; margin-top: 1px; }
.nr-topo-uport { padding: 0 .3rem; border-radius: 3px; background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); }
.nr-topo-rate { font-variant-numeric: tabular-nums; }
.nr-topo-speed { font-weight: 600; }
.nr-topo-no-traffic .nr-topo-rate, .nr-topo-no-ports .nr-topo-uport { display: none; }
.nr-topo-trunk { fill: none; stroke: var(--bs-secondary-color); stroke-width: 1.6; opacity: .55; stroke-linecap: round; }
.nr-topo-hl { fill: none; stroke: var(--bs-primary); stroke-width: 7; opacity: 0; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.nr-topo-link.nr-topo-hover .nr-topo-hl { opacity: .28; }
.nr-ev-link { color: inherit; text-decoration: none; } .nr-ev-link:hover { color: var(--bs-link-hover-color); text-decoration: underline; }
.nr-spark-pop { position: fixed; z-index: 1080; width: 340px; padding: .45rem .6rem .4rem; font-size: .78rem; background: var(--bs-body-bg);
  border: 1px solid var(--nr-border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); pointer-events: none; }
.nr-spark-head { display: flex; gap: .4rem; align-items: baseline; margin-bottom: .2rem; white-space: nowrap; overflow: hidden; }
.nr-spark-foot { display: flex; justify-content: space-between; gap: .5rem; margin-top: .2rem; white-space: nowrap; }
[data-port-spark] { cursor: help; }
.nr-tile-of { font-size: 1rem; font-weight: 500; color: var(--bs-secondary-color); margin-left: .25rem; }
.nr-avail-body { max-height: 340px; overflow: auto; padding: .6rem .75rem; }
.nr-avail-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; color: var(--bs-secondary-color); margin: .35rem 0 .25rem; }
.nr-avail-group:first-child { margin-top: 0; }
.nr-avail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 4px; }
.nr-avail { display: block; padding: .28rem .45rem; font-size: .74rem; font-weight: 600; color: #fff !important; text-decoration: none !important;
  border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--nr-unknown); }
.nr-avail:hover { filter: brightness(1.1); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.nr-avail-up { background: #2f9e44; }
.nr-avail-down { background: var(--nr-down); animation: nr-pulse 2s infinite; }
.nr-avail-disabled { background: var(--nr-disabled); }
.nr-avail-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; vertical-align: baseline; }
.nr-step { display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--bs-primary); color: #fff; font-size: .78rem; font-weight: 700; margin-right: .3rem; }
.nr-kind-pick .btn { white-space: normal; line-height: 1.25; }
.nr-picker-list { max-height: 260px; overflow: auto; border: 1px solid var(--nr-border); border-radius: 6px; padding: .25rem .4rem; }
.nr-picker-group { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--bs-secondary-color); margin: .35rem 0 .1rem; }
.nr-picker-item { display: flex; align-items: center; gap: .4rem; padding: .12rem .2rem; border-radius: 4px; cursor: pointer; font-size: .85rem; }
.nr-picker-item:hover { background: var(--bs-tertiary-bg); }
.nr-sticky { position: sticky; top: 70px; }
.nr-preview-list { max-height: calc(100vh - 260px); overflow: auto; }
.nr-mail-head { font-size: .82rem; padding: .4rem .6rem; border: 1px solid var(--nr-border); border-radius: 6px; background: var(--bs-tertiary-bg); }
.nr-mail-frame { width: 100%; height: 640px; border: 1px solid var(--nr-border); border-radius: 6px; background: #eef0f3; }
.nr-phone { background: linear-gradient(160deg, #3b4252, #1f2430); border-radius: 0 0 8px 8px; }
.nr-push { background: rgba(255, 255, 255, .95); color: #1f2328; border-radius: 14px; padding: .6rem .8rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.nr-phone .text-body-secondary { color: #c9d1d9 !important; }
.nr-push .text-body-secondary { color: #6b7280 !important; }
.nr-push-tags { font-size: .7rem; font-weight: 400; color: #6b7280; }
.nr-chat { background: linear-gradient(180deg, #a7c4d6, #8db0c6); border-radius: 0 0 8px 8px; }
.nr-bubble { display: inline-block; max-width: 100%; background: #fff; color: #1f2328; padding: .5rem .7rem; border-radius: 12px 12px 12px 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2); font-size: .88rem; }
.nr-chat .text-body-secondary { color: #1f3b4d !important; }
.nr-vars-group { font-size: .7rem; font-weight: 600; text-transform: uppercase; color: var(--bs-secondary-color); margin: .5rem 0 .2rem; }
.nr-tpl { font-size: .8rem; line-height: 1.4; tab-size: 2; }
.nr-pv-scroll { max-height: calc(100vh - 170px); overflow: auto; }
.nr-pv-stack { display: flex; flex-direction: column; gap: .75rem; max-height: calc(100vh - 85px); }
.nr-pv-card { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.nr-pv-card .nr-pv-scroll { max-height: none; flex: 1 1 auto; min-height: 0; }
.nr-fields-card { flex: 0 0 auto; }
.nr-fields-scroll { max-height: 30vh; overflow: auto; }
@media (max-width: 1199.98px) { .nr-pv-stack { position: static; max-height: none; } .nr-fields-scroll { max-height: none; } }
.nr-pv-body { padding: .75rem; }
.nr-pv-sample { margin-bottom: .6rem; }
.nr-pv-mock { padding: .8rem; border-radius: 8px; margin-bottom: .75rem; }
.nr-pv-field { border: 1px solid var(--nr-border); border-radius: 6px; padding: .45rem .6rem; margin-bottom: .6rem; transition: border-color .2s, box-shadow .2s; }
.nr-pv-label { display: flex; justify-content: space-between; align-items: center; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .3px; color: var(--bs-secondary-color); margin-bottom: .3rem; }
.nr-pv-out { margin: 0; font-size: .82rem; white-space: pre-wrap; word-break: break-word; background: var(--bs-tertiary-bg);
  border-radius: 4px; padding: .4rem .5rem; font-family: var(--bs-font-monospace); }
.nr-pv-line { font-family: inherit; font-weight: 600; }
.nr-pv-field.nr-active, .nr-tpl-field.nr-active { border-color: var(--bs-primary); box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15); }
.nr-tpl-field { border: 1px solid transparent; border-radius: 6px; padding: .35rem .45rem; margin-left: -.45rem; margin-right: -.45rem; transition: border-color .2s, box-shadow .2s; }
.nr-howto { background: var(--bs-tertiary-bg); border-left: 3px solid var(--bs-primary); border-radius: 4px; padding: .5rem .7rem; }
.nr-version-head { background: var(--bs-tertiary-bg); border-radius: 6px; padding: .6rem .7rem; margin-bottom: .8rem; }
.nr-vars-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px; }
.nr-var { display: flex; flex-direction: column; align-items: flex-start; text-align: left; border: 1px solid var(--nr-border);
  background: var(--bs-body-bg); border-radius: 5px; padding: .25rem .45rem; font-size: .75rem; line-height: 1.25; cursor: pointer; }
.nr-var:hover { border-color: var(--bs-primary); background: var(--bs-tertiary-bg); }
.nr-var code { font-size: .78rem; }
.nr-var-desc { color: var(--bs-secondary-color); }
.nr-var-val { font-weight: 600; word-break: break-word; }
.nr-var-empty .nr-var-val { font-weight: 400; color: var(--bs-secondary-color); font-style: italic; }
.nr-sev-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: .2rem; vertical-align: middle; }
.nr-sev-warning { background: var(--nr-warn); }
.nr-sev-critical { background: var(--nr-down); }
.nr-chip-icon { display: inline-flex; align-items: center; gap: .35rem; }
.nr-api-badge { display: inline-block; font-size: .62rem; font-weight: 700; letter-spacing: .03em; line-height: 1; padding: .2em .4em;
  border-radius: 4px; color: #6f42c1; background: rgba(111, 66, 193, .12); border: 1px solid rgba(111, 66, 193, .35); vertical-align: middle; }
.nr-api-badge-err { color: var(--bs-danger); background: rgba(220, 53, 69, .1); border-color: rgba(220, 53, 69, .4); }
[data-bs-theme="dark"] .nr-api-badge { color: #c29ffa; background: rgba(194, 159, 250, .12); border-color: rgba(194, 159, 250, .35); }
.nr-scroll-table thead th { position: sticky; top: 0; z-index: 1; background: var(--bs-body-bg); }
.nr-mini-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.nr-mini-stat { display: flex; flex-direction: column; padding: .3rem .5rem; border: 1px solid var(--nr-border); border-radius: 6px;
  color: inherit; text-decoration: none; font-size: .78rem; line-height: 1.25; }
.nr-mini-stat:hover { background: var(--bs-tertiary-bg); }
.nr-mini-stat span { color: var(--bs-secondary-color); }
.nr-mini-stat b { font-size: .95rem; }
