:root {
  --hintergrund: #0b0d12;
  --oberflaeche: #12151c;
  --oberflaeche-hell: #1a1f2a;
  --rand: #2a3140;
  --text: #e8eaef;
  --text-muted: #9aa3b5;
  --gold: #c9a227;
  --gold-hell: #e4c04d;
  --gold-dunkel: #8a7018;
  --erfolg: #3ecf8e;
  --fehler: #ff6b6b;
  --radius: 12px;
  --schatten: 0 12px 40px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", system-ui, sans-serif;
  background: radial-gradient(ellipse at top, #151a24 0%, var(--hintergrund) 55%);
  color: var(--text);
}

#app {
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-karte {
  width: min(420px, 100%);
  background: linear-gradient(160deg, var(--oberflaeche) 0%, #0f1218 100%);
  border: 1px solid var(--rand);
  border-radius: calc(var(--radius) + 4px);
  padding: 32px;
  box-shadow: var(--schatten);
}

.logo-block {
  text-align: center;
  margin-bottom: 28px;
}

.logo-ring {
  display: inline-block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  box-shadow: 0 0 24px rgba(201, 162, 39, 0.35);
  margin-bottom: 12px;
  background: radial-gradient(circle at 30% 30%, var(--gold-hell), var(--gold-dunkel));
}

.login-karte h1 {
  font-size: 1.35rem;
  margin: 0 0 8px;
}

.untertitel {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 14px 0 6px;
}

input, select, textarea {
  width: 100%;
  background: var(--oberflaeche-hell);
  border: 1px solid var(--rand);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

.btn:focus-visible,
.nav-link:focus-visible,
.benutzer-aktionen button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.nas-hilfe-tour-panel:focus-visible {
  outline: 2px solid var(--gold-hell, #e8c872);
  outline-offset: 4px;
}

.glb-viewer-panel:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  width: 100%;
  margin-top: 18px;
  background: linear-gradient(135deg, var(--gold-hell), var(--gold-dunkel));
  color: #1a1405;
  box-shadow: 0 8px 20px rgba(201, 162, 39, 0.25);
}

.btn-secondary {
  background: var(--oberflaeche-hell);
  color: var(--text);
  border: 1px solid var(--rand);
}

.btn-ghost {
  width: 100%;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--rand);
}

.fehler-text {
  color: var(--fehler);
  font-size: 0.88rem;
  margin-top: 12px;
}

.hinweis {
  margin-top: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.seitenleiste {
  background: var(--oberflaeche);
  border-right: 1px solid var(--rand);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
}

.markenzeichen {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid var(--rand);
  margin-bottom: 16px;
}

.logo-mini {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-hell), var(--gold-dunkel));
  box-shadow: 0 0 16px rgba(201, 162, 39, 0.3);
}

.markenzeichen strong {
  display: block;
  letter-spacing: 0.06em;
}

.markenzeichen small {
  color: var(--text-muted);
}

.navigation {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-link {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}

.nav-link:hover {
  color: var(--text);
  background: var(--oberflaeche-hell);
}

.nav-link.aktiv {
  color: var(--gold-hell);
  border-color: rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.08);
}

.seitenleiste-fuss {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--rand);
}

.benutzer-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.inhalt {
  padding: 28px 32px 40px;
}

.kopfzeile {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.kopfzeile h2 {
  margin: 0 0 6px;
  font-size: 1.6rem;
}

.kopfzeile p {
  margin: 0;
  color: var(--text-muted);
}

.kopfzeile-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.bridge-indikator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--rand);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  white-space: nowrap;
  max-width: min(320px, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
}

.bridge-indikator-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.bridge-indikator-name {
  color: var(--text-muted);
  font-weight: 400;
}

.bridge-indikator--online .bridge-indikator-name,
.bridge-indikator--offline .bridge-indikator-name {
  color: inherit;
  opacity: 0.85;
}

.bridge-indikator-punkt {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.bridge-indikator--online {
  color: #7dcea0;
  border-color: rgba(125, 206, 160, 0.45);
  background: rgba(46, 125, 80, 0.12);
}

.bridge-indikator--online .bridge-indikator-punkt {
  background: #2ecc71;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.55);
}

.bridge-indikator--offline {
  color: #e8a0a0;
  border-color: rgba(232, 160, 160, 0.35);
  background: rgba(180, 60, 60, 0.1);
}

.bridge-indikator--offline .bridge-indikator-punkt {
  background: #e74c3c;
  box-shadow: none;
}

.bridge-indikator--pruefen .bridge-indikator-punkt {
  animation: bridge-puls 1.2s ease-in-out infinite;
}

@keyframes bridge-puls {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

.badge {
  background: rgba(201, 162, 39, 0.12);
  color: var(--gold-hell);
  border: 1px solid rgba(201, 162, 39, 0.35);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.seite {
  display: none;
}

.seite.aktiv {
  display: block;
}

.karten-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.bridge-grid {
  grid-template-columns: 1fr 2fr;
}

.karte {
  background: var(--oberflaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--schatten);
}

.karte h3 {
  margin: 0 0 12px;
  color: var(--gold-hell);
  font-size: 1rem;
}

.karte-breit {
  grid-column: span 1;
}

.zahl {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  color: var(--gold);
}

.status-zeile {
  margin: 0;
  color: var(--text-muted);
}

.formular-inline {
  display: grid;
  grid-template-columns: 1fr 1.5fr auto;
  gap: 10px;
  margin-bottom: 16px;
}

.formular-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.tabelle-wrapper {
  overflow: auto;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  background: var(--oberflaeche);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rand);
  text-align: left;
}

th {
  color: var(--gold-hell);
  font-weight: 600;
  background: var(--oberflaeche-hell);
}

tr:last-child td {
  border-bottom: none;
}

.code-ausgabe {
  margin-top: 16px;
  background: #080a0f;
  border: 1px solid var(--rand);
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--oberflaeche-hell);
  border: 1px solid var(--gold-dunkel);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: var(--schatten);
  max-width: 360px;
  z-index: 1000;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .seitenleiste {
    border-right: none;
    border-bottom: 1px solid var(--rand);
  }

  .navigation {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .formular-inline {
    grid-template-columns: 1fr;
  }

  .bridge-grid {
    grid-template-columns: 1fr;
  }
}
