/* ===================== ESTOQUE (DATA GRID PREMIUM) ===================== */
#estoqueConteudo .estoque-grid{
  background:#fff;
  border:1px solid #e5eaf0;
  border-radius:18px;
  overflow:hidden;
  box-shadow: 0 14px 34px rgba(15,23,42,.08);
}

#estoqueConteudo table th,
#estoqueConteudo table td{
  vertical-align: middle;
}

#estoqueConteudo table th:nth-child(1),
#estoqueConteudo table td:nth-child(1){
  text-align: left;
}

#estoqueConteudo table th:nth-child(2),
#estoqueConteudo table td:nth-child(2){
  text-align: center;
  white-space: nowrap;
}

#estoqueConteudo table th:nth-child(3),
#estoqueConteudo table td:nth-child(3){
  text-align: center;
}

#estoqueConteudo table thead th{
  padding-top: 12px;
  padding-bottom: 12px;
}

#estoqueConteudo table tbody td{
  padding-top: 10px;
  padding-bottom: 10px;
}

#estoqueConteudo table tbody tr{
  height: 52px;
}

.paginacaoEstoque .btnPagNumero{
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--bdr);
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: transform .06s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
}

.paginacaoEstoque .btnPagNumero:hover{ transform: translateY(-1px); }

.paginacaoEstoque .btnPagNumero.active{
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 20px rgba(59,130,246,0.12);
}

.paginacaoEstoque .btnPagSeta{
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--bdr);
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
}

.paginacaoEstoque .btnPagSeta:hover{ transform: translateY(-1px); }

#estoqueConteudo .paginacaoEstoque{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 0 4px;
}

/* ===== Toolbar Estoque (minimalista) ===== */
.stk-toolbar{
  display:flex; align-items:center; gap:8px;
  padding:8px 0; border-bottom:1px solid #ffffff; margin-bottom:10px;
}
.stk-toolbar .spacer{ flex:1; }
.stk-actions{ display:flex; align-items:center; gap:10px; }
.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:10px; border:1px solid #e5eaf0;
  background:#ffffff; cursor:pointer;
}
.icon-btn .ico{ font-size:16px; line-height:1; }
.icon-btn:hover{ box-shadow:0 2px 8px rgba(0,0,0,0.06); }

/* Menu dropdown da engrenagem (estoque) */
.menu-wrap{ position: relative; display: inline-block; }
.menu{ position: absolute; top: calc(100% + 10px); right: 0; background: #ffffff; border: 1px solid #e6e9ef; border-radius: 12px; box-shadow: 0 12px 30px rgba(11,34,58,0.12); min-width: 220px; padding: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 1200; }
.menu[aria-hidden="true"]{ display: none; }
.menu-item{ background: transparent; border: none; padding: 10px 12px; text-align: left; border-radius: 8px; cursor: pointer; font-weight: 600; color: #0f4466; display: flex; align-items: center; gap: 10px; }
.menu-item .menu-ico{ width:18px; height:18px; display:inline-block; }
.menu-item:hover{ background: #f4f7fb; }
.menu-sep{ height:1px; background: #eef3f8; border-radius:1px; margin:6px 0; }
.menu-item.danger{ color: #c0392b; }

/* Pequeno ajuste para ícones SVG dentro de botões do estoque */
#estoque .icon-btn-blue svg{ width:18px; height:18px; display:block; }

/* Gráfico compacto */
#estoqueGrafico canvas{ max-height:260px; }
/* Barra de busca da aba Estoque */
#estoque .estoque-busca-wrap{
  position: relative;
  flex: 1;
  max-width: 320px;
}

#estoque .estoque-busca-wrap::before{
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cline x1='15.5' y1='15.5' x2='20' y2='20'/%3E%3C/svg%3E");
  opacity: 0.7;
  pointer-events: none;
}

/* Input da busca: menor e clean */
#estoque #buscaEstoque{
  width: 100%;
  padding: 8px 10px 8px 28px; /* espaço pra lupa */
  border-radius: 8px;
  border: 1px solid var(--bdr);
  font-size: 13px;
  background: #fff;
}

/* Icon buttons – tema azul minimalista dentro da aba Estoque */
#estoque .icon-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:10px;
  border:1px solid var(--blue-300);
  background:#ffffff;
  color:var(--blue);
  cursor:pointer;
}

#estoque .icon-btn .ico{
  font-size:16px;
  line-height:1;
}

#estoque .icon-btn:hover{
  box-shadow:0 2px 8px rgba(0,0,0,0.06);
  background:var(--blue-100);
}

/* Botões padrão já existem (.btn, .btn-primary).
   Vamos criar um secundário branco para o topo dos Treinamentos */
