/* ─── App Shell ─────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ─── Topbar ────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  background: var(--c-primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.topbar .brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.topbar .topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  color: #fff;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity var(--transition);
}
.avatar:hover { opacity: .85; }

/* ─── Bottom Nav (mobile) ───────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px 8px;
  font-size: .65rem;
  color: var(--c-muted);
  transition: color var(--transition);
  min-width: 0;
  overflow: hidden;
}
.bottom-nav a .nav-icon  { font-size: 1.35rem; line-height: 1; }
.bottom-nav a .nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-nav a.active { color: var(--c-primary); }

/* ─── Main Content ──────────────────────────────────────── */
.page {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(56px + 16px); /* bottom-nav height */
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

/* ─── Section / Card ────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 12px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
}
.section-title {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c-muted);
  margin-bottom: 8px;
}

/* ─── Sidebar: auf Mobile versteckt ────────────────────── */
.sidebar { display: none; }

/* ─── Desktop: sidebar layout ───────────────────────────── */
@media (min-width: 768px) {
  #app { flex-direction: row; }
  .sidebar {
    width: 240px;
    min-height: 100dvh;
    background: var(--c-surface);
    border-right: 1px solid var(--c-border);
    padding: 16px 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: var(--r-sm);
    margin: 0 8px;
    font-size: .9rem;
    color: var(--c-text);
    transition: background var(--transition), color var(--transition);
    cursor: pointer;
  }
  .sidebar-item .icon { font-size: 1.1rem; }
  .sidebar-item:hover { background: var(--c-bg); }
  .sidebar-item.active { background: #eef2ff; color: var(--c-primary); font-weight: 600; }
  .sidebar-logo {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--c-primary);
    padding: 0 20px 16px;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 8px;
  }
  .sidebar-user {
    margin-top: auto;
    padding: 12px 20px;
    border-top: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .85rem;
  }
  .bottom-nav { display: none; }
  .topbar { display: none; }
  .page { padding: 24px; max-width: none; }
  .content-area {
    flex: 1;
    overflow-y: auto;
  }
}
