/* 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;
}

.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;
}

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;
}

.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__icon {
  width: 1.1rem;
  text-align: center;
  opacity: 0.9;
}

.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-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;
  overflow-x: hidden;
}

.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%;
}

.theme-switch--topbar-fallback {
  display: none;
}

html.sidebar-collapsed .theme-switch--topbar-fallback {
  display: inline-flex;
}

@media (max-width: 640px) {
  .sidebar {
    display: none;
  }

  .theme-switch--topbar-fallback {
    display: inline-flex;
  }
}

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

.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: 40;
  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;
}

/* —— 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;
  }

  .sidebar {
    display: none;
  }
}

.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;
}

.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: 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: repeat(3, 1fr);
  gap: 0.65rem;
}

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

.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);
}

.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;
}

.nw-widget-dns__srv-err {
  color: var(--danger);
  font-size: 0.74rem;
  line-height: 1.35;
}

.nw-widget-dns__srv-empty {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-style: italic;
}

.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 {
  word-break: break-all;
  line-height: 1.35;
}

.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;
}
