/* style.css - estilos customizados do sistema de controle de estoque Salão+ Store */

/* Centraliza o container de login vertical e horizontalmente */
body, html {
  height: 100%;
  margin: 0;
}

/* Garantir que o body não tenha overflow que interfira com dropdowns */
body {
  max-width: 100vw;
}

/* Navbar sem overflow para permitir dropdown */
.navbar {
  overflow: visible !important;
  z-index: 1030
}

/* Dropdown do usuário */
.navbar .dropdown-menu {
  z-index: 1050;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
}

/* Dropdown do usuário - Forçar aparecimento correto */
.navbar .dropdown-menu {
  z-index: 1050 !important;
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  min-width: 200px;
  margin-top: 0 !important;
  background-color: #343a40;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  display: none;
}

.navbar .dropdown-menu.show {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* Garantir que o dropdown do usuário apareça corretamente */
.navbar-nav .dropdown-menu {
  z-index: 1050 !important;
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  min-width: 200px;
  margin-top: 0 !important;
  background-color: #343a40 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.navbar-nav .dropdown-menu.show {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* Estilos para os itens do dropdown */
.navbar .dropdown-item {
  color: #fff !important;
  padding: 0.5rem 1rem;
}

.navbar .dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.navbar .dropdown-divider {
  border-color: rgba(255, 255, 255, 0.1) !important;
  margin: 0.5rem 0;
}

.navbar-nav, .nav-item.dropdown, .navbar .container-fluid, .navbar-nav.ms-auto {
  position: relative !important;
  overflow: visible !important;
}

/* Container principal sem overflow */
.container-fluid {
  padding-left: 0;
  padding-right: 0;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Row principal sem overflow */
.container-fluid .row {
  margin-top: 0 !important;
  margin-left: 0;
  margin-right: 0;
  overflow-x: hidden;
  z-index: 1;
}

.login-container {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  padding: 2rem;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.logo {
  width: 120px;
  margin-bottom: 1rem;
}
.system-name {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 2rem;
}

/* Estilos para o Dashboard */
.sidebar {
  min-height: calc(100vh - 56px);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.1);
  margin-top: 56px; /* Compensar a navbar fixa */
}

.sidebar .nav-link {
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  margin: 0.125rem 0.5rem;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 0.8);
}

.sidebar .nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .dropdown-menu {
  background-color: #343a40;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .dropdown-item {
  color: rgba(255, 255, 255, 0.8);
}

.sidebar .dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar .dropdown-item.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Submenu expansível */
.submenu {
  margin-left: 1rem;
  transition: all 0.3s ease;
  overflow: hidden;
}

.submenu-item {
  padding-left: 2rem !important;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7) !important;
  transition: all 0.2s ease;
}

.submenu-item:hover {
  color: rgba(255, 255, 255, 0.9) !important;
  background-color: rgba(255, 255, 255, 0.05);
}

.submenu-item.active {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Animação do ícone de seta */
#cadastrosChevron {
  transition: transform 0.3s ease;
}

#cadastrosChevron.rotated {
  transform: rotate(180deg);
}

#configuracoesChevron {
  transition: transform 0.3s ease;
}

#configuracoesChevron.rotated {
  transform: rotate(180deg);
}

/* Avatares de usuários */
.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.avatar-md {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

/* Cards do Dashboard */
.border-left-primary {
  border-left: 0.25rem solid #007bff !important;
}

.border-left-success {
  border-left: 0.25rem solid #28a745 !important;
}

.border-left-info {
  border-left: 0.25rem solid #17a2b8 !important;
}

.border-left-warning {
  border-left: 0.25rem solid #ffc107 !important;
}

/* Estilos para o conteúdo principal */
main {
  min-height: calc(100vh - 56px);
  padding-top: 1rem;
}

/* Ajuste adicional para o sidebar */
.sidebar {
  min-height: calc(100vh - 56px);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.1);
}

/* Remover margin-top duplicado */
.container-fluid .row {
  margin-top: 0 !important;
}

/* Ajuste específico para o conteúdo principal */
.col-md-9.ms-sm-auto.col-lg-10.px-md-4 {
  margin-top: 56px !important;
  z-index: 1;
}

/* Ajustes para o layout responsivo */
@media (min-width: 768px) {
  .col-md-9 {
    flex: 0 0 auto;
    width: 75%;
  }
  
  .col-lg-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
  }
  
  .ms-sm-auto {
    margin-left: auto !important;
  }
}

/* Responsividade */
@media (max-width: 767.98px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -100%;
    z-index: 1000;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.1);
    transition: left 0.3s ease-in-out;
    width: 280px;
  }
  
  .sidebar.show {
    left: 0;
  }
  
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
  }
  
  .sidebar-overlay.show {
    display: block;
  }
  
  /* Botão hambúrguer */
  .navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
  }
  
  .navbar-toggler:focus {
    box-shadow: none;
  }
}

