/* fp-topbar — sticky top bar inside the main column.
   Holds the search bar, mobile-only brand/avatar, and the page tabs.
   Sticks to the top on scroll so the tabs are always reachable. */

.fp-top {
  position: sticky;
  top: 0;
  z-index: var(--z-elevated);
  background: var(--bg-overlay);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-3) var(--space-4);
  padding-top: max(var(--space-3), env(safe-area-inset-top));
}

@media (min-width: 1024px) {
  .fp-top {
    padding-top: var(--space-3);
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

.fp-top__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

/* Mobile-only logo + avatar (sidebar covers them on desktop) */
.fp-top__logo-mobile {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--accent-primary);
  color: var(--accent-primary-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  flex-shrink: 0;
}

.fp-avatar-mobile {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary-text);
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .fp-top__logo-mobile,
  .fp-avatar-mobile { display: none; }
}

/* Search bar — pill input that always fills the available row space */
.fp-search {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-family: inherit;
  outline: none;
  transition: var(--transition-color);
}

.fp-search:focus {
  border-color: var(--accent-primary);
  background: var(--bg-base);
  color: var(--text-primary);
}

/* Page tabs — horizontal scroll on mobile, wrap-style on desktop OK.
   Default: visible on every breakpoint (used for page-local sub-views
   like Day Planner's My Shift / On Shift / Tasks / etc.).
   Modifier `--mobile-only`: visible on phone, hidden on tablet/desktop
   where the sidebar covers primary navigation. Used on pages where the
   tabs are nav shortcuts rather than true sub-views (e.g. dashboard). */
.fp-tabs {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(var(--space-4) * -1);
  padding: 0 var(--space-4);
}

.fp-tabs::-webkit-scrollbar { display: none; }

@media (min-width: 1024px) {
  .fp-tabs {
    margin: 0 calc(var(--space-6) * -1);
    padding: 0 var(--space-6);
  }
  .fp-tabs--mobile-only { display: none; }
}

.fp-tab {
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (hover: hover) and (pointer: fine) {
  .fp-tab:hover { color: var(--text-primary); }
}

.fp-tab.is-active {
  background: var(--text-primary);
  color: var(--bg-base);
}

/* Optional count chip inside a tab */
.fp-tab__count {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  font-size: 10px;
  color: var(--text-tertiary);
}

.fp-tab.is-active .fp-tab__count {
  background: var(--bg-base);
  color: var(--text-primary);
}
