/**
 * Sidebar + Header v2 — Huge Networks
 * Design Apple-inspired com tokens semânticos, Lucide outline icons e motion sutil.
 * Namespace: .sidebar-v2 e .header-v2 para não conflitar com app.css legado
 */

/* ============================================================
   1. TOKENS DE COR
   ============================================================ */
:root {
  /* Paleta Neutra */
  --neutral-900: #1d1d1f;
  --neutral-700: #374151;
  --neutral-600: #6b7280;
  --neutral-500: #6e6e73;
  --neutral-400: #9ca3af;
  --neutral-200: #e5e7eb;
  --neutral-150: #f0f0f5;
  --neutral-100: #f3f4f6;
  --neutral-75: #f5f5f7;
  --neutral-active: #eef0f8;
  --neutral-active-sub: #e8eaf6;
  --neutral-divider: rgba(0, 0, 0, 0.08);
  --neutral-divider-soft: rgba(0, 0, 0, 0.06);

  /* Paleta da Marca */
  --accent-highlight: #030A8C;
  --accent-highlight-hover: #0410b5;

  /* Sidebar Dimensions */
  --sidebar-expanded-width: 260px;
  --sidebar-collapsed-width: 92px;
  --sidebar-current-width: 260px;

  /* Header */
  --header-height: 72px;

  /* Motion */
  --ease-apple: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-sidebar: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 280ms;
  --duration-slow: 420ms;

  /* Superfícies e bordas */
  --background: #ffffff;
  --card-bg-v2: #ffffff;
  --border-v2: rgba(0, 0, 0, 0.08);
  --muted: #e8e8ed;
  --input-bg: #f5f5f7;
}

/* ============================================================
   2. TIPOGRAFIA BASE
   ============================================================ */
.sidebar-v2,
.header-v2 {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   3. SIDEBAR — CONTAINER PRINCIPAL
   ============================================================ */
.sidebar-v2 {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 51;
  width: var(--sidebar-expanded-width);
  height: calc(100vh - 16px);
  margin: 8px;
  padding: 0 16px 24px 16px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    width 0.3s var(--ease-sidebar),
    padding 0.3s var(--ease-sidebar);
  box-sizing: border-box;
}

/* ============================================================
   4. SIDEBAR — ÁREA DO LOGO (EXPANDIDA)
   ============================================================ */
.sidebar-v2__logo-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--header-height) - 8px);
  padding: 0 0 16px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--neutral-150);
  flex-shrink: 0;
  box-sizing: border-box;
}

.sidebar-v2__logo-full {
  height: 28px;
  width: auto;
  display: block;
}

.sidebar-v2__logo-icon {
  width: 36px;
  height: 36px;
  display: none;
}

.sidebar-v2__collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--neutral-200);
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--duration-fast) ease;
  color: var(--neutral-400);
}

.sidebar-v2__collapse-btn:hover {
  background: var(--neutral-100);
}

.sidebar-v2__collapse-btn svg {
  width: 14px;
  height: 14px;
  stroke: var(--neutral-400);
  stroke-width: 2;
}

/* Botão externo de expandir (visível quando colapsado) */
.sidebar-v2__expand-btn {
  display: none;
  position: absolute;
  right: -22px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(200, 200, 230, 0.35);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 52;
  transition: background var(--duration-fast) ease;
}

.sidebar-v2__expand-btn:hover {
  background: rgba(200, 200, 230, 0.55);
}

.sidebar-v2__expand-btn svg {
  width: 12px;
  height: 12px;
  stroke: #8b8fd8;
  stroke-width: 2;
}

/* ============================================================
   5. SIDEBAR — SCROLL WRAPPER
   ============================================================ */
.sidebar-v2-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  list-style: none;
  margin: 0;
  padding: 8px 0 0 0;
}

/* Scrollbar customizada */
.sidebar-scroll::-webkit-scrollbar {
  width: 3px;
}
.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 10px;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* ============================================================
   6. SIDEBAR — SECTION LABELS
   ============================================================ */
