/* App shell — mobile first */
.app-page {
  min-height: 100dvh;
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.app-shell {
  width: 100%;
  min-height: 100dvh;
  background: var(--nestora-bg);
  display: flex;
  position: relative;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .app-page {
    padding: 1rem;
  }

  .app-shell {
    max-width: 1600px;
    height: 90vh;
    min-height: 640px;
    border-radius: var(--nestora-radius-xl);
    box-shadow: var(--nestora-shadow);
    ring: 8px solid rgba(255, 255, 255, 0.2);
    outline: 8px solid rgba(255, 255, 255, 0.15);
  }
}

.app-sidebar {
  display: none;
  width: 5.5rem;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .app-sidebar {
    display: flex;
  }
}

.app-sidebar__logo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}

.app-sidebar__logo span {
  width: 0.75rem;
  height: 0.75rem;
  background: var(--nestora-text);
  border-radius: 999px;
}

.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
}

.app-sidebar__item {
  position: relative;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nestora-sidebar-icon);
  transition: background 0.2s, color 0.2s;
}

.app-sidebar__item:hover {
  background: rgba(255, 255, 255, 0.45);
  color: var(--nestora-text-secondary);
}

[data-theme="dark"] .app-sidebar__item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.app-sidebar__item.is-active {
  background: var(--nestora-accent);
  color: #fff;
  box-shadow: 0 10px 20px var(--nestora-accent-ring);
}

.app-sidebar__item.is-active::before {
  content: "";
  position: absolute;
  left: -1.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 2rem;
  background: var(--nestora-accent);
  border-radius: 0 999px 999px 0;
}

.app-sidebar__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.app-sidebar__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--nestora-accent);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.75rem 0.75rem calc(var(--nestora-bottom-nav-h) + 1rem + env(safe-area-inset-bottom));
}

@media (min-width: 1024px) {
  .app-main {
    padding: 1rem 1rem 1rem 0;
  }
}

.app-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* Bottom navigation — mobile */
.bottom-nav {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(0.5rem + env(safe-area-inset-bottom));
  z-index: 60;
  height: var(--nestora-bottom-nav-h);
  background: var(--nestora-surface);
  border: 1px solid var(--nestora-border);
  border-radius: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.25rem;
  box-shadow: var(--nestora-shadow);
}

@media (min-width: 1024px) {
  .bottom-nav {
    display: none;
  }
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem;
  min-height: 44px;
  color: var(--nestora-text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  position: relative;
}

.bottom-nav__item.is-active {
  color: var(--nestora-accent);
}

.bottom-nav__badge {
  position: absolute;
  top: 0.35rem;
  right: calc(50% - 1.1rem);
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--nestora-danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab-add {
  position: fixed;
  right: 1.25rem;
  bottom: calc(var(--nestora-bottom-nav-h) + 1.25rem + env(safe-area-inset-bottom));
  z-index: 55;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  background: var(--nestora-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px var(--nestora-accent-ring);
}

@media (min-width: 1024px) {
  .fab-add {
    display: none;
  }
}

/* Marketing layout */
.mkt-page {
  min-height: 100dvh;
  background: var(--nestora-bg);
  color: var(--nestora-text);
}

.mkt-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--nestora-bg) 85%, transparent);
  border-bottom: 1px solid var(--nestora-border);
}

.mkt-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.mkt-brand {
  font-family: var(--nestora-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.mkt-nav {
  display: none;
  gap: 1.25rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--nestora-text-secondary);
}

@media (min-width: 768px) {
  .mkt-nav {
    display: flex;
  }
}

.mkt-footer {
  margin-top: 4rem;
  padding: 2.5rem 1.25rem;
  border-top: 1px solid var(--nestora-border);
  text-align: center;
  color: var(--nestora-text-muted);
  font-size: 0.875rem;
}

.mkt-footer a {
  color: var(--nestora-accent);
  font-weight: 600;
}

.app-footer-credit {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.7rem;
  color: var(--nestora-text-muted);
}

.app-footer-credit a {
  color: var(--nestora-accent);
  font-weight: 600;
}

@media (max-width: 1023px) {
  .app-footer-credit {
    padding-bottom: 0.25rem;
  }
}
