/* ============================================================
 * CAF · sidebar.css — fonte única de estilos da sidebar
 *
 * Usa as classes que JÁ existem em 9 das 11 páginas:
 *   .sidebar, .sidebar-brand, .brand-mark, .brand-text > .name/.role,
 *   .nav-section, .nav-label, .nav-item, .sidebar-footer, .user-chip, .avatar
 *
 * Carregado APÓS o <style> inline → ganha cascata e garante
 * que TODAS as páginas tenham EXATAMENTE as mesmas dimensões.
 * ============================================================ */

/* Reserva espaço fixo pra scrollbar do navegador em TODAS as páginas.
 * Sem isso, quando navega de uma página sem scrollbar pra uma com scrollbar
 * (ou vice-versa), todo o conteúdo shift 15-17px → parece que a sidebar mexe. */
html {
  scrollbar-gutter: stable;
}

aside.sidebar {
  width: 240px;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0;
  margin: 0;
}
aside.sidebar::-webkit-scrollbar { width: 4px; }
aside.sidebar::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

aside.sidebar .sidebar-brand {
  padding: 22px 20px 20px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
}
aside.sidebar .brand-mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #001a0d;
  font-weight: 800; font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0,255,149,0.3), 0 4px 16px rgba(0,255,149,0.25), 0 0 24px rgba(0,255,149,0.2);
}
aside.sidebar .brand-text { line-height: 1.1; min-width: 0; }
aside.sidebar .brand-text .name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; color: var(--text); }
aside.sidebar .brand-text .role { font-family: var(--mono, monospace); font-size: 10px; color: var(--text-4); margin-top: 3px; letter-spacing: 0.05em; }

aside.sidebar .nav-section { padding: 14px 12px 4px; margin: 0; }
aside.sidebar .nav-label { font-family: var(--mono, monospace); font-size: 10px; font-weight: 500; letter-spacing: 0.12em; color: var(--text-4); padding: 0 10px 8px; text-transform: uppercase; }

aside.sidebar .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin: 1px 0;
  border-radius: 8px;
  color: var(--text-2); cursor: pointer;
  font-size: 13.5px; font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: background-color 0.15s ease, color 0.15s ease;
}
aside.sidebar .nav-item:hover { background: var(--surface); color: var(--text); }
aside.sidebar .nav-item.active { background: var(--surface-2); color: var(--text); }
aside.sidebar .nav-item.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: var(--accent); border-radius: 2px; box-shadow: 0 0 12px rgba(0,255,149,0.4); }
aside.sidebar .nav-item i { font-size: 17px; flex-shrink: 0; }
aside.sidebar .nav-item > span:not(.badge) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
aside.sidebar .nav-item .badge { margin-left: auto; font-family: var(--mono, monospace); font-size: 9px; padding: 3px 7px; border-radius: 100px; font-weight: 700; flex-shrink: 0; }

aside.sidebar .sidebar-footer { margin-top: auto; padding: 14px; border-top: 1px solid var(--border); }
aside.sidebar .user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; transition: background 0.15s ease; cursor: pointer; }
aside.sidebar .user-chip:hover { background: var(--surface); }
aside.sidebar .avatar { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #2a3142, #1a2030); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11.5px; color: var(--text); position: relative; flex-shrink: 0; }
aside.sidebar .avatar.online::after { content: ''; position: absolute; bottom: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-1); }