.sidebar-v2__section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neutral-400);
  padding: 0 8px;
  margin-bottom: 8px;
  margin-top: 16px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-v2__section-label:first-child,
.sidebar-v2__section:first-child .sidebar-v2__section-label {
  margin-top: 0;
}

.sidebar-v2__section-spacer {
  display: none;
  height: 16px;
  margin: 4px 0;
}

/* ============================================================
   7. SIDEBAR — NAV ITEMS (EXPANDIDA)
   ============================================================ */
.sidebar-v2__item {
  position: relative;
  list-style: none;
}

.sidebar-v2__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none !important;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
  overflow: hidden;
  color: var(--neutral-700) !important;
  font-size: 14px;
  font-weight: 400;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.sidebar-v2__link:hover {
  background: var(--neutral-100);
  color: var(--neutral-900) !important;
  text-decoration: none !important;
}

.sidebar-v2__link.active {
  background: var(--neutral-active);
  color: var(--neutral-900) !important;
  font-weight: 500;
}

.sidebar-v2__link.active .sidebar-v2-icon {
  stroke: var(--neutral-900);
}

.sidebar-v2__link-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ícone do item */
.sidebar-v2-icon {
  width: 20px;
  height: 20px;
  stroke: var(--neutral-400);
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
  transition: stroke var(--duration-fast) ease;
}

.sidebar-v2__link:hover .sidebar-v2-icon {
  stroke: var(--neutral-900);
}

/* Chevron para items com sub-menu */
.sidebar-v2__chevron {
  width: 16px;
  height: 16px;
  stroke: var(--neutral-400);
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  margin-left: auto;
}

.sidebar-v2__item--open > .sidebar-v2__link .sidebar-v2__chevron {
  transform: rotate(0deg);
}

.sidebar-v2__item:not(.sidebar-v2__item--open) > .sidebar-v2__link .sidebar-v2__chevron {
  transform: rotate(-90deg);
}

/* ============================================================
   8. SIDEBAR — SUB-ITEMS
   ============================================================ */
.sidebar-v2__submenu {
  list-style: none;
  padding: 0;
  margin: 0 0 4px 28px;
  border-left: 1px solid var(--neutral-200);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s var(--ease-apple), opacity 0.2s ease;
  opacity: 0;
}

.sidebar-v2__item--open > .sidebar-v2__submenu {
  max-height: 400px;
  opacity: 1;
}

.sidebar-v2__sublink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--neutral-600) !important;
  text-decoration: none !important;
  border-radius: 8px;
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-v2__sublink:hover {
  background: var(--neutral-100);
  color: var(--neutral-900) !important;
  text-decoration: none !important;
}

.sidebar-v2__sublink.active {
  background: var(--neutral-active-sub);
  color: var(--neutral-900) !important;
  font-weight: 500;
}

/* ============================================================
   9. SIDEBAR — CTA CARD "COMECE POR AQUI"
   ============================================================ */
.sidebar-v2__cta {
  flex-shrink: 0;
  margin-top: 16px;
}

/* Estado expandido */
.sidebar-v2__cta-card {
  position: relative;
  aspect-ratio: 1 / 1.1;
  border-radius: 20px;
  padding: 24px;
  background-color: #c8caee;
  background-image: linear-gradient(145deg,
    rgba(3, 10, 140, 0.92) 0%,
    rgba(3, 10, 140, 0.55) 35%,
    rgba(3, 10, 140, 0.18) 65%,
    rgba(3, 10, 140, 0.00) 100%);
  box-shadow: 0 8px 32px rgba(3, 10, 140, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-v2__cta-card--hidden {
  display: none;
}

.sidebar-v2__cta-flag {
  width: 32px;
  height: 32px;
  stroke: #ffffff;
  stroke-width: 1.5;
  fill: none;
  margin-bottom: 20px;
}

.sidebar-v2__cta-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  margin: 0 0 12px 0;
}

.sidebar-v2__cta-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
  margin-bottom: 12px;
  border: none;
}

