/* JAVIS NETWORK INTELLIGENCE V0.2 – NEXUS-Redesign.
   Palette: #020a12 Hintergrund · #071a29 Panel · #0b2435 Panel erhöht · #00e5ff Cyan · #009dff Blau · #a855f7 Violett
   · #00e68a Grün · #ffb020 Warnung · #ff5263 Fehler · #eafbff Text */
.net-view {
  --nb-bg: #020a12; --nb-panel: #071a29; --nb-raise: #0b2435; --nb-cyan: #00e5ff; --nb-blue: #009dff; --nb-violet: #a855f7;
  --nb-ok: #00e68a; --nb-warn: #ffb020; --nb-bad: #ff5263; --nb-text: #eafbff; --nb-muted: #8db4c6; --nb-line: rgba(0, 229, 255, .22);
  position: fixed; z-index: 100; top: var(--net-top, 64px); left: var(--net-left, 14px); right: 14px; bottom: calc(var(--net-bottom, 0px) + 10px);
  overflow: auto; overscroll-behavior: contain; padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 12px;
  background: radial-gradient(1100px 600px at 70% -10%, rgba(0, 157, 255, .12), transparent 60%), var(--nb-bg);
  border: 1px solid var(--nb-line); border-radius: 14px; color: var(--nb-text);
}
.net-view .panel, .net-view .net-card { background: linear-gradient(180deg, rgba(11, 36, 53, .78), rgba(7, 26, 41, .86)); border: 1px solid var(--nb-line); border-radius: 12px; box-shadow: 0 0 0 1px rgba(0, 229, 255, .04), 0 8px 24px rgba(0, 0, 0, .35); }
.net-view .muted { color: var(--nb-muted); }
.net-sec { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ---- Kopf ---- */
.net-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.net-logo { width: 44px; height: 44px; flex: none; fill: none; stroke: var(--nb-cyan); stroke-width: 3; stroke-linecap: round; }
.net-logo circle { fill: var(--nb-cyan); stroke: none; }
.net-title-block { flex: 1 1 280px; min-width: 0; }
.net-head h2 { margin: 0; font-size: 24px; letter-spacing: 1.5px; font-weight: 700; }
.net-sub { margin: 2px 0 0; color: var(--nb-muted); }
.net-router { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--nb-line); border-radius: 12px; background: rgba(7, 26, 41, .8); flex-wrap: wrap; }
.net-router > svg { width: 52px; height: 34px; flex: none; fill: none; stroke: var(--nb-text); stroke-width: 2; stroke-linecap: round; }
.net-router strong { display: block; font-size: 15px; }
.net-router span { color: var(--nb-muted); font-size: 13px; }
.net-router-state { display: grid; gap: 4px; justify-items: start; }
.net-router-state small { color: var(--nb-muted); font-size: 12px; }
.net-badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; border: 1px solid var(--nb-line); color: var(--nb-muted); }
.net-badge[data-state="online"] { color: var(--nb-ok); border-color: rgba(0, 230, 138, .6); background: rgba(0, 230, 138, .08); }
.net-badge[data-state="offline"] { color: var(--nb-bad); border-color: rgba(255, 82, 99, .6); }
.net-iconbtn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--nb-line); background: rgba(0, 229, 255, .08); color: var(--nb-cyan); cursor: pointer; }
.net-iconbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.net-iconbtn:hover { background: rgba(0, 229, 255, .18); }
.net-head .btn { flex: none; min-height: 44px; padding: 8px 16px; }

