/* ============================================================
   SANTOOLIVER — NAVEGAÇÃO DESKTOP E MOBILE DOCK
   Barra superior fixa no desktop e dock inferior no celular
   ============================================================ */

.nav {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 9px;
  margin: 12px 0 22px;
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 0;
  background: rgba(245, 245, 251, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
}

.nav button {
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 13px 10px;
  border-radius: 14px;
  min-height: 54px;
  cursor: pointer;
  font-weight: 750;
  font-size: 14px;
  color: var(--text);
  box-shadow: 0 3px 12px rgba(31, 31, 67, 0.035);
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  white-space: nowrap;
}

.nav button:hover {
  background: #f2edff;
  border-color: #d7c8ff;
  transform: translateY(-1px);
}

.nav button.ativo,
.nav button.ativo:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(118, 80, 212, 0.22);
}

/* Nav específica de cliente */
#navCliente {
  grid-template-columns: repeat(2, 1fr);
}

/* Pagina container */
.pagina {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.pagina.ativa {
  display: block;
}

/* Tablet */
@media (max-width: 980px) {
  .nav {
    grid-template-columns: repeat(4, 1fr);
  }
  .nav button {
    font-size: 13px;
  }
}

/* Celulares (Android e iPhone): Dock flutuante inferior com safe-area */
@media (max-width: 700px) {
  .app {
    padding-bottom: calc(116px + env(safe-area-inset-bottom));
  }

  .nav,
  #navCliente {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 50;
    margin: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    display: flex;
    grid-template-columns: none !important;
    gap: 7px;
    align-items: stretch;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--line);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 35px rgba(31, 31, 67, 0.09);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav button {
    flex: 1 0 74px;
    min-width: 74px;
    max-width: 110px;
    min-height: 62px;
    padding: 6px 6px 4px;
    font-size: 11.5px;
    line-height: 1.2;
    white-space: normal;
    scroll-snap-align: center;
    border: 0;
    box-shadow: none;
    background: transparent;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .nav button::before {
    display: block;
    font-size: 20px;
    line-height: 1.1;
  }

  /* Ícones estilizados para a dock móvel */
  #navAdmin button:nth-child(1)::before { content: '✦'; } /* Novo */
  #navAdmin button:nth-child(2)::before { content: '▦'; } /* Agenda */
  #navAdmin button:nth-child(3)::before { content: '◈'; } /* Financeiro */
  #navAdmin button:nth-child(4)::before { content: '✂'; } /* Serviços */
  #navAdmin button:nth-child(5)::before { content: '♙'; } /* Profissionais */
  #navAdmin button:nth-child(6)::before { content: '⚙'; } /* Usuários */
  #navAdmin button:nth-child(7)::before { content: '♧'; } /* Clientes */
  #navAdmin button:nth-child(8)::before { content: '◷'; } /* Horários */

  #navCliente button:nth-child(1)::before { content: '✦'; }
  #navCliente button:nth-child(2)::before { content: '▣'; }

  .nav button.ativo,
  .nav button.ativo:hover {
    background: #ede7fc;
    color: #5732aa;
    box-shadow: none;
    transform: none;
  }

  .nav button:hover {
    transform: none;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: calc(90px + env(safe-area-inset-bottom));
    max-width: none;
    text-align: center;
  }
}
