/* ============================================================
   Statusseite — Design im SKRIME-Stil
   Farbtokens direkt von der Referenzseite übernommen.
   ============================================================ */

:root {
  --bg: #15171c;
  --bg-elev: #1a1c21;
  --bg-elev-2: #20232a;
  --border: #262a33;
  --bar-empty: #2a2f3a;

  --text: #f8f9fa;
  --text-muted: #8b93a1;
  --text-dim: #6b7280;

  --up: #2eca8b;
  --down: #e43f52;
  --warn: #f17425;
  --info: #2f55d4;
  --accent: var(--up);

  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --maxw: 900px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Nunito, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px;
}
.container-wide { max-width: 1240px; }

/* ------------------------------------------------------------- Hero */

.hero {
  position: relative;
  padding: 64px 0 44px;
  text-align: center;
  background:
    radial-gradient(1000px 340px at 50% -110px, rgba(46, 202, 139, 0.14), transparent 70%),
    linear-gradient(180deg, #1c2836 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 -1px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}
.hero-logo { height: 46px; margin-bottom: 18px; }
.hero h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero p.lead {
  margin: 10px auto 0;
  max-width: 620px;
  color: var(--text-muted);
}

/* Overall-Banner */
.overall {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-top: 26px;
  padding: 11px 22px;
  border-radius: 800px;
  font-weight: 700;
  font-size: 1.02rem;
  background: rgba(46, 202, 139, 0.11);
  border: 1px solid rgba(46, 202, 139, 0.32);
  color: var(--up);
}
.overall[data-state='partial'] {
  background: rgba(241, 116, 37, 0.11);
  border-color: rgba(241, 116, 37, 0.32);
  color: var(--warn);
}
.overall[data-state='major'] {
  background: rgba(228, 63, 82, 0.11);
  border-color: rgba(228, 63, 82, 0.32);
  color: var(--down);
}
.overall[data-state='maintenance'] {
  background: rgba(47, 85, 212, 0.13);
  border-color: rgba(47, 85, 212, 0.35);
  color: #7d97ea;
}
.overall[data-state='unknown'] {
  background: rgba(139, 147, 161, 0.1);
  border-color: rgba(139, 147, 161, 0.28);
  color: var(--text-muted);
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 2s infinite;
  flex: none;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45); }
  70%  { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
}

/* ------------------------------------------------------------- Tabs */

.tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 28px 0 6px;
}
.tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 800px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); background: var(--bg-elev); }
.tab.active {
  color: var(--text);
  background: var(--bg-elev);
  border-color: var(--border);
}
.tab .count {
  display: inline-block;
  margin-left: 7px;
  padding: 0 7px;
  border-radius: 800px;
  background: var(--bar-empty);
  font-size: 0.74rem;
  font-weight: 800;
  vertical-align: middle;
}

/* ------------------------------------------------------------- Cards */

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-top: 12px;
}
.card.tight { padding: 12px 16px; }

.section { padding: 26px 0 10px; }
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 2px;
  font-size: 1.05rem;
  font-weight: 800;
}
.section-title small { color: var(--text-dim); font-weight: 600; font-size: 0.8rem; }

.empty {
  color: var(--text-dim);
  text-align: center;
  padding: 26px 12px;
  font-size: 0.92rem;
}

/* -------------------------------------------------- Cluster Live Stats */

.cluster {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 640px) { .cluster { grid-template-columns: 1fr; } }