/* ---- Collector-Chips / Sync ---- */
.net-collectors { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.net-collectors .svc { min-width: 0; }
.net-collectors .svc[data-state="online"] { --c: var(--nb-ok); }
.net-collectors .svc[data-state="unconfigured"] { --c: var(--nb-warn); }
.net-sync { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 8px 14px; border: 1px solid var(--nb-line); border-radius: 10px; background: rgba(7, 26, 41, .7); min-height: 44px; }
#net-sync-text { flex: 1 1 220px; min-width: 0; }
.net-sync-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--nb-muted); flex: none; }
.net-sync[data-state="ok"] .net-sync-dot { background: var(--nb-ok); box-shadow: 0 0 8px var(--nb-ok); }
.net-sync[data-state="loading"] .net-sync-dot { background: var(--nb-cyan); animation: net-pulse 1.1s ease-in-out infinite; }
.net-sync[data-state="stale"] .net-sync-dot, .net-sync[data-state="unconfigured"] .net-sync-dot { background: var(--nb-warn); }
.net-sync[data-state="error"] .net-sync-dot, .net-sync[data-state="auth"] .net-sync-dot, .net-sync[data-state="unreachable"] .net-sync-dot { background: var(--nb-bad); }
.net-sync[data-state="stale"] { border-color: rgba(255, 176, 32, .5); }
.net-sync[data-state="error"], .net-sync[data-state="auth"], .net-sync[data-state="unreachable"] { border-color: rgba(255, 82, 99, .5); }
.net-sync progress { flex: 1 1 160px; max-width: 320px; height: 8px; accent-color: var(--nb-cyan); }
.net-sync .btn { flex: none; min-height: 44px; }
.net-notice { margin: 0; padding: 10px 14px; border: 1px solid var(--nb-warn); border-radius: 10px; background: rgba(60, 40, 0, .5); color: #ffe9b0; }
@keyframes net-pulse { 50% { opacity: .35; } }

/* ---- Tabs ---- */
.net-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--nb-line); }
.net-tabs [role=tab] { min-height: 44px; padding: 8px 18px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--nb-muted); font: inherit; cursor: pointer; }
.net-tabs [role=tab][aria-selected="true"] { color: var(--nb-cyan); border-bottom-color: var(--nb-cyan); text-shadow: 0 0 10px rgba(0, 229, 255, .4); }

