/* SalesBot shared shell — compact IA (5 merchant + admin system) */
:root {
  --sb-nav-w: 220px;
  --sb-nav-bg: #0f172a;
  --sb-nav-fg: #e2e8f0;
  --sb-nav-muted: #94a3b8;
  --sb-nav-active: #38bdf8;
  --sb-nav-border: #1e293b;
}

#sb-shell {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sb-nav-w);
  background: var(--sb-nav-bg);
  color: var(--sb-nav-fg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.25);
}

#sb-shell .sb-brand {
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--sb-nav-border);
}

#sb-shell .sb-brand a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

#sb-shell .sb-brand small {
  display: block;
  color: var(--sb-nav-muted);
  font-size: 0.72rem;
  margin-top: 4px;
  font-weight: 500;
}

#sb-shell nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px 20px;
}

#sb-shell .sb-group {
  margin-bottom: 4px;
}

#sb-shell .sb-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--sb-nav-fg);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

#sb-shell .sb-link:hover {
  background: rgba(148, 163, 184, 0.12);
}

#sb-shell .sb-link.active,
#sb-shell .sb-child.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--sb-nav-active);
}

#sb-shell .sb-children {
  display: none;
  padding: 2px 0 6px 12px;
}

#sb-shell .sb-group.open .sb-children,
#sb-shell .sb-group.has-active .sb-children {
  display: block;
}

#sb-shell .sb-child {
  display: block;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--sb-nav-muted);
  text-decoration: none;
  font-size: 0.82rem;
}

#sb-shell .sb-child:hover {
  color: #fff;
  background: rgba(148, 163, 184, 0.1);
}

#sb-shell .sb-admin-only {
  display: none;
}

#sb-shell.sb-is-admin .sb-admin-only {
  display: block;
}

#sb-shell .sb-footer {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--sb-nav-border);
  font-size: 0.75rem;
  color: var(--sb-nav-muted);
}

#sb-shell .sb-footer a {
  color: var(--sb-nav-muted);
  text-decoration: none;
}

#sb-shell .sb-footer a:hover {
  color: #fff;
}

#sb-nav-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10001;
  background: var(--sb-nav-bg);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

body.sb-has-shell {
  margin-left: var(--sb-nav-w) !important;
}

/* Hide legacy per-page chip navs */
body.sb-has-shell .nav-links {
  display: none !important;
}

#sb-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}

#sb-subnav .sb-subtab {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: #334155;
  background: #e2e8f0;
}

#sb-subnav .sb-subtab.active {
  background: #0ea5e9;
  color: #fff;
}

header #sb-subnav .sb-subtab {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

header #sb-subnav .sb-subtab.active {
  background: #fff;
  color: #0f172a;
}

@media (max-width: 900px) {
  #sb-nav-toggle {
    display: block;
  }

  #sb-shell {
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  body.sb-nav-open #sb-shell {
    transform: translateX(0);
  }

  body.sb-has-shell {
    margin-left: 0 !important;
  }

  body.sb-has-shell .container,
  body.sb-has-shell .login-container {
    padding-top: 52px;
  }
}