.sidebar-v2__cta-desc {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.sidebar-v2__cta-action {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.2s var(--ease-bounce), transform 0.2s var(--ease-bounce);
  text-decoration: none;
}

.sidebar-v2__cta-action:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transform: scale(1.08);
}

.sidebar-v2__cta-action svg {
  width: 18px;
  height: 18px;
  stroke: #000000;
  stroke-width: 1.8;
  fill: none;
}

.sidebar-v2__cta-minimize {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-v2__cta-minimize svg {
  width: 14px;
  height: 14px;
  stroke: #ffffff;
  stroke-width: 2;
  fill: none;
}

/* Estado minimizado do CTA */
.sidebar-v2__cta-mini {
  display: none;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  padding: 14px 16px;
  background-color: #c8caee;
  background-image: linear-gradient(145deg,
    rgba(3, 10, 140, 0.92) 0%,
    rgba(3, 10, 140, 0.55) 35%,
    rgba(3, 10, 140, 0.18) 65%,
    rgba(3, 10, 140, 0.00) 100%);
  box-shadow: 0 4px 16px rgba(3, 10, 140, 0.12), 0 2px 4px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  border: none;
  width: 100%;
}

.sidebar-v2__cta-mini svg.cta-mini-flag {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
}

.sidebar-v2__cta-mini-label {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  flex: 1;
  text-align: left;
}

.sidebar-v2__cta-mini-expand {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-v2__cta-mini-expand svg {
  width: 14px;
  height: 14px;
  stroke: #ffffff;
  stroke-width: 2;
  fill: none;
}

/* CTA minimizado visível */
.sidebar-v2__cta--minimized .sidebar-v2__cta-card {
  display: none;
}

.sidebar-v2__cta--minimized .sidebar-v2__cta-mini {
  display: flex;
}

/* ============================================================
   10. SIDEBAR — FAB LOGOUT (COLAPSADA)
   ============================================================ */
.sidebar-v2__fab-logout {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e2580;
  box-shadow: 0 4px 12px rgba(30, 37, 128, 0.35);
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.sidebar-v2__fab-logout:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(30, 37, 128, 0.45);
}

.sidebar-v2__fab-logout svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  stroke-width: 1.5;
  fill: none;
}

/* ============================================================
   11. SIDEBAR — ESTADO COLAPSADO
   ============================================================ */
.sidebar-v2--collapsed {
  width: var(--sidebar-collapsed-width);
  padding: 16px 8px;
  overflow: visible;
}

.sidebar-v2--collapsed .sidebar-v2__logo-full {
  display: none;
}

.sidebar-v2--collapsed .sidebar-v2__logo-icon {
  display: block;
  margin: 0 auto;
}

.sidebar-v2--collapsed .sidebar-v2__collapse-btn {
  display: none;
}

.sidebar-v2--collapsed .sidebar-v2__expand-btn {
  display: flex;
}

.sidebar-v2--collapsed .sidebar-v2__logo-area {
  justify-content: center;
  flex-direction: row;
  gap: 8px;
  position: relative;
}

/* Section labels: viram espaçadores invisíveis */
.sidebar-v2--collapsed .sidebar-v2__section-label {
  display: none;
}

.sidebar-v2--collapsed .sidebar-v2__section-spacer {
  display: block;
}

/* Nav items colapsados */
.sidebar-v2--collapsed .sidebar-v2__link {
  width: 52px;
  height: 52px;
  padding: 0;
  justify-content: center;
  border-radius: 16px;
  margin: 0 auto;
  gap: 0;
}

.sidebar-v2--collapsed .sidebar-v2__link-text,
.sidebar-v2--collapsed .sidebar-v2__chevron {
  display: none;
}

.sidebar-v2--collapsed .sidebar-v2-icon {
  width: 24px;
  height: 24px;
}

/* Sub-menus: esconder no estado colapsado (flyout via JS) */
.sidebar-v2--collapsed .sidebar-v2__submenu {
  display: none;
}

/* CTA: esconder e mostrar FAB */
.sidebar-v2--collapsed .sidebar-v2__cta {
  display: none;
}

.sidebar-v2--collapsed .sidebar-v2__fab-logout {
  display: flex;
  margin: 0 auto;
}

/* ============================================================
   12. SIDEBAR — TOOLTIP (ESTADO COLAPSADO)
   ============================================================ */
.sidebar-v2__tooltip {
  position: fixed;
  background: var(--neutral-900);
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', sans-serif;
}

.sidebar-v2__tooltip.visible {
  opacity: 1;
}

/* ============================================================
   13. SIDEBAR — FLYOUT SUBMENU (ESTADO COLAPSADO)
   ============================================================ */
.sidebar-v2__flyout {
  position: fixed;
  left: 108px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  z-index: 9998;
  padding: 8px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.sidebar-v2__flyout.visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.sidebar-v2__flyout-item {
  display: block;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--neutral-600);
  text-decoration: none;
  border-radius: 8px;
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
}

.sidebar-v2__flyout-item:hover {
  background: var(--neutral-100);
  color: var(--neutral-900);
  text-decoration: none;
}

.sidebar-v2__flyout-item.active {
  background: var(--neutral-active-sub);
  color: var(--neutral-900);
  font-weight: 500;
}

/* ============================================================
   14. HEADER V2 — CONTAINER PRINCIPAL
   ============================================================ */
.header-v2 {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 0 calc(var(--sidebar-current-width) + 24px);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--neutral-divider);
  transition: padding-left 0.3s var(--ease-sidebar);
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   15. HEADER — BARRA DE BUSCA
   ============================================================ */
.header-v2__search {
  flex: 1;
  max-width: 600px;
  margin: 0 24px;
}

.header-v2__search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  border-radius: 9999px;
  background: #ffffff;
  border: none !important;
  outline: none !important;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.25s var(--ease-apple);
  overflow: hidden;
}

