/* =========================
   STATUS SYSTEM
========================= */

.tm-badge,
.tm-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  width: fit-content;

  padding: 8px 12px;

  border-radius: 999px;

  background: var(--tm-bg-soft);
  color: var(--tm-muted);

  font-size: 0.78rem;
  font-weight: 800;

  line-height: 1;
}

.tm-badge::before,
.tm-status-badge::before {
  content: "";

  width: 8px;
  height: 8px;

  border-radius: 999px;

  background: currentColor;
}

/* Varianten */

.tm-status-good {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.tm-status-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.tm-status-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.tm-status-info {
  background: rgba(37, 99, 235, 0.12);
  color: var(--tm-primary);
}

/* Status Card */

.tm-status-card {
  padding: 28px;

  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-lg);

  background: #ffffff;

  box-shadow: var(--tm-shadow-md);
}

.tm-status-card h3 {
  margin-bottom: 10px;
}

.tm-status-card p {
  margin: 0;

  color: var(--tm-muted);

  line-height: 1.7;
}

/* Metric */

.tm-metric {
  display: grid;
  gap: 8px;
}

.tm-metric strong {
  color: var(--tm-text);

  font-size: clamp(2.4rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.tm-metric span {
  color: var(--tm-muted);

  font-size: 0.9rem;
  font-weight: 700;
}

/* Mobile */

@media (max-width: 768px) {
  .tm-status-card {
    padding: 24px;
  }

  .tm-status-card-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* =========================
   STATUS ROW
========================= */

.tm-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

@keyframes tmPulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.45;
    transform: scale(1.18);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* =========================
   KPI CARDS
========================= */

.tm-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 20px;

  padding: 30px;

  border: 1px solid rgba(226,232,240,0.9);
  border-radius: 28px;

  background: #ffffff;

  box-shadow:
    0 10px 30px rgba(15,23,42,0.04),
    0 2px 10px rgba(15,23,42,0.03);
}

.tm-kpi-label {
  color: #64748b;

  font-size: 0.82rem;
  font-weight: 800;

  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tm-kpi-value {
  color: #0f172a;

  font-size: clamp(2.6rem, 4vw, 4rem);
  font-weight: 850;

  line-height: 0.95;
  letter-spacing: -0.06em;
}

.tm-kpi-change {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  width: fit-content;

  padding: 8px 12px;

  border-radius: 999px;

  font-size: 0.78rem;
  font-weight: 800;
}

.tm-kpi-up {
  background: rgba(34,197,94,0.12);
  color: #15803d;
}

.tm-kpi-down {
  background: rgba(239,68,68,0.12);
  color: #b91c1c;
}

.tm-kpi-neutral {
  background: rgba(148,163,184,0.14);
  color: #475569;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 760px) {

  .tm-kpi-card {
    padding: 24px;
    border-radius: 24px;
  }

  .tm-kpi-value {
    font-size: 2.6rem;
  }

}

/* =========================
   STATUS / AMPEL SYSTEM
========================= */

/* =========================================
   STATUS / AMPEL SYSTEM
========================================= */

.tm-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 42px;
}

.tm-status-traffic {
  position: relative;
  overflow: hidden;

  padding: 28px;
  border-radius: 24px;

  background: rgba(255, 255, 255, .98);

  border: 1px solid rgba(226, 232, 240, .85);

  box-shadow:
    0 10px 30px rgba(15, 23, 42, .05),
    inset 0 1px 0 rgba(255, 255, 255, .7);

  backdrop-filter: blur(14px);

  transition:
    transform .25s ease,
    box-shadow .25s ease,
    border-color .25s ease;
}

.tm-status-traffic:hover {
  transform: translateY(-4px);

  box-shadow:
    0 18px 45px rgba(15, 23, 42, .08),
    inset 0 1px 0 rgba(255, 255, 255, .8);
}

.tm-status-traffic::before {
  content: "";

  position: absolute;
  inset: 0;

  opacity: .95;
  pointer-events: none;
}

.tm-status-good::before {
  background:
    radial-gradient(circle at 0% 0%,
      rgba(22, 163, 74, .10),
      transparent 38%),
    linear-gradient(180deg,
      rgba(255, 255, 255, .00),
      rgba(255, 255, 255, .35));
}

.tm-status-warning::before {
  background:
    radial-gradient(circle at 0% 0%,
      rgba(245, 158, 11, .12),
      transparent 38%),
    linear-gradient(180deg,
      rgba(255, 255, 255, .00),
      rgba(255, 255, 255, .35));
}

.tm-status-danger::before {
  background:
    radial-gradient(circle at 0% 0%,
      rgba(220, 38, 38, .10),
      transparent 38%),
    linear-gradient(180deg,
      rgba(255, 255, 255, .00),
      rgba(255, 255, 255, .35));
}

.tm-status-traffic>* {
  position: relative;
  z-index: 2;
}

.tm-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 32px;
  padding: 0 14px;

  border-radius: 999px;

  font-size: .78rem;
  font-weight: 700;
}

.tm-status-good .tm-status-pill {
  background: rgba(22, 163, 74, .10);
  color: #15803D;
}

.tm-status-warning .tm-status-pill {
  background: rgba(245, 158, 11, .12);
  color: #B45309;
}

.tm-status-danger .tm-status-pill {
  background: rgba(220, 38, 38, .10);
  color: #B91C1C;
}

.tm-status-traffic-lights {
  display: flex;
  flex-direction: column;
  gap: 14px;

  width: 68px;

  padding: 14px;

  border-radius: 999px;

  background:
    linear-gradient(180deg,
      #0F172A,
      #1E293B);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 12px 24px rgba(15, 23, 42, .18);
}

.tm-status-light {
  position: relative;

  width: 40px;
  height: 40px;

  border-radius: 50%;

  background: rgba(255, 255, 255, .14);

  opacity: .42;

  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, .06),
    inset 0 -4px 10px rgba(0, 0, 0, .35);

  transition:
    opacity .3s ease,
    box-shadow .3s ease,
    transform .3s ease;
}

.tm-status-light::before {
  content: "";

  position: absolute;
  inset: 6px;

  border-radius: inherit;

  background:
    radial-gradient(circle at 30% 30%,
      rgba(255, 255, 255, .18),
      rgba(255, 255, 255, .02));
}

.tm-status-good .tm-status-light-green,
.tm-status-warning .tm-status-light-yellow,
.tm-status-danger .tm-status-light-red {
  opacity: 1;
  transform: scale(1.02);
}

.tm-status-good .tm-status-light-green {
  background: #16A34A;

  box-shadow:
    0 0 22px rgba(22, 163, 74, .45),
    0 0 44px rgba(22, 163, 74, .18);
}

.tm-status-warning .tm-status-light-yellow {
  background: #F59E0B;

  box-shadow:
    0 0 22px rgba(245, 158, 11, .45),
    0 0 44px rgba(245, 158, 11, .18);
}

.tm-status-danger .tm-status-light-red {
  background: #DC2626;

  box-shadow:
    0 0 22px rgba(220, 38, 38, .45),
    0 0 44px rgba(220, 38, 38, .18);
}

@media (max-width: 1100px) {

  .tm-status-grid {
    grid-template-columns: 1fr;
  }

  .tm-status-traffic {
    padding: 24px;
  }

}

@media (max-width: 640px) {

  .tm-status-traffic {
    border-radius: 22px;
  }

}

/*Abtsand der Ampel zur Überschrift */

.tm-status-traffic-card {
  margin-top: 26px;
}

.tm-status-badge::before,
.tm-badge::before {
  flex: 0 0 auto;
  box-shadow:
    0 0 0 5px color-mix(in srgb, currentColor 14%, transparent),
    0 0 18px color-mix(in srgb, currentColor 34%, transparent);
}

.tm-status-good::before {
  background: #22c55e;
  box-shadow:
    0 0 0 5px rgba(34,197,94,.14),
    0 0 18px rgba(34,197,94,.34);
}

.tm-status-info::before {
  background: #2563eb;
  box-shadow:
    0 0 0 5px rgba(37,99,235,.12),
    0 0 18px rgba(37,99,235,.30);
}

.tm-status-warning::before {
  background: #f59e0b;
  box-shadow:
    0 0 0 5px rgba(245,158,11,.14),
    0 0 18px rgba(245,158,11,.32);
}