/* ---- Statistik ---- */
.net-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.net-stat { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--nb-line); border-radius: 12px; background: linear-gradient(180deg, #0b2435, #071a29); }
.net-stat > svg { width: 44px; height: 44px; flex: none; padding: 9px; border-radius: 12px; fill: none; stroke: var(--nb-cyan); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; background: rgba(0, 229, 255, .1); }
.net-stat.ok > svg { stroke: var(--nb-ok); background: rgba(0, 230, 138, .1); }
.net-stat.violet > svg { stroke: var(--nb-violet); background: rgba(168, 85, 247, .12); }
.net-stat strong { display: block; font-size: 34px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.net-stat span { color: var(--nb-muted); font-size: 13px; }
.net-stats[data-load="loading"] strong { color: transparent; position: relative; min-width: 3ch; display: inline-block; border-radius: 6px; background: linear-gradient(90deg, rgba(0, 229, 255, .08), rgba(0, 229, 255, .25), rgba(0, 229, 255, .08)); background-size: 200% 100%; animation: net-shimmer 1.4s linear infinite; }
.net-stats[data-load="stale"] { opacity: .75; }
@keyframes net-shimmer { to { background-position: -200% 0; } }

/* ---- Raster ---- */
.net-grid { display: grid; grid-template-columns: minmax(0, 13fr) minmax(0, 7fr); gap: 12px; align-items: start; }
.net-bottom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.net-card { padding: 16px; display: grid; gap: 10px; min-width: 0; }
.net-card h3 { margin: 0; font-size: 17px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.net-card h3 small, .net-card .muted { font-size: 12px; font-weight: 400; }
.net-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.net-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.net-toolbar h3 { flex: 1 1 200px; }
.net-view input[type=search], .net-view select { min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--nb-line); background: rgba(2, 10, 18, .8); color: var(--nb-text); font: inherit; }
.net-view input[type=search] { flex: 1 1 200px; min-width: 0; }
.net-view select:disabled { opacity: .5; }

/* ---- Tabelle ---- */
.net-table-wrap { position: relative; max-height: 52vh; overflow: auto; border: 1px solid var(--nb-line); border-radius: 10px; }
.net-table-wrap table { width: 100%; border-collapse: collapse; }
.net-table-wrap th { position: sticky; top: 0; z-index: 1; text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 600; letter-spacing: .5px; color: var(--nb-muted); background: #0a2233; }
.net-table-wrap td { padding: 9px 12px; border-top: 1px solid rgba(0, 229, 255, .08); overflow-wrap: anywhere; vertical-align: middle; }
.net-table-wrap td.m { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; }
.net-table-wrap td.na, .net-table-wrap .nm.na, .net-table-wrap td.na .cn { color: var(--nb-muted); }
.net-table-wrap tbody tr { cursor: pointer; }
.net-table-wrap tbody tr:hover { background: rgba(0, 229, 255, .06); }
.net-table-wrap tbody tr.sel { background: rgba(0, 157, 255, .2); box-shadow: inset 3px 0 0 var(--nb-cyan); }
.net-table-wrap tbody tr:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--nb-cyan); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--nb-muted); }
.dot[data-state="ok"] { background: var(--nb-ok); box-shadow: 0 0 6px var(--nb-ok); }
.dot[data-state="off"] { background: #6b8493; }
.dot[data-state="unknown"] { background: var(--nb-warn); }
.cico { width: 18px; height: 18px; margin-right: 8px; vertical-align: -4px; fill: none; stroke: var(--nb-cyan); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.net-empty { padding: 28px 12px; text-align: center; margin: 0; }
#net-more { min-height: 44px; justify-self: start; flex: none; }
#net-devices-err:empty { display: none; }
.net-spinner { display: none; position: absolute; inset: 0; z-index: 2; background: rgba(2, 10, 18, .6); }
.net-spinner::after { content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px; border-radius: 50%; border: 3px solid rgba(0, 229, 255, .25); border-top-color: var(--nb-cyan); animation: net-spin .9s linear infinite; }
.net-table-wrap.loading .net-spinner { display: block; }
@keyframes net-spin { to { transform: rotate(360deg); } }

/* ---- WAN ---- */
.net-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.net-seg { display: inline-flex; border: 1px solid var(--nb-line); border-radius: 10px; overflow: hidden; }
.net-seg button { min-height: 44px; padding: 6px 14px; border: 0; background: none; color: var(--nb-muted); font: inherit; cursor: pointer; }
.net-seg button[aria-pressed="true"] { background: rgba(0, 229, 255, .18); color: var(--nb-cyan); }
.net-seg button:disabled { opacity: .4; cursor: not-allowed; }
.net-rates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.net-rates > div { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--nb-line); display: grid; gap: 2px; background: rgba(2, 10, 18, .4); }
.net-rates span { font-size: 12px; color: var(--nb-muted); }
.net-rates strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.net-rates .down strong { color: var(--nb-cyan); }
.net-rates .up strong { color: var(--nb-violet); }
.net-chart-wrap { position: relative; min-height: 120px; }
.net-chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.net-chart .grid { stroke: rgba(0, 229, 255, .12); stroke-width: 1; }
.net-chart text { stroke: none; font-weight: 400; }
.net-chart .ax { fill: var(--nb-muted); font-size: 11px; }
.net-chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; }
.net-chart .ln.down { stroke: var(--nb-cyan); }
.net-chart .ln.up { stroke: var(--nb-violet); }
.net-chart .area { stroke: none; }
.net-chart .area.down { fill: rgba(0, 229, 255, .14); }
.net-chart .area.up { fill: rgba(168, 85, 247, .14); }
.net-chart .cursor { stroke: rgba(234, 251, 255, .35); stroke-width: 1; stroke-dasharray: 3 3; }
.net-chart .dot { stroke: var(--nb-bg); stroke-width: 1.5; margin: 0; }
.net-chart .dot.down { fill: var(--nb-cyan); }
.net-chart .dot.up { fill: var(--nb-violet); }
.net-tip { position: absolute; top: 4px; z-index: 3; display: grid; gap: 2px; padding: 6px 10px; border-radius: 8px; font-size: 12px; pointer-events: none; background: rgba(2, 10, 18, .94); border: 1px solid var(--nb-line); white-space: nowrap; }
.net-tip .down { color: var(--nb-cyan); } .net-tip .up { color: var(--nb-violet); }
.net-wan-empty { margin: 0; padding: 40px 0; text-align: center; font-size: 15px; }
.net-legend { margin: 0; font-size: 12px; color: var(--nb-muted); display: flex; gap: 6px; align-items: center; }
.net-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; margin-left: 8px; }
.net-legend i:first-child { margin-left: 0; }
.net-legend i.down { background: var(--nb-cyan); } .net-legend i.up { background: var(--nb-violet); }
#net-wan-note:empty { display: none; }
.net-totals, #net-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.net-totals dt, #net-detail dt { color: var(--nb-muted); }
.net-totals dd, #net-detail dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#net-detail h4 { margin: 0 0 8px; font-size: 16px; color: var(--nb-cyan); }
#net-detail p { margin: 0; }
.net-conn { display: grid; gap: 10px; }
.conn-row { display: grid; grid-template-columns: 90px auto 1fr; gap: 10px; align-items: center; }
.conn-row b { font-variant-numeric: tabular-nums; }
.conn-row .track { height: 8px; border-radius: 4px; background: rgba(0, 229, 255, .1); overflow: hidden; }
.conn-row .bar { display: block; height: 100%; background: linear-gradient(90deg, var(--nb-blue), var(--nb-cyan)); transition: width .4s ease; }