.header-v2__search-wrap:hover {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
}

.header-v2__search-wrap:focus-within {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
}

.header-v2__search-input {
  flex: 1;
  height: 100%;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 12px 0 20px !important;
  font-size: 14px;
  color: var(--neutral-900);
  caret-color: var(--accent-highlight);
  outline: none !important;
  font-family: inherit;
  min-width: 0;
  border-radius: 0 !important;
}

.header-v2__search-input:focus,
.header-v2__search-input:active {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  outline: none !important;
}

.header-v2__search-input::placeholder {
  color: var(--neutral-400);
}

.header-v2__search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #030A8C, #010660);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.header-v2__search-btn:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.header-v2__search-btn:active {
  transform: scale(0.95);
}

.header-v2__search-btn svg {
  width: 16px;
  height: 16px;
  stroke: #ffffff;
  stroke-width: 2;
  fill: none;
}

/* Resultados da busca */
.header-v2__search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.header-v2__search-results.active {
  display: block;
}

/* ============================================================
   16. HEADER — ÍCONES À DIREITA
   ============================================================ */
.header-v2__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.header-v2__icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--neutral-900);
  text-decoration: none;
  padding: 0;
}

.header-v2__icon-btn:hover {
  background: var(--neutral-100);
}

.header-v2__icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--neutral-900);
  stroke-width: 1.5;
  fill: none;
  transition: stroke 0.2s ease;
}

.header-v2__icon-btn:hover svg {
  stroke: var(--accent-highlight);
}

/* Badge do carrinho */
.header-v2__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-highlight);
  color: #ffffff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: inherit;
  font-weight: 500;
}

/* Avatar do usuário */
.header-v2__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--neutral-75);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-v2__avatar svg {
  width: 16px;
  height: 16px;
  stroke: var(--neutral-500);
  stroke-width: 1.5;
  fill: none;
}

/* ============================================================
   17. HEADER — DROPDOWN BASE
   ============================================================ */
.header-v2__dropdown {
  position: relative;
}

.header-v2__dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--neutral-100);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.10);
  z-index: 500;
  padding: 8px 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s var(--ease-apple), transform 0.2s var(--ease-apple);
  min-width: 200px;
}