/* Logo da navbar em formato quadrado */
.navbar-brand img {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
}

/* Adicione seus estilos customizados abaixo */ 

/* Garante que o dropdown do Awesomplete fique acima de outros elementos */
.awesomplete {
    z-index: 9999 !important;
    position: relative;
}
.awesomplete > ul {
    position: absolute;
    z-index: 9999 !important;
} 

/* Força o dropdown do Awesomplete a ficar acima de tudo e evita barra de rolagem */
.awesomplete > ul {
    position: fixed !important;
    left: auto !important;
    top: auto !important;
    min-width: 250px;
    z-index: 99999 !important;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    max-height: 250px;
    overflow-y: auto;
} 

/* Melhor contraste para itens do Awesomplete */
.awesomplete > ul > li {
    background: #fff;
    color: #222;
    border-bottom: 1px solid #eee;
}
.awesomplete > ul > li[aria-selected="true"],
.awesomplete > ul > li:hover {
    background: #007bff;
    color: #fff;
}
.awesomplete > ul > li:last-child {
    border-bottom: none;
} 

/* Aumenta a largura do campo de busca de produtos com autocomplete */
#produto_id_input.awesomplete {
    min-width: 350px;
    width: 100%;
    max-width: 500px;
    display: inline-block;
} 

/* Remove o arredondamento do lado direito do campo de busca de produto */
.no-radius-right {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Estilos para autocomplete de produtos nas entradas - VERSÃO CORRIGIDA */
.produto-busca-container {
    position: relative;
    width: 100%;
}

.produto-sugestoes {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #343a40 !important;
    border: 1px solid #495057;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
    color: white !important;
}

.produto-sugestoes.show {
    display: block;
}

.produto-sugestoes .list-group-item {
    border: none;
    border-bottom: 1px solid #495057;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    background: transparent !important;
    color: white !important;
    margin: 0;
}

.produto-sugestoes .list-group-item:hover {
    background-color: #495057 !important;
    color: white !important;
}

.produto-sugestoes .list-group-item:last-child {
    border-bottom: none;
    border-radius: 0 0 0.375rem 0.375rem;
}

.produto-sugestoes .list-group-item small {
    display: block;
    opacity: 0.8;
}

/* Campo de busca de produto */
.produto-busca {
    width: 100%;
    border-radius: 0.375rem;
}

.produto-busca:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Remove estilos conflitantes do Awesomplete */
.awesomplete > ul {
    display: none !important;
}

/* Estilos específicos para o autocomplete do kit - CORREÇÃO DE POSICIONAMENTO */
#produto_kit.awesomplete {
    position: relative !important;
    z-index: 1000 !important;
}

/* Container do dropdown do autocomplete do kit */
#produto_kit + .awesomplete > ul,
.awesomplete > ul[id^="awesomplete_list"] {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    background: #fff !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
    /* FORÇAR POSIÇÃO ABSOLUTA */
    transform: none !important;
    min-width: 100% !important;
}

/* Garantir que o container do Awesomplete tenha posição relativa */
.awesomplete {
    position: relative !important;
    display: inline-block !important;
    width: 100% !important;
}

/* Garantir que o container do campo tenha posição relativa */
.col-md-8:has(#produto_kit) {
    position: relative !important;
    z-index: 1000 !important;
}

/* Estilos dos itens do dropdown do kit */
#produto_kit + .awesomplete > ul > li,
.awesomplete > ul[id^="awesomplete_list"] > li {
    padding: 0.5rem 0.75rem !important;
    cursor: pointer !important;
    border-bottom: 1px solid #eee !important;
    background: #fff !important;
    color: #212529 !important;
    display: block !important;
    position: relative !important;
    z-index: 9999 !important;
    margin: 0 !important;
    list-style: none !important;
}

#produto_kit + .awesomplete > ul > li:hover,
#produto_kit + .awesomplete > ul > li[aria-selected="true"],
.awesomplete > ul[id^="awesomplete_list"] > li:hover,
.awesomplete > ul[id^="awesomplete_list"] > li[aria-selected="true"] {
    background: #007bff !important;
    color: #fff !important;
}

#produto_kit + .awesomplete > ul > li:last-child,
.awesomplete > ul[id^="awesomplete_list"] > li:last-child {
    border-bottom: none !important;
    border-radius: 0 0 0.375rem 0.375rem !important;
}

/* Garantir que o row que contém o campo tenha z-index alto */
.row:has(#produto_kit) {
    position: relative !important;
    z-index: 1000 !important;
}

/* Forçar que todos os containers pais tenham overflow visível */
#kitCard {
    overflow: visible !important;
    position: relative !important;
    z-index: 100 !important;
}

#kitCard .card {
    overflow: visible !important;
}

#kitCard .card-body {
    overflow: visible !important;
}

/* Garantir que o Bootstrap não interfira */
.col-md-8 {
    overflow: visible !important;
}

.row {
    overflow: visible !important;
}

