/* ===== App shell: sidebar + topbar ===== */
.app-shell { min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: transform .2s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 18px 20px 14px;
}
.sidebar-brand .mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, #635bff, #0a2540);
  flex-shrink: 0;
}
.sidebar-brand .name { font-weight: 800; font-size: 15px; letter-spacing: -0.02em; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.nav-group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--faint); font-weight: 700; margin: 18px 10px 6px;
}
.nav-group-label:first-child { margin-top: 8px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-md);
  color: var(--ink-2); font-weight: 500; font-size: 13.5px;
  margin-bottom: 1px;
}
.nav-item:hover { background: var(--surface-hover); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.nav-item .ic { width: 17px; height: 17px; color: var(--muted); }
.nav-item.active .ic { color: var(--accent); }
.nav-item .count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  color: var(--muted); background: var(--surface-sunken);
  border-radius: var(--r-pill); padding: 1px 7px;
}
.nav-item.active .count { color: var(--accent-ink); background: #fff; }

.sidebar-footer { border-top: 1px solid var(--border); padding: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--r-md); position: relative;
}
.user-chip:hover { background: var(--surface-hover); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.user-chip .who { min-width: 0; flex: 1; }
.user-chip .who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who span { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-search {
  flex: 1; max-width: 420px; position: relative;
}
.topbar-search input {
  width: 100%; height: 36px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface-sunken);
  padding: 0 12px 0 34px; font-size: 13px;
}
.topbar-search input:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.topbar-search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 15px; height: 15px; }
.topbar-search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 10.5px; color: var(--faint); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; font-family: var(--mono);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  position: relative;
}
.icon-btn:hover { background: var(--surface-hover); border-color: var(--border); color: var(--ink); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--danger); border: 1.5px solid #fff;
}

.content { padding: 28px 32px 56px; flex: 1; max-width: 1360px; width: 100%; }

@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .app-main { margin-left: 0; }
}

/* ===== Auth shell ===== */
.auth-shell { min-height: 100vh; display: flex; }
.auth-visual {
  flex: 1; position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(700px 500px at 15% 10%, rgba(99,91,255,.35), transparent 60%),
    radial-gradient(600px 500px at 85% 90%, rgba(99,91,255,.18), transparent 60%),
    #0a2540;
  padding: 44px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-visual .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; }
.auth-visual .brand .mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #a29bff, #635bff); }
.auth-visual .pitch h1 { font-size: 32px; color: #fff; max-width: 460px; line-height: 1.2; letter-spacing: -0.03em; }
.auth-visual .pitch p { margin-top: 12px; color: #b9c4d6; font-size: 14px; max-width: 420px; line-height: 1.6; }
.auth-visual .quote { font-size: 12.5px; color: #9fb0c8; max-width: 420px; line-height: 1.6; border-top: 1px solid rgba(255,255,255,.14); padding-top: 16px; }
.auth-visual .quote b { color: #fff; }

.auth-form-side {
  width: 480px; flex-shrink: 0; background: var(--surface);
  display: flex; align-items: center; justify-content: center; padding: 40px;
  overflow-y: auto;
}
.auth-card { width: 100%; max-width: 340px; }
.auth-card h2 { font-size: 22px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 13px; color: var(--muted); }
.auth-foot a { color: var(--accent); font-weight: 600; }

@media (max-width: 900px) {
  .auth-visual { display: none; }
  .auth-form-side { width: 100%; }
}
