:root {
  --bg: #f4f1ea;
  --ink: #13202b;
  --muted: #5c6b74;
  --line: #d7ddd8;
  --surface: #fff;
  --aqua-900: #073b4c;
  --aqua-700: #0a5c68;
  --aqua-500: #118ab2;
  --aqua-300: #4fb8c5;
  --soft: #e8f4f4;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(215, 221, 216, .8);
  background: rgba(244, 241, 234, .88);
  backdrop-filter: blur(10px);
}
.vault-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 22px;
  background: #f7efe4;
  border-bottom: 1px solid #e4d3bf;
  color: #6a4b2b;
  font-size: 14px;
}
.vault-banner a {
  color: var(--aqua-700);
  font-weight: 600;
  white-space: nowrap;
}
.vault-prompt {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.vault-prompt-bg {
  position: absolute;
  inset: 0;
  background: rgba(19, 32, 43, .32);
}
.vault-prompt-card {
  position: relative;
  width: min(420px, 100%);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(19, 32, 43, .18);
  padding: 28px 28px 24px;
}
.vault-prompt-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--aqua-900);
}
.vault-prompt-card .lead {
  margin: 0 0 18px;
  font-size: 15px;
}
.vault-prompt-card .error { margin: 0 0 12px; }
.vault-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.vault-prompt-actions .primary { margin-top: 0; }
.vault-prompt-actions .btn-ghost {
  width: 100%;
  justify-content: center;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-home { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand strong { font-size: 14px; color: var(--aqua-900); }
.brand-version { font-size: 10px; font-weight: 600; letter-spacing: .02em; color: #7a8890; }
.header-back { flex-shrink: 0; }
.crumb { color: #b7c2c4; }
.crumb-title { color: var(--aqua-700); font-size: 14px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 12px; }
.user-meta { text-align: right; }
.user-meta b { display: block; font-size: 14px; color: var(--aqua-900); }
.user-meta span { font-size: 12px; color: #7a8890; }
.btn, .btn-ghost {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 7px 12px;
  color: var(--aqua-700);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.btn-ghost { color: var(--muted); }
.btn:hover, .btn-ghost:hover { border-color: var(--aqua-500); }
.btn[hidden], .btn-ghost[hidden], .btn-danger[hidden], .primary[hidden] { display: none !important; }
.btn-danger {
  border-radius: 999px;
  border: 1px solid #c53030;
  background: #fff5f5;
  padding: 7px 12px;
  color: #9b2c2c;
  cursor: pointer;
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-danger:hover { background: #9b2c2c; color: #fff; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 40px 22px 64px; }
.kicker { color: var(--aqua-700); font-size: 14px; font-weight: 600; margin: 0 0 4px; }
h1 { font-family: Outfit, "Segoe UI", sans-serif; font-size: 36px; letter-spacing: -0.03em; margin: 0; color: var(--aqua-900); }
.lead { max-width: 640px; color: var(--muted); line-height: 1.7; margin: 12px 0 0; }

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 36px;
}
.tile {
  min-height: 188px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(19, 32, 43, .04);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.tile.is-off {
  opacity: 0.58;
  filter: grayscale(0.25);
  background: #f6f3ec;
  box-shadow: none;
}
.tile.is-off:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}
.tile.is-off .icon {
  background: #ece8df;
  color: #8a8478;
}
.tile.is-off:hover .icon {
  background: #ece8df;
  color: #8a8478;
}
.tile.is-off .go { color: #8a8478; }

.settings-group { margin-top: 28px; }
.settings-group:first-child { margin-top: 8px; }
.settings-group > h2 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--aqua-700);
}
.settings-group .tiles { margin-top: 0; }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.icon {
  width: 48px; height: 48px; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--soft); color: var(--aqua-700);
}
.icon svg {
  display: block;
  overflow: visible;
}
.tile:hover .icon { background: var(--aqua-700); color: #fff; }
.pill { border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.pill-on { background: #e5f6ee; color: #1b7a4a; }
.pill-off { background: #f3f1ea; color: #7a6b4a; }
.tile h2 { margin: 0; font-size: 18px; color: var(--aqua-900); }
.tile p { margin: 8px 0 0; color: var(--muted); line-height: 1.6; font-size: 14px; flex: 1; }
.tile .go { margin-top: 16px; color: var(--aqua-700); font-size: 14px; font-weight: 600; }

.status-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.status-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.8);
  border-radius: 16px;
  padding: 16px 20px;
}
.status-card b { display: block; color: var(--aqua-900); }
.status-card span { color: var(--muted); font-size: 14px; }

.server-panel {
  margin-top: 22px;
  padding: 12px 16px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.55);
}
.server-panel + .server-panel { margin-top: 12px; }
.server-panel .kicker { margin: 0 0 8px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.server-lines { display: grid; gap: 2px; }
.server-line {
  display: grid;
  grid-template-columns: 10px 108px 1fr;
  align-items: center;
  gap: 8px 10px;
  padding: 5px 2px;
  font-size: 13px;
  color: var(--muted);
  border-radius: 8px;
}
a.server-line:hover { background: rgba(255,255,255,.7); color: var(--aqua-700); }
.server-line b { color: var(--aqua-900); font-size: 13px; font-weight: 600; }
.ampel {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  display: block;
}
.ampel-ok { background: #2f9e6b; }
.ampel-warn { background: #c9a227; }
.ampel-kritisch { background: #c44536; }
.ampel-daten { background: #9bb0b5; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 20px;
  background: #e8eef0;
  position: relative;
  overflow: hidden;
}
.glow {
  position: absolute; border-radius: 999px; filter: blur(60px); pointer-events: none;
}
.g1 { width: 320px; height: 320px; background: rgba(79,184,197,.25); left: -80px; top: -80px; }
.g2 { width: 380px; height: 380px; background: rgba(10,92,104,.15); right: -80px; top: 80px; }
.card {
  position: relative;
  width: min(420px, 100%);
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(7,59,76,.12);
}
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.login-brand small { display: block; color: rgba(10,92,104,.8); }
.login-brand b { font-size: 24px; color: var(--aqua-900); }
.login-version { display: block; margin-top: 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: #7a8890; }
label { display: block; margin-bottom: 14px; }
label span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--aqua-900); }
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  outline: none;
}
input:focus { border-color: var(--aqua-500); box-shadow: 0 0 0 3px rgba(79,184,197,.35); }
.search-clear {
  position: relative;
  display: block;
  width: 100%;
}
.search-clear input { padding-right: 2.4rem; }
.search-clear input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.search-clear-btn {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: #7a8890;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.search-clear-btn:hover { background: var(--soft); color: var(--aqua-900); }
.search-clear-btn[hidden] { display: none !important; }
.primary {
  width: 100%;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  background: var(--aqua-700);
  color: #fff;
  font-weight: 700;
  padding: 11px 16px;
  cursor: pointer;
}
.primary:hover { background: var(--aqua-900); }
.hint { text-align: center; color: #7a8890; font-size: 12px; margin: 22px 0 0; }
.error { background: #fff1f0; color: #9b2c2c; border-radius: 12px; padding: 8px 12px; font-size: 14px; }

.soon {
  max-width: 640px;
  margin: 48px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 40px;
  box-shadow: 0 8px 24px rgba(19,32,43,.04);
}
.soon h2 { margin: 8px 0 0; font-size: 28px; color: var(--aqua-900); }
.soon p { color: var(--muted); line-height: 1.7; }
.frame-page { height: 100vh; display: flex; flex-direction: column; }
.frame-page iframe { flex: 1; width: 100%; border: 0; min-height: 0; background: #f6f7f9; }

@media (max-width: 980px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 30px; }
}
@media (max-width: 700px) {
  .tiles { grid-template-columns: 1fr; }
  .user-meta, .brand-text { display: none; }
}

.save-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  transform: translateX(-50%) translateY(10px);
  padding: 10px 18px;
  border-radius: 14px;
  background: var(--aqua-900);
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  box-shadow: 0 8px 24px rgba(7, 59, 76, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.save-toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
