/* css/layout.css — shell layout: topbar, sidebar, content area */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 56px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 18px;
  flex-shrink: 0;
}

.nav-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 18px;
}

.nav-icon:hover { background: var(--surface-raised); color: var(--text); }
.nav-icon.active { background: var(--surface-raised); color: var(--accent); }
.nav-icon.disabled { opacity: 0.35; cursor: not-allowed; }

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.topbar h1 {
  font-family: var(--font-serif);
  font-size: 18px;
  margin: 0;
  font-weight: 600;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-right span { font-size: 13px; color: var(--text-muted); }

.sync-status {
  display: none;
  align-items: center;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-muted);
}
.sync-status.offline { color: var(--danger); }

#page-main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

@media (max-width: 760px) {
  .app-shell {
    min-height: 100dvh;
  }

  .layout-project .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    width: 100%;
    height: calc(58px + env(safe-area-inset-bottom));
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-right: none;
    border-top: 1px solid var(--border);
    gap: 4px;
  }

  .layout-project .nav-icon {
    width: 40px;
    height: 40px;
    font-size: 19px;
  }

  .layout-project .content-area {
    min-height: 100dvh;
    padding-bottom: calc(58px + env(safe-area-inset-bottom));
  }

  .topbar {
    padding: 10px 12px;
    gap: 10px;
  }

  .topbar h1 {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
  }

  .topbar-right {
    gap: 8px;
    flex-shrink: 0;
  }

  .topbar-right #user-email {
    display: none;
  }

  .topbar .ghost {
    padding: 7px 9px;
    font-size: 12px;
  }

  #page-main {
    padding: 16px;
  }
}
