/* 02-layout.css — Sidebar, main area and top bar.
   Part of the portal stylesheet; index.html loads the parts in order (01 to 12), so the cascade is
   the same as one file. */

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px 20px 20px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.08);
  border-right: 1px solid var(--line-soft);
  overflow-y: auto;
}
.sidebar-logo img { display: block; width: 220px; max-width: 100%; height: auto; filter: drop-shadow(0 12px 18px rgba(17, 20, 24, 0.08)); }
.side-nav { display: grid; gap: 2px; align-content: start; flex: 1; }
.nav-group-label { margin: 10px 0 2px 14px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group-label:first-child { margin-top: 0; }
.side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 6px 12px 6px 16px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--nav-ink);
  font: inherit;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.side-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link svg { width: 18px; height: 18px; opacity: 0.84; }
.side-link:hover { background: color-mix(in srgb, var(--primary) 7%, transparent); color: var(--primary-dark); }
.side-link.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 13%, transparent), color-mix(in srgb, var(--primary-dark) 7%, transparent));
  color: var(--primary-dark);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}
.side-link.active::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 3px; border-radius: 999px; background: var(--primary); }

/* ---------- Main and top bar ---------- */
main { min-width: 0; padding: 0 var(--gutter) 48px; outline: none; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 0 calc(-1 * var(--gutter)) var(--space-6);
  padding: 22px var(--gutter) 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--topbar-bg);
  backdrop-filter: blur(18px) saturate(1.08);
}
.topbar-titles { min-width: 0; }
.topbar-titles h1 { overflow-wrap: anywhere; }
#subtitle { color: var(--muted); margin-top: 2px; }
#subtitle:empty { display: none; }
.topbar-tools { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.view-host { max-width: var(--content-max); }
.view { display: grid; gap: var(--space-4); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.page-actions:empty { display: none; }
.loading { padding: 20px 0; }