.btn-secondary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 9px 22px;
  border-radius:999px;
  border:1px solid var(--blue-300);
  background:#ffffff;
  color:var(--blue);
  font-weight:500;
  font-size:14px;
  cursor:pointer;
  box-shadow:0 4px 12px rgba(15,23,42,0.06);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn-secondary:hover{
  background:#eff6ff;
  box-shadow:0 6px 18px rgba(37,99,235,0.18);
  transform: translateY(-1px);
}

/* Deixar espaço entre os dois botões da direita */
.train-header-right{
  display:flex;
  align-items:center;
  gap:12px;
}


/* ===== ESTOQUE — NOVO LAYOUT ===== */

/* ===== ESTOQUE — NOVO LAYOUT ===== */
#estoque {
  margin-top: 8px;
}

#estoque h3 {
  font-size: 1.35rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
}

#estoque .muted {
  margin-bottom: 4px;
}

/* Card do gráfico */
#estoqueGrafico {
  margin-top: 12px;
  padding: 20px 24px 24px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
}

/* Barra de busca + ícones logo abaixo do gráfico */
.estoque-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  border: 1px solid #e6eefc;
  box-shadow: 0 10px 28px rgba(15,23,42,.06);
}

/* Campo de busca compacto */
.estoque-search {
  position: relative;
  flex: 1;
  max-width: 380px;
}

.estoque-search input {
  width: 100%;
  height: 40px;
  border-radius: 999px;
  border: 1px solid #d0e2ff;
  padding: 0 38px 0 14px;
  font-size: 0.875rem;
  color: #0f172a;
  background: #f9fafb;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.estoque-search input::placeholder {
  color: #9ca3af;
}

.estoque-search input:focus {
  outline: none;
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

/* Ícone de lupa (outline) no final do campo */
.estoque-search .search-ico{
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  width:16px;
  height:16px;
  pointer-events:none;
  opacity:.75;

  font-size:0;

  background: no-repeat center / 16px 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}

/* Botões minimalistas (atualizar / engrenagem) */
.estoque-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn-blue{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #bcd9ff;
  background: #eef6ff;
  color: #0f5fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 16px;
  line-height: 1;
  cursor:pointer;
  transition: .15s ease;
}
.icon-btn-blue:hover{
  background:#dcecff;
  transform: translateY(-1px);
}

/* Card da tabela de estoque */
#estoqueConteudo {
  margin-top: 12px;
  padding: 12px 18px 18px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
}

/* Garante que a tabela ocupe bem o card */
#estoqueConteudo table {
  width: 100%;
  border-collapse: collapse;
}


/* ===== ESTOQUE: tabela premium ===== */
#estoqueConteudo .table-wrap{
  overflow:auto;
  border-radius: 14px;
  border: 1px solid #eef2f7;
}

#estoqueConteudo .table-epi{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
}

#estoqueConteudo .table-epi thead th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: none;
  color: #334155;
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
}

#estoqueConteudo .table-epi tbody td{
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color:#0f172a;
}

#estoqueConteudo .table-epi tbody tr:nth-child(even){
  background: #fcfdff;
}

#estoqueConteudo .table-epi tbody tr:hover{
  background: #f3f8ff;
}

#estoqueConteudo .table-epi td.mono{
  font-variant-numeric: tabular-nums;
}

/* Stepper de quantidade (visual premium) */
#estoqueConteudo td .btn.btn--sm{
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid #dbeafe;
  background: #ffffff;
  color: #2563eb;
  display: inline-flex;
  align-items:center;
  justify-content:center;
}

#estoqueConteudo td .btn.btn--sm:hover{
  background:#eff6ff;
}

#estoqueConteudo td input.ctrl{
  height: 30px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  text-align: center;
  font-variant-numeric: tabular-nums;
}



/* =========================
   ESTOQUE - UI IMPROVEMENTS
   ========================= */

/* Sticky header, compact cells, zebra and hover */
#estoqueConteudo .table-epi thead th{
  position: sticky;
  top: 0;
  z-index: 6;
  background: linear-gradient(180deg,#fbfdff,#ffffff);
  box-shadow: 0 6px 18px rgba(15,23,42,0.04);
  border-bottom: 1px solid #eef2f7;
  padding: 10px 14px;
}

#estoqueConteudo .table-epi tbody td{
  padding: 10px 12px;
  font-size: 13px;
  vertical-align: middle;
}

#estoqueConteudo .table-epi tbody tr:nth-child(even){ background: #fbfdff; }
#estoqueConteudo .table-epi tbody tr:hover td{ background: #f3f8ff; transition: background .12s ease; }

