/* NUDGE — layouts.css — page-level layout patterns */

.sync-indicator {
  position: fixed;
  top: var(--s3);
  right: var(--s3);
  z-index: var(--z-toast);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  transition: background var(--mid) var(--ease);
}

.sync-dot.synced { background: var(--success); }
.sync-dot.syncing { background: var(--warn); animation: pulse 1s var(--ease) infinite; }
.sync-dot.offline { background: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── SIDEBAR (hidden on mobile) ── */

.sidebar {
  display: none;
}

/* ── DESKTOP LAYOUT ── */

@media (min-width: 768px) {

  #app {
    flex-direction: row;
    max-width: 980px;
    min-height: 100dvh;
  }

  /* ── Sidebar ── */

  .sidebar {
    display: flex;
    flex-direction: column;
    width: 220px;
    min-width: 220px;
    height: 100dvh;
    position: sticky;
    top: 0;
    background: var(--surface);
    border-right: 1px solid var(--surface2);
    z-index: var(--z-sticky);
  }

  .sidebar-wordmark {
    padding: var(--s5);
    font-family: var(--font-ui);
    font-size: var(--t-xl);
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 var(--s2);
  }

  .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: var(--s3);
    height: 44px;
    padding: 0 var(--s3);
    border-radius: var(--r-sm);
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
    border-left: 3px solid transparent;
  }

  .sidebar-nav-item:hover {
    background: var(--surface2);
  }

  .sidebar-nav-item.active {
    color: var(--accent);
    border-left-color: var(--accent);
  }

  .sidebar-nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
    flex-shrink: 0;
  }

  .sidebar-spacer {
    flex: 1;
  }

  .sidebar-bottom {
    padding: var(--s4);
    display: flex;
    flex-direction: column;
    gap: var(--s2);
    border-top: 1px solid var(--surface2);
  }

  .sidebar-bottom-row {
    display: flex;
    align-items: center;
    gap: var(--s2);
  }

  .sidebar-email {
    font-size: var(--t-xs);
    color: var(--text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
  }

  .sidebar-bottom .btn-text {
    padding: var(--s1);
    min-height: 32px;
    color: var(--text-faint);
  }

  .sidebar-bottom .btn-text:hover {
    color: var(--text-dim);
  }

  /* ── Hide mobile tab bar on desktop ── */

  .tab-bar {
    display: none !important;
  }

  /* ── Hide mobile top bar (sync + settings) on desktop ── */

  .mobile-topbar {
    display: none !important;
  }

  /* ── Content area ── */

  .main-content {
    flex: 1;
    max-width: 760px;
    padding: var(--s5) var(--s6);
    padding-bottom: var(--s5);
    min-width: 0;
  }

  /* ── Add task bar: static on desktop ── */

  .add-task-bar {
    position: static !important;
    transform: none !important;
    left: auto !important;
    bottom: auto !important;
    max-width: none !important;
    border-top: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: var(--s3);
    border-bottom: 1px solid var(--surface2);
    padding-bottom: var(--s3) !important;
  }

  /* ── Focus bar: sticky within content, not full width ── */

  .focus-bar {
    border-radius: var(--r-sm);
    margin-bottom: var(--s3);
  }

  /* ── Chip row: not sticky on desktop ── */

  .chip-row {
    position: static;
  }

  /* ── Sheets: center on desktop, not full bottom ── */

  .sheet {
    max-width: 640px;
  }

  /* ── Rhythm banner: constrained to content ── */

  .rhythm-banner {
    max-width: 760px;
  }
}
