/*
 * Shared Verge internal sidebar styles. Loaded by BOTH the clip-ops static
 * app (clip-ops/index.html) and the Next.js admin
 * (auto-clipping/web/app/_components/Sidebar.tsx) so the two sidebars can
 * never drift visually again. Markup uses the `vsb-` class namespace.
 *
 * Colors come from --vsb-* tokens that bridge each app's own palette: they
 * read the Next app's --color-* tokens first, fall back to clip-ops's --bg /
 * --text / --border tokens, then to a hardcoded value. Both apps flip their
 * palette on :root[data-theme="dark"], and because var() substitution is
 * resolved per element, --vsb-* tracks that flip automatically. No separate
 * light/dark blocks needed here.
 */
:root {
  --vsb-bg: var(--color-bg, var(--bg, #0a0a0a));
  --vsb-surface: var(--color-surface, var(--bg-elev, #141414));
  --vsb-surface-2: var(--color-surface-2, var(--bg-elev-2, #1c1c1c));
  --vsb-ink: var(--color-ink, var(--text, #fafaf9));
  --vsb-ink-soft: var(--color-ink-soft, var(--text-dim, #d4d4d4));
  --vsb-ink-mute: var(--color-ink-mute, var(--text-mute, #a3a3a3));
  --vsb-line: var(--color-line, var(--border, rgba(255, 255, 255, 0.08)));
  --vsb-line-strong: var(--color-line-strong, var(--border-strong, rgba(255, 255, 255, 0.16)));
  --vsb-success: var(--color-success, var(--success, #16a34a));
}

.vsb-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 240px;
  flex-shrink: 0;
  background: var(--vsb-bg);
  border-right: 1px solid var(--vsb-line);
  display: flex;
  flex-direction: column;
  padding: 0 12px 20px;
  overflow-y: auto;
  color: var(--vsb-ink);
}
.vsb-topbar {
  display: none;
}
.vsb-backdrop {
  display: none;
}
.vsb-drawer-close {
  display: none;
}
@media (max-width: 767px) {
  .vsb-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: min(280px, 86vw);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  }
  .vsb-sidebar.is-open {
    transform: translateX(0);
  }
  .vsb-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 40;
    height: 52px;
    padding: 0 14px;
    background: var(--vsb-bg);
    border-bottom: 1px solid var(--vsb-line);
  }
  .vsb-topbar-spacer {
    flex: 1;
  }
  .vsb-burger {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid var(--vsb-line);
    background: var(--vsb-bg);
    color: var(--vsb-ink);
    cursor: pointer;
  }
  .vsb-burger:hover {
    background: var(--vsb-surface);
  }
  .vsb-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }
  .vsb-topbar-brand .vsb-brand-logo {
    width: 24px;
    height: 24px;
    border-radius: 6px;
  }
  .vsb-topbar-brand .vsb-brand-name {
    font-size: 12px;
  }
  .vsb-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(10, 10, 11, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }
  .vsb-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  .vsb-drawer-close {
    display: grid;
    place-items: center;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--vsb-ink-soft);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
  }
  .vsb-drawer-close:hover {
    background: var(--vsb-surface);
    color: var(--vsb-ink);
  }
}
.vsb-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 12px 16px;
}
.vsb-brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--vsb-ink);
  color: var(--vsb-bg);
  display: grid;
  place-items: center;
}
.vsb-brand-logo svg {
  width: 100%;
  height: 100%;
}
.vsb-brand-name {
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 13px;
  color: var(--vsb-ink);
}
.vsb-brand-tag {
  font-size: 9px;
  padding: 2px 6px;
  background: var(--vsb-surface-2);
  color: var(--vsb-ink);
  border-radius: 4px;
  margin-left: auto;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.vsb-section {
  padding: 6px 0;
}
.vsb-nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--vsb-ink-mute);
  padding: 0 12px 6px;
  text-transform: uppercase;
}
.vsb-nav {
  display: flex;
  flex-direction: column;
}
.vsb-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--vsb-ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.1s, color 0.1s;
  user-select: none;
  position: relative;
  text-decoration: none;
}
.vsb-nav-item:hover {
  background: var(--vsb-surface);
  color: var(--vsb-ink);
}
.vsb-nav-item:hover .vsb-nav-icon {
  color: var(--vsb-ink);
}
.vsb-nav-item.active {
  background: var(--vsb-surface-2);
  color: var(--vsb-ink);
}
.vsb-nav-item.active .vsb-nav-icon {
  color: var(--vsb-ink);
}
.vsb-nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--vsb-ink-soft);
  display: inline-flex;
  transition: color 120ms cubic-bezier(0.4, 0, 0.2, 1);
}
.vsb-nav-icon svg {
  width: 16px;
  height: 16px;
}
.vsb-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--vsb-line);
}
.vsb-theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--vsb-ink-soft);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--vsb-line);
  /* font-family, not the `font` shorthand: the shorthand resets font-size and
     would inflate the pill to the inherited size. This bug is what made the
     toggle larger on the Next.js pages than in the static clip-ops sidebar. */
  font-family: inherit;
  width: 100%;
  text-align: left;
}
.vsb-theme-toggle:hover {
  background: var(--vsb-surface);
  color: var(--vsb-ink);
}
.vsb-theme-toggle svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.vsb-presence-wrap {
  position: relative;
  margin-bottom: 4px;
}
.vsb-presence-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--vsb-ink-soft);
  border: 1px solid var(--vsb-line);
  background: var(--vsb-surface);
  /* font-family, not the `font` shorthand (see note above). */
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.vsb-presence-pill:hover {
  border-color: var(--vsb-line-strong);
  background: var(--vsb-surface-2);
}
.vsb-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--vsb-success);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 var(--vsb-success);
  animation: vsbLivePulse 2.2s infinite;
}
.vsb-live-dot.idle {
  background: var(--vsb-ink-mute);
  animation: none;
}
@keyframes vsbLivePulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--vsb-success) 55%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.vsb-presence-caret {
  width: 13px;
  height: 13px;
  margin-left: auto;
  color: var(--vsb-ink-mute);
  flex-shrink: 0;
}
.vsb-presence-pop {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--vsb-bg);
  border: 1px solid var(--vsb-line-strong);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 6px;
  z-index: 60;
  max-height: 320px;
  overflow-y: auto;
}
.vsb-pop-empty {
  font-size: 12px;
  color: var(--vsb-ink-mute);
  padding: 10px;
  text-align: center;
}
.vsb-pop-h {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vsb-ink-mute);
  padding: 8px 10px 6px;
}
.vsb-pop-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}
.vsb-pop-av {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f472b6, #a78bfa);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #0a0a0b;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}
.vsb-pop-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--vsb-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vsb-pop-when {
  margin-left: auto;
  font-size: 11px;
  color: var(--vsb-ink-mute);
  flex-shrink: 0;
}
.vsb-sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.vsb-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
}
.vsb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f472b6, #a78bfa);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 11px;
  color: #0a0a0b;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}
.vsb-user-info {
  font-size: 12px;
  line-height: 1.3;
  min-width: 0;
  flex: 1;
}
.vsb-user-name {
  color: var(--vsb-ink);
  font-weight: 500;
}
.vsb-sync-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--vsb-ink-mute);
  flex-shrink: 0;
}