/* Qty stepper - uses existing markup (.qty, .qty-btn, .qty-input) */
#estoqueConteudo .td-qtd{
  text-align: center;
  white-space: nowrap;
}

#estoqueConteudo .td-qtd .qty{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  margin: 0 auto;
}

#estoqueConteudo .td-qtd .qty-btn{
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  border-radius: 8px;
  border: 1px solid #dbeafe;
  background: #ffffff;
  color: #124679;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(15,23,42,0.04);
  transition: transform .12s ease, background .12s ease;
}

#estoqueConteudo .td-qtd .qty-btn:hover{
  background: #eef6ff;
  transform: translateY(-1px);
}

#estoqueConteudo .td-qtd .qty-input{
  width: 52px;
  min-width: 52px;
  height: 30px;
  padding: 0 4px;
  margin: 0;
  flex: 0 0 52px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid #e6eefc;
  background: #f9fbff;
  font-weight: 800;
}

/* remove setinhas nativas do input number */
#estoqueConteudo .td-qtd .qty-input::-webkit-outer-spin-button,
#estoqueConteudo .td-qtd .qty-input::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}

#estoqueConteudo .td-qtd .qty-input{
  -moz-appearance: textfield;
  appearance: textfield;
}

/* highlight modified rows */
.row-modified td{ box-shadow: inset 0 0 0 2px rgba(59,130,246,0.06); }

