/* Developed by Enjyn Gruppe — https://enjyn.de */

:root {
  --grund:      #f6f7f6;
  --flaeche:    #ffffff;
  --leiste:     #0d2620;
  --leiste-2:   #14352c;
  --linie:      #e2e6e3;
  --linie-stark:#cfd6d2;
  --tinte:      #14201c;
  --tinte-matt: #5b6863;
  --tinte-leise:#7d8a85;
  --gruen:      #0f6b52;
  --gruen-tief: #0a4e3c;
  --gruen-hauch:#eaf4f0;
  --gold:       #b08d3e;
  --gold-hauch: #fbf5e7;
  --rot:        #b3261e;
  --rot-hauch:  #fdecea;

  --text: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --kasse: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --kurve: cubic-bezier(.22, 1, .36, 1);
  --kurz: 150ms;
  --dauer: 220ms;

  --z-leiste: 20;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--tinte);
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.011em; }

/* ---- Kopfleiste ---- */

.leiste {
  position: sticky;
  top: 0;
  z-index: var(--z-leiste);
  background: var(--leiste);
  color: #eef3f1;
}

.leiste-innen {
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.leiste-marke {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
}

.leiste-marke svg { width: 1.3rem; height: 1.3rem; color: var(--gold); flex: none; }
.leiste-marke span { color: rgba(238, 243, 241, .6); font-weight: 400; }

.leiste-weg { display: flex; gap: .15rem; margin-left: auto; }

.leiste-weg button {
  padding: .45rem .85rem;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: rgba(238, 243, 241, .68);
  font-family: var(--text);
  font-size: .89rem;
  cursor: pointer;
  transition: background var(--kurz) var(--kurve), color var(--kurz) var(--kurve);
}

.leiste-weg button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.leiste-weg button[data-an] { background: rgba(255, 255, 255, .13); color: #fff; }
.leiste-weg button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.leiste-gast {
  padding: .4rem .8rem;
  border: 1px solid rgba(238, 243, 241, .25);
  border-radius: 7px;
  color: inherit;
  font-size: .85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color var(--kurz) var(--kurve);
}

.leiste-gast:hover { border-color: var(--gold); color: var(--gold); }

@media (max-width: 760px) {
  .leiste-innen { height: auto; padding-block: .6rem; flex-wrap: wrap; }
  .leiste-weg { width: 100%; margin-left: 0; overflow-x: auto; }
}

/* ---- Rumpf ---- */

.rumpf { max-width: 78rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

.seiten-kopf {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.seiten-kopf h2 { font-size: 1.35rem; }
.seiten-kopf p { margin: .25rem 0 0; color: var(--tinte-matt); font-size: .92rem; }

.blatt { display: none; }
.blatt[data-an] { display: block; }

/* ---- Kennzahlen ---- */

.zahlen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.zahl {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}

.zahl dt {
  font-size: .78rem;
  color: var(--tinte-leise);
  letter-spacing: .01em;
}

.zahl dd {
  margin: .35rem 0 0;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.zahl-neben { margin: .2rem 0 0; font-size: .8rem; color: var(--tinte-leise); }

/* Ein gesperrter Hauptknopf soll nicht mehr nach Hauptknopf aussehen. */
.knopf--voll:disabled { background: #dfe4e1; color: var(--tinte-leise); }

/* ---- Karten und Tabellen ---- */

.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 10px;
  overflow: hidden;
}

.karte + .karte { margin-top: 1.25rem; }

.karte-kopf {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--linie);
}

.karte-kopf h3 { font-size: 1rem; }
.karte-kopf p { margin: .15rem 0 0; font-size: .85rem; color: var(--tinte-leise); }

.karte-rumpf { padding: 1.25rem; }

.tabelle-rahmen { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }

th {
  text-align: left;
  padding: .65rem 1.25rem;
  background: #fafbfa;
  border-bottom: 1px solid var(--linie);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--tinte-leise);
  white-space: nowrap;
}

td {
  padding: .8rem 1.25rem;
  border-bottom: 1px solid var(--linie);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--kurz) var(--kurve); }
tbody tr:hover { background: #fafbfa; }

.zahlspalte { font-family: var(--kasse); font-variant-numeric: tabular-nums; }

.leer {
  padding: 3rem 1.25rem;
  text-align: center;
  color: var(--tinte-leise);
}

.leer strong { display: block; color: var(--tinte); font-weight: 600; margin-bottom: .3rem; }

/* ---- Marken ---- */

.marke-zustand {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 500;
  white-space: nowrap;
}

.marke-zustand::before {
  content: "";
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: currentColor;
}

.marke-zustand[data-z="online"]   { background: var(--gruen-hauch); color: var(--gruen-tief); }
.marke-zustand[data-z="wartet"]   { background: var(--gold-hauch); color: var(--gold); }
.marke-zustand[data-z="beendet"]  { background: #f1f3f2; color: var(--tinte-leise); }

.quelle {
  font-size: .78rem;
  padding: .15rem .5rem;
  border-radius: 5px;
  background: #f1f3f2;
  color: var(--tinte-matt);
}

.quelle[data-q="pms"] { background: var(--gruen-hauch); color: var(--gruen-tief); }

/* ---- Knöpfe ---- */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .55rem 1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--text);
  font-size: .89rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--kurz) var(--kurve), border-color var(--kurz) var(--kurve),
              color var(--kurz) var(--kurve);
}

.knopf--voll { background: var(--gruen); color: #fff; }
.knopf--voll:hover { background: var(--gruen-tief); }
.knopf--rand { background: var(--flaeche); border-color: var(--linie-stark); color: var(--tinte); }
.knopf--rand:hover { border-color: var(--gruen); color: var(--gruen); }
.knopf--klein { padding: .35rem .7rem; font-size: .84rem; }
.knopf--gefahr { background: var(--flaeche); border-color: var(--linie-stark); color: var(--rot); }
.knopf--gefahr:hover { background: var(--rot-hauch); border-color: var(--rot); }
.knopf:disabled { opacity: .5; cursor: default; }
.knopf:focus-visible { outline: 2px solid var(--gruen); outline-offset: 2px; }

.knopf-reihe { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---- Formular ---- */

.formgitter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.feld label {
  display: block;
  font-size: .82rem;
  font-weight: 500;
  color: var(--tinte-matt);
  margin-bottom: .35rem;
}

.feld input, .feld select {
  width: 100%;
  padding: .6rem .75rem;
  background: var(--flaeche);
  border: 1px solid var(--linie-stark);
  border-radius: 8px;
  color: var(--tinte);
  font-family: var(--text);
  font-size: .92rem;
  transition: border-color var(--kurz) var(--kurve), box-shadow var(--kurz) var(--kurve);
}

.feld input:hover, .feld select:hover { border-color: #b3bdb8; }

.feld input:focus, .feld select:focus {
  outline: none;
  border-color: var(--gruen);
  box-shadow: 0 0 0 3px rgba(15, 107, 82, .14);
}

.feld-fehler { color: var(--rot); font-size: .82rem; margin: .3rem 0 0; }
.feld-fehler:empty { display: none; }

.feld-hilfe { color: var(--tinte-leise); font-size: .82rem; margin: .3rem 0 0; }

/* ---- Anbindung ---- */

.anbindung {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 880px) { .anbindung { grid-template-columns: 1fr; } }

.status-zeile {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--linie);
  font-size: .92rem;
}

.status-punkt {
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  flex: none;
  background: var(--gruen);
  box-shadow: 0 0 0 3px rgba(15, 107, 82, .18);
}

.status-punkt[data-aus] { background: var(--tinte-leise); box-shadow: 0 0 0 3px rgba(125, 138, 133, .2); }

.zuordnung { font-family: var(--kasse); font-size: .84rem; }

.zuordnung-zeile {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem 0;
  border-bottom: 1px dashed var(--linie);
}

.zuordnung-zeile:last-child { border-bottom: 0; }
.zuordnung-zeile span:first-child { flex: none; width: 8rem; color: var(--tinte-matt); }
.zuordnung-pfeil { color: var(--tinte-leise); }
.zuordnung-zeile code {
  background: var(--gruen-hauch);
  color: var(--gruen-tief);
  padding: .1rem .4rem;
  border-radius: 4px;
}

.protokoll {
  font-family: var(--kasse);
  font-size: .82rem;
  line-height: 1.7;
  max-height: 14rem;
  overflow-y: auto;
}

.protokoll div { padding: .2rem 0; border-bottom: 1px dashed var(--linie); }
.protokoll div:last-child { border-bottom: 0; }
.protokoll time { color: var(--tinte-leise); margin-right: .6rem; }

/* ---- Hinweisband ---- */

.band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
  padding: .8rem 1.25rem;
  background: var(--gold-hauch);
  border-bottom: 1px solid #f0e3c4;
  font-size: .87rem;
  color: #6b5518;
}

.band strong { font-weight: 600; }
.band a { color: inherit; }

/* ---- Werkzeugzeile ---- */

.werkzeuge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
}

.suche {
  flex: 1;
  min-width: 12rem;
  padding: .55rem .8rem;
  background: var(--flaeche);
  border: 1px solid var(--linie-stark);
  border-radius: 8px;
  font-family: var(--text);
  font-size: .9rem;
}

.suche:focus { outline: none; border-color: var(--gruen); box-shadow: 0 0 0 3px rgba(15, 107, 82, .14); }

/* ---- Anmeldung ---- */

.anmeldung {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(36rem 22rem at 50% -4rem, rgba(176, 141, 62, .22), transparent 70%),
    linear-gradient(165deg, #14352c, #081a15);
}

.anmelde-karte {
  width: 100%;
  max-width: 22rem;
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(224, 197, 132, .22);
  border-radius: 16px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8);
  color: #f0ece1;
}

.anmelde-zeichen { width: 2.2rem; height: 2.2rem; color: #d9bc7c; margin-bottom: 1rem; }

.anmelde-karte h1 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.anmelde-haus {
  margin: .3rem 0 2rem;
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #d9bc7c;
}

.anmelde-label {
  display: block;
  font-size: .8rem;
  color: rgba(240, 236, 225, .65);
  margin-bottom: .75rem;
}

.pin-felder {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-bottom: .25rem;
}

.pin-felder input {
  width: 3rem;
  height: 3.5rem;
  padding: 0;
  text-align: center;
  background: rgba(8, 26, 21, .6);
  border: 1px solid rgba(224, 197, 132, .28);
  border-radius: 10px;
  color: #f0ece1;
  font-family: var(--kasse);
  font-size: 1.5rem;
  font-weight: 600;
  transition: border-color var(--kurz) var(--kurve), box-shadow var(--kurz) var(--kurve);
}

.pin-felder input:hover { border-color: rgba(224, 197, 132, .5); }

.pin-felder input:focus {
  outline: none;
  border-color: #d9bc7c;
  box-shadow: 0 0 0 3px rgba(217, 188, 124, .2);
}

.anmelde-fehler {
  min-height: 1.4rem;
  margin: .6rem 0 0;
  font-size: .85rem;
  color: #e8a87c;
}

.anmelde-knopf {
  width: 100%;
  margin-top: 1rem;
  padding-block: .8rem;
  background: #d9bc7c;
  color: #0b2019;
  font-weight: 600;
}

.anmelde-knopf:hover { background: #e6cd94; }

/* Bei falscher PIN wackeln die Felder kurz — schneller verstanden als jeder Satz. */
@keyframes wackeln {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.pin-felder[data-falsch] { animation: wackeln .4s ease-in-out; }
.pin-felder[data-falsch] input { border-color: #e8a87c; }

@media (prefers-reduced-motion: reduce) {
  .pin-felder[data-falsch] { animation: none; }
}

.anmelde-fuss {
  margin: 1.75rem 0 0;
  font-size: .8rem;
  line-height: 1.7;
  color: rgba(240, 236, 225, .5);
}

.anmelde-fuss a { color: #d9bc7c; }

/* Abmelden sitzt in der Leiste und ist ein Knopf, kein Link. */
button.leiste-gast {
  background: transparent;
  font-family: var(--text);
  cursor: pointer;
}