/* Remove estilos conflitantes do Awesomplete */
.awesomplete > ul {
    display: none !important;
}

/* Forçar exibição quando há itens */
.awesomplete > ul:not(:empty) {
    display: block !important;
    z-index: 999999 !important;
}

/* Estilos dos itens do dropdown */
.awesomplete > ul > li {
    padding: 0.5rem 0.75rem !important;
    cursor: pointer !important;
    border-bottom: 1px solid #eee !important;
    background: #fff !important;
    color: #212529 !important;
    display: block !important;
    position: relative !important;
    z-index: 999999 !important;
}

.awesomplete > ul > li:hover,
.awesomplete > ul > li[aria-selected="true"] {
    background: #007bff !important;
    color: #fff !important;
}

.awesomplete > ul > li:last-child {
    border-bottom: none !important;
}

/* Garantir que a tabela não interfira */
.table-responsive {
    z-index: 1 !important;
    position: relative !important;
}

/* Garantir que o card do kit não interfira */
#kitCard {
    position: relative !important;
    z-index: 1 !important;
}

/* Melhor contraste para itens do Awesomplete */
.awesomplete > ul > li {
    background: #fff;
    color: #222;
    border-bottom: 1px solid #eee;
}
.awesomplete > ul > li[aria-selected="true"],
.awesomplete > ul > li:hover {
    background: #007bff;
    color: #fff;
}
.awesomplete > ul > li:last-child {
    border-bottom: none;
} 

/* Aumenta a largura do campo de busca de produtos com autocomplete */
#produto_id_input.awesomplete {
    min-width: 350px;
    width: 100%;
    max-width: 500px;
    display: inline-block;
} 

/* Remove o arredondamento do lado direito do campo de busca de produto */
.no-radius-right {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Estilos para autocomplete de produtos nas entradas - VERSÃO CORRIGIDA */
.produto-busca-container {
    position: relative;
    width: 100%;
}

.produto-sugestoes {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #343a40 !important;
    border: 1px solid #495057;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
    color: white !important;
}

.produto-sugestoes.show {
    display: block;
}

.produto-sugestoes .list-group-item {
    border: none;
    border-bottom: 1px solid #495057;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    background: transparent !important;
    color: white !important;
    margin: 0;
}

.produto-sugestoes .list-group-item:hover {
    background-color: #495057 !important;
    color: white !important;
}

.produto-sugestoes .list-group-item:last-child {
    border-bottom: none;
    border-radius: 0 0 0.375rem 0.375rem;
}

.produto-sugestoes .list-group-item small {
    display: block;
    opacity: 0.8;
}

/* Campo de busca de produto */
.produto-busca {
    width: 100%;
    border-radius: 0.375rem;
}

.produto-busca:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Remove estilos conflitantes do Awesomplete */
.awesomplete > ul {
    display: none !important;
}

/* Forçar exibição quando há itens */
.awesomplete > ul:not(:empty) {
    display: block !important;
}

/* Estilos dos itens do dropdown */
.awesomplete > ul > li {
    padding: 0.5rem 0.75rem !important;
    cursor: pointer !important;
    border-bottom: 1px solid #eee !important;
    background: #fff !important;
    color: #212529 !important;
    display: block !important;
}

.awesomplete > ul > li:hover,
.awesomplete > ul > li[aria-selected="true"] {
    background: #007bff !important;
    color: #fff !important;
}

.awesomplete > ul > li:last-child {
    border-bottom: none !important;
}

/* Garantir que o container da busca tenha z-index alto */
.col-md-6.position-relative {
    z-index: 1000;
}

/* Garantir que a tabela não interfira no z-index */
.table-responsive {
    z-index: 1;
    position: relative;
}

/* Área do kit com espaçamento adequado */
#kitArea {
    margin-bottom: 2rem;
}

/* Espaçamento entre os campos de busca e a tabela */
#kitArea .row.mb-3 {
    margin-bottom: 2rem !important;
}

/* Melhorias para o modal de busca */
.modal-lg {
    max-width: 800px;
}

/* Correção para problemas de z-index e interação do modal */
.modal-backdrop {
    z-index: 1040 !important;
}

.modal {
    z-index: 1050 !important;
}

.modal-dialog {
    z-index: 1060 !important;
}

.modal-content {
    z-index: 1070 !important;
    position: relative;
}

/* Garantir que o input seja clicável */
#busca_produto_input {
    border-radius: 0.5rem;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    z-index: 1080 !important;
    position: relative;
}

/* Garantir que todos os elementos do modal sejam interativos */
.modal-body * {
    z-index: inherit;
    position: relative;
}

.list-group-item-action:hover {
    background-color: var(--bs-primary) !important;
    color: white !important;
}

.list-group-item-action:hover .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.list-group-item-action:hover .badge {
    background-color: white !important;
    color: var(--bs-primary) !important;
}

/* Responsividade para mobile */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-lg {
        max-width: none;
    }
}