.header-v2__dropdown-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ============================================================
   18. HEADER — DROPDOWN DE MOEDA
   ============================================================ */
.header-v2__currency-menu {
  width: 224px;
}

.header-v2__currency-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
}

.header-v2__currency-item:hover {
  background: var(--neutral-100);
}

.header-v2__currency-item.active {
  background: var(--neutral-active);
}

.header-v2__currency-code {
  font-size: 13px;
  font-weight: 500;
  color: var(--neutral-700);
  letter-spacing: 0.03em;
}

.header-v2__currency-item.active .header-v2__currency-code {
  color: var(--accent-highlight);
}

.header-v2__currency-item:hover .header-v2__currency-code {
  color: var(--neutral-900);
}

.header-v2__currency-check {
  width: 16px;
  height: 16px;
  stroke: var(--accent-highlight);
  stroke-width: 2;
  fill: none;
}

/* ============================================================
   19. HEADER — DROPDOWN DE PERFIL
   ============================================================ */
.header-v2__profile-menu {
  width: 256px;
  padding: 0;
  overflow: hidden;
}

.header-v2__profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--neutral-divider-soft);
}

.header-v2__profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--neutral-75);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-v2__profile-avatar svg {
  width: 20px;
  height: 20px;
  stroke: var(--neutral-500);
  stroke-width: 1.5;
  fill: none;
}

.header-v2__profile-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-900);
  margin: 0;
  line-height: 1.3;
}

.header-v2__profile-email {
  font-size: 12px;
  color: var(--accent-highlight);
  margin: 0;
  line-height: 1.3;
}

.header-v2__profile-body {
  padding: 8px;
}

.header-v2__profile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--neutral-700);
  font-size: 14px;
  transition: background var(--duration-fast) ease;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
}

.header-v2__profile-item:hover {
  background: var(--neutral-100);
  text-decoration: none;
  color: var(--neutral-900);
}

.header-v2__profile-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--neutral-500);
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
}

.header-v2__profile-footer {
  padding: 8px;
  border-top: 1px solid var(--neutral-divider-soft);
}

/* ============================================================
   20. HEADER — DROPDOWN DE IDIOMA
   ============================================================ */
.header-v2__lang-menu {
  min-width: 160px;
}

.header-v2__lang-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
  text-decoration: none;
  color: var(--neutral-700);
  font-size: 14px;
  border: none;
  background: transparent;
  width: 100%;
}

.header-v2__lang-item:hover {
  background: var(--neutral-100);
  text-decoration: none;
}

.header-v2__lang-item.active {
  background: var(--neutral-active);
  color: var(--accent-highlight);
  font-weight: 500;
}

/* ============================================================
   21. HEADER — DROPDOWN DE NOTIFICAÇÕES
   ============================================================ */
.header-v2__notif-menu {
  width: 320px;
}

.header-v2__notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--neutral-divider-soft);
}

.header-v2__notif-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-900);
  margin: 0;
}

.header-v2__notif-actions {
  display: flex;
  gap: 8px;
}

.header-v2__notif-action-link {
  font-size: 12px;
  color: var(--accent-highlight);
  text-decoration: none;
}

.header-v2__notif-action-link:hover {
  text-decoration: underline;
}

.header-v2__notif-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px 0;
}

.header-v2__notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  text-decoration: none;
  transition: background var(--duration-fast) ease;
  cursor: pointer;
}

.header-v2__notif-item:hover {
  background: var(--neutral-100);
  text-decoration: none;
}

.header-v2__notif-item.seen {
  opacity: 0.6;
}

.header-v2__notif-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-highlight);
  flex-shrink: 0;
  margin-top: 5px;
}

.header-v2__notif-item.seen .header-v2__notif-dot {
  background: var(--neutral-400);
}

.header-v2__notif-content {
  flex: 1;
  min-width: 0;
}

