/* ============================================================
   NAV.CSS — Single source of truth for site navigation
   All pages link this file. Do not duplicate these rules
   inline or in page-specific stylesheets.
   ============================================================ */

@font-face {
  font-family: 'Inter-fallback';
  src: local('-apple-system'), local('BlinkMacSystemFont'), local('Segoe UI');
  font-display: swap;
  ascent-override: 90%; descent-override: 22%; line-gap-override: 0%; size-adjust: 107%;
}

/* ── Skip link ─────────────────────────────────────────────── */
.skip-link {
  position: absolute; top: -100%; left: 0;
  padding: 12px 20px;
  background: #6eb4dc; color: var(--color-bg-primary);
  font-weight: 700; z-index: 10000; text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ── Site header ───────────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000; height: 80px;
  background: var(--color-header-bg, rgba(10,10,15,0.85));
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex; flex-direction: row;
  align-items: center; justify-content: space-between;
  width: 100%; height: 80px;
  max-width: 1200px; margin: 0 auto;
  padding: 0 24px; box-sizing: border-box;
}

/* ── Logo ──────────────────────────────────────────────────── */
.logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; flex-shrink: 0;
}
.logo img { height: 40px; width: auto; display: block; }

/* ── Mobile toggle ─────────────────────────────────────────── */
.mobile-menu-toggle {
  touch-action: manipulation;
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; width: 44px; height: 44px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.mobile-menu-toggle span {
  display: block; width: 100%; height: 2px;
  background: var(--text,#f0f2f5); border-radius: 2px;
}

/* ── Main nav ──────────────────────────────────────────────── */
.main-nav {
  display: flex; flex-direction: row; align-items: center; gap: 0;
}

.nav-list {
  display: flex; flex-direction: row; list-style: none;
  gap: 0; margin: 0; padding: 0; align-items: center;
}
.nav-list li { display: flex; align-items: center; }

/* ── Nav links ─────────────────────────────────────────────── */
.nav-link {
  touch-action: manipulation;
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 16px;
  font-size: 14px; font-weight: 500;
  color: var(--color-text-secondary); text-decoration: none;
  white-space: nowrap; position: relative;
  box-sizing: border-box; line-height: 1;
  transition: color .15s;
}
.nav-link:hover { color: var(--color-text-primary); }
.nav-link[aria-current="page"] {
  color: var(--color-accent);
  font-weight: 600;
}
.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute; bottom: 8px;
  left: 16px; right: 16px;
  height: 2px; background: var(--color-accent); border-radius: 1px;
}
.nav-link:hover::after {
  content: '';
  position: absolute; bottom: 8px;
  left: 16px; right: 16px;
  height: 2px; background: rgba(var(--accent-rgb,110,160,184),.4); border-radius: 1px;
}

/* ── Auth nav items (Pricing, Admin Panel) ─────────────────── */
#nav-pricing-li a, #nav-admin-link {
  padding: 0 16px;
  display: inline-flex; align-items: center; min-height: 44px;
}

