/* ===== Navbar ===== */

.navbar {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: var(--navbar-bg);
  color: var(--navbar-text);
  padding: 0 1.5rem;
  height: var(--navbar-h);
  position: sticky;
  top: 0;
  z-index: var(--z-dropdown);
  border-bottom: 1px solid var(--border);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--navbar-text);
  cursor: pointer;
}
.navbar-brand:hover {
  opacity: 0.85;
}

.navbar-logo {
  height: 28px;
  width: auto;
}

.hero-logo {
  display: block;
  height: 96px;
  width: auto;
  margin-bottom: 1.25rem;
}

/* Primal navbar ghost-icon shape — hamburger/theme-toggle/notif-bell share this; only
   padding/color/structural layout differ per icon. */
.btn-hamburger,
.btn-theme-toggle,
.btn-notif-bell {
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
.btn-hamburger:hover,
.btn-theme-toggle:hover { background: var(--navbar-overlay-soft); }

.btn-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0.4rem 0.5rem;
  order: -1;
  flex-shrink: 0;
}
.btn-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navbar-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.btn-hamburger.open .ham-top    { transform: translateY(7px) rotate(45deg); }
.btn-hamburger.open .ham-mid    { opacity: 0; }
.btn-hamburger.open .ham-bottom { transform: translateY(-7px) rotate(-45deg); }

/* the phone tab bar's desktop state · css/mobile/shell.css is the only place that shows it, and its Edit button in the drawer */
.tabbar,
.nav-edit-tabbar { display: none; }

.navbar-links {
  display: none;
  position: fixed;
  top: var(--navbar-h);
  left: 0;
  width: 200px;
  max-height: calc(100vh - var(--navbar-h));
  overflow-y: auto;
  flex-direction: column;
  background: var(--navbar-bg);
  border: 1px solid var(--navbar-overlay-strong);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 20px var(--shadow-lg);
  z-index: var(--z-dropdown);
  padding: 0.5rem 0;
}
.navbar-links.nav-mobile-open {
  display: flex;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--navbar-link);
  text-decoration: none;
  padding: 0.8rem 1.25rem;
  border-radius: 0;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
}

.nav-link svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.nav-link:hover svg,
.nav-link.active svg {
  opacity: 1;
}

.nav-link:hover {
  background: var(--navbar-overlay-soft);
  color: var(--navbar-text);
}

.nav-link.active {
  background: var(--navbar-overlay-soft);
  color: var(--navbar-text);
  font-weight: 500;
  box-shadow: inset 0 -2px 0 var(--primary);
}

/* A heading over each run of links — replaces the three bare .nav-link-divider rules, which were this same idea with the labels left off */
.nav-group {
  padding: 0.75rem 1.25rem 0.3rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navbar-link);
  opacity: 0.55;
  border-top: 1px solid var(--navbar-overlay-soft);
  margin-top: 0.3rem;
}
/* the first heading opens the list, so it needs no rule above it */
.nav-group:first-child { border-top: none; margin-top: 0; padding-top: 0.25rem; }
/* auth.js hides a heading whose whole run is permission-hidden, so no empty section is left labelled */
.nav-group.hidden { display: none; }

.btn-theme-toggle {
  margin-left: 0.25rem;
  font-size: 1.1rem;
  padding: 0.25rem 0.5rem;
  color: var(--navbar-link);
  line-height: 1;
}

/* Notification bell + dropdown */
.nav-notif {
  position: relative;
}

.btn-notif-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.5rem;
  color: var(--navbar-link);
}
.btn-notif-bell:hover {
  background: var(--navbar-overlay-soft);
  color: var(--navbar-text);
}

/* the bell's count is the shared count-badge (shared.css) */

/* A count a side-menu link carries · the Changes link's changes waiting on you, pushed to the link's far end */
.nav-count {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--warning);
  color: var(--navbar-bg);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-width: calc(100vw - 2rem);
  max-height: 420px;
  overflow-y: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--navbar-overlay-strong);
  border-radius: 6px;
  box-shadow: 0 6px 20px var(--shadow-lg);
  z-index: var(--z-panel);
}

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  position: sticky;
  top: 0;
  /* --surface-deep, not --surface — sits directly on .notif-dropdown, which is also
     --surface; the sticky header needs its own visible band, not just a bottom border. */
  background: var(--surface-deep);
}

.notif-dropdown-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-notif-mark-all {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.btn-notif-mark-all:hover {
  text-decoration: underline;
}

.notif-list {
  display: flex;
  flex-direction: column;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:last-child {
  border-bottom: none;
}
.notif-item:hover {
  background: var(--navbar-overlay-soft);
}
.notif-item.notif-unread {
  background: var(--badge-danger-bg, rgba(192, 57, 43, 0.06));
}

.notif-item-main {
  flex: 1;
  min-width: 0;
}

.notif-item-del {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1;
  padding: 0.2rem 0.3rem;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s, background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.notif-item:hover .notif-item-del {
  opacity: 1;
}
.notif-item-del:hover {
  color: var(--danger);
  background: var(--navbar-overlay-soft);
}

.notif-item-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.notif-item-body {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.notif-item-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.notif-empty {
  padding: 1.25rem 0.85rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Notifications tab (full table page — see notif-* above for the bell dropdown) ===== */

.notif-row-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--primary);
}

.notif-row-unread .notif-row-title {
  font-weight: 700;
}

.notif-row-body {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.notif-row-type {
  color: var(--text-muted);
  white-space: nowrap;
}

/* Auth navbar elements */
.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.nav-user-info {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875rem;
  color: var(--navbar-text);
  white-space: nowrap;
}
.nav-user-info--clickable {
  cursor: pointer;
  transition: background 0.15s;
}
.nav-user-info--clickable:hover {
  background: var(--navbar-overlay-soft);
}

.btn-nav-login,
.btn-nav-logout {
  background: none;
  border: 1px solid var(--navbar-overlay-strong);
  border-radius: 4px;
  color: var(--navbar-text);
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-nav-login:hover,
.btn-nav-logout:hover {
  background: var(--navbar-overlay-soft);
}
