.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.logo {
  padding: 8px 8px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand);
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}

.logo h1 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.2px;
}

.logo p {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 3px;
  text-align: center;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav button {
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--ink-2);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav button.active {
  background: var(--brand-soft-solid);
  color: var(--brand);
  font-weight: 600;
}

.nav button.active::before {
  content: "";
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--brand);
  margin-left: -4px;
}

.side-foot {
  font-size: 11px;
  color: var(--ink-3);
  padding: 8px 10px 0;
  border-top: 1px solid var(--border);
  line-height: 1.6;
}

.main {
  min-width: 0;
  padding: 20px 24px 40px;
  background: var(--bg);
}

.main-inner {
  max-width: none;
  width: 100%;
  margin: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.topbar h2 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.3px;
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sync-pill {
  font-size: 12px;
  color: var(--ink-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
}

.sync-pill.ok {
  color: var(--down);
  border-color: rgba(31, 122, 76, 0.25);
  background: var(--down-soft);
}

.sync-pill.syncing {
  color: var(--brand);
  border-color: transparent;
  background: var(--brand-soft);
}

.sync-pill.bad {
  color: var(--up);
  border-color: transparent;
  background: var(--up-soft);
}

.bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 16px 14px 88px;
  }

  .topbar h2 {
    font-size: 20px;
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 6px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .bottom-nav button {
    min-height: 50px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
  }

  .bottom-nav button.active {
    color: var(--brand);
    font-weight: 650;
    background: var(--brand-soft);
  }
}