/* ── CTA button (Sign In / Sign Out) ───────────────────────── */
.nav-cta {
  touch-action: manipulation;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 20px;
  font-size: 14px; font-weight: 600;
  color: var(--color-bg-primary); background: var(--color-accent);
  border: none; border-radius: 9999px;
  text-decoration: none; cursor: pointer;
  white-space: nowrap; min-height: 44px;
  margin-left: 12px;
  transition: background .15s, transform .15s;
}
.nav-cta:hover { background: var(--color-accent-light, #8fbdd4); transform: translateY(-1px); }

/* ── Sign Out subtle variant ───────────────────────────────── */
#nav-signout-btn { font-size: 13px; opacity: .9; color: var(--bg-0,#0a0a0f); }
#nav-signout-btn:hover { opacity: 1; color: var(--bg-0,#0a0a0f); }
#nav-signout-btn svg { stroke: var(--bg-0,#0a0a0f); color: var(--bg-0,#0a0a0f); }

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .mobile-menu-toggle { display: flex; }
  .main-nav {
    position: fixed; top: 0; right: 0; bottom: 0; left: auto;
    width: 85%; max-width: 340px; height: 100vh; height: 100dvh;
    z-index: 1100; background: var(--color-bg-secondary, #0f0f17);
    border-left: 1px solid var(--color-border);
    flex-direction: column; align-items: stretch;
    padding: calc(80px + 24px) 24px 24px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    box-shadow: -8px 0 32px rgba(var(--shadow-rgb,0,0,0),0.4); box-sizing: border-box;
  }
  .main-nav.open { transform: translateX(0); }
  .nav-list {
    display: flex; flex-direction: column;
    width: 100%; gap: 0; align-items: stretch;
  }
  .nav-list li {
    display: block; width: 100%;
    border-bottom: 1px solid var(--color-border);
  }
  .nav-list li:last-child { border-bottom: none; }
  .nav-link {
    display: flex; align-items: center; width: 100%;
    min-height: 52px; padding: 12px 0;
    font-size: 17px; font-weight: 500;
    color: var(--color-text-primary); line-height: 1.4;
  }
  .nav-link[aria-current="page"] { color: var(--color-accent); font-weight: 600; }
  .nav-link::after, .nav-link:hover::after { display: none !important; }
  .nav-cta {
    margin: 24px 0 0 0; width: 100%;
    justify-content: center; padding: 14px 16px;
    font-size: 16px; min-height: 48px;
  }
  #nav-pricing-li a, #nav-admin-link {
    padding: 12px 0; min-height: 52px; width: 100%;
  }
}

/* ── Admin/CRM: font scale reset so nav matches main site ───── */
/* Force nav to px sizes so app 14px base font does not affect it */
.site-header .nav-link { font-size: 14px !important; }
.site-header .nav-cta  { font-size: 14px !important; }

/* ── Employee Access dropdown ──────────────────────────────── */
.nav-employee-wrap {
  position: relative;
  display: none; /* shown by JS when employee is logged in */
  align-items: center;
}
.nav-employee-btn {
  touch-action: manipulation;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px;
  font-size: 14px; font-weight: 500;
  color: var(--color-text-secondary);
  background: none; border: none; cursor: pointer;
  white-space: nowrap; position: relative;
  transition: color .15s;
}
.nav-employee-btn:hover { color: var(--color-text-primary); }
.nav-employee-btn .emp-chevron {
  width: 12px; height: 12px; flex-shrink: 0;
  transition: transform .2s;
  stroke: currentColor;
}
.nav-employee-wrap.open .emp-chevron { transform: rotate(180deg); }
.nav-employee-menu {
  display: none;
  position: absolute; top: calc(100% + 4px); right: 0;
  min-width: 170px;
  background: var(--color-bg-secondary, #111118);
  border: 1px solid var(--color-border, rgba(var(--overlay-rgb,255,255,255),0.08));
  border-radius: 10px;
  box-shadow: 0 10px 32px var(--scrim,rgba(var(--shadow-rgb,0,0,0),0.5));
  overflow: hidden; z-index: 1200;
}
.nav-employee-wrap.open .nav-employee-menu { display: block; }
.nav-employee-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--color-text-secondary, #a0a8b4);
  text-decoration: none;
  transition: background .1s, color .1s;
  white-space: nowrap;
}
.nav-employee-menu a:hover {
  background: rgba(var(--accent-rgb,110,160,184),0.1);
  color: var(--color-text-primary, #f0f2f5);
}
.nav-employee-menu a .emp-menu-tag { display: none; }
.nav-employee-menu a:first-child { border-bottom: none; }

/* Theme switch (see emp-menu.js). It is a <button> because it acts rather than
   navigates, so it needs the `a` styling restated plus a reset of the UA button
   chrome that would otherwise draw a grey box inside the menu. */
.nav-employee-menu button.nav-emp-theme {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 16px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--color-text-secondary, #a0a8b4);
  background: none; border: 0; border-radius: 0;
  text-align: left; cursor: pointer;
  transition: background .1s, color .1s;
  white-space: nowrap;
}
.nav-employee-menu button.nav-emp-theme:hover {
  background: rgba(var(--accent-rgb,110,160,184),0.1);
  color: var(--color-text-primary, #f0f2f5);
}
.nav-emp-theme-icon { font-size: 14px; line-height: 1; }
.nav-emp-theme-state {
  margin-left: auto; padding-left: 12px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--color-accent, #6ea0b8);
}
.nav-employee-menu button.nav-emp-theme[aria-checked="false"] .nav-emp-theme-state {
  color: var(--color-text-muted, #6b7280);
}

@media (max-width: 900px) {
  .nav-employee-wrap { flex-direction: column; align-items: stretch; }
  .nav-employee-btn {
    min-height: 52px; padding: 12px 0;
    font-size: 17px; color: var(--color-text-primary);
  }
  .nav-employee-menu {
    display: block; position: static;
    box-shadow: none; border: none; border-radius: 0;
    background: none; padding-left: 16px;
  }
  .nav-employee-menu a {
    min-height: 44px; padding: 10px 0;
    font-size: 15px; border-bottom: 1px solid var(--color-border);
  }
  .nav-employee-menu a:last-child { border-bottom: none; }
  .nav-employee-menu a .emp-menu-tag { display: none; }
  .nav-employee-menu button.nav-emp-theme {
    min-height: 44px; padding: 10px 0; font-size: 15px;
  }
}
