/* Top navigation: a navy bar across the top with the logo, the menu links as pills (the open one highlighted in teal), and at the right
   the Worked time, Check in / Check out and the account menu. Teal marks the open link. On small screens the links wait behind the menu
   button and open as a panel under the bar (topnav_controller.js adds .nav-open to the app shell). */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  color: #fff;
  background: var(--lb-primary); /* one flat navy, so the dashboard band under it continues it with no seam */
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 6px 20px rgba(var(--lb-primary-rgb), 0.18);
}
/* Over a dashboard band the bar and the band are one dark surface: no line and no shadow between them. */
body:has(.dash-hero-band) .app-topbar { border-bottom: 0; box-shadow: none; }

.topbar-inner { display: flex; align-items: center; gap: 1.25rem; min-height: 64px; padding: 0 var(--lb-content-gutter); }

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
}

.brand-link:hover { color: #fff; }

.brand-mark { flex-shrink: 0; border-radius: 8px; }
.topbar-brand { display: inline-flex; flex: none; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: #fff; text-decoration: none; }
.topbar-brand { cursor: default; user-select: none; }

.topbar-nav { display: flex; flex: 1; align-items: center; gap: 0.25rem; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topbar-nav::-webkit-scrollbar { display: none; }
.topbar-link {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  border-radius: 999px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.topbar-link i { font-size: 1rem; color: rgba(255, 255, 255, 0.5); transition: color 0.15s ease; }
.topbar-link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.topbar-link:hover i { color: #fff; }
.topbar-link.active { font-weight: 600; color: #fff; background: rgba(255, 255, 255, 0.14); }
.topbar-link.active i { color: #fff; }
.topbar-link:focus-visible { outline: 2px solid var(--lb-accent-light); outline-offset: 2px; }
/* A count beside a link (open tasks). */
.topbar-count { min-width: 1.3rem; padding: 0.05rem 0.4rem; font-size: 0.7rem; font-weight: 700; line-height: 1.4; text-align: center; color: var(--lb-primary); background: #fff; border-radius: 999px; }

.topbar-end { display: flex; flex: none; align-items: center; gap: 0.75rem; }

/* The account button: just the initials in a round avatar. */
.topbar-user { display: flex; align-items: center; padding: 0.2rem; color: #fff; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px; transition: background-color 0.15s ease; }
.topbar-user:hover, .topbar-user[aria-expanded="true"] { background: rgba(255, 255, 255, 0.18); }
.topbar-user:focus-visible { outline: 2px solid var(--lb-accent-light); outline-offset: 2px; }
.topbar-user-avatar { display: grid; flex: none; place-items: center; width: 34px; height: 34px; font-size: 0.78rem; font-weight: 700; color: #fff; background: var(--lb-gradient-accent); border-radius: 50%; }
.user-menu .dropdown-item.active { font-weight: 600; background: var(--lb-hover); }

/* The Worked time and Check in / Check out on the dark bar. */
.app-topbar .navbar-attendance { margin-left: 0; }
.app-topbar .navbar-worked { color: rgba(255, 255, 255, 0.72); background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.14); box-shadow: none; }
.app-topbar .navbar-worked strong { color: #fff; }
.app-topbar .navbar-worked i, .app-topbar .navbar-attendance-note i { color: var(--lb-accent-light); }
.app-topbar .navbar-attendance-note { color: rgba(255, 255, 255, 0.72); }

/* The breadcrumb trail: a slim row under the bar. */
.app-trail { padding: 0.9rem var(--lb-content-gutter) 0; }

/* The menu button: only on small screens. */
.topbar-toggle { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; font-size: 22px; color: #fff; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 12px; }
.topbar-toggle:hover { background: rgba(255, 255, 255, 0.18); }
.topnav-backdrop { display: none; }

@media (max-width: 991.98px) {
  .topbar-inner { gap: 0.75rem; padding-inline: 16px; }
  .topbar-toggle { display: inline-flex; }
  .topbar-brand { margin-right: auto; }
  .topbar-end { order: 3; }
  /* The links open as a panel under the bar. */
  .topbar-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 1;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.7rem 16px 1rem;
    overflow: visible;
    background: var(--lb-primary);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 30px rgba(var(--lb-primary-rgb), 0.3);
  }
  .nav-open .topbar-nav { display: flex; }
  .topbar-link { padding: 0.75rem 1rem; border-radius: 12px; }
  .nav-open .topnav-backdrop { position: fixed; inset: 0; z-index: 990; display: block; background: rgba(var(--lb-primary-rgb), 0.45); }
  .app-trail { padding-inline: 16px; }
}
@media (max-width: 575.98px) { .app-topbar .navbar-worked-label { display: none; } }

/* Account menu: opens under the name (role, Profile, Settings, Log out). */
.user-menu {
  width: 222px;
  padding: 6px;
  border: 1px solid var(--lb-border-soft);
  border-radius: var(--lb-radius-lg);
  box-shadow: var(--lb-shadow-lg);
}

.user-menu-role { padding: 6px 10px; font-size: 13px; color: var(--lb-muted); }

.user-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-weight: 500;
  border-radius: 8px;
}

.user-menu .dropdown-item i { font-size: 16px; color: var(--lb-muted); }
.user-menu .dropdown-item.text-danger i { color: inherit; }
.user-menu .dropdown-item:hover { background: var(--lb-hover); }
.user-menu .dropdown-divider { margin: 4px 0; border-color: var(--lb-border-soft); }
.menu-logout { margin: 0; }

.min-w-0 { min-width: 0; }


.min-w-0 { min-width: 0; }

/* Lock the page behind the open menu. Locked on <html> (the viewport), so the page keeps its scroll position. */
html:has(body.no-scroll) { overflow: hidden; }
body.no-scroll { overflow: visible; }
