/* ── Global: prevent horizontal overflow breaking the mobile layout ── */
html, body {
  max-width: 100%;
  overflow-x: clip; /* 'clip' unlike 'hidden' does NOT create a scroll container, so position:sticky still works */
}

/* ── Primary Navbar ─────────────────────────────────── */
.navbar-primary {
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: 1px solid var(--bs-border-color);
}

/* Logo scales fluidly with viewport – never pushes controls off screen */
.navbar-brand {
  flex-shrink: 1;   /* brand gives up space first */
  min-width: 0;
}
.navbar-brand-logo {
  /* 18px on ~400px phones, grows to 30px at ~667px+ */
  height: clamp(18px, 4.5vw, 30px);
  width: auto;
}

/* Right controls (theme + user) are NEVER shrunk or hidden */
.navbar-primary .navbar-nav.ms-auto {
  flex-shrink: 0;
}

/* App-Switcher tabs inside the primary bar */
.app-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 0.9rem;
  border-bottom: 3px solid transparent;
  color: var(--bs-secondary-color);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.app-tab:hover {
  color: var(--bs-body-color);
}

/* Rechnungen – blue */
.app-tab.tab-invoice {
  color: var(--bs-primary);
  border-bottom-color: var(--bs-primary);
}

/* Prüfungen – green */
.app-tab.tab-exam {
  color: var(--bs-success);
  border-bottom-color: var(--bs-success);
}

/* ── Sub-Navbar ─────────────────────────────────────── */
.navbar-sub {
  min-height: 40px;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: 1px solid var(--bs-border-color);
  background-color: var(--bs-tertiary-bg);
}

.navbar-sub .nav-link {
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  color: var(--bs-secondary-color);
  transition: color 0.12s;
}

.navbar-sub .nav-link:hover,
.navbar-sub .nav-link.active {
  color: var(--bs-body-color);
}

.navbar-sub .nav-link.active {
  font-weight: 600;
}

.navbar-sub .navbar-toggler {
  border: none;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
}

.navbar-sub .navbar-toggler:focus {
  box-shadow: none;
}
