/* Einstiegsseite nw.hs-anhalt.de — Layout orientiert an gängigen NOC-/Controller-Dashboards (ohne Fremd-Branding) */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:root {
  color-scheme: light;
  --bg-page: #f2f5f7;
  --bg-sidebar: #2c2c2c;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5c5c5c;
  --text-on-dark: #e8e8e8;
  --text-on-dark-muted: #a8a8a8;
  --accent: #00a0c8;
  --accent-hover: #0088a8;
  --border: #d9dee3;
  --success: #2e8540;
  --danger: #c0392b;
  --icon-btn-hover-bg: rgba(0, 0, 0, 0.06);
  --kpi-bg-1: #e8f4f8;
  --kpi-bg-2: #dfeef3;
  --kpi-border: #c5dde6;
  --donut-track: #e0e8ec;
  --info-list-row-border: #f0f0f0;
  --placeholder-icon-opacity: 0.35;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;
  --header-height: 56px;
  /* Passwort-Button: Höhe an Topbar gekoppelt, Breite folgt Bild (gen_password.png ~1159:351) */
  --topbar-pwgen-img-h: clamp(1.45rem, calc(var(--header-height) - 14px), 2.65rem);
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --theme-switch-track: #cfd8dc;
  --theme-switch-thumb: #fff;
  --theme-switch-checked: var(--accent);
  --input-bg: #fff;
  --input-text: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #121212;
  --bg-sidebar: #000000;
  --bg-card: #1e1e1e;
  --bg-header: #1a1a1a;
  --text: #e8eaed;
  --text-muted: #9aa0a6;
  --text-on-dark: #e8eaed;
  --text-on-dark-muted: #8a9096;
  --accent: #4dc4e0;
  --accent-hover: #6dceeb;
  --border: #3c4043;
  --success: #5cad6b;
  --danger: #e57373;
  --icon-btn-hover-bg: rgba(255, 255, 255, 0.08);
  --kpi-bg-1: #1a3338;
  --kpi-bg-2: #152428;
  --kpi-border: #2a4a52;
  --donut-track: #2d3339;
  --info-list-row-border: #333;
  --placeholder-icon-opacity: 0.45;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  --theme-switch-track: #3c4043;
  --theme-switch-thumb: #e8eaed;
  --theme-switch-checked: var(--accent);
  --input-bg: #2d3339;
  --input-text: var(--text);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* —— Sidebar —— */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100vh;
  padding: 0 0 1rem;
  transition: width 0.22s ease;
  overflow-x: hidden;
  overflow-y: hidden;
}

html.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

.sidebar__top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.6rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

html.sidebar-collapsed .sidebar__top {
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.35rem 0.65rem;
  gap: 0.4rem;
}

/* Favorites (Sidebar) */
.sidebar__favs {
  padding: 0.7rem 0.75rem 0.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

html.sidebar-collapsed .sidebar__favs {
  display: none;
}

.sidebar__favs-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
}

.sidebar__favs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.sidebar__fav-tile {
  position: relative;
  display: block;
  padding: 0.5rem 0.55rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-on-dark);
  text-decoration: none;
  overflow: hidden;
}

