* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: background 0.25s, color 0.25s;
}
button, input { font: inherit; color: inherit; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--bg-panel);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 28px;
}
.logo {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 6px;
}
.logo b { font-size: 26px; letter-spacing: 0.5px; }
.logo span { color: var(--akzent); font-size: 26px; font-weight: 700; }
.claim { color: var(--text-dim); font-size: 13px; margin-bottom: 24px; }
.feld { margin-bottom: 14px; }
.feld label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.feld input {
  width: 100%; padding: 13px 14px;
  background: var(--bg); border: 1px solid var(--rand);
  border-radius: 10px; outline: none;
}
.feld input:focus { border-color: var(--akzent); }
.knopf {
  width: 100%; padding: 14px; margin-top: 6px;
  background: var(--akzent); color: #fff; font-weight: 600;
  border: 0; border-radius: 10px; cursor: pointer;
}
.knopf:active { transform: translateY(1px); }
.fehler-text { color: var(--fehler); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ---------- App-Rahmen ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--rand);
}
.topbar .logo b, .topbar .logo span { font-size: 19px; }
.topbar .wer { margin-left: auto; text-align: right; }
.topbar .wer .name { font-weight: 600; font-size: 14px; }
.topbar .wer .rolle { color: var(--text-dim); font-size: 12px; }
.icon-knopf {
  background: none; border: 1px solid var(--rand); border-radius: 10px;
  padding: 8px 11px; cursor: pointer; font-size: 15px;
}
.icon-knopf:hover { background: var(--bg-panel-hover); }

main { padding: 20px; max-width: 1100px; margin: 0 auto; }
h2 { font-size: 15px; color: var(--text-dim); font-weight: 600; margin: 18px 4px 12px; }

/* ---------- Kacheln ---------- */
.kacheln {
  display: grid; gap: var(--spalt);
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.kachel {
  background: var(--bg-panel);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 18px 16px;
  cursor: pointer;
  box-shadow: var(--schatten);
  transition: background 0.15s, transform 0.1s;
  min-height: 108px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.kachel:hover { background: var(--bg-panel-hover); }
.kachel:active { transform: scale(0.98); }
.kachel .icon { font-size: 26px; }
.kachel .name { font-weight: 600; font-size: 14.5px; margin-top: 10px; }
.kachel .status { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }
.kachel.bau { opacity: 0.55; }
.kachel.bau .status { color: var(--warn); }

/* ---------- Geräte-Liste ---------- */
.liste { display: flex; flex-direction: column; gap: 10px; }
.zeile {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-panel); border: 1px solid var(--rand);
  border-radius: 12px; padding: 13px 15px;
}
.zeile .haupt { font-weight: 600; font-size: 14px; }
.zeile .neben { color: var(--text-dim); font-size: 12px; }
.zeile .rechts { margin-left: auto; }
.mini-knopf {
  background: none; border: 1px solid var(--fehler); color: var(--fehler);
  border-radius: 8px; padding: 6px 10px; font-size: 12.5px; cursor: pointer;
}
.badge {
  font-size: 11px; padding: 3px 8px; border-radius: 99px;
  background: var(--akzent); color: #fff;
}

/* ---------- Theme-Umschalter ---------- */
.theme-menu { display: flex; gap: 6px; }
.theme-menu button.aktiv { border-color: var(--akzent); color: var(--akzent); }

.versteckt { display: none !important; }

@media (max-width: 480px) {
  main { padding: 14px; }
  .kacheln { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
