/* The app shell: sidebar, content column, page headers. */

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

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 14px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark { width: 32px; height: 32px; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.15; }
.brand__sub { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; }

.nav { padding: 6px 10px; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  color: var(--ink-2); font-weight: 500; font-size: 13.5px;
}
.nav__item svg { width: 17px; height: 17px; color: var(--faint); }
.nav__item:hover { background: var(--surface-2); text-decoration: none; }
.nav__item--active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.nav__item--active svg { color: var(--brand); }
.nav__count { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--critical-bg); color: var(--critical); border-radius: 99px; padding: 1px 7px; }

.sidebar__foot { border-top: 1px solid var(--line-2); padding: 10px 10px 14px; display: flex; flex-direction: column; gap: 2px; }

.sync-chip { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; }
.sync-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.sync-chip--unhealthy .sync-chip__dot { background: var(--high); box-shadow: 0 0 0 3px var(--high-bg); }
.sync-chip__text { flex: 1; min-width: 0; font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.sync-chip__text strong { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.sync-chip form { margin-left: auto; }

.user-line { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 12.5px; color: var(--muted); }
.user-line .avatar { width: 24px; height: 24px; font-size: 10px; }
.user-line form { margin-left: auto; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 36px 72px; }

.banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--high-bg); border-bottom: 1px solid var(--high-line);
  color: var(--high); font-size: 13px; font-weight: 500;
  padding: 10px 36px;
}
.banner svg { width: 16px; height: 16px; }
.banner a { color: var(--high); font-weight: 600; text-decoration: underline; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { font-size: 12.5px; font-weight: 600; color: var(--brand-ink); }

.stack { display: flex; flex-direction: column; gap: 22px; }
.stack--tight { gap: 10px; }
.stack--narrow { max-width: 720px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--wrap { flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth__card { width: 100%; max-width: 400px; }
.auth .brand { justify-content: center; padding: 0 0 18px; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: none; border-bottom: 1px solid var(--line); }
  .brand { padding: 12px 16px; }
  .brand__sub { display: none; }
  .nav { flex-direction: row; flex: 1 1 auto; overflow-x: auto; padding: 6px 8px; }
  .nav__item { white-space: nowrap; }
  .sidebar__foot { border-top: 1px solid var(--line-2); width: 100%; flex-direction: row; align-items: center; justify-content: space-between; padding: 4px 8px; }
  .content { padding: 20px 16px 56px; }
  .banner { padding: 10px 16px; }
}

@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  h1 { font-size: 24px; }
  .sidebar__foot .nav__item span { display: none; }
}

@media (max-width: 560px) {
  .strip { flex-wrap: wrap; }
  .strip__body { flex-basis: calc(100% - 40px); }
}
.subtitle + form { margin-top: 18px; }
