/* CurupiraHUB - sidebar.css */

.app-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.app-sidebar {
  width: 60px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: stretch;
  padding: 16px 0 12px; gap: 2px; flex-shrink: 0;
  transition: width 0.35s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
}
.app-sidebar.expanded { width: 220px; }
/* Restauracao do estado entre navegacoes: aplica largura/labels sem animar. */
.app-sidebar.no-anim, .app-sidebar.no-anim *, .app-main-area.no-anim { transition: none !important; }

/* Logo */
.sidebar-logo {
  height: 36px;
  display: flex; align-items: center; gap: 10px;
  margin: 0 8px 16px; padding: 0 10px;
  background: var(--accent); border-radius: var(--radius-md);
  font-weight: 700; font-size: 14px; color: #fff;
  overflow: hidden; white-space: nowrap; flex-shrink: 0; text-decoration: none;
}
.sidebar-logo:hover { background: var(--accent-hover); color: #fff; }
.sidebar-logo .logo-icon { flex-shrink: 0; width: 20px; text-align: center; }
.sidebar-logo .logo-text {
  max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap;
  transition: max-width 0.3s ease, opacity 0.2s ease;
  color: #ffffff; font-weight: 700; font-size: 13px; letter-spacing: -0.01em; line-height: 1;
}
.app-sidebar.expanded .sidebar-logo .logo-text { max-width: 200px; opacity: 1; }

/* Group label */
.nav-group-label {
  height: 28px;
  display: flex; align-items: flex-end;
  padding: 0 18px 4px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); white-space: nowrap; overflow: hidden;
  opacity: 0; max-width: 0;
  transition: opacity 0.2s ease, max-width 0.35s ease;
  margin-top: 6px;
}
.app-sidebar.expanded .nav-group-label { opacity: 1; max-width: 220px; }

/* Nav items */
.nav-item {
  height: 40px; border-radius: var(--radius-md);
  display: flex; align-items: center; gap: 10px;
  margin: 1px 8px; padding: 0 10px;
  color: var(--text-muted); cursor: pointer;
  overflow: hidden; white-space: nowrap;
  font-size: 13px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
  position: relative; text-decoration: none;
}
.nav-item:hover { background: var(--bg-elevated); color: var(--text-secondary); text-decoration: none; }
.nav-item.active { background: var(--accent-subtle); color: var(--accent); }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-item .nav-icon { flex-shrink: 0; width: 20px; text-align: center; font-size: 16px; }
.nav-item .nav-label {
  max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap;
  transition: max-width 0.3s ease, opacity 0.2s ease;
}
.app-sidebar.expanded .nav-item .nav-label { max-width: 160px; opacity: 1; }

/* Footer */
.sidebar-spacer { flex: 1; }
.sidebar-footer { width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 0 8px; }

/* User card */
.sidebar-user {
  height: 40px; display: flex; align-items: center; gap: 10px;
  padding: 0 6px; background: var(--bg-elevated);
  border-radius: var(--radius-md); overflow: hidden; white-space: nowrap;
  cursor: pointer; transition: background 0.15s; border: none; width: 100%;
  text-align: left;
}
.sidebar-user:hover { background: #2d3f55; }
.sidebar-user .user-info {
  max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap;
  transition: max-width 0.3s ease, opacity 0.2s ease; pointer-events: none;
}
.app-sidebar.expanded .sidebar-user .user-info { max-width: 160px; opacity: 1; pointer-events: auto; }
.user-info .user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.user-info .user-role { font-size: 10px; color: var(--text-muted); }

/* Square avatar */
.sb-avatar {
  width: 32px; height: 32px; border-radius: var(--radius-md);
  background: var(--accent-subtle); border: 1.5px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans); font-size: 11px; font-weight: 700;
  color: var(--accent); line-height: 1; text-align: center;
  flex-shrink: 0; overflow: hidden;
}
.sb-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Main area */
.app-main-area {
  margin-left: 60px; flex: 1; min-height: 100vh;
  transition: margin-left 0.35s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.app-main-area.expanded { margin-left: 220px; }

/* Topbar */
.app-topbar {
  height: 52px; background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 12px;
  position: sticky; top: 0; z-index: 100; flex-shrink: 0;
}
.app-hamburger {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-left: -8px; flex-shrink: 0;
  border-radius: var(--radius-md); background: transparent; color: var(--text-secondary); cursor: pointer;
}
.app-hamburger:hover { background: var(--bg-elevated); color: var(--text-primary); }
.app-backdrop { display: none; }
.app-breadcrumb {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  font-size: 12px; color: var(--text-muted);
}
.app-breadcrumb .current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-breadcrumb .sep { color: var(--border-strong); }
.app-breadcrumb .current { color: var(--text-primary); font-weight: 500; }
.topbar-spacer { flex: 1; }

.totvs-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: var(--radius-full); padding: 4px 10px;
  font-size: 11px; color: var(--text-secondary); cursor: help;
}

/* Page — largura máxima confortável e centralizada (evita conteúdo esticado
   de ponta a ponta com áreas vazias em telas largas) */
.app-page { flex: 1; padding: 24px; width: 100%; max-width: 1360px; margin-inline: auto; }

/* =========================================================================
   Ícones SVG + trilho centralizado + botão Sair (redesign 2026-06b)
   ========================================================================= */

/* Logo agora é SVG (mark hexagonal) sobre o fundo accent */
.sidebar-logo .logo-icon { display: flex; align-items: center; justify-content: center; }
.sidebar-logo .logo-icon svg {
  width: 22px; height: 22px; fill: none; stroke: #fff;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Ícones de navegação: line icons herdando a cor do item (currentColor) */
.nav-item .nav-icon,
.sidebar-logout .nav-icon {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; flex-shrink: 0; font-size: 0; overflow: visible;
}
.nav-item .nav-icon svg,
.sidebar-logout .nav-icon svg {
  width: 19px; height: 19px; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  overflow: visible;
  transition: transform 0.18s var(--ease-spring);
}
.nav-item:hover .nav-icon svg { transform: translateX(1px); }
.nav-item.active .nav-icon svg { stroke-width: 2.1; }

/* Botão "Sair" explícito (separado do avatar → perfil) */
.sidebar-logout {
  height: 40px; width: 100%; margin: 0; padding: 0 10px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: none; cursor: pointer; text-align: left;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden;
  transition: background 0.15s, color 0.15s;
}
.sidebar-logout:hover { background: rgba(239,68,68,0.13); color: var(--err); }
.sidebar-logout .nav-label {
  max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap;
  transition: max-width 0.3s ease, opacity 0.2s ease;
}
.app-sidebar.expanded .sidebar-logout .nav-label { max-width: 140px; opacity: 1; }

/* Ícones centralizam pelo padding simétrico (box 24px em trilho de 44px).
   Sem override por estado → recolher anima só a largura do label, sem pulo. */