.sidebar__fav-tile:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar__fav-tile-title {
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__fav-tile-sub {
  margin: 0.15rem 0 0;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar icons (colored) */
.sidebar__icon {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.95;
  color: #0b0b0b;
  background: rgba(255, 255, 255, 0.16);
}

.sidebar__icon--fav {
  background: #ffd54f;
}
.sidebar__icon--dash {
  background: #64b5f6;
}
.sidebar__icon--monitor {
  background: #4ddc84;
}
.sidebar__icon--admin {
  background: #ffb74d;
}
.sidebar__icon--tools {
  background: #ba68c8;
}
.sidebar__icon--config {
  background: #90a4ae;
}

/* Collapsible sections in sidebar */
.sidebar__section {
  margin: 0;
  padding: 0;
}

.sidebar__section > summary {
  list-style: none;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.sidebar__section > summary::-webkit-details-marker {
  display: none;
}

.sidebar__section-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  color: var(--text-on-dark-muted);
  font-size: 0.875rem;
  border-left: 3px solid transparent;
}

.sidebar__section-summary:hover {
  color: var(--text-on-dark);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar__section-chevron {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.7rem;
  line-height: 1;
  transform: rotate(-90deg);
  transition: transform 0.18s ease;
}

.sidebar__section[open] .sidebar__section-chevron {
  transform: rotate(0deg);
}

html.sidebar-collapsed .sidebar__section-chevron {
  display: none;
}

html.sidebar-collapsed .sidebar__section-summary {
  justify-content: center;
  padding: 0.55rem 0.35rem;
  border-left: none;
}

.sidebar__section-body {
  padding: 0 0 0.2rem;
}

.sidebar__section--nested {
  margin: 0.15rem 0 0.1rem;
}

.sidebar__section--nested > .sidebar__section-summary {
  padding: 0.35rem 0.65rem 0.35rem 1.35rem;
  font-size: 0.82rem;
}

.sidebar__section--nested .sidebar__subnav a {
  padding-left: 1.65rem;
  font-size: 0.8rem;
}

.sidebar__section--depth-0 > .sidebar__section-summary .sidebar__nav-label {
  font-weight: 650;
}

.sidebar__section--depth-1 > .sidebar__section-summary {
  padding-left: 1.15rem;
  font-size: 0.84rem;
}

.sidebar__section--depth-2 > .sidebar__section-summary {
  padding-left: 1.55rem;
  font-size: 0.8rem;
}

.sidebar__section--depth-1 .sidebar__subnav > li > a {
  padding-left: 1.35rem;
}

.sidebar__section--depth-2 .sidebar__subnav > li > a {
  padding-left: 1.75rem;
  font-size: 0.8rem;
}

.sidebar__scanner-cta {
  padding: 0.35rem 0.55rem 0.65rem;
}

.sidebar__scanner-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.72rem 0.85rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 18%, var(--sidebar-bg, #1a2332));
  color: var(--text-on-dark);
  font-weight: 650;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar__scanner-btn:hover {
  background: color-mix(in srgb, var(--accent) 28%, var(--sidebar-bg, #1a2332));
  border-color: var(--accent);
}

.sidebar__scanner-btn-icon {
  font-size: 1.15rem;
  line-height: 1;
}

html.sidebar-collapsed .sidebar__scanner-btn-label {
  display: none;
}

html.sidebar-collapsed .sidebar__scanner-cta {
  padding: 0.35rem 0.25rem 0.5rem;
}

.sidebar__icon--datasearch {
  color: #5eb8ff;
}
.sidebar__icon--user {
  background: #81c784;
}
.sidebar__icon--device {
  background: #4db6ac;
}

.sidebar__toggle {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-on-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar__toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar__toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sidebar__toggle-icon {
  display: block;
  transition: transform 0.22s ease;
}

html.sidebar-collapsed .sidebar__toggle-icon {
  transform: rotate(180deg);
}

.sidebar__logo-link {
  display: block;
  flex: 1;
  min-width: 0;
  line-height: 0;
}

html.sidebar-collapsed .sidebar__logo-link {
  flex: none;
  width: 100%;
  display: flex;
  justify-content: center;
}

.sidebar__logo {
  max-height: 48px;
  width: auto;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: left center;
}

html.sidebar-collapsed .sidebar__logo {
  max-height: 36px;
  object-position: center;
}

.sidebar__search {
  padding: 0.75rem 1rem 0;
  transition: opacity 0.2s ease, max-height 0.22s ease;
  max-height: 4rem;
}

/* Sidebar cleanup: legacy elements (replaced by new sidebar UX) */
.sidebar__search,
.sidebar__cta,
.sidebar__dock-quick {
  display: none;
}

html.sidebar-collapsed .sidebar__search {
  max-height: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.sidebar__search input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-on-dark);
  font-size: 0.8rem;
}

.sidebar__search input::placeholder {
  color: var(--text-on-dark-muted);
}

.sidebar__nav {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sidebar__nav li a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  color: var(--text-on-dark-muted);
  text-decoration: none;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
}

.sidebar__nav-label {
  white-space: nowrap;
}

html.sidebar-collapsed .sidebar__nav-label,
html.sidebar-collapsed .sidebar__group-head .sidebar__nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html.sidebar-collapsed .sidebar__nav li a {
  justify-content: center;
  padding: 0.55rem 0.35rem;
  border-left: none;
}

html.sidebar-collapsed .sidebar__nav li.is-active a {
  background: rgba(0, 160, 200, 0.22);
  border-radius: 4px;
}

.sidebar__nav li a:hover {
  color: var(--text-on-dark);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar__nav li.is-active a {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(0, 160, 200, 0.12);
}

/* Monitor: Gruppenkopf + Unterseiten */
.sidebar__group {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar__group-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  color: var(--text-on-dark-muted);
  text-decoration: none;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
}

.sidebar__group-head:hover {
  color: var(--text-on-dark);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar__group--active > .sidebar__group-head {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(0, 160, 200, 0.12);
}

.sidebar__subnav {
  list-style: none;
  margin: 0;
  padding: 0 0 0.2rem;
}

.sidebar__subnav li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem 0.4rem 2.25rem;
  color: var(--text-on-dark-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  border-left: 3px solid transparent;
}

.sidebar__subnav li a:hover {
  color: var(--text-on-dark);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar__subnav li.is-active a {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(0, 160, 200, 0.1);
}

html.sidebar-collapsed .sidebar__subnav {
  display: none;
}

html.sidebar-collapsed .sidebar__group-head {
  justify-content: center;
  padding: 0.55rem 0.35rem;
  border-left: none;
}

html.sidebar-collapsed .sidebar__group--active > .sidebar__group-head {
  background: rgba(0, 160, 200, 0.22);
  border-radius: 4px;
}

.sidebar__cta {
  margin: 1rem 1rem 0;
  padding-top: 0.5rem;
}

html.sidebar-collapsed .sidebar__cta {
  display: none;
}

.sidebar__cta button {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.sidebar__cta button:hover {
  background: var(--accent-hover);
}

.sidebar__footer {
  margin-top: auto;
  padding: 0.65rem 0.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar__dock {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar__dock-quick {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.15rem 0.55rem;
  border: none;
  background: transparent;
  color: var(--text-on-dark-muted);
  font: inherit;
  text-align: left;
  cursor: not-allowed;
  opacity: 0.92;
}

.sidebar__dock-quick-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.sidebar__dock-quick-label {
  font-size: 0.76rem;
  font-style: italic;
  color: var(--text-on-dark-muted);
  line-height: 1.25;
}

.sidebar__dock-rule {
  height: 1px;
  margin: 0 0 0.15rem;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar__dock-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar__dock-list > li {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__dock-list > li:last-of-type {
  border-bottom: none;
}

.sidebar__dock-split {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__dock-split .sidebar__dock-item {
  flex: 1;
  min-width: 0;
  border-bottom: none;
}

.sidebar__dock-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.48rem 0.15rem;
  border: none;
  background: transparent;
  color: var(--text-on-dark);
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: not-allowed;
  opacity: 0.95;
}

.sidebar__dock-item:not(:disabled) {
  cursor: pointer;
  opacity: 1;
}

.sidebar__dock-item-icon {
  flex-shrink: 0;
  width: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-dark);
  line-height: 0;
}

.sidebar__dock-item-icon--bell {
  position: relative;
}

.sidebar__dock-item-badge {
  position: absolute;
  top: -1px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e53935;
  border: 1px solid var(--bg-sidebar);
}

.sidebar__dock-item-label {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.sidebar__dock-count {
  color: var(--text-on-dark-muted);
  font-weight: 400;
}

.sidebar__dock-profile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar__dock-profile[title]:not([title=""]) {
  cursor: help;
}

.sidebar__dock-avatar {
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 6px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-on-dark);
}

.sidebar__dock-profile-text {
  min-width: 0;
  flex: 1;
}

.sidebar__dock-profile-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-on-dark);
  line-height: 1.25;
  word-break: break-word;
}

.sidebar__dock-profile-org {
  margin-top: 0.12rem;
  font-size: 0.72rem;
  color: var(--text-on-dark-muted);
  line-height: 1.2;
}

.sidebar__dock-groups {
  margin-top: 0.3rem;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.15rem;
  -webkit-overflow-scrolling: touch;
}

.sidebar__dock-group {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.64rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark);
  user-select: none;
}

.sidebar__dock-group.is-off {
  opacity: 0.38;
  filter: saturate(0.65);
}

.sidebar__dock-group.is-on {
  opacity: 1;
}

.sidebar__dock-group--spl-admin {
  border-color: rgba(246, 195, 67, 0.55);
  background: rgba(246, 195, 67, 0.14);
}
.sidebar__dock-group--spl-alpha {
  border-color: rgba(77, 196, 224, 0.55);
  background: rgba(77, 196, 224, 0.12);
}
.sidebar__dock-group--spl-beta {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
}
.sidebar__dock-group--spl-user {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}
.sidebar__dock-group--hsa-admin {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
}
.sidebar__dock-group--hsa-mitarbeiter {
  border-color: rgba(33, 150, 243, 0.5);
  background: rgba(33, 150, 243, 0.12);
}
.sidebar__dock-group--hsa-studierende {
  border-color: rgba(217, 119, 6, 0.55);
  background: rgba(217, 119, 6, 0.14);
}

.sidebar__dock-einordnung {
  margin-top: 0.4rem;
}

.sidebar__dock-logout {
  margin-top: 0.45rem;
  width: 100%;
}

.theme-switch--dock {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.theme-switch-dock__glyph {
  font-size: 0.68rem;
  line-height: 1;
  color: var(--text-on-dark-muted);
  opacity: 0.45;
  user-select: none;
}

html[data-theme="light"] .theme-switch-dock__glyph--sun {
  opacity: 1;
  color: #ffc107;
}

html[data-theme="light"] .theme-switch-dock__glyph--moon {
  opacity: 0.35;
}

html[data-theme="dark"] .theme-switch-dock__glyph--moon {
  opacity: 1;
  color: #90caf9;
}

html[data-theme="dark"] .theme-switch-dock__glyph--sun {
  opacity: 0.35;
}

.theme-switch--dock .theme-switch-dock__track {
  width: 2.35rem;
  height: 1.28rem;
}

.theme-switch--dock .theme-switch-dock__track::after {
  width: calc(1.28rem - 6px);
  height: calc(1.28rem - 6px);
}

.sidebar__footer-user {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.sidebar__user-line {
  font-size: 0.8rem;
  color: var(--text-on-dark-muted);
  line-height: 1.3;
  word-break: break-word;
  max-width: 100%;
}

.sidebar__user-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(77, 196, 224, 0.55);
  color: #7dd3f0;
  background: rgba(77, 196, 224, 0.12);
}

.sidebar__logout {
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: var(--text-on-dark);
  cursor: pointer;
}

.sidebar__logout:hover {
  background: rgba(255, 255, 255, 0.1);
}

html.sidebar-collapsed .sidebar__footer {
  display: none;
}

.sidebar__version {
  margin: 0.65rem 1rem 0;
  padding: 0;
  font-size: 0.65rem;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.02em;
}

html.sidebar-collapsed .sidebar__version {
  margin: 0.4rem 0.35rem 0;
  font-size: 0.58rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* —— Main column —— */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.topbar {
  min-height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 1.25rem;
  flex-shrink: 0;
  box-shadow: var(--shadow);
  min-width: 0;
  /* visible: Search-History/Dropdowns dürfen unter die Topbar ragen;
     overflow-x:hidden würde laut CSS overflow-y ebenfalls clippen */
  overflow: visible;
  position: relative;
  z-index: 200;
}

.topbar--with-tagbar {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding-bottom: 0.45rem;
}

.topbar__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.topbar__tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  width: 100%;
  padding-top: 0.15rem;
  border-top: 1px solid var(--border);
}

.nw-tag-bar__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
}

.nw-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem 0.35rem 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
}

.nw-tag-chip__text {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nw-tag-chip__x {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 0.15rem;
  border-radius: 4px;
}

.nw-tag-chip__x:hover {
  color: var(--danger);
  background: var(--icon-btn-hover-bg);
}

.nw-tag-bar__input-wrap {
  position: relative;
  flex: 0 1 12rem;
  min-width: 8rem;
}

.nw-tag-bar__input {
  width: 100%;
  padding: 0.3rem 0.5rem;
  border: 1px dashed var(--border);
  border-radius: 4px;
  font-size: 0.75rem;
  background: var(--input-bg);
  color: var(--input-text);
}

.nw-tag-bar__suggest {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 50;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow);
  max-height: 11rem;
  overflow: auto;
}

.nw-tag-bar__suggest-item {
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text);
}

.nw-tag-bar__suggest-item:hover {
  background: var(--icon-btn-hover-bg);
}

.nw-tag-demo__list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.nw-tag-demo__empty {
  list-style: none;
  margin-left: -1.2rem;
  color: var(--text-muted);
}

.topbar__left {
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(28rem, 55vw);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

/* —— Mobile: Off-Canvas-Sidebar (Match JS nw-common.js: max-width 768px) —— */
.nw-topbar-nav-toggle {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  margin: 0 0.2rem 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-header);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  -webkit-tap-highlight-color: transparent;
}

.nw-topbar-nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nw-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 1.05rem;
  pointer-events: none;
}

.nw-burger__line {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

.nw-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
  display: none;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.48);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

html.nw-sidebar-mobile-open .nw-sidebar-backdrop {
  display: block;
}

@media (max-width: 768px) {
  .nw-topbar-nav-toggle {
    display: inline-flex;
  }

  /* In schmalen Viewports: „eingeklappt“-Zustand nicht anwenden (verhindert 64px-Drawer + fehlende Labels) */
  html.sidebar-collapsed .sidebar,
  .sidebar {
    width: min(20.5rem, 92vw) !important;
  }

  html.sidebar-collapsed .sidebar__top {
    flex-direction: row !important;
    align-items: flex-start !important;
  }

  html.sidebar-collapsed .sidebar__logo-link {
    display: block !important;
    flex: 1 1 auto !important;
    width: auto !important;
    justify-content: flex-start !important;
  }

  html.sidebar-collapsed .sidebar__logo {
    max-height: 48px !important;
    object-position: left center !important;
  }

  html.sidebar-collapsed .sidebar__nav-label,
  html.sidebar-collapsed .sidebar__group-head .sidebar__nav-label {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    border: 0 !important;
    white-space: nowrap;
  }

  html.sidebar-collapsed .sidebar__nav li a,
  .sidebar__nav li a {
    justify-content: flex-start;
  }

  html.sidebar-collapsed .sidebar__subnav {
    display: block !important;
  }

  html.sidebar-collapsed .sidebar__favs,
  html.sidebar-collapsed .sidebar__footer,
  .sidebar__footer,
  .sidebar__favs {
    display: block;
  }

  html.sidebar-collapsed .sidebar__section-chevron {
    display: block !important;
  }

  html.sidebar-collapsed .sidebar__section-summary {
    justify-content: flex-start !important;
    padding: 0.55rem 1rem !important;
  }

  html.nw-sidebar-mobile-open,
  html.nw-sidebar-mobile-open body {
    overflow: hidden;
    height: 100%;
  }

  .app {
    position: relative;
  }

  .app .sidebar {
    position: fixed;
    z-index: 201;
    top: 0;
    left: 0;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    flex: none;
    width: min(20.5rem, 92vw) !important;
    padding-bottom: 0.75rem;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.28);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }

  html.nw-sidebar-mobile-open .app .sidebar {
    transform: translateX(0);
  }

  .app .main {
    flex: 1 1 100%;
    min-width: 0;
  }
}

/* Globale Topbar-Suche + History-Dropdown */
.nw-global-search {
  position: relative;
  z-index: 1;
}

.nw-global-search--open {
  z-index: 210;
}

.nw-global-search__wrap {
  position: relative;
}

.nw-global-search__wrap > input[type="search"] {
  width: 100%;
  max-width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
  background: var(--input-bg);
  color: var(--input-text);
}

.nw-global-search--open .nw-global-search__wrap > input[type="search"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.nw-global-search__hint {
  margin: 0.35rem 0 0;
  font-size: 0.7rem;
  color: var(--accent);
  line-height: 1.3;
}

.nw-search-history {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 220;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: var(--shadow);
  max-height: 14rem;
  overflow: auto;
}

.nw-search-history__panel {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nw-search-history__panel-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.5rem;
  cursor: pointer;
  text-align: left;
}

.nw-search-history__panel-toggle:hover {
  background: var(--icon-btn-hover-bg);
}

.nw-search-history__chevron {
  flex-shrink: 0;
  width: 1rem;
  display: inline-flex;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.65rem;
  line-height: 1;
}

.nw-search-history__panel-title {
  flex: 1;
  min-width: 0;
}

.nw-search-history__badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nw-search-history__items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nw-search-history__panel--collapsed .nw-search-history__items {
  display: none;
}

.nw-search-history__item {
  display: grid;
  grid-template-columns: 1.75rem 1fr 1.75rem;
  align-items: center;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}

.nw-search-history__item:last-child {
  border-bottom: none;
}

.nw-search-history__del {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.35rem;
  border-radius: 4px;
}

.nw-search-history__del:hover {
  background: var(--icon-btn-hover-bg);
  color: var(--danger);
}

.nw-search-history__term {
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.4rem 0.2rem;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nw-search-history__term:hover {
  text-decoration: underline;
  color: var(--accent);
}

.nw-search-history__copy {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nw-search-history__copy:hover {
  background: var(--icon-btn-hover-bg);
  color: var(--accent);
}

.topbar__welcome {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.topbar__icons {
  display: flex;
  gap: 0.35rem;
}

.topbar__icons button {
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
}

.topbar__icons button:hover {
  background: var(--icon-btn-hover-bg);
  color: var(--text);
}

.topbar__pwgen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: auto;
  max-width: min(7.5rem, 32vw);
  height: auto;
  min-width: 0;
  padding: 0.1rem 0.25rem;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 1;
  line-height: 0;
  vertical-align: middle;
  overflow: hidden;
}

.topbar__pwgen:hover {
  background: var(--icon-btn-hover-bg);
}

.topbar__pwgen:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.topbar__pwgen-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: var(--topbar-pwgen-img-h);
  aspect-ratio: 1159 / 351;
  object-fit: contain;
  object-position: left center;
  pointer-events: none;
  user-select: none;
}

.topbar__presence {
  display: none;
  align-items: center;
  flex-direction: row;
  flex-shrink: 1;
  min-width: 0;
  padding-right: 0.15rem;
}

.topbar__presence.is-on {
  display: flex;
}

.topbar__presence-item {
  position: relative;
  flex-shrink: 0;
  width: 1.7rem;
  height: 1.7rem;
  margin-left: -0.4rem;
  border-radius: 50%;
  border: 2px solid var(--bg-header);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.topbar__presence-item:first-child {
  margin-left: 0;
}

.topbar__presence-ini {
  line-height: 1;
  user-select: none;
}

.topbar__presence-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar__presence-more {
  flex-shrink: 0;
  margin-left: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* —— Theme-Umschalter —— */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
}

.theme-switch__label-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  user-select: none;
}

.theme-switch__btn {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--theme-switch-track);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.theme-switch__btn::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(1.5rem - 6px);
  height: calc(1.5rem - 6px);
  border-radius: 50%;
  background: var(--theme-switch-thumb);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: left 0.2s ease, right 0.2s ease;
}

.theme-switch__btn[aria-checked="true"] {
  background: var(--theme-switch-checked);
}

.theme-switch__btn[aria-checked="true"]::after {
  left: auto;
  right: 3px;
}

.theme-switch__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.content {
  padding: 1.25rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.content__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text-muted);
}

/* KPI-Zeile */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 1200px) {
  .kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .kpi-row {
    grid-template-columns: 1fr 1fr;
  }
}

.kpi-card {
  background: linear-gradient(
    180deg,
    var(--kpi-bg-1) 0%,
    var(--kpi-bg-2) 100%
  );
  border: 1px solid var(--kpi-border);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  min-height: 4.5rem;
}

.kpi-card__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}

.kpi-card__value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.kpi-card__sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.kpi-card__sub .up {
  color: var(--success);
}

.kpi-card__sub .down {
  color: var(--danger);
}

/* Dashboard-Startseite: moderne Kachel-Optik */
.content--dash-tiles .kpi-row {
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.content--dash-tiles .kpi-card {
  border-radius: 14px;
  padding: 0.85rem 1rem;
  min-height: 5rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  border: 1px solid var(--kpi-border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.content--dash-tiles .kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
}

html[data-theme="dark"] .content--dash-tiles .kpi-card {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .content--dash-tiles .kpi-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.content--dash-tiles .widget-grid,
.content--dash-tiles .dashboard-tools {
  gap: 1rem;
}

.content--dash-tiles .widget {
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 28px rgba(15, 23, 42, 0.07);
  overflow: hidden;
  min-height: 11rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.content--dash-tiles .widget:hover {
  box-shadow: 0 10px 36px rgba(15, 23, 42, 0.1);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}

html[data-theme="dark"] .content--dash-tiles .widget {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .content--dash-tiles .widget:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.content--dash-tiles .widget__head {
  padding: 0.7rem 1rem;
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--accent) 12%, transparent) 0%,
    transparent 55%
  );
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  gap: 0.5rem;
}

/* Fav star is position:absolute on the tile; keep title clear of the corner control */
.widget:has(> .nw-fav-btn) .widget__head {
  padding-left: 2.85rem;
}

.content--dash-tiles .widget__head-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 650;
}

.content--dash-tiles .widget__head-icon {
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0.92;
}

.content--dash-tiles .widget__body {
  padding: 1rem 1.05rem 1.1rem;
}

.content--dash-tiles .widget__head-meta {
  font-size: 0.68rem;
  max-width: 52%;
  text-align: right;
  line-height: 1.3;
}

/* Widget-Grid */
.widget-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 1100px) {
  .widget-grid {
    grid-template-columns: 1fr;
  }
}

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 12rem;
}

.widget__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
}

.widget__head-meta {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
}

.widget__body {
  padding: 0.75rem;
  flex: 1;
}

.widget__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  min-height: 8rem;
}

.widget__placeholder-icon {
  font-size: 2rem;
  opacity: var(--placeholder-icon-opacity);
  margin-bottom: 0.5rem;
}

/* Dashboard: System-Kachel (Hinweis-/Fehlertext) */
.nw-system__hint {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.nw-system__hint--warn {
  color: color-mix(in srgb, var(--accent) 65%, var(--text));
  font-weight: 600;
}

.nw-system__hint--err {
  color: var(--danger);
  font-weight: 700;
}

.nw-system__section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.4rem 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nw-system__section-label:first-child {
  margin-top: 0;
}

.nw-system__section-link {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
  text-decoration: none;
}

.nw-system__section-link:hover {
  text-decoration: underline;
}

.nw-watchdog {
  list-style: none;
  margin: 0 0 0.35rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nw-watchdog__item {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.3;
}

.nw-watchdog__dot {
  flex: 0 0 auto;
  width: 0.45rem;
  height: 0.45rem;
  margin-top: 0.28rem;
  border-radius: 50%;
  background: var(--text-muted);
}

.nw-watchdog__item--ok .nw-watchdog__dot {
  background: var(--success);
}

.nw-watchdog__item--alert .nw-watchdog__dot {
  background: var(--danger);
}

.nw-watchdog__name {
  flex: 0 0 auto;
  font-weight: 650;
}

.nw-watchdog__detail {
  min-width: 0;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nw-watchdog__item--alert .nw-watchdog__detail {
  color: var(--danger);
}

.nw-system__section-meta {
  margin-left: 0.35rem;
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.nw-system-hosts {
  margin-top: 0.15rem;
}

.nw-system-hosts__empty {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* SPL-Hosts: eine Zeile pro Host */
.nw-system-hosts__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nw-system-host-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.85rem;
  padding: 0.28rem 0.4rem;
  border-radius: 0.3rem;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--bg-card) 94%, var(--text) 3%);
  font-size: 0.72rem;
}

.nw-system-host-row--down {
  border-color: color-mix(in srgb, var(--danger, #b91c1c) 35%, var(--border));
}

.nw-system-host-row__name {
  flex: 0 0 6.5rem;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}

.nw-system-host-row__metrics {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  flex: 1 1 auto;
  min-width: 0;
}

.nw-system-host-row__metric {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 7.5rem;
}

.nw-system-host-row__metric-label {
  flex: 0 0 2rem;
  font-size: 0.62rem;
  color: var(--text-muted);
}

.nw-system-host-row__track {
  display: block;
  flex: 1 1 3.5rem;
  min-width: 2.5rem;
  max-width: 5rem;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

html[data-theme="dark"] .nw-system-host-row__track {
  background: rgba(255, 255, 255, 0.1);
}

.nw-system-host-row__fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  transition: width 0.35s ease;
}

.nw-system-host-row__metric-val {
  flex: 0 0 2.4rem;
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text-muted);
}

.nw-system-host-row__meta {
  margin-left: auto;
  font-size: 0.62rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nw-system-host-row__err {
  color: #b45309;
  font-size: 0.68rem;
}

html[data-theme="dark"] .nw-system-host-row__err {
  color: #fbbf24;
}

/* Legacy card styles (falls noch referenziert) */
.nw-system-hosts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.45rem;
}

.nw-system-hosts__grid--row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 72rem) {
  .nw-system-hosts__grid--row {
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  }
}

.nw-system-host {
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: 0.4rem;
  padding: 0.45rem 0.55rem 0.5rem;
  background: color-mix(in srgb, var(--bg-card) 92%, var(--text) 4%);
}

.nw-system-host--down {
  border-color: color-mix(in srgb, var(--danger, #b91c1c) 35%, var(--border));
}

.nw-system-host__head {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-bottom: 0.35rem;
}

.nw-system-host__head strong {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text);
}

.nw-system-host__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.62rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.nw-system-host__err {
  margin: 0;
  font-size: 0.68rem;
  color: #b45309;
  line-height: 1.25;
}

html[data-theme="dark"] .nw-system-host__err {
  color: #fbbf24;
}

.nw-system-host__bars {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.nw-system-host__bar {
  display: grid;
  grid-template-columns: 2.1rem 1fr 2.4rem;
  align-items: center;
  gap: 0.28rem;
}

.nw-system-host__bar-label {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.nw-system-host__bar-track {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

html[data-theme="dark"] .nw-system-host__bar-track {
  background: rgba(255, 255, 255, 0.1);
}

.nw-system-host__bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  transition: width 0.35s ease;
}

.nw-system-host__bar-fill--ok {
  background: linear-gradient(90deg, #0d9488, #14b8a6);
}

.nw-system-host__bar-fill--warn {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.nw-system-host__bar-fill--crit {
  background: linear-gradient(90deg, #b91c1c, #ef4444);
}

.nw-system-host__bar-fill--na {
  background: rgba(120, 120, 120, 0.35);
  width: 0 !important;
}

.nw-system-host__bar-value {
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text-muted);
}

/* Dashboard: System-Kachel kompakt — Portal-Host als eine Zeile */
.content--dash-tiles [data-nw-system-widget] .widget__body {
  padding: 0.65rem 0.85rem 0.75rem;
}

.content--dash-tiles [data-nw-system-widget] .info-list--strip,
.content--dash-tiles [data-nw-system-widget] .info-list {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 1.1rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.content--dash-tiles [data-nw-system-widget] .info-list li {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.1rem 0;
  border-bottom: none;
  min-width: 0;
}

.content--dash-tiles [data-nw-system-widget] .info-list dt {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-muted);
}

.content--dash-tiles [data-nw-system-widget] .info-list dd {
  font-weight: 600;
  text-align: left;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12rem;
}

.content--dash-tiles [data-nw-system-widget].widget--system {
  grid-column: 1 / -1;
  max-width: none;
}

@media (max-width: 700px) {
  .nw-system-host-row__name {
    flex-basis: 100%;
  }

  .nw-system-host-row__meta {
    margin-left: 0;
  }
}

/* Dashboard: kleine Werkzeug-Widgets unter dem Haupt-Grid */
.dashboard-tools {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 0.75rem;
}

.content--dash-tiles .nw-widget-dns.widget {
  min-height: auto;
}

.nw-widget-dns__lead {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.nw-widget-dns__form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: stretch;
  margin-bottom: 0.75rem;
}

.nw-widget-dns__input {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--input-text);
  font: inherit;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] .nw-widget-dns__input {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

.nw-widget-dns__input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.nw-widget-dns__btn {
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
}

.nw-widget-dns__btn:hover:not(:disabled) {
  filter: brightness(1.05);
}

.nw-widget-dns__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.nw-widget-dns__gate {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--text-muted) 8%, transparent);
}

.nw-widget-dns__err {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--danger);
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.content--dash-tiles .nw-widget-dns__summary {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.85rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--bg-page);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.content--dash-tiles .nw-widget-dns__summary strong {
  color: var(--text);
  font-weight: 650;
}

.nw-widget-dns__summary {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.nw-widget-dns__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.nw-widget-dns__srv {
  position: relative;
  display: flex;
  align-items: stretch;
  border-radius: 12px;
  padding: 0;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  min-height: 4.25rem;
}

html[data-theme="dark"] .nw-widget-dns__srv {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.nw-widget-dns__srv-badge {
  flex: 0 0 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: color-mix(in srgb, var(--text-muted) 12%, var(--bg-page));
  color: var(--text-muted);
  border-right: 1px solid var(--border);
}

.nw-widget-dns__srv--ok .nw-widget-dns__srv-badge {
  background: color-mix(in srgb, var(--success) 18%, var(--bg-page));
  color: var(--success);
}

.nw-widget-dns__srv--empty .nw-widget-dns__srv-badge {
  background: color-mix(in srgb, var(--text-muted) 10%, var(--bg-page));
}

.nw-widget-dns__srv--error .nw-widget-dns__srv-badge {
  background: color-mix(in srgb, var(--danger) 16%, var(--bg-page));
  color: var(--danger);
}

.nw-widget-dns__srv-body {
  flex: 1;
  padding: 0.55rem 0.65rem 0.6rem;
  min-width: 0;
}

.nw-widget-dns__srv--ok {
  border-color: color-mix(in srgb, var(--success) 28%, var(--border));
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--success) 9%, var(--bg-card)) 0%,
    var(--bg-card) 48%
  );
}

.nw-widget-dns__srv--empty {
  border-color: color-mix(in srgb, var(--text-muted) 15%, var(--border));
}

.nw-widget-dns__srv--error {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--danger) 8%, var(--bg-card)) 0%,
    var(--bg-card) 50%
  );
}

.nw-widget-dns__srv-head {
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.25;
  margin-bottom: 0.2rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nw-widget-dns__srv-ip {
  font-weight: 600;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.68rem;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nw-widget-dns__srv-err {
  color: var(--danger);
  font-size: 0.74rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nw-widget-dns__srv-empty {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nw-widget-dns__rr-type {
  display: inline-block;
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-right: 0.35rem;
}

.nw-widget-dns__rr ul {
  margin: 0.2rem 0 0.4rem;
  padding-left: 1rem;
}

.nw-widget-dns__rr li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

/* Dashboard: MAC → Hersteller (OUI) */
.content--dash-tiles .nw-widget-mac-vendor.widget {
  grid-column: span 1;
}

.content__title--dash-more {
  margin-top: 1.25rem;
  font-size: 1.05rem;
}

.dashboard-tools--links,
.dashboard-tools--favs {
  margin-top: 0.75rem;
}

a.widget--link-tile {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

a.widget--link-tile:hover {
  transform: translateY(-1px);
}

a.widget--link-tile:focus-visible {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: 2px;
}

.widget--link-tile__lead {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Dashboard-Tools: 4er-Raster (damit MAC-Hersteller = 1/4) */
@media (min-width: 1101px) {
  .dashboard-tools {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .content--dash-tiles .nw-widget-c2i.widget {
    grid-column: span 2;
  }

  .content--dash-tiles .nw-widget-dns.widget {
    grid-column: span 1;
  }

  .content--dash-tiles .nw-widget-mac-vendor.widget {
    grid-column: span 1;
  }
}

.nw-widget-mac-vendor__lead {
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.nw-widget-mac-vendor__form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.nw-widget-mac-vendor__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
}

html[data-theme="dark"] .nw-widget-mac-vendor__input {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-on-dark);
}

.nw-widget-mac-vendor__input:focus {
  outline: 2px solid rgba(0, 160, 200, 0.35);
  outline-offset: 1px;
}

.nw-widget-mac-vendor__btn {
  flex: 0 0 auto;
  padding: 0.42rem 0.7rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

.nw-widget-mac-vendor__btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.nw-widget-mac-vendor__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.nw-widget-mac-vendor__gate,
.nw-widget-mac-vendor__err {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.nw-widget-mac-vendor__err {
  color: #b00020;
}

html[data-theme="dark"] .nw-widget-mac-vendor__err {
  color: #ff7a7a;
}

.nw-widget-mac-vendor__out {
  margin-top: 0.45rem;
}

.nw-widget-mac-vendor__card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .nw-widget-mac-vendor__card {
  background: rgba(255, 255, 255, 0.04);
}

.nw-widget-mac-vendor__mac {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.nw-widget-mac-vendor__vendor {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

html[data-theme="dark"] .nw-widget-mac-vendor__vendor {
  color: var(--text-on-dark);
}

.nw-widget-mac-vendor__vendor--empty {
  font-weight: 600;
  color: var(--text-muted);
}

.nw-widget-mac-vendor__meta {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.donut-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.donut {
  text-align: center;
}

.donut__ring {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  border: 8px solid var(--donut-track);
  border-top-color: var(--accent);
  margin: 0 auto 0.35rem;
  transform: rotate(-45deg);
}

.donut__label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.donut__value {
  font-size: 1.1rem;
  font-weight: 700;
}

.info-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
}

.info-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--info-list-row-border);
}

.info-list li:last-child {
  border-bottom: none;
}

.info-list dt {
  color: var(--text-muted);
  margin: 0;
}

.info-list dd {
  margin: 0;
  font-weight: 500;
  text-align: right;
}

.content--dash-tiles .nw-widget-c2i.widget {
  min-width: min(100%, 28rem);
}

.nw-widget-c2i__meta {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.nw-widget-c2i__tablewrap {
  overflow-x: auto;
}

.nw-widget-c2i__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.nw-widget-c2i__table th,
.nw-widget-c2i__table td {
  padding: 0.35rem 0.45rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.nw-widget-c2i__table th {
  color: var(--text-muted);
  font-weight: 600;
}

.nw-widget-c2i__table td:last-child {
  white-space: nowrap;
}

.nw-widget-c2i__empty {
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem 0;
}

.nw-widget-c2i__gate {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.nw-widget-c2i__err {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--danger);
}

.footer-note {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* Favorite toggle button on tiles (pinned to top-left of card) */
.nw-fav-btn {
  position: absolute;
  z-index: 2;
  top: 0.35rem;
  left: 0.35rem;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  background: color-mix(in srgb, var(--bg-card) 85%, transparent);
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.nw-fav-btn:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
}

/* Auswahl → Zwischenablage (nw-common.js) */
.nw-copy-toast {
  position: fixed;
  z-index: 9999;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  background: var(--text, #1a1a1a);
  color: var(--bg-page, #fff);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.nw-copy-toast.is-on {
  opacity: 1;
}

.nw-fav-btn--on {
  color: #f6c343;
  border-color: color-mix(in srgb, #f6c343 55%, var(--border));
}

.nw-rbac-denied {
  margin: 1.25rem 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(217, 119, 6, 0.45);
  background: rgba(217, 119, 6, 0.12);
  color: var(--text, #1a1a1a);
  font-size: 0.9rem;
  line-height: 1.5;
}

html[data-theme="dark"] .nw-rbac-denied {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.35);
}
