/* Server-Dashboard – dunkelblau, Boxen mit Regenbogen-Kontur und Glow. Keine Fremdquellen (CSP 'self'). */
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  --bg: #050b1f;
  --bg2: #0a1636;
  --card: rgba(12, 26, 64, 0.82);
  --card-solid: #0b1838;
  --line: rgba(120, 160, 255, 0.14);
  --text: #e6ecff;
  --muted: #8f9cc4;
  --faint: #5b6890;
  --ok: #3ef0a1;
  --warn: #ffc94d;
  --crit: #ff5577;
  --info: #5cc8ff;
  --rainbow: #ff2d75, #ff8a2b, #ffe23d, #3df59a, #2ee6ff, #5a7bff, #c34dff, #ff2d75;
  --radius: 18px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(64, 90, 255, 0.22), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, rgba(195, 77, 255, 0.14), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(46, 230, 255, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* feines Sternenraster */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(160, 190, 255, 0.10) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.2));
  z-index: 0;
}

a { color: var(--info); }

/* ------------------------------------------------------------------ Regenbogen-Box */

/* Kein isolation/backdrop-filter hier: beide erzeugen einen eigenen Stapelkontext, dann läge der
   Glow (z-index -1) über dem Kartenhintergrund statt dahinter. Stapelkontext ist main bzw. .login-wrap. */
.glow {
  position: relative;
  border-radius: var(--radius);
  background: var(--card-solid);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 40px rgba(0, 0, 0, 0.35);
}
.glow::before,
.glow::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--angle), var(--rainbow));
  animation: spin 8s linear infinite;
  pointer-events: none;
}
/* Kontur: nur der Rand bleibt sichtbar */
.glow::before {
  padding: 1.5px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  z-index: 1;
}
/* Glow dahinter */
.glow::after {
  filter: blur(16px);
  opacity: 0.38;
  z-index: -1;
}
.glow:hover::after { opacity: 0.6; }

@keyframes spin { to { --angle: 360deg; } }

@media (prefers-reduced-motion: reduce) {
  .glow::before, .glow::after { animation: none; }
}

/* ------------------------------------------------------------------ Login */

.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login {
  width: 100%;
  max-width: 380px;
  padding: 36px 30px 30px;
}
.login .logo {
  width: 54px; height: 54px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: conic-gradient(from 210deg, var(--rainbow));
  box-shadow: 0 0 28px rgba(90, 123, 255, 0.55);
}
.login .logo svg { width: 28px; height: 28px; }
.login h1 {
  margin: 0 0 4px;
  text-align: center;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.2px;
}
.login .sub { margin: 0 0 24px; text-align: center; color: var(--muted); font-size: 13px; }
.login label { display: block; margin: 14px 0 6px; font-size: 12px; color: var(--muted); letter-spacing: .4px; text-transform: uppercase; }
.login input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(3, 9, 28, 0.7);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login input:focus { border-color: #5a7bff; box-shadow: 0 0 0 3px rgba(90, 123, 255, 0.25); }
.login button {
  width: 100%;
  margin-top: 22px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 650;
  font-size: 15px;
  color: #050b1f;
  cursor: pointer;
  background: linear-gradient(90deg, #2ee6ff, #5a7bff 50%, #c34dff);
  box-shadow: 0 6px 24px rgba(90, 123, 255, 0.45);
  transition: transform .1s, box-shadow .15s;
}
.login button:hover { box-shadow: 0 8px 30px rgba(90, 123, 255, 0.65); }
.login button:active { transform: translateY(1px); }
.login .error {
  margin: 0 0 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 85, 119, 0.12);
  border: 1px solid rgba(255, 85, 119, 0.35);
  color: #ffb3c2;
  font-size: 13px;
}
.login .foot { margin-top: 18px; text-align: center; color: var(--faint); font-size: 12px; }

/* ------------------------------------------------------------------ Dashboard-Rahmen */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 24px;
  background: rgba(5, 11, 31, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top .brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; }
.top .brand i {
  width: 12px; height: 12px; border-radius: 50%;
  background: conic-gradient(var(--rainbow));
  box-shadow: 0 0 12px rgba(90, 123, 255, .9);
}
.top .meta { color: var(--muted); font-size: 12px; }
.top .spacer { flex: 1; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); }
.seg button {
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 12px; font-weight: 600;
  padding: 6px 11px; border-radius: 8px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: linear-gradient(90deg, rgba(46,230,255,.25), rgba(195,77,255,.25)); color: var(--text); }
