/* Bottom Navigation Bar PWA */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 1024px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--surface-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.02);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.4s;
}

.bottom-nav.hidden {
  transform: translate(-50%, 150%);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.70rem;
  font-weight: 600;
  gap: 4px;
  transition: color 0.2s ease;
  padding: 4px 0;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
}

.nav-item:active {
  background-color: var(--bg-color);
}

.nav-item svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), stroke-width 0.2s;
}

.nav-item.active {
  color: var(--accent-green);
}

.nav-item.active svg {
  transform: translateY(-2px);
  stroke-width: 2.5;
}

/* Botão de Ação Central (FAB) incorporado no menu */
.fab-wrapper {
  flex: 0 0 66px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.fab-button {
  position: absolute;
  top: -28px; /* Eleva o botão vazando a borda superior da barra */
  background-color: var(--accent-green);
  color: #fff;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px var(--accent-green-shadow);
  border: 4px solid var(--bg-color); /* Cut-out visual matching background color */
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.4s ease, background-color 0.2s ease;
}

.fab-button:active {
  transform: scale(0.9);
  background-color: var(--accent-green-hover);
}

.fab-button svg {
  stroke: #fff;
  width: 28px;
  height: 28px;
  stroke-width: 2.5;
  transition: transform 0.3s ease;
}

.fab-button.open svg {
  transform: rotate(45deg);
}

/* Basic Helpers */
.hide-mobile { display: none; }

/* Widescreen Sidebar Navigation (SaaS Mode) */
@media (min-width: 768px) {
  .hide-mobile { display: flex; }
  
  .bottom-nav {
    position: sticky;
    top: 0;
    left: 0;
    width: 232px;
    max-width: 232px;
    height: 100vh;
    transform: none;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 32px;
    border: none;
    border-right: 1px solid var(--divider);
    border-radius: 0;
    box-shadow: none;
    background: var(--surface-color);
  }
  
  /* SaaS Hierarchy Rearrangement using Flex Order */
  .desktop-logo { order: 0; }
  .nav-home { order: 1; }
  .nav-accounts { order: 2; }
  .nav-clients { order: 3; }
  .fab-wrapper { order: 4; }
  .nav-spacer { order: 5; flex: 1; }
  .nav-settings { order: 6; }
  
  .nav-item {
    flex-direction: row;
    padding: 12px 20px;
    margin: 2px 16px;
    width: calc(100% - 32px);
    font-size: 0.95rem;
    font-weight: 600;
    justify-content: flex-start;
    gap: 12px;
    border-radius: 8px;
  }
  .nav-item.active {
    background-color: var(--accent-green);
    color: #fff;
  }
  .nav-item.active svg {
    stroke: #fff;
  }
  .nav-item:hover:not(.active) {
    background-color: var(--surface-glass);
  }
  .nav-item svg {
    width: 22px;
    height: 22px;
  }
  .fab-wrapper {
    margin: 16px auto; 
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .fab-button {
    position: static;
    width: calc(100% - 32px);
    height: 48px;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--accent-green-shadow);
  }
  .fab-button::after {
    content: 'Add Transação';
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 8px;
  }
  .fab-button:hover {
    transform: scale(1.02);
  }
}

