/* =============================================
   layout.css — sidebar, main, header
   ============================================= */

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 10;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border-light);
}

.logo-mark {
  width: 30px; height: 30px;
  background: var(--text);
  color: #fff;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo-text {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--text);
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  min-height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--accent-light); color: var(--accent); }

.sidebar-footer {
  padding: 10px 10px 0;
  display: flex;
  flex-direction: column;
}

.sidebar-footer-bottom {
  border-top: 1px solid var(--border-light);
  padding: 12px 10px;
  margin-top: 4px;
}

.workspace-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.ws-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-complete);
}

/* ---- Main ---- */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 40px 48px 40px;
  height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
}

/* ---- Page header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-bottom: 28px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
}

.workspace-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-xmuted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: var(--bg);
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--border);
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

/* ---- Overlay (dropdown backdrop) ---- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
}

/* ---- Dark mode ---- */
[data-theme="dark"] .sidebar {
  background: #16161f;
  border-right-color: #2e2e3e;
}

[data-theme="dark"] .logo-mark {
  background: #e8e8f0;
  color: #111118;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  body { display: block; }
  .sidebar { display: none; }
  .main { padding: 24px 16px 100px; width: 100%; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
  .page-title { font-size: 22px; }
}