.btn-ghost {
  border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text);
  font: inherit; font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 10px; cursor: pointer;
}
.btn-ghost:hover { border-color: rgba(120,160,255,.4); }

main {
  position: relative;
  z-index: 1;
  max-width: 1500px;
  margin: 0 auto;
  padding: 22px 24px 48px;
}

.section-title {
  margin: 30px 2px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(12, 1fr); }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; }
.c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
@media (max-width: 1200px) { .c3 { grid-column: span 6; } .c4, .c5, .c7, .c8 { grid-column: span 12; } .c6 { grid-column: span 12; } }
@media (max-width: 640px) {
  .c3 { grid-column: span 12; }
  main { padding: 16px 16px 40px; }
  .top { padding: 12px 16px; position: static; }
}

.card { padding: 18px 20px; min-width: 0; }
.card h2 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  display: flex; align-items: baseline; gap: 8px;
}
.card h2 .hint { margin-left: auto; font-weight: 500; font-size: 11px; color: var(--faint); }

/* ------------------------------------------------------------------ Kennzahlen */

.kpi { display: flex; flex-direction: column; gap: 6px; min-height: 128px; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.kpi .sub { font-size: 12px; color: var(--faint); }
.kpi .bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,0.07); overflow: hidden; margin-top: auto; }
.kpi .bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #2ee6ff, #5a7bff, #c34dff); box-shadow: 0 0 12px rgba(90,123,255,.6); }
.kpi .bar span.warn { background: linear-gradient(90deg, #ffe23d, #ff8a2b); }
.kpi .bar span.crit { background: linear-gradient(90deg, #ff8a2b, #ff2d75); }
.kpi canvas, .kpi svg.spark { width: 100%; height: 34px; margin-top: auto; }

/* ------------------------------------------------------------------ Diagramme */

.chart { position: relative; width: 100%; height: 230px; }
.chart.tall { height: 400px; }
.chart.short { height: 190px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .axis text { fill: var(--faint); font-size: 10.5px; font-family: var(--font); }
.chart .grid-line { stroke: rgba(140, 170, 255, 0.08); stroke-width: 1; }
.chart .cross { stroke: rgba(230, 236, 255, 0.35); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .empty { fill: var(--faint); font-size: 12px; }
.tip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  min-width: 130px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(4, 10, 30, 0.94);
  border: 1px solid rgba(120,160,255,.28);
  box-shadow: 0 8px 30px rgba(0,0,0,.45);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .1s;
}
.tip.on { opacity: 1; }
.tip .t { color: var(--muted); margin-bottom: 4px; font-size: 11px; }
.tip .r { display: flex; align-items: center; gap: 7px; }
.tip .r b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-wrap svg { width: 150px; height: 150px; flex: none; }
.donut-wrap .legend { flex-direction: column; margin: 0; flex: 1; min-width: 140px; }
.donut-wrap .legend span b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.donut-wrap .legend span { display: flex; }

/* ------------------------------------------------------------------ Tabellen & Listen */

.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .6px;
  color: var(--faint); padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 8px 6px; border-bottom: 1px solid rgba(120,160,255,0.06); vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .mini { height: 6px; border-radius: 4px; background: rgba(255,255,255,.06); min-width: 70px; }
td .mini span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #2ee6ff, #5a7bff, #c34dff); }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.scroll { max-height: 360px; overflow-y: auto; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 650; white-space: nowrap;
  background: rgba(62, 240, 161, 0.12); color: var(--ok); border: 1px solid rgba(62,240,161,.3);
}
.badge.warn { background: rgba(255, 201, 77, 0.12); color: var(--warn); border-color: rgba(255,201,77,.3); }
.badge.crit { background: rgba(255, 85, 119, 0.13); color: var(--crit); border-color: rgba(255,85,119,.35); }
.badge.info { background: rgba(92, 200, 255, 0.12); color: var(--info); border-color: rgba(92,200,255,.3); }

.checks { display: grid; gap: 2px; }
.check { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid rgba(120,160,255,0.06); }
.check:last-child { border-bottom: 0; }
.check .name { font-weight: 600; }
.check .detail { color: var(--muted); font-size: 12px; }
.check .badge { margin-left: auto; }

.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.svc {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line); font-size: 12.5px;
}
.svc .dot { box-shadow: 0 0 8px currentColor; }

.big-number { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-row div .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.loading { opacity: .5; }
.notice {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 201, 77, 0.08); border: 1px solid rgba(255,201,77,.25); color: #ffe3a3; font-size: 13px;
}
.hidden { display: none !important; }
.mt { margin-top: 16px; }

/* ------------------------------------------------------------------ Anwendungs-Symbole */

.app-ico {
  width: 26px; height: 26px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.app-ico svg { width: 16px; height: 16px; filter: drop-shadow(0 0 4px currentColor); }
.app-ico.sm { width: 22px; height: 22px; border-radius: 7px; }
.app-ico.sm svg { width: 14px; height: 14px; }
td .site { display: flex; align-items: center; gap: 9px; }

.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.site-tile {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
  min-width: 0;
}
.site-tile .app-ico { width: 34px; height: 34px; border-radius: 10px; }
.site-tile .app-ico svg { width: 20px; height: 20px; }
.site-tile .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-tile .d { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-tile > div { min-width: 0; }
.parking { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.parking .chip { padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); }

/* ------------------------------------------------------------------ Mail nach Domain */

.search {
  width: 100%; margin: 0 0 12px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(3, 9, 28, 0.6); color: var(--text); font: inherit; outline: none;
}
.search:focus { border-color: #5a7bff; box-shadow: 0 0 0 3px rgba(90, 123, 255, 0.2); }
.maildomains { max-height: 560px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.maildomains details { border-bottom: 1px solid rgba(120,160,255,0.08); }
.maildomains details:last-child { border-bottom: 0; }
.maildomains summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 16px minmax(140px, 1.6fr) auto minmax(90px, .8fr) 80px minmax(60px, .7fr);
  align-items: center; gap: 12px; padding: 10px 4px; border-radius: 8px;
}
.maildomains summary::-webkit-details-marker { display: none; }
.maildomains summary:hover { background: rgba(255,255,255,0.03); }
.maildomains summary .chev { color: var(--faint); transition: transform .15s; font-size: 11px; }
.maildomains details[open] summary .chev { transform: rotate(90deg); color: var(--text); }
.maildomains summary .dom { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maildomains summary .cnt { display: flex; gap: 6px; flex-wrap: wrap; }
.maildomains summary .flow { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.maildomains summary .size { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.maildomains .inner { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 4px 6px 16px 32px; }
.maildomains .inner h3 { margin: 6px 0 4px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .6px; color: var(--faint); }
.maildomains .dest { color: var(--muted); }
.maildomains .dest div { white-space: nowrap; }
.maildomains .empty-dom { opacity: .55; }
@media (max-width: 760px) {
  .maildomains summary { grid-template-columns: 16px 1fr auto; }
  .maildomains summary .flow, .maildomains summary .bar-cell { display: none; }
  .maildomains .inner { grid-template-columns: 1fr; padding-left: 10px; }
}
.maildomains .mini { height: 6px; border-radius: 4px; background: rgba(255,255,255,.06); }
.maildomains .mini span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #2ee6ff, #5a7bff, #c34dff); }
.maildomains tr.sys-alias td { color: var(--faint); }
.maildomains tr.sys-alias .dest { color: var(--faint); }

/* ------------------------------------------------------------------ Erreichbarkeit (Uptime Kuma) */

.notice.crit { background: rgba(255, 85, 119, 0.10); border-color: rgba(255,85,119,.35); color: #ffc2cf; }
tr.kgroup td { padding-top: 14px; font-weight: 650; color: var(--text); text-transform: uppercase; font-size: 11.5px; letter-spacing: .5px; }
tr.kgroup td:first-child { color: var(--info); }
tr.kpaused td { opacity: .5; }
td .tgt { display: block; font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
td.pct-warn { color: var(--warn); } td.pct-crit { color: var(--crit); }
.badge.paused { background: rgba(255,255,255,0.04); color: var(--muted); border-color: var(--line); }
.site-tile .kdot { margin-left: auto; box-shadow: 0 0 8px currentColor; }
@media (max-width: 600px) { .hide-sm { display: none; } td .tgt { max-width: 190px; } }
