/* =====================================================================
   Layout: Sidebar + Topbar + Content  (Desktop)
            Bottom-Nav + Karten         (Mobile ≤ 768px)
   ===================================================================== */

/* App-Grid */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 100vh;
  height: 100vh;
}
.app[hidden] { display: none; }

/* ---------------- Sidebar ---------------- */
.sidebar {
  grid-column: 1;
  background: var(--bg-s);
  border-right: 1px solid var(--brd);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--brd);
  flex-shrink: 0;
}
.sidebar__brand .logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-h));
  display: grid; place-items: center; color: #fff; font-weight: 700;
}
.sidebar__brand b { font-size: 15px; }
.sidebar__brand span { color: var(--ts); font-size: 12px; display: block; }

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
}
.nav-section + .nav-section { margin-top: 18px; }
.nav-section__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tt);
  padding: 0 10px 8px;
}

.sidebar__footer {
  border-top: 1px solid var(--brd);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

/* ---------------- Main ---------------- */
.main {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  border-bottom: 1px solid var(--brd);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar__title { font-size: 18px; font-weight: 650; }
.topbar__sub { color: var(--ts); font-size: 12.5px; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }

.content {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px 40px;
}

/* Bottom-Nav nur Mobile */
.bottom-nav { display: none; }

/* ---------------- Responsive ≤ 768px ---------------- */
@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }
  .sidebar { display: none; }
  .main { grid-column: 1; }

  .topbar { padding: 0 16px; }
  .content {
    padding: 16px 14px calc(var(--bottomnav-h) + 24px);
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottomnav-h);
    background: var(--bg-s);
    border-top: 1px solid var(--brd);
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--ts);
    font-size: 10.5px;
    position: relative;
  }
  .bottom-nav__item svg { width: 22px; height: 22px; }
  .bottom-nav__item.active { color: var(--accent); }
}
