:root {
  --bg: #050816;
  --bg-card: #111827;
  --bg-card-hover: #1f2937;
  --accent: #facc15;
  --accent-soft: rgba(250, 204, 21, 0.15);
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --border: #1f2937;
  --ok: #22c55e;
  --warn: #fbbf24;
  --radius-xl: 18px;
  --shadow-soft: 0 18px 40px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #111827 0, #020617 55%, #020617 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header-Bereich */

header {
  padding: 18px 20px 10px;
  border-bottom: 1px solid rgba(148,163,184,0.2);
  backdrop-filter: blur(12px);
  background: linear-gradient(to right, rgba(15,23,42,0.95), rgba(15,23,42,0.85));
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-pill {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #fde68a, #f97316 40%, #78350f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 10px 25px rgba(0,0,0,.6);
}

.title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.subtitle {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Suche + Pill */

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-input {
  background: rgba(15,23,42,0.9);
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.45);
  color: var(--text);
  font-size: .9rem;
  padding: 7px 12px;
  min-width: 180px;
  outline: none;
}

.search-input::placeholder {
  color: rgba(148,163,184,0.8);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(250,204,21,0.5);
}

.pill {
  font-size: .8rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.6);
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s ease, transform .08s ease, box-shadow .15s ease;
}

.pill span.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
}

.pill:hover {
  background: rgba(15,23,42,0.9);
  box-shadow: 0 0 0 1px rgba(148,163,184,0.4);
  transform: translateY(-1px);
}

/* Layout */

main {
  flex: 1;
  padding: 18px 16px 24px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Tabellen-Card */

.table-card {
  background: linear-gradient(135deg, rgba(15,23,42,.96), rgba(17,24,39,.98));
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148,163,184,0.3);
  padding: 14px 16px 10px;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(51,65,85,0.8);
}

.table-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-title-badge {
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(250,204,21,0.45);
}

.table-sub {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Tabelle */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.table thead {
  text-align: left;
  color: var(--text-muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table th,
.table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(30,41,59,0.85);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background .12s ease, transform .08s ease, box-shadow .12s ease;
}

.table tbody tr:hover {
  background: rgba(15,23,42,0.98);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0,0,0,.45);
}

.table tbody tr:hover .plant-name {
  color: var(--accent);
}

/* Anlagen-Spalte */

.plant-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plant-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: radial-gradient(circle at 25% 25%, #fde68a, #f97316 40%, #4b5563 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 10px 20px rgba(0,0,0,.6);
}

.plant-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plant-name {
  font-weight: 500;
}

.plant-location {
  font-size: .8rem;
  color: var(--text-muted);
}

/* ============================================
   STATUS-BADGES (Normal / Wartung / im Bau)
   ============================================ */

/* Standard: Normal (grün) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: .78rem;
  border: 1px solid rgba(34,197,94,0.45);
  background: rgba(22,163,74,0.18);
  color: #bbf7d0;
}

.status-pill .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.25);
}

/* Wartung (orange) */
.status-pill[data-status="Wartung"] {
  border-color: rgba(252, 140, 24, 0.6);
  background: rgba(252, 140, 24, 0.20);
  color: #ffedd5;
}

.status-pill[data-status="Wartung"] .status-dot {
  background: #f97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.25);
}

/* im Bau (rot) */
.status-pill[data-status="im Bau"] {
  border-color: rgba(239,68,68,0.65);
  background: rgba(239,68,68,0.20);
  color: #fecaca;
}

.status-pill[data-status="im Bau"] .status-dot {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.25);
}

/* Typ-Tag */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .8rem;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15,23,42,0.85);
  border: 1px solid rgba(51,65,85,0.9);
}

/* Zahlen */

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Aktion / Buttons */

.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-link {
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.7);
  background: transparent;
  color: var(--text);
  font-size: .8rem;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: filter .12s ease, transform .08s ease, box-shadow .12s ease;
}

.btn-link.primary {
  border-color: var(--accent);
  background: radial-gradient(circle at 30% 0, #fef9c3 0, #facc15 38%, #b45309 85%);
  color: #1f2937;
  box-shadow: 0 10px 25px rgba(250,204,21,0.55);
}

.btn-link.primary span.icon {
  font-size: 1rem;
}

.btn-link:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

/* Hinweis */

.hint {
  margin-top: 10px;
  font-size: .78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hint-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
}

/* Responsive */

@media (max-width: 800px) {
  header {
    padding: 14px 12px 8px;
  }
  main {
    padding: 14px 10px 20px;
  }
  .table-card {
    padding: 10px 10px 8px;
  }
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .search-wrap {
    width: 100%;
    justify-content: space-between;
  }

  .table thead {
    display: none;
  }
  .table tbody tr {
    display: block;
    padding: 8px 4px;
    border-radius: 14px;
    border: 1px solid rgba(30,41,59,0.9);
    margin-bottom: 8px;
  }
  .table tbody tr:hover {
    transform: translateY(-2px);
  }
  .table tbody td {
    display: flex;
    justify-content: space-between;
    border-bottom: none;
    padding: 4px 4px;
  }
  .table tbody td::before {
    content: attr(data-label);
    font-size: .75rem;
    color: var(--text-muted);
    margin-right: 10px;
  }
  .actions {
    justify-content: flex-start;
  }
}
