/* NAVI application shell layout (AppShell / PageHeader per plan section 8.4). */

.navi-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "topbar topbar"
    "nav main";
  min-height: 100vh;
}

.navi-topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: var(--navi-space-3);
  padding: var(--navi-space-2) var(--navi-space-4);
  background: var(--navi-bg-surface);
  border-bottom: 1px solid var(--navi-border-default);
}

.navi-topbar__brand {
  font-size: var(--navi-font-size-section);
  line-height: var(--navi-line-height-section);
  font-weight: 600;
  color: var(--navi-brand-strong);
}

.navi-topbar__spacer {
  flex: 1;
}

.navi-topbar__user {
  color: var(--navi-text-secondary);
}

.navi-topbar__link {
  color: var(--navi-brand);
  text-decoration: none;
}
.navi-topbar__link:hover {
  text-decoration: underline;
}

.navi-nav {
  grid-area: nav;
  background: var(--navi-bg-surface);
  border-right: 1px solid var(--navi-border-default);
  padding: var(--navi-space-4) 0;
}

.navi-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.navi-nav__link {
  display: block;
  padding: var(--navi-space-2) var(--navi-space-4);
  color: var(--navi-text-primary);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.navi-nav__link:hover {
  background: var(--navi-bg-surface-secondary);
}

.navi-nav__link--active {
  border-left-color: var(--navi-brand);
  background: var(--navi-bg-selected);
  font-weight: 600;
}

.navi-nav__link--disabled {
  color: var(--navi-color-neutral-90);
  cursor: default;
}

.navi-main {
  grid-area: main;
  padding: var(--navi-space-6);
  overflow-x: auto;
}

.navi-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--navi-space-3);
  margin-bottom: var(--navi-space-4);
}

.navi-page__title {
  font-size: var(--navi-font-size-page);
  line-height: var(--navi-line-height-page);
  margin: 0;
}

@media (max-width: 900px) {
  .navi-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "nav"
      "main";
  }
  .navi-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .navi-nav__link--active {
    border-left-color: transparent;
    border-bottom: 3px solid var(--navi-brand);
  }
}

/* Auth pages (login / setup) */
.navi-auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--navi-space-4);
}

.navi-auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--navi-bg-surface);
  border: 1px solid var(--navi-border-default);
  border-radius: var(--navi-radius-large);
  padding: var(--navi-space-6);
}

.navi-auth-card h1 {
  margin-top: 0;
  font-size: var(--navi-font-size-page);
  line-height: var(--navi-line-height-page);
  color: var(--navi-brand-strong);
}

.navi-auth-intro {
  color: var(--navi-text-secondary);
}