.header-v2__notif-subject {
  font-size: 13px;
  color: var(--neutral-900);
  font-weight: 500;
  margin: 0 0 2px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-v2__notif-date {
  font-size: 11px;
  color: var(--neutral-400);
  margin: 0;
}

.header-v2__notif-empty {
  text-align: center;
  padding: 24px;
  color: var(--neutral-400);
  font-size: 13px;
}

/* ============================================================
   22. HEADER — DROPDOWN COLOR OVERRIDES
   Garante que herança de cor do app.css (a { color: #2305F1 })
   não afete os dropdowns do header v2
   ============================================================ */

/* Font-family e anti-aliasing para todos os dropdowns */
.header-v2__dropdown-menu {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Reset de cor base para todos os links e botões dentro dos dropdowns */
.header-v2__dropdown-menu a,
.header-v2__dropdown-menu button {
  color: var(--neutral-700);
  font-family: inherit;
  text-decoration: none;
}

.header-v2__dropdown-menu a:hover,
.header-v2__dropdown-menu button:hover {
  color: var(--neutral-900);
  text-decoration: none;
}

/* Perfil — itens do menu */
.header-v2__profile-item {
  color: var(--neutral-700) !important;
}

.header-v2__profile-item:hover {
  color: var(--neutral-900) !important;
}

/* Idioma — itens do menu */
.header-v2__lang-item {
  color: var(--neutral-700) !important;
}

.header-v2__lang-item:hover {
  color: var(--neutral-900) !important;
  text-decoration: none;
}

.header-v2__lang-item.active {
  color: var(--accent-highlight) !important;
}

/* Notificações — itens da lista */
.header-v2__notif-item {
  color: var(--neutral-900) !important;
}

.header-v2__notif-item:hover {
  color: var(--neutral-900) !important;
  text-decoration: none;
}

/* ============================================================
   23. LAYOUT — BODY CONTENT ADJUSTMENT
   ============================================================ */
.body-content-v2 {
  margin-left: calc(var(--sidebar-current-width) + 24px);
  padding-top: calc(var(--header-height) + 8px);
  transition: margin-left 0.3s var(--ease-sidebar);
  min-height: 100vh;
  box-sizing: border-box;
}

/* ============================================================
   23. MOBILE — OVERLAY E HAMBURGER
   ============================================================ */
.sidebar-v2__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 40;
}

.sidebar-v2__overlay.visible {
  display: block;
}

.header-v2__hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--duration-fast) ease;
}

.header-v2__hamburger:hover {
  background: var(--neutral-100);
}

.header-v2__hamburger svg {
  width: 20px;
  height: 20px;
  stroke: var(--neutral-900);
  stroke-width: 1.5;
  fill: none;
}

/* ============================================================
   24. RESPONSIVIDADE MOBILE (< 1024px)
   ============================================================ */
@media (max-width: 1023px) {
  .sidebar-v2 {
    transform: translateX(calc(-100% - 16px));
    transition:
      transform 0.3s var(--ease-sidebar),
      width 0.3s var(--ease-sidebar);
    border-radius: 0 16px 16px 0;
    margin: 0;
    height: 100vh;
    width: 260px !important;
    padding: 24px 16px;
    z-index: 41;
  }

  .sidebar-v2--mobile-open {
    transform: translateX(0);
  }

  /* Remover botão de collapse no mobile */
  .sidebar-v2__collapse-btn,
  .sidebar-v2__expand-btn {
    display: none !important;
  }

  /* Header ocupa a largura toda no mobile */
  .header-v2 {
    padding-left: 16px !important;
    width: 100%;
  }

  /* Mostrar hamburger no mobile */
  .header-v2__hamburger {
    display: flex;
  }

  /* Body sem margem lateral no mobile */
  .body-content-v2 {
    margin-left: 0;
  }

  /* Ocultar busca desktop no mobile (simplificado) */
  .header-v2__search {
    display: none;
  }
}

@media (min-width: 1024px) {
  /* Hamburger apenas mobile */
  .header-v2__hamburger {
    display: none;
  }
}

/* ============================================================
   25. OVERRIDES DE LAYOUT LEGADO (Tasks 11 + 12)
   ============================================================ */

/* Background global #f5f5f7 — também anula qualquer background-image/gradient legado */
body.has-v2-layout {
  background-color: var(--neutral-75) !important;
  background-image: none !important;
}

