/* ==========================================================================
   workspace.css — App shell chrome: sidebar, topbar, nav
   ========================================================================== */

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar,
.appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 58px;
  background: rgba(5, 8, 16, 0.80);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04);
}

.appbar--flat {
  background: rgba(5, 8, 16, 0.75);
}

.topbar__left,
.appbar__left {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.topbar__title,
.appbar__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.topbar__subtitle,
.appbar__subtitle {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.topbar__right,
.appbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(6, 9, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

/* When sidebar IS the nav mount */
#sidebarNav {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: rgba(6, 9, 18, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  padding: 20px 12px 28px;
}

.sidebar__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px 12px 28px;
  gap: 20px;
}

/* ── Brand block ─────────────────────────────────────────────────────────── */
.brand {
  padding: 4px 8px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.brand__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand__tagline {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 3px;
}

/* ── Nav container ───────────────────────────────────────────────────────── */
.nav {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.nav__group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav__heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 10px 6px;
  margin-bottom: 2px;
}

.nav__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Nav items ───────────────────────────────────────────────────────────── */
.nav__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition);
  user-select: none;
}

.nav__item:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border);
  color: var(--text);
}

/* Active pill with glow */
.nav__item.is-active {
  background: linear-gradient(135deg,
    rgba(34,211,238,0.14) 0%,
    rgba(34,211,238,0.07) 100%
  );
  border-color: var(--accent-cyan-edge);
  color: var(--text);
  box-shadow: 0 0 12px rgba(34,211,238,0.10), inset 0 1px 0 rgba(34,211,238,0.10);
}

.nav__label { flex: 1; min-width: 0; }

/* ── Disabled nav items ──────────────────────────────────────────────────── */
.nav__item--disabled {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}
/* Ensure no hover glow bleeds through */
.nav__item--disabled:hover {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  box-shadow: none;
}

/* ── Sidebar footer ──────────────────────────────────────────────────────── */
.sidebar__footer {
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px solid var(--border);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

/* ── Legacy navitem classes (older page markup) ──────────────────────────── */
.navitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin: 0 2px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition);
}
.navitem:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border);
  color: var(--text);
}
.navitem.is-active {
  background: rgba(34,211,238,0.12);
  border-color: var(--accent-cyan-edge);
  color: var(--text);
  box-shadow: 0 0 12px rgba(34,211,238,0.10);
}
.navitem.is-disabled {
  opacity: 0.38;
  pointer-events: none;
  cursor: not-allowed;
}

/* ── Progress card ───────────────────────────────────────────────────────── */
.progcard { margin-top: 0; }

/* ── Dashboard main ──────────────────────────────────────────────────────── */
.dashboard-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Eyebrow / kicker ────────────────────────────────────────────────────── */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}

/* ── Responsive: collapse sidebar ───────────────────────────────────────── */
@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar,
  #sidebarNav {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 12px;
  }

  .sidebar__inner {
    padding: 12px;
    gap: 12px;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav__group { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .nav__heading { display: none; }
  .nav__list { flex-direction: row; flex-wrap: wrap; gap: 4px; }

  .nav__item {
    padding: 7px 12px;
    font-size: 12.5px;
  }

  .sidebar__footer { display: none; }
  .brand { padding-bottom: 10px; margin-bottom: 0; }
}

/* ── Gate page (index.html) ──────────────────────────────────────────────── */
header.appbar + main,
body > header + main {
  display: flex;
  flex-direction: column;
}

/* ── Email gate embed container ──────────────────────────────────────────── */
#email-gate {
  background: var(--panel);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-xl);
  padding: 28px 30px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  max-width: 480px;
  margin: 0 auto;
}

#email-gate h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

/* ── Gate page hero ──────────────────────────────────────────────────────── */
body > header ~ main section:first-child {
  padding: 60px 24px 40px;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

/* ── Already-subscribed section ─────────────────────────────────────────── */
#already-subscribed {
  text-align: center;
  padding: 32px 24px;
  max-width: 480px;
  margin: 0 auto;
}