.gauge-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 18px;
}
.gauge-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.gauge-label { font-weight: 700; font-size: 0.88rem; color: var(--text-muted); }
.gauge-value { font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.gauge-track {
  height: 8px;
  background: var(--bar-empty);
  border-radius: 800px;
  overflow: hidden;
}
.gauge-fill {
  height: 100%;
  border-radius: 800px;
  background: var(--up);
  width: 0;
  transition: width 0.6s ease, background 0.3s;
}
.gauge-sub { margin-top: 8px; font-size: 0.76rem; color: var(--text-dim); }

/* ------------------------------------------------------- Monitor-Karten */

.group-label {
  margin: 24px 0 -2px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.monitor-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.monitor-card:hover { border-color: #333a47; background: #1c1f25; }

.monitor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.monitor-name {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.monitor-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  background: var(--text-dim);
}
.dot.up { background: var(--up); animation: beat 1.6s ease-in-out infinite; }
.dot.down { background: var(--down); animation: beat 0.9s ease-in-out infinite; }
@keyframes beat {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.75); opacity: 0.65; }
}
@media (prefers-reduced-motion: reduce) { .dot { animation: none !important; } }

/* Uptime-Balken */
.uptime-bars {
  display: flex;
  gap: 2px;
  margin-top: 12px;
  height: 24px;
}
.uptime-bar {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px;
  background: var(--bar-empty);
  transition: opacity 0.15s, transform 0.15s;
}
.uptime-bar:hover { opacity: 0.7; transform: scaleY(1.12); }
.uptime-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-dim);
}
/* Auf schmalen Displays weniger Tage zeigen — Legende zieht mit */
.only-md, .only-sm { display: none; }
@media (max-width: 700px) {
  .uptime-bar.hide-sm { display: none; }
  .only-lg { display: none; }
  .only-md { display: inline; }
}
@media (max-width: 460px) {
  .uptime-bar.hide-xs { display: none; }
  .only-md { display: none; }
  .only-sm { display: inline; }
}

/* Detailbereich einer Monitorkarte */
.monitor-detail {
  display: none;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.monitor-card.open .monitor-detail { display: block; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}
.detail-item .k {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
}
.detail-item .v { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------- Vorfälle / Wartung */

.entry {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-dim);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-top: 12px;
}
.entry[data-sev='minor'] { border-left-color: var(--warn); }
.entry[data-sev='major'] { border-left-color: #ff6b35; }
.entry[data-sev='critical'] { border-left-color: var(--down); }
.entry[data-sev='resolved'] { border-left-color: var(--up); }
.entry[data-sev='maintenance'] { border-left-color: var(--info); }
.entry[data-sev='news'] { border-left-color: var(--accent); }

.entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.entry-title { font-weight: 800; font-size: 1rem; }
.entry-time { font-size: 0.78rem; color: var(--text-dim); flex: none; }
.entry-body { margin-top: 8px; color: var(--text-muted); white-space: pre-wrap; }

.badge {
  display: inline-block;
  padding: 2px 11px;
  border-radius: 800px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--bar-empty);
  color: var(--text-muted);
}
.badge.up { background: rgba(46, 202, 139, 0.16); color: var(--up); }
.badge.down { background: rgba(228, 63, 82, 0.16); color: var(--down); }
.badge.warn { background: rgba(241, 116, 37, 0.16); color: var(--warn); }
.badge.info { background: rgba(47, 85, 212, 0.2); color: #7d97ea; }

.timeline { margin-top: 12px; border-left: 2px solid var(--border); padding-left: 15px; }
.timeline-item { margin-bottom: 13px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item .t { font-size: 0.74rem; color: var(--text-dim); }
.timeline-item .m { color: var(--text-muted); white-space: pre-wrap; }

.affected {
  margin-top: 9px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.74rem;
}
.chip {
  padding: 2px 10px;
  border-radius: 800px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ------------------------------------------------------------- Footer */

.footer {
  margin-top: 56px;
  padding: 26px 0 40px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.83rem;
}
.footer .lang {
  margin-top: 10px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.lang-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 800px;
  padding: 3px 12px;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.lang-btn.active { border-color: var(--accent); color: var(--accent); }

.skeleton {
  background: linear-gradient(90deg, var(--bg-elev) 25%, var(--bg-elev-2) 50%, var(--bg-elev) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
  height: 74px;
  margin-top: 12px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.hidden { display: none !important; }
