/*
  Layout/navigation extraction target.
  Shared shell/layout rules still live mostly in base.css until the next scoped pass.
*/
/* --- Navbar --- */
.navbar {
  /* No backdrop-filter here — it would create a new stacking context
     and trap position:fixed children (the mobile drawer). Instead the
     frosted-glass effect is applied via ::before. */
  border-bottom: 0;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 200;
}
.navbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(230,230,238,.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  z-index: -1;
}
.brand {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -.025em;
}

/* desktop nav links */
.nav-links { display: flex; align-items: center; gap: .25rem; }
.nav-links a:not(.btn) {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  padding: .35rem .7rem;
  border-radius: var(--radius-sm);
  transition: color var(--t), background var(--t);
}
.nav-links a:not(.btn):hover { color: var(--text); background: var(--border-subtle); }
.nav-links a:not(.btn).nav-active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}
.nav-close { display: none; }

/* burger button — hidden on desktop */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none; border: none;
  cursor: pointer; padding: 4px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.burger span {
  display: block; height: 2px; width: 100%;
  background: var(--text); border-radius: 2px;
  transition: transform .25s, opacity .2s;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* dim overlay */
.nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 150; }
.nav-overlay.active { display: block; }

/* --- Container --- */
.container { max-width: 960px; margin: 2rem auto; padding: 0 1.25rem; flex: 1; width: 100%; }
/* --- Responsive --- */
@media (max-width: 960px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .table { font-size: .78rem; }
  .table .actions { flex-direction: column; }
  .page-header h1 { font-size: 1.25rem; }

  /* burger menu */
  .burger { display: flex; }
  .navbar {
    position: sticky;
    top: 0;
    z-index: 300;
    min-height: 64px;
    justify-content: space-between;
    background: rgba(230,230,238,.82);
  }
  .navbar::before {
    background: rgba(230,230,238,.82);
  }
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(76vw, 300px);
    max-width: none;
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
    padding: calc(env(safe-area-inset-top, 0px) + 4.25rem) .9rem 1.15rem;
    border-left: 1px solid rgba(255,255,255,.72);
    background: rgba(230,230,238,.94);
    box-shadow: -18px 0 48px rgba(13,14,16,.16);
    backdrop-filter: blur(20px) saturate(1.15);
    -webkit-backdrop-filter: blur(20px) saturate(1.15);
    z-index: 260;
    overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-close {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 1rem);
    right: .9rem;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(13,14,16,.08);
    border-radius: 50%;
    background: rgba(255,255,255,.52);
    color: var(--eb-ink, var(--text));
    cursor: pointer;
  }
  .nav-items {
    display: flex;
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: .55rem;
    flex: initial;
  }
  .nav-items a:not(.btn) {
    width: 100%;
  }
  .nav-links a:not(.btn) {
    display: flex;
    width: auto;
    max-width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: flex-start;
    padding: .62rem .82rem;
    border: 1px solid rgba(13,14,16,.08);
    border-radius: 999px;
    background: rgba(255,255,255,.36);
    color: var(--eb-ink, var(--text));
    font-size: .94rem;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
  }
  .nav-links a:not(.btn).nav-active {
    background: var(--eb-ink, var(--primary));
    color: #fff;
  }
  .nav-links .btn {
    width: 100%;
    justify-content: center;
  }
  .nav-links .user-menu {
    width: 100%;
    position: relative;
  }
  .nav-links .notification-menu {
    width: auto;
    margin-top: auto;
    margin-bottom: .35rem;
    align-self: flex-start;
  }
  .nav-links .notification-trigger {
    width: 48px;
    height: 48px;
    min-height: 48px;
    justify-content: center;
    border-radius: 50%;
    border-color: rgba(13,14,16,.08);
    background: rgba(255,255,255,.36);
  }
  .nav-links .user-menu-trigger {
    width: 100%;
    min-height: 56px;
    padding: .42rem .48rem;
    justify-content: flex-start;
    border-color: rgba(13,14,16,.08);
    border-radius: 22px;
    background: rgba(255,255,255,.46);
    box-shadow: var(--shadow-sm);
  }
  .nav-links .user-menu-identity {
    max-width: none;
  }
  .nav-links .notification-popover {
    position: static;
    width: 100%;
    margin-top: .55rem;
  }
  .nav-links .user-menu-popover {
    position: absolute;
    top: auto;
    right: 0;
    bottom: calc(100% + .55rem);
    left: 0;
    width: 100%;
    min-width: 0;
    margin-top: 0;
    border-radius: 18px;
    background: rgba(255,255,255,.92);
    box-shadow: var(--shadow);
  }
  .nav-overlay {
    z-index: 240;
    background: rgba(13,14,16,.28);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}