/* badge for low stock */
.badge-low{ display:inline-block; padding:4px 8px; border-radius:999px; font-size:12px; font-weight:700; background:#fff7ed; color:#9a3412; border:1px solid rgba(249,115,22,0.12); }

/* Small responsive adjustments */
@media (max-width:820px){
  .qty-input{ width:56px; }
  #estoqueConteudo .table-epi thead th{ font-size:12px; padding:8px 10px; }
  #estoqueConteudo .table-epi tbody td{ padding:8px 10px; font-size:13px; }
}

/* ensure table card looks tidy */
#estoqueConteudo{ border-radius:14px; padding:12px; }

/* === Ajuste: aproximar texto dos ícones (override final) === */
/* Mantém o ícone na mesma posição e aproxima apenas o texto. */
.sidebar .sidebar-item { gap: 12px !important; }
.sidebar .sidebar-item .nav-ico { margin-right: 12px !important; flex: 0 0 auto !important; }
.sidebar .nav-txt { margin-left: 4px !important; transition: opacity .18s ease, transform .18s ease; }
.sidebar.sidebar--mini:hover .sidebar-item { padding-left: 12px !important; }
.sidebar .nav-ico { position: relative; }

/* Ajuste alternativo (aumente/abaixe para 4px ou 2px conforme desejar) */
/* .sidebar .sidebar-item { gap: 4px !important; } */

/* === Override mais específico para garantir aplicação === */
/* Seletores mais longos e !important para vencer outras regras conflitantes */
.sidebar .sidebar-list .sidebar-group .sidebar-item,
.sidebar nav .sidebar-item,
.sidebar .sidebar-item {
  gap: 12px !important;
}

.sidebar .sidebar-list .sidebar-item > .nav-ico,
.sidebar nav .sidebar-item > .nav-ico,
.sidebar .sidebar-item > .nav-ico {
  margin-right: 12px !important;
  flex: 0 0 auto !important;
}

.sidebar .sidebar-list .sidebar-item > .nav-ico + .nav-txt,
.sidebar nav .sidebar-item > .nav-ico + .nav-txt,
.sidebar .sidebar-item > .nav-ico + .nav-txt {
  margin-left: 4px !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* Quando a sidebar está no modo mini e em hover garantir que o texto fique alinhado */
.sidebar.sidebar--mini:hover .nav-txt {
  opacity: 1 !important;
  width: auto !important;
  margin-left: 4px !important;
  transform: none !important;
  pointer-events: auto !important;
}

/* Se algo usa padding-left para alinhar o texto, garantir que não empurre o ícone */
.sidebar .sidebar-item .nav-txt {
  padding-left: 0 !important;
}

/* Dica: se ainda não ver mudanças, faça um hard refresh (Ctrl+F5) no navegador */

/* ===== FIX FINAL: garantir que texto não sobreponha o ícone ===== */
/* Aplica somente quando a sidebar estiver no modo "mini" e em hover (expandida) */
.sidebar.sidebar--mini .nav-ico { z-index: 20 !important; }
.sidebar.sidebar--mini .nav-txt { z-index: 10 !important; }

/* Força o texto começar depois da largura do mini, evitando sobreposição. */
.sidebar.sidebar--mini:hover .sidebar-item > .nav-txt,
.sidebar.sidebar--mini:hover .sidebar-item .nav-txt{
  margin-left: calc(var(--sb-mini, 52px) + 8px) !important; /* ajuste fino */
  display: inline-block !important;
  width: auto !important;
  opacity: 1 !important;
}

/* Alternativa para quando a estrutura do HTML usar ícone e texto como irmãos em container */
.sidebar.sidebar--mini:hover .sidebar-item > .nav-ico + .nav-txt{
  margin-left: 8px !important; /* garante espaçamento caso o item já tenha padding-left maior */
}

/* proteção: quando há regras que escondem o texto via width:0, garantir que no hover fique visível */
.sidebar.sidebar--mini:hover .nav-txt[style],
.sidebar.sidebar--mini:hover .nav-txt[hidden]{
  width: auto !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}








:root{
  --sb-hit-gap: 1px;
  --sb-hit-inset-x: 0px;
  --sb-hit-h: 36px;
  --sb-hit-radius: 0px;
  --sb-hover-bg: rgba(255,255,255,0.032);
  --sb-active-bg: rgba(255,255,255,0.058);
  --sb-active-ring: inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.16);
}

/* faixa contínua entre os itens */
.sidebar .sidebar-list{
  gap: 0 !important;
}

/* item continua clicável inteiro */
.sidebar .sidebar-item{
  position: relative !important;
  margin: 0 !important;
  min-height: calc(var(--sb-hit-h) + (var(--sb-hit-gap) * 2)) !important;
  height: calc(var(--sb-hit-h) + (var(--sb-hit-gap) * 2)) !important;
  border-radius: 0 !important;
  background: transparent !important;
}

/* camada visual do item */
.sidebar .sidebar-item::before{
  content: "" !important;
  position: absolute !important;
  inset: var(--sb-hit-gap) var(--sb-hit-inset-x) !important;
  border-radius: var(--sb-hit-radius) !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: background 160ms ease, box-shadow 160ms ease !important;
  pointer-events: none !important;
}

/* hover mais fluido e mais horizontal */
.sidebar .sidebar-item:hover{
  background: transparent !important;
}

.sidebar .sidebar-item:hover::before{
  background: var(--sb-hover-bg) !important;
}

/* item ativo */
.sidebar .sidebar-item.active,
.sidebar .sidebar-item.is-active{
  background: transparent !important;
  color: #ffffff !important;
}

.sidebar .sidebar-item.active::before,
.sidebar .sidebar-item.is-active::before{
  background: var(--sb-active-bg) !important;
  box-shadow: var(--sb-active-ring) !important;
}

/* conteúdo acima da faixa */
.sidebar .sidebar-item > *{
  position: relative !important;
  z-index: 1 !important;
}

/* ativo com leitura mais forte */

.sidebar .sidebar-item.active > .nav-txt,
.sidebar .sidebar-item.is-active > .nav-txt{
  color: rgba(255,255,255,0.96) !important;
  font-weight: 500 !important;
}

.sidebar .sidebar-item.active > .nav-ico,
.sidebar .sidebar-item.is-active > .nav-ico{
  color: rgba(255,255,255,0.96) !important;
}

/* ===== Estilos para Downloads (engrenagem premium) ===== */
#btnDownloadsGear {
  border: 1px solid rgba(0,0,0,0.08);
  background: #ffffff;
  transition: background .14s ease, transform .12s ease, box-shadow .14s ease;
  box-shadow: none;
  color: #0f172a;
}
#btnDownloadsGear:hover {
  background: #eef6ff; /* azul clarinho */
}
#btnDownloadsGear:active {
  transform: translateY(1px);
}

#downloadsGearWrap { display:inline-flex; align-items:center; }

#downloadsGearMenu {
  min-width: 260px;
  padding: 8px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(16,24,40,0.08), 0 2px 6px rgba(16,24,40,0.04);
}

#downloadsGearMenu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  transition: background .12s ease;
}
#downloadsGearMenu a:hover {
  background: #eaf4ff; /* hover azul suave */
}
#downloadsGearMenu a:focus {
  outline: 3px solid rgba(59,130,246,0.18);
  outline-offset: 2px;
}

#downloadsGearMenu a i { width: 18px; height: 18px; color: rgba(17,24,39,0.9); }
#downloadsGearMenu a .dl-right { margin-left: auto; width: 16px; height: 16px; opacity: 0.9; }

@media (max-width: 720px) {
  #downloadsGearMenu { right: 0; left: auto; }
}

/* ===== Fim Downloads ===== */

/* FIX DEFINITIVO — Carrinho da LOJA
   Overlay abaixo do Drawer (senão o overlay “come” o clique) */
#lojaCartOverlay { z-index: 6000; }
#lojaCartDrawer  { z-index: 6001; }
