/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background:
    linear-gradient(180deg, rgba(10,10,11,0.94) 0%, rgba(8,8,9,0.98) 100%),
    url('/images/varc-sidebar-wireframe-texture.png');
  background-size: cover;
  background-position: center;
  border-right: 1px solid rgba(255,255,255,0.10);
  box-shadow: 18px 0 60px rgba(0,0,0,0.28), inset -1px 0 0 rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
  transition: transform var(--t-slow);
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.08), transparent 34%),
    linear-gradient(90deg, rgba(0,0,0,0.20), transparent 52%, rgba(255,255,255,0.025));
  opacity: 0.82;
}

.sidebar-head,
.sidebar-nav,
.sidebar-foot {
  position: relative;
  z-index: 1;
}

.sidebar-head {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.sidebar-logo span { color: var(--text-muted); font-weight: 400; }

.sidebar-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.035);
  padding: 2px 8px; border-radius: var(--r-full);
  margin-top: 8px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-section-label {
  font-family: var(--font-display);
  font-size: 8px; font-weight: 400;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  padding: 12px 12px 6px;
}

.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 13px; font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--t-fast);
  position: relative;
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.045);
  color: var(--text-secondary);
  border-color: rgba(255,255,255,0.06);
}
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(255,255,255,0.10), rgba(255,255,255,0.045));
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 8px 24px rgba(0,0,0,0.18);
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 50%;
  width: 2px;
  height: 18px;
  border-radius: var(--r-full);
  background: #f4f2ee;
  transform: translateY(-50%);
  box-shadow: 0 0 16px rgba(255,255,255,0.35);
}
.sidebar-link svg { flex-shrink: 0; opacity: 0.7; }
.sidebar-link.active svg { opacity: 1; }
.sidebar-link-label { flex: 1; }
.sidebar-link-badge {
  font-family: var(--font-display);
  font-size: 8px; letter-spacing: 0.06em;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2px 6px; border-radius: var(--r-sm);
}

.sidebar-foot {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.030));
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  margin-bottom: 8px;
}
.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700;
  color: var(--text-secondary);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-username {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-credits {
  font-family: var(--font-body);
  font-size: 11px; color: var(--text-muted);
  margin-top: 1px;
}
.sidebar-credits strong {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 300;
  width: 40px; height: 40px;
  background: rgba(18,18,20,0.86);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-md);
  align-items: center; justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.24);
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 190;
  backdrop-filter: blur(4px);
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w) - 10px)); }
  .sidebar.open { transform: translateX(0); --sidebar-w: 260px; }
  .sidebar-toggle { display: flex; }
  .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity var(--t-base); }
  .sidebar-overlay.open { opacity: 1; pointer-events: all; }
}

/* Language Pill Selector */
.lang-pill-item {
  background: transparent;
  color: var(--text-dim);
  border: none;
  font-family: var(--font-display, sans-serif);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  border-radius: 4px;
}
.lang-pill-item:hover {
  color: var(--text-primary);
}
.lang-pill-item.active {
  background: #f4f2ee;
  color: #080809;
  box-shadow: 0 1px 10px rgba(255,255,255,0.16);
}
