:root {
  --bg: #0b1020;
  --bg2: #121a31;
  --card: rgba(255, 255, 255, 0.07);
  --card-hover: rgba(255, 255, 255, 0.11);
  --text: #eef2ff;
  --muted: #b8c0e0;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);

  --ok: rgba(34, 197, 94, 0.9);
  --ok-soft: rgba(34, 197, 94, 0.22);

  --fail: rgba(239, 68, 68, 0.9);
  --fail-soft: rgba(239, 68, 68, 0.22);

  --unknown: rgba(148, 163, 184, 0.7);
  --unknown-soft: rgba(148, 163, 184, 0.18);

  --checking: rgba(251, 191, 36, 0.9);
  --checking-soft: rgba(251, 191, 36, 0.22);
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(9, 14, 28, 0.85), rgba(9, 14, 28, 0.92)),
    url("./images/bg-dashboard.svg") center center / cover no-repeat fixed,
    linear-gradient(180deg, var(--bg), var(--bg2));
}

/* optional: blur bubbles kannst du drin lassen oder entfernen */
.bg-blur {
  display: none;
}

.tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
}

.tile:hover {
  transform: translateY(-2px);
  background: var(--card-hover);
}

.tile-image {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  object-fit: cover;
  padding: 0;
}

.meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.meta strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: lowercase;
}

@media (max-width: 640px) {
  .tile {
    min-height: 86px;
    padding: 10px 12px;
  }

  .tile-image {
    width: 56px;
    height: 56px;
  }
}

/* --- grid: statt full-width-stretch lieber wrap/floating cards --- */
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

/* --- tile: feste kartenbreite, damit sie nicht jede zeile voll machen --- */
.tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;

  flex: 0 0 250px;      /* feste breite pro karte */
  max-width: 250px;
  min-height: 96px;

  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
}

.tile:hover {
  transform: translateY(-2px);
  background: var(--card-hover);
}

.tile:active {
  transform: translateY(0);
}

/* --- wichtig: content über status-overlay legen --- */
.tile > * {
  position: relative;
  z-index: 2;
}

/* --- dein neues image styling --- */
.tile-image {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 6px;
}

/* --- textblock --- */
.meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: lowercase;
}

/* --- status-ring wieder deutlich sichtbar --- */
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  border: 1px solid transparent;
  box-shadow: inset 0 0 0 0 transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  z-index: 1;
}

/* --- zusätzlicher status-dot oben rechts (damit man’s direkt sieht) --- */
.tile::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--unknown);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.18);
  z-index: 3;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.tile.status-ok::after {
  border-color: var(--ok);
  box-shadow: inset 0 0 0 1px var(--ok-soft), 0 0 0 2px rgba(34, 197, 94, 0.06);
}
.tile.status-ok::before {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.tile.status-fail::after {
  border-color: var(--fail);
  box-shadow: inset 0 0 0 1px var(--fail-soft), 0 0 0 2px rgba(239, 68, 68, 0.05);
}
.tile.status-fail::before {
  background: var(--fail);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
}

.tile.status-unknown::after {
  border-color: var(--unknown);
  box-shadow: inset 0 0 0 1px var(--unknown-soft);
}
.tile.status-unknown::before {
  background: var(--unknown);
}

.tile.status-checking::after {
  border-color: var(--checking);
  box-shadow: inset 0 0 0 1px var(--checking-soft);
}
.tile.status-checking::before {
  background: var(--checking);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18);
}

/* optional: checking animation jetzt aufs image statt .badge */
.tile.status-checking .tile-image {
  animation: pulse 1s ease-in-out infinite;
}

/* mobile: dann darf wieder full width sein */
@media (max-width: 700px) {
  .grid {
    gap: 10px;
  }

  .tile {
    flex: 1 1 100%;
    max-width: none;
    min-height: 86px;
    border-radius: 14px;
  }

  .tile::after {
    border-radius: 14px;
  }

  .tile-image {
    width: 56px;
    height: 56px;
  }
}