/* ---- Global Network Map ---- */
.net-mapgrid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 12px; align-items: start; }
.net-mapside { display: grid; gap: 12px; }
.net-map-frame { position: relative; height: clamp(360px, 56vh, 640px); border-radius: 10px; overflow: hidden; border: 1px solid var(--nb-line); background: #020a12; }
.net-worldmap { position: absolute; inset: 0; }
.net-layers { position: absolute; left: 10px; top: 10px; z-index: 2; margin: 0; padding: 8px 10px; border: 1px solid var(--nb-line); border-radius: 10px; background: rgba(2, 10, 18, .85); display: grid; gap: 2px; font-size: 13px; }
.net-layers legend { padding: 0 4px; color: var(--nb-muted); font-size: 12px; }
.net-layers label, .net-check { display: flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; }
.net-check { min-height: 44px; font-size: 13px; color: var(--nb-muted); }
.net-layers input, .net-check input { width: 18px; height: 18px; accent-color: var(--nb-cyan); }
.net-legend-box { position: absolute; left: 10px; bottom: 10px; z-index: 2; margin: 0; padding: 8px 12px; list-style: none; display: grid; gap: 4px; font-size: 12px; border: 1px solid var(--nb-line); border-radius: 10px; background: rgba(2, 10, 18, .85); }
.net-legend-box i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.c-active { background: #00e5ff; } .c-high { background: #a855f7; } .c-cdn { background: #59b8ff; } .c-risk { background: #ff5263; }
.net-map-banner, .net-banner-top, .net-map-status { position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); padding: 10px 18px; border-radius: 10px; text-align: center; max-width: 90%; }
.net-map-banner { top: 50%; transform: translate(-50%, -50%); font-size: 16px; background: rgba(2, 10, 18, .88); border: 1px solid var(--nb-line); }
.net-banner-top { top: 10px; background: rgba(60, 40, 0, .9); border: 1px solid var(--nb-warn); color: #ffe9b0; font-weight: 600; }
.net-map-status { bottom: 10px; background: rgba(60, 6, 14, .85); border: 1px solid var(--nb-bad); font-size: 13px; }
.net-flowlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.net-filters { display: grid; gap: 8px; }

.net-view button:focus-visible, .net-view input:focus-visible, .net-view select:focus-visible { outline: none; box-shadow: var(--focus); }

@media (max-width: 1100px) {
  .net-grid, .net-mapgrid { grid-template-columns: minmax(0, 1fr); }
  .net-bottom { grid-template-columns: minmax(0, 1fr); }
  .net-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .net-router { width: 100%; }
}
@media (max-width: 700px) {
  .net-view { padding: 12px 12px 20px; }
  .net-head h2 { font-size: 18px; letter-spacing: 1px; }
  .net-logo { width: 34px; height: 34px; }
  .net-stat { padding: 10px; gap: 10px; }
  .net-stat > svg { width: 36px; height: 36px; padding: 7px; }
  .net-stat strong { font-size: 28px; }
  .net-table-wrap { max-height: none; overflow: visible; border: none; }
  .net-table-wrap thead { display: none; }
  .net-table-wrap table, .net-table-wrap tbody, .net-table-wrap tr, .net-table-wrap td { display: block; width: 100%; }
  .net-table-wrap tbody tr { margin-bottom: 8px; padding: 6px 4px; border: 1px solid var(--nb-line); border-radius: 10px; min-height: 44px; }
  .net-table-wrap td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 4px 10px; text-align: right; }
  .net-table-wrap td::before { content: attr(data-label); color: var(--nb-muted); text-align: left; flex: none; }
  .net-table-wrap td.n { font-weight: 600; }
  .net-rates strong { font-size: 18px; }
  .net-map-frame { height: 56vh; }
  .net-layers { padding: 6px 8px; }
  .net-layers label { min-height: 44px; }
  .net-legend-box { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .net-spinner::after, .net-sync[data-state="loading"] .net-sync-dot, .net-stats[data-load="loading"] strong { animation: none; }
  .conn-row .bar { transition: none; }
}

/* =====================================================================================================================
   V0.3 – Layout ohne verschachtelte Scrollbereiche, Statistik-Details, Global Connection Center, Import-Dialog
   ===================================================================================================================== */
.sidebar { overflow-x: hidden; }                       /* kein horizontaler Scrollbalken in der Seitenleiste */
body.net-open .statbar { display: none; }              /* Die globale Fußleiste zeigt JAVIS-Tracker-Geräte – nicht mit FRITZ!Box-Geräten verwechseln */
.net-view { overflow-x: hidden; }

.net-strip { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px 12px; }
.net-strip .net-collectors { flex: 0 1 auto; }
.net-strip .net-sync { flex: 1 1 320px; margin: 0; }
.net-sec { min-width: 0; }
.net-scroll { overflow: auto; min-height: 0; }

.net-stat > div { display: grid; gap: 1px; min-width: 0; flex: 1; }
.net-stat .stat-time { color: var(--nb-muted); font-size: 11px; }
.distbar { display: block; height: 4px; border-radius: 2px; background: rgba(107, 132, 147, .45); overflow: hidden; margin-top: 4px; }
.distbar b { display: block; height: 100%; width: 0; background: var(--nb-ok); transition: width .5s ease; }
.net-stats[data-load="ok"] .net-stat.ok > svg { animation: net-glow 3.2s ease-in-out infinite; }
@keyframes net-glow { 50% { box-shadow: 0 0 14px rgba(0, 230, 138, .45); } }

.net-mode { display: inline-block; margin-left: 10px; padding: 3px 12px; font-size: 12px; font-weight: 600; letter-spacing: 0; border-radius: 999px; border: 1px solid var(--nb-line); color: var(--nb-muted); }
.net-mode[data-mode="imported"] { color: var(--nb-warn); border-color: rgba(255, 176, 32, .6); background: rgba(255, 176, 32, .08); }
.net-mode[data-mode="live"] { color: var(--nb-ok); border-color: rgba(0, 230, 138, .6); }
.net-actions-col { display: flex; flex-wrap: wrap; gap: 8px; }
.net-actions-col .btn { flex: 1 1 auto; min-height: 44px; }
.net-maptools { display: flex; gap: 12px; align-items: center; }
.c-hist { background: #6b8493; }
.net-flow-wrap { max-height: none; }
.net-flow-wrap tr[data-cls="high"] td:first-child { box-shadow: inset 3px 0 0 var(--nb-violet); }
.net-flow-wrap tr[data-cls="hist"] td:first-child { box-shadow: inset 3px 0 0 #6b8493; }
.net-flow-wrap tr[data-cls="obs"] td:first-child { box-shadow: inset 3px 0 0 var(--nb-cyan); }
.net-activity-chart { width: 100%; height: 80px; display: block; }
.net-activity-chart .ln { vector-effect: non-scaling-stroke; }
.net-center .net-card h3 small { font-weight: 400; }

/* Import-Dialog */
.net-modal { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(2, 10, 18, .78); }
.net-modal-box { width: min(640px, 100%); max-height: 100%; overflow: auto; display: grid; gap: 10px; padding: 18px; border-radius: 14px; border: 1px solid var(--nb-line); background: #071a29; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.net-modal-box h3 { margin: 0; }
.net-field { display: grid; gap: 4px; margin: 0; padding: 0; border: 0; min-width: 0; }
.net-field legend { padding: 0; margin-bottom: 4px; color: var(--nb-muted); }
.net-field input[type=file], .net-field input[type=text] { min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--nb-line); background: rgba(2, 10, 18, .8); color: var(--nb-text); font: inherit; }
.net-devpick { max-height: 160px; overflow: auto; display: grid; gap: 0; padding: 4px 8px; border: 1px solid var(--nb-line); border-radius: 10px; }
.net-devpick .net-check { min-height: 44px; }
.net-import-result { margin: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(0, 230, 138, .5); background: rgba(0, 230, 138, .08); }
.net-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.net-modal-actions .btn { flex: none; min-height: 44px; padding: 8px 18px; }

/* ---- Desktop: alles passt in den sichtbaren Bereich, nur die Gerätetabelle scrollt in sich ---- */
@media (min-width: 1101px) and (min-height: 760px) {
  .net-view { display: flex; flex-direction: column; overflow: hidden; gap: 10px; padding: 12px 16px 14px; }
  .net-head, .net-strip, .net-tabs, .net-notice { flex: none; }
  .net-sec:not(.hidden) { flex: 1 1 0; min-height: 0; }
  .net-overview:not(.hidden) { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; }
  .net-overview .net-grid { min-height: 0; align-items: stretch; }
  .net-overview .net-devices { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
  .net-overview .net-devices .net-table-wrap { flex: 1 1 0; min-height: 0; max-height: none; }
  .net-overview .net-wan { display: flex; flex-direction: column; min-height: 0; gap: 6px; padding: 12px 14px; overflow: hidden; }
  .net-overview .net-wan .net-card-head { gap: 6px 10px; }
  .net-overview .net-wan .net-chart-wrap { flex: 1 1 0; min-height: 90px; display: grid; }
  .net-overview .net-wan .net-chart { width: 100%; height: 100%; }
  .net-overview .net-wan .net-totals { grid-template-columns: auto 1fr auto 1fr; gap: 2px 10px; font-size: 13px; }
  .net-overview .net-wan .net-totals dd { text-align: left; }
  .net-overview .net-wan .net-rates strong { font-size: 20px; }
  .net-overview .net-bottom { height: 168px; align-items: stretch; }
  .net-overview .net-bottom .net-card { grid-template-rows: auto minmax(0, 1fr); padding: 12px 14px; gap: 6px; min-height: 0; overflow: hidden; }
  .net-overview .net-bottom .net-card h3 { font-size: 15px; }
  .net-overview #net-detail dl { grid-template-columns: auto 1fr auto 1fr; gap: 2px 12px; font-size: 13px; }
  .net-overview #net-detail dd { text-align: left; }
  .net-stat { padding: 10px 14px; }
  .net-stat strong { font-size: 30px; }

  .net-center:not(.hidden) { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: minmax(0, 1fr) clamp(150px, 24vh, 220px); gap: 10px; }
  .net-center .net-mapcard { display: flex; flex-direction: column; min-height: 0; padding: 12px 14px; }
  .net-center .net-map-frame { flex: 1 1 0; height: auto; min-height: 0; }
  .net-center .net-mapside { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; min-height: 0; }
  .net-center .net-mapside .net-card { min-height: 0; overflow: hidden; grid-template-rows: auto minmax(0, 1fr); }
  .net-center .net-mapside .net-activity { grid-template-rows: auto auto auto; }
  .net-center .net-flows { display: flex; flex-direction: column; min-height: 0; padding: 12px 14px; gap: 6px; }
  .net-center .net-flows .net-flow-wrap { flex: 1 1 0; min-height: 0; }
  .net-center .net-sources { min-height: 0; overflow: auto; padding: 12px 14px; gap: 6px; grid-template-rows: auto auto auto; align-content: start; }
  .net-center .net-sources .net-totals { font-size: 12px; gap: 2px 10px; }
}

/* ---- Niedrige Fenster: die Ansicht scrollt als Ganzes (ein einziger Scrollbereich) ---- */
@media (max-height: 759px) and (min-width: 1101px) {
  .net-view { overflow-y: auto; }
  .net-overview .net-table-wrap { max-height: 40vh; }
  .net-center:not(.hidden) { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 10px; }
  .net-center .net-map-frame { height: 60vh; }
  .net-center .net-flows { grid-column: 1; } .net-center .net-sources { grid-column: 2; }
}

@media (max-width: 1100px) {
  .net-center:not(.hidden) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .net-center .net-mapside { display: grid; gap: 12px; }
}
@media (max-width: 700px) {
  .net-collectors .svc { flex: 1 1 140px; }
  .net-modal { padding: 8px; }
  .net-flow-wrap { overflow: visible; border: none; }
  .net-flow-wrap thead { display: none; }
  .net-flow-wrap table, .net-flow-wrap tbody, .net-flow-wrap tr, .net-flow-wrap td { display: block; width: 100%; }
  .net-flow-wrap tbody tr { margin-bottom: 8px; padding: 6px 4px; border: 1px solid var(--nb-line); border-radius: 10px; min-height: 44px; }
  .net-flow-wrap td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 4px 10px; text-align: right; }
  .net-flow-wrap td::before { content: attr(data-label); color: var(--nb-muted); text-align: left; flex: none; }
  .net-maptools .net-check { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .net-stats[data-load="ok"] .net-stat.ok > svg, .distbar b { animation: none; transition: none; }
}

/* V0.3 Feinschliff: kompakte Desktop-Darstellung */
@media (min-width: 1101px) and (min-height: 760px) {
  .net-overview .net-wan .net-controls { gap: 6px; }
  .net-overview .net-wan .net-seg button { min-height: 34px; padding: 4px 12px; }
  .net-overview .net-wan .net-rates { gap: 8px; }
  .net-overview .net-wan .net-rates > div { padding: 6px 10px; }
  .net-overview .net-wan .net-rates strong { font-size: 18px; }
  .net-overview .net-wan .net-legend { margin: 0; }
  .net-overview .net-wan .net-chart-wrap { min-height: 110px; }
  .net-center:not(.hidden) { grid-template-rows: minmax(0, 1fr) clamp(190px, 25vh, 240px); }
  .net-center .net-sources .net-totals dd { text-align: right; overflow-wrap: anywhere; }
  .net-center .net-layers { padding: 4px 8px; font-size: 12px; }
  .net-center .net-layers label { min-height: 24px; }
  .net-center .net-layers legend { font-size: 11px; }
}
.net-maptools .btn { flex: none; min-height: 36px; }
@media (max-width: 1100px) { .net-maptools .btn { min-height: 44px; } }

@media (min-width: 1101px) and (min-height: 760px) {
  .net-center:not(.hidden) { grid-template-rows: minmax(0, 1fr) clamp(210px, 28vh, 270px); }
  .net-center .net-mapside .net-activity .net-activity-chart { height: 52px; }
  .net-center #net-flow-detail dl { gap: 1px 10px; font-size: 12.5px; }
}

@media (min-width: 1101px) and (min-height: 760px) {
  .net-overview #net-sysinfo { grid-template-columns: auto 1fr auto 1fr; font-size: 13px; gap: 2px 12px; }
  .net-overview #net-sysinfo dd { text-align: left; }
}

@media (max-width: 1100px) {
  .net-view { left: 0; right: 0; bottom: 0; border-radius: 0; border-left: 0; border-right: 0; }
}
@media (min-width: 1101px) and (min-height: 760px) {
  .net-center .net-mapside .net-activity .net-activity-chart { height: 40px; }
  .net-center .net-mapside .net-activity { gap: 4px; padding-top: 10px; padding-bottom: 10px; }
}