.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-soft);
}

.brand {
  font-size: 1.375rem;
  font-weight: 700;
  white-space: nowrap;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text);
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav a:hover {
  background: var(--panel-soft);
}

.nav a.active {
  background: var(--panel-soft);
  font-weight: 700;
}

.status-dots {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--unknown);
  border: 1px solid rgba(0, 0, 0, 0.14);
}

.dot.ok {
  background: var(--ok);
}

.dot.warn {
  background: var(--warn);
}

.dot.error,
.dot.off {
  background: var(--off);
}

.dot.unknown {
  background: var(--unknown);
}

.theme-toggle {
  appearance: none;
  border: 1px solid var(--theme-toggle-border);
  background: var(--theme-toggle-bg);
  color: var(--theme-toggle-text);
  border-radius: 999px;
  padding: 8px 12px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  filter: brightness(0.98);
}

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

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .header {
    align-items: flex-start;
  }

  .header-right {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .header {
    padding: 12px 14px;
  }

  .header-right {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .nav {
    flex-direction: column;
    align-items: stretch;
  }

  .nav a {
    width: 100%;
  }

  .status-dots {
    gap: 10px;
  }
}

.icon-button {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--panel);
}

.theme-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-icon-moon {
  display: block;
}

.header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-soft);
}

.header-brand {
  display: flex;
  align-items: center;
  min-width: 220px;
}

.brand {
  font-size: 1.45rem;
  font-weight: 700;
  white-space: nowrap;
}

.header-status {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.status-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.status-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.95rem;
  color: var(--muted);
  white-space: nowrap;
}

.status-separator {
  width: 1px;
  height: 20px;
  background: var(--line);
  margin: 0 4px;
}

.dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--unknown);
  border: 1px solid rgba(0, 0, 0, 0.14);
}

.dot.ok {
  background: var(--ok);
}

.dot.warn {
  background: var(--warn);
}

.dot.error,
.dot.off {
  background: var(--off);
}

.dot.unknown {
  background: var(--unknown);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text);
  border-radius: 12px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav a:hover {
  background: var(--panel-soft);
}

.nav a.active {
  background: var(--panel-soft);
  font-weight: 700;
}

/* dag/nacht schakelaar */
.theme-toggle-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.theme-toggle-icon:hover {
  background: var(--panel);
}

.theme-icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-icon-moon {
  display: block;
}

@media (max-width: 1280px) {
  .header {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .header-brand,
  .header-status,
  .header-nav {
    justify-content: center;
  }

  .header-nav {
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .status-dots {
    gap: 10px;
  }

  .status-item {
    font-size: 0.88rem;
  }

  .header-nav {
    flex-direction: column;
  }

  .nav {
    justify-content: center;
  }
}
