/* App shell: sidebar, user menu, main column, page header, vertical settings nav, placeholders.
   Values 1:1 with the prototype sidebar (README "Nawigacja"). */
.app { display: flex; min-height: 100vh; background: var(--bg-app); color: var(--text-primary); }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 10px; padding: 0 20px; height: 76px; flex: none;
  color: var(--text-primary);
}
.sidebar__brand:hover { color: var(--text-primary); }
.sidebar__name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px;
  border-radius: var(--r-md); color: var(--text-secondary); font-size: var(--fs-nav);
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.is-active { background: var(--bg-raised); color: var(--text-primary); font-weight: 500; }
.nav-item.is-active:hover { background: var(--bg-hover); }
.nav-item__bar {
  position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--accent);
}

/* User chip + menu */
.user { position: relative; margin-top: auto; padding: 16px 16px 20px; }
.user__chip {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: var(--r-md);
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.user__chip:hover { background: var(--bg-card); }
.avatar {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: var(--r-full);
  background: var(--bg-raised); color: var(--text-secondary);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.02em;
}
.avatar--lg { width: 40px; height: 40px; font-size: var(--fs-small); letter-spacing: 0; }
.user__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.user__name { font-size: var(--fs-body); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user__role { font-size: var(--fs-micro); color: var(--text-tertiary); }
.user__caret { color: var(--text-tertiary); transition: transform var(--dur) var(--ease); }
.user__caret.is-open { transform: rotate(180deg); }
.user__menu {
  position: absolute; left: 16px; right: 16px; bottom: 68px; display: flex; flex-direction: column; gap: 2px;
  padding: 6px; border: 1px solid var(--border-default); border-radius: var(--r-md); background: var(--bg-raised);
  box-shadow: var(--shadow-dropdown); z-index: var(--z-user-menu);
}
.menu-item {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-primary); font-size: var(--fs-meta); text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.menu-item--danger { color: var(--danger); }
.menu-item--danger:hover { color: var(--danger); }

/* Main column + page header */
.main { flex: 1; min-width: 0; padding: var(--page-pad); }
.page-header { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.page-header__title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.page-title { font-size: var(--fs-h1); font-weight: 600; letter-spacing: -0.015em; }
.page-meta { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: var(--fs-meta); }
.page-header__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: var(--fs-meta); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--text-primary); }

/* Vertical section nav (Settings) */
.side-nav { display: flex; flex-direction: column; gap: 2px; max-width: 250px; width: 100%; }
.side-nav__item {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-secondary); font-size: var(--fs-body); font-weight: 400;
  text-align: left; cursor: pointer;
}
.side-nav__item:hover { background: var(--bg-card); color: var(--text-primary); }
.side-nav__item.is-active {
  background: var(--bg-raised); color: var(--text-primary); font-weight: 500; box-shadow: inset 2px 0 0 var(--accent);
}
.settings-layout {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 20px;
  margin-top: 24px; align-items: start;
}
.settings-layout__body { grid-column: span 3; min-width: 0; display: flex; flex-direction: column; gap: 16px; max-width: 860px; }

/* Placeholder body for screens not built yet (WP6a/WP6b replace it) */
.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 320px; margin-top: 26px; padding: 40px 24px; text-align: center;
  border: 1px dashed var(--border-default); border-radius: var(--r-md); color: var(--text-tertiary);
}
.placeholder__title { color: var(--text-secondary); font-size: var(--fs-body); font-weight: 500; }

/* Boot / fatal states */
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--text-tertiary); font-size: var(--fs-meta); }
.boot__box { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
