/* ============================================================
   layout.css — sidebar, main content, page headers
   ============================================================ */

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

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--c-surface);
  border-right: 0.5px solid var(--c-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 16px 18px;
  border-bottom: 0.5px solid var(--c-border);
}
.sidebar-logo .logo-name {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.3px;
  color: var(--c-text);
}
.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--c-text-3);
  margin-top: 2px;
}

.sidebar-nav {
  padding: 10px 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 400;
  color: var(--c-text-2);
  transition: background 0.12s, color 0.12s;
  cursor: pointer;
  user-select: none;
}
.nav-item:hover {
  background: var(--c-bg);
  color: var(--c-text);
}
.nav-item.active {
  background: var(--c-blue-bg);
  color: var(--c-blue-text);
  font-weight: 500;
}
.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.8;
}
.nav-item.active svg { opacity: 1; }

/* ---- Main ---- */
.main {
  flex: 1;
  padding: 28px 28px 48px;
  overflow-y: auto;
  max-width: calc(100vw - var(--sidebar-w));
}

/* ---- Page ---- */
.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

/* ---- Toast ---- */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--c-text);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--r-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 9999;
}
#toast.show {
  opacity: 1;
  transform: translateY(0);
}
#toast.error { background: var(--c-red); }
#toast.success { background: var(--c-green); }