/* Cards Apple-inspired */
body.has-v2-layout .card {
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04) !important;
  transition: box-shadow 0.2s ease !important;
}

body.has-v2-layout .card:hover {
  transform: none !important;
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.06), 0 1px 3px -1px rgba(0, 0, 0, 0.04) !important;
}

body.has-v2-layout .card-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  border-radius: 16px 16px 0 0 !important;
}

body.has-v2-layout .card-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  border-radius: 0 0 16px 16px !important;
}

/* Ocultar navbar e sidebar antigos quando o v2 estiver ativo */
body.has-v2-layout .navbar.fixed-top {
  display: none !important;
}

body.has-v2-layout .sidebar {
  display: none !important;
}

/* Body content: padding dinâmico via CSS var */
body.has-v2-layout .body-content {
  margin-left: calc(var(--sidebar-current-width) + 24px) !important;
  padding-top: calc(var(--header-height) + 8px) !important;
  transition: margin-left 0.3s var(--ease-sidebar);
}

/* Footer text */
body.has-v2-layout .footer {
  background: transparent;
}

/* Barra de sub-nav: ocultar pois foi desativada */
body.has-v2-layout .sub-bar {
  display: none !important;
}

/* Overlay antigo: ocultar quando v2 ativo */
body.has-v2-layout .sidebar-overlay,
body.has-v2-layout .main-overlay {
  display: none !important;
}

/* Garantir que section-main não tenha padding-top extra */
body.has-v2-layout .section-main {
  padding-top: 0;
}

/* ── Reset de classes legadas que conflitam ── */

/* A sidebar v2 usa position:fixed próprio, ignorar sidenav-toggled */
body.has-v2-layout.sidenav-toggled .body-content {
  margin-left: calc(var(--sidebar-current-width) + 24px) !important;
}

/* Botão hambúrguer legado: ocultar */
body.has-v2-layout .btn-toggler.d-lg-none {
  display: none !important;
}

/* ============================================================
   26. FOOTER V2 — Apple-inspired
   ============================================================ */

/* Neutralizar full-width hacks do custom-overrides.css */
body.has-v2-layout .footer-content {
  width: auto !important;
  max-width: none !important;
  left: auto !important;
  right: auto !important;
  position: relative !important;
  margin-left: calc(var(--sidebar-current-width) + 24px) !important;
  margin-right: 0 !important;
  padding: 0 !important;
  background: transparent;
  transition: margin-left 0.3s var(--ease-sidebar);
}

body.has-v2-layout .footer {
  background: transparent;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 20px 32px !important;
  margin: 0 !important;
  max-width: none !important;
  min-width: auto !important;
}

body.has-v2-layout .footer .footer-box {
  max-width: 1400px;
  margin: 0 auto !important;
  padding: 0 !important;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--neutral-500);
}

body.has-v2-layout .footer .footer-box small {
  font-size: 13px;
  color: var(--neutral-500);
}

body.has-v2-layout .footer .nav-link,
body.has-v2-layout .footer a.nav-link {
  color: var(--neutral-500) !important;
  font-size: 13px !important;
  padding: 4px 10px !important;
  text-decoration: none !important;
  transition: color 0.15s ease;
}

body.has-v2-layout .footer .nav-link:hover,
body.has-v2-layout .footer a.nav-link:hover {
  color: var(--neutral-900) !important;
  text-decoration: none !important;
}

@media (max-width: 1023px) {
  body.has-v2-layout .body-content {
    margin-left: 0 !important;
    padding-top: calc(var(--header-height) + 8px) !important;
  }

  body.has-v2-layout .footer-content {
    margin-left: 0 !important;
    width: 100% !important;
  }

  body.has-v2-layout .footer {
    padding: 16px 16px !important;
  }

  body.has-v2-layout .footer .footer-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Header v2: full width mobile — padding reset */
  body.has-v2-layout .header-v2 {
    padding-left: 16px !important;
    right: 0;
    width: 100%;
  }
}
