/* Gerüst: Kopfzeile, Inhalt, Navigation unten (Handy) bzw. oben (Computer). */
#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar::before {
  content: ""; display: block; height: 8px;
  background: repeating-conic-gradient(var(--check-red) 0 25%, var(--check-yellow) 0 50%) 0 0 / 16px 16px;
}
.topbar__row {
  display: flex; align-items: center; gap: 10px;
  max-width: 820px; margin: 0 auto; padding: 8px 12px 8px 16px; min-height: 56px;
}
.topbar__who { flex: 1; min-width: 0; }
.topbar__app { font-size: .78rem; color: var(--muted); line-height: 1.1; }
.topbar__vehicle { font-size: 1.15rem; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__select {
  appearance: none; background: transparent; border: 0; padding: 0 22px 0 0; max-width: 100%;
  font-size: 1.15rem; font-weight: 700; color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23788894' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 2px center;
}
.topbar__status { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.topbar__status[data-state="error"] { color: var(--short); font-weight: 700; }

.view {
  flex: 1; width: 100%; max-width: 820px; margin: 0 auto;
  padding: 18px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
  outline: none;
}
.view--login { max-width: 460px; padding-top: 0; padding-bottom: 32px; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav__inner { display: flex; width: 100%; max-width: 820px; }
.nav__item {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: var(--nav-h); padding: 6px 4px;
  background: none; border: 0; color: var(--muted);
  font-size: .78rem; font-weight: 600;
}
.nav__item .icon { width: 1.5rem; height: 1.5rem; }
.nav__item[aria-current="page"] { color: var(--tab-color); }
.nav__item[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 18%; right: 18%; height: 3px;
  background: var(--tab-color); border-radius: 0 0 3px 3px;
}
.nav__item[data-tab="check"] { --tab-color: var(--check); }
.nav__item[data-tab="used"] { --tab-color: var(--used); }
.nav__item[data-tab="missing"] { --tab-color: var(--short); }
.nav__item[data-tab="admin"] { --tab-color: var(--ink); }
.nav__badge {
  position: absolute; top: 6px; left: calc(50% + 6px);
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--short); color: #fff; font-size: .74rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

@media (min-width: 900px) {
  /* Auf großen Bildschirmen steht die Navigation oben unter der Kopfzeile */
  .nav { position: sticky; top: 64px; bottom: auto; order: -1; border-top: 0; border-bottom: 1px solid var(--line); z-index: 15; }
  #topbar { order: -2; }
  .nav__item { flex-direction: row; justify-content: center; gap: 8px; min-height: 52px; font-size: .95rem; }
  .nav__item[aria-current="page"]::before { top: auto; bottom: 0; border-radius: 3px 3px 0 0; }
  .nav__badge { position: static; }
  .view { padding-bottom: 48px; }
}
