/* App shell — WARM REDESIGN top navigation.
   Replaces the original dark sidebar. The page is a sticky top bar + a
   centred content column (.wrap). All shell chrome (nav tabs, search,
   theme toggle, primary CTA, avatar) lives here so templates only need
   the markup in base.html. */

.app { min-height: 100vh; }

/* ---- Top nav -------------------------------------------------------- */
.topnav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  height: 60px; padding: 0 26px;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topnav .brand { display: flex; align-items: center; gap: 10px; padding-right: 18px; margin-right: 6px; }
.topnav .brand .logo { width: 30px; height: 30px; border-radius: 9px; box-shadow: var(--shadow-accent); flex-shrink: 0; }
.topnav .brand .name { font-weight: 800; font-size: 17px; letter-spacing: -.3px; color: var(--ink); }

.navtabs { display: flex; gap: 3px; }
.navtab {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--r-pill); border: 0; background: none;
  font: inherit; font-weight: 700; font-size: 13.5px; color: var(--muted);
  cursor: pointer; transition: .12s; text-decoration: none;
}
.navtab:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.navtab.active { background: var(--accent-soft); color: var(--accent-text); }
.navtab svg { width: 17px; height: 17px; }
.navtab.soon { opacity: .5; cursor: default; }
.navtab.soon:hover { background: none; color: var(--muted); }
.navtab .count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800;
}

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.nav-form { margin: 0; padding: 0; }

/* nav search (distinct from the page .search-input) */
.searchbar {
  width: 230px; flex: 0 0 230px; display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid transparent; border-radius: var(--r-pill);
  padding: 8px 14px; color: var(--muted);
}
.searchbar:focus-within { border-color: var(--border-strong); background: var(--surface); }
.searchbar input { border: 0; background: none; outline: none; font: inherit; color: var(--text); flex: 1; min-width: 0; }
.searchbar svg { width: 16px; height: 16px; flex-shrink: 0; }

/* nav primary CTA */
.nav-cta {
  display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: var(--r-pill);
  padding: 9px 16px; font-family: inherit; font-weight: 700; font-size: 13.5px; white-space: nowrap;
  background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm);
  cursor: pointer; transition: background .12s, transform .06s; text-decoration: none;
}
.nav-cta:hover { background: var(--accent-hover); text-decoration: none; }
.nav-cta:active { transform: translateY(1px); }
.nav-cta svg { width: 16px; height: 16px; }

.icon-btn, .theme-toggle {
  width: 38px; height: 38px; border-radius: var(--r-pill); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: var(--surface-2); color: var(--muted); cursor: pointer;
}
.icon-btn:hover, .theme-toggle:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg, .theme-toggle svg { width: 18px; height: 18px; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #F2A33C); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
}
.nav-signout {
  background: transparent; color: var(--muted); border: 0; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 13px; padding: 9px 12px; border-radius: var(--r-pill);
}
.nav-signout:hover { color: var(--text); background: var(--surface-2); }

/* ---- Page container ------------------------------------------------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 26px 60px; }
.wrap.wide { max-width: 1340px; }
.main { /* legacy class kept for any template still using it */ max-width: 1240px; margin: 0 auto; padding: 22px 26px 60px; }

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.pagehead h1 { font-size: 23px; font-weight: 800; letter-spacing: -.5px; color: var(--ink); margin: 0; }
.pagehead .sub { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 3px; }
.pagehead .pa { display: flex; align-items: center; gap: 9px; }

/* ---- Auth-not-configured banner ------------------------------------- */
.auth-banner {
  background: var(--warn-soft); color: var(--warn);
  border-bottom: 1px solid var(--border-strong);
  padding: 10px 18px; font-size: 13px;
}
.auth-banner code { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
