/* App shell: sidebar + topbar + content, shared by every protected page */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
#sidebar-mount {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 22px;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13.5px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--text-primary);
}

.nav-item.active .nav-icon {
  color: var(--accent);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  display: flex;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.nav-logout {
  margin-top: auto;
  color: var(--text-secondary);
}

.nav-logout:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.nav-logout:hover .nav-icon {
  color: var(--danger);
}

#sidebar-toggle {
  display: none;
}

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: rgba(11, 13, 18, 0.85);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
}

.topbar-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- Main content ---------- */
.main-content {
  min-width: 0;
}

.content-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 28px 32px 64px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  #sidebar-mount {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    width: 260px;
    transform: translateX(-100%);
    transition: transform var(--dur-med) var(--ease);
    box-shadow: var(--shadow-lg);
  }

  #sidebar-mount.open {
    transform: translateX(0);
  }

  #sidebar-toggle {
    display: flex;
  }

  .content-inner {
    padding: 20px 16px 48px;
  }

  .topbar {
    padding: 0 16px;
  }
}
