/* ===== Estoque (Agente Operações) — também contém estilos comuns op-* usados em Compras e Frota ===== */

/* ---- Comuns ---- */
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; font: 700 11px/1 var(--fonte);
  background: rgba(255,255,255,.75); border: 1px solid rgba(12,37,51,.15); border-bottom-width: 2px; color: var(--texto-2); }
.op-pisca { animation: opPisca 1.4s var(--anim); }
@keyframes opPisca { 0%, 40% { box-shadow: 0 0 0 3px var(--turquesa), 0 10px 30px rgba(20,184,166,.35); background: rgba(209,250,229,.85); } 100% { box-shadow: none; } }
.op-pop { position: fixed; z-index: 120; width: 330px; max-width: calc(100vw - 24px); padding: 16px; background: rgba(255,255,255,.94);
  border-radius: 18px; box-shadow: 0 24px 60px rgba(6,40,56,.35); animation: surge .18s var(--anim); }
.op-pop.folha { left: 8px !important; right: 8px; bottom: 8px; top: auto !important; width: auto; max-width: none; border-radius: 22px; padding: 18px; }
.op-pop-tit { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 15px; margin-bottom: 4px; }
.op-pop-tit .ic { width: 18px; height: 18px; color: var(--turquesa); flex: none; }
.op-pop .campo { margin-bottom: 10px; }
.op-pop-bt { display: flex; justify-content: flex-end; gap: 8px; }
.op-pop.folha .op-pop-bt .btn { flex: 1; padding: 12px; font-size: 15px; }
.op-passo { display: flex; align-items: center; gap: 8px; }
.op-passo input { flex: 1; text-align: center; font-size: 20px; font-weight: 800; padding: 8px; }
.op-passo .btn-ic { width: 40px; height: 40px; flex: none; }
.op-rap-info { min-height: 18px; margin: -6px 0 10px; }

/* ---- Barra de atalhos ---- */
.est-atalhos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.est-at { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 18px; cursor: pointer; text-align: left;
  border: 1px solid var(--borda-forte); background: var(--vidro-forte); backdrop-filter: blur(14px); color: var(--texto); font-weight: 700; font-size: 14.5px;
  box-shadow: var(--sombra-p); transition: transform .18s var(--anim), box-shadow .18s, background .18s; }
.est-at:hover { transform: translateY(-2px); background: rgba(255,255,255,.85); box-shadow: 0 14px 30px rgba(6,40,56,.2); }
.est-at:active { transform: scale(.98); }
.est-at > .ic { width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: var(--c, #f97316); color: #fff; flex: none; box-shadow: 0 6px 14px rgba(0,0,0,.12); }
.est-at span { flex: 1; line-height: 1.2; }
.est-at kbd { position: absolute; top: 8px; right: 8px; }
.est-at.verde { --c: var(--verde); } .est-at.azul { --c: var(--azul); } .est-at.escuro { --c: var(--preto); } .est-at.roxo { --c: var(--roxo); }

/* ---- Painel da lista ---- */
.est-painel { padding: 16px 16px 10px; }
.est-ferramentas { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.est-ferramentas .busca { max-width: none; }
.est-ordem { width: auto; min-width: 210px; border-radius: 999px; }
.est-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.est-chips .chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 12px; }
.est-chips .chip b { font-size: 11.5px; opacity: .7; }
.est-chips .chip .ic { width: 14px; height: 14px; }
.est-chip-alerta { color: #be123c; }
.est-chip-alerta.ativo { background: var(--vermelho) !important; border-color: var(--vermelho) !important; color: #fff; }
.est-ponto { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* Linha de cadastro rápido */
.est-novo { display: grid; grid-template-columns: 30px minmax(180px, 2.2fr) minmax(110px, 1fr) 76px repeat(3, minmax(80px, .7fr)) auto; gap: 6px; align-items: center;
  padding: 8px; margin-bottom: 8px; border-radius: 16px; border: 1.5px dashed rgba(20,184,166,.55); background: rgba(255,255,255,.45); transition: background .2s, border-color .2s; }
.est-novo:focus-within { background: rgba(255,255,255,.85); border-style: solid; border-color: var(--turquesa); box-shadow: 0 0 0 3px rgba(20,184,166,.18); }
.est-novo input, .est-novo select { padding: 8px 10px; font-size: 13.5px; border-radius: 10px; }
.est-novo-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--turquesa); color: #fff; }
.est-novo-ic .ic { width: 16px; height: 16px; }
.est-novo .btn { white-space: nowrap; }

/* Cabeçalho e linhas */
.est-cab, .est-linha { display: grid; grid-template-columns: 40px minmax(200px, 2.2fr) minmax(170px, 1.5fr) 130px 110px 132px; gap: 12px; align-items: center; }
.est-cab { padding: 4px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--texto-3); font-weight: 700; }
.est-lista { display: flex; flex-direction: column; gap: 6px; }
.est-linha { padding: 10px; border-radius: 16px; background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.75); cursor: pointer; position: relative;
  transition: background .15s, transform .15s, box-shadow .15s; animation: sobeSuave .35s var(--anim) both; }
.est-linha:hover, .est-linha:focus-visible { background: rgba(255,255,255,.88); box-shadow: 0 8px 22px rgba(6,40,56,.12); outline: none; }
.est-linha::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--nv, transparent); }
.est-linha.zerado, .est-linha.baixo { --nv: var(--vermelho); }
.est-linha.atencao { --nv: var(--amarelo); }
.est-av { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #0b1720)); box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 35%, transparent); }
.est-av.g { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; }
.est-nome { min-width: 0; }
.est-nome b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-nome .fraco { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.est-nivel { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; }
.est-saldo { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.est-saldo b { font-size: 19px; font-weight: 800; letter-spacing: -.02em; color: var(--nc, #047857); }
.est-saldo span { font-size: 12.5px; color: var(--texto-3); }
.est-linha.zerado, .est-linha.baixo, .est-hero.zerado, .est-hero.baixo { --nc: #e11d48; }
.est-linha.atencao, .est-hero.atencao { --nc: #b45309; }
.est-tag { font-style: normal; font-size: 10.5px; font-weight: 750; padding: 2px 8px; border-radius: 999px; margin-left: 4px; }
.est-tag.zerado, .est-tag.baixo { background: #ffe4e6; color: #be123c; }
.est-tag.atencao { background: #fef3c7; color: #b45309; }
.est-tag.ok { background: #d1fae5; color: #047857; }
.est-barra { position: relative; height: 8px; border-radius: 6px; background: rgba(12,37,51,.08); overflow: visible; }
.est-barra i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #10b981, #14b8a6); animation: enche .8s var(--anim) both; transform-origin: left; }
.zerado .est-barra i, .baixo .est-barra i { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.atencao .est-barra i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.est-barra .min { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--texto); opacity: .55; }
.est-min { font-size: 11px; }
.est-spark { display: flex; flex-direction: column; gap: 2px; }
.est-spark .fraco { font-size: 11.5px; }
.est-valor b { font-weight: 700; font-size: 14px; }
.est-acoes { display: flex; gap: 6px; justify-content: flex-end; }
.est-acoes .btn-ic { width: 38px; height: 38px; }
.est-acoes .btn-ic .ic { width: 17px; height: 17px; }
.est-menos:hover { background: #fff0f3; color: #e11d48; border-color: #fecdd6; }
.est-mais { background: var(--verde); border-color: var(--verde); color: #fff; }
.est-mais:hover { background: #059669; }
.est-rodape { padding: 10px 6px 4px; text-align: right; }
.est-dica-teclado { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 14px 0 4px; color: rgba(240,252,253,.92); font-size: 12.5px; }
.est-dica-teclado .ic { width: 16px; height: 16px; }

/* ---- Página do item ---- */
.est-hero { display: grid; grid-template-columns: auto minmax(220px, 1fr) minmax(220px, 1.3fr) auto; gap: 22px; align-items: center; margin-bottom: 18px; background: var(--vidro-forte); }
.est-hero small { display: block; font-size: 12px; color: var(--texto-3); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.est-hero-saldo > div { font-size: 15px; color: var(--texto-2); margin-bottom: 6px; }
.est-hero-saldo > div b { font-size: 40px; font-weight: 850; letter-spacing: -.03em; color: var(--nc, #047857); }
.est-hero-saldo .est-barra { height: 10px; margin-bottom: 6px; }
.est-hero-info { display: flex; flex-direction: column; gap: 10px; }
.est-hero-info > div > b { display: block; font-size: 17px; }
.est-ped { display: block; font-size: 13px; padding: 5px 10px; border-radius: 10px; background: rgba(139,92,246,.1); color: #6d28d9; margin-top: 4px; }
.est-hero-bt { display: flex; flex-direction: column; gap: 8px; }
.est-abas-p { margin: 0; padding: 3px; }
.est-abas-p .aba { padding: 6px 11px; font-size: 12.5px; }
.est-movs { display: flex; flex-direction: column; }
.est-mov { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid rgba(255,255,255,.55); border-radius: 12px; }
.est-mov[data-ir] { cursor: pointer; }
.est-mov[data-ir]:hover { background: rgba(255,255,255,.4); }
.est-mov:last-child { border-bottom: 0; }
.est-mov-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.est-mov-ic .ic { width: 18px; height: 18px; }
.est-mov-ic.verde { background: #d1fae5; color: #047857; } .est-mov-ic.vermelho { background: #ffe4e6; color: #be123c; }
.est-mov-ic.azul { background: #e0f2fe; color: #0369a1; } .est-mov-ic.amarelo { background: #fef3c7; color: #b45309; }
.est-mov-txt { flex: 1; min-width: 0; }
.est-mov-txt b { display: block; font-weight: 650; font-size: 14px; }
.est-mov-txt .fraco { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-mov-q { font-weight: 800; font-size: 16px; white-space: nowrap; }
.est-mov-q.pos { color: #047857; } .est-mov-q.neg { color: #e11d48; }
.est-mov-q small, .kpi .val small { font-size: 12px; font-weight: 600; color: var(--texto-3); }

/* ---- Responsivo ---- */
@media (max-width: 1250px) {
  .est-atalhos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .est-cab, .est-linha { grid-template-columns: 40px minmax(170px, 2fr) minmax(150px, 1.4fr) 110px 132px; }
  .est-valor, .est-cab span:nth-child(5) { display: none; }
  .est-novo { grid-template-columns: 30px 1fr 1fr 76px; }
  .est-novo [name=estoque_minimo] { grid-column: 2; }
  .est-novo .btn { grid-column: 4; }
  .est-hero { grid-template-columns: auto 1fr; }
  .est-hero-bt { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 820px) {
  .est-atalhos { display: flex; overflow-x: auto; gap: 8px; margin: 0 -12px 12px; padding: 0 12px 4px; scrollbar-width: none; }
  .est-atalhos::-webkit-scrollbar { display: none; }
  .est-at { flex: none; padding: 10px 12px; font-size: 13.5px; border-radius: 16px; }
  .est-at > .ic { width: 32px; height: 32px; padding: 7px; }
  .est-at kbd { display: none; }
  .est-painel { padding: 12px 10px 8px; }
  .est-ferramentas .busca { flex-basis: 100%; }
  .est-ordem { flex: 1; min-width: 0; }
  .est-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -2px; margin-right: -2px; padding-bottom: 2px; }
  .est-chips::-webkit-scrollbar { display: none; }
  .est-chips .chip { flex: none; }
  .est-novo { grid-template-columns: 30px 1fr auto; }
  .est-novo > :not(.est-novo-ic):not([name=nome]):not(.btn) { display: none; }
  .est-novo.aberto, .est-novo:focus-within { grid-template-columns: 1fr 1fr; }
  .est-novo.aberto > *, .est-novo:focus-within > * { display: block !important; }
  .est-novo.aberto .est-novo-ic, .est-novo:focus-within .est-novo-ic { display: none !important; }
  .est-novo.aberto [name=nome], .est-novo:focus-within [name=nome], .est-novo.aberto .btn, .est-novo:focus-within .btn { grid-column: 1 / -1; }
  .est-novo input, .est-novo select { font-size: 16px; }
  .est-linha { grid-template-columns: 38px minmax(0, 1fr) auto; grid-template-areas: "av nome acoes" "av nivel nivel"; gap: 6px 10px; padding: 10px; }
  .est-linha .est-av { grid-area: av; align-self: start; }
  .est-linha .est-nome { grid-area: nome; }
  .est-linha .est-nivel { grid-area: nivel; }
  .est-linha .est-acoes { grid-area: acoes; }
  .est-acoes { gap: 4px; }
  .est-acoes .btn-ic { width: 36px; height: 36px; }
  .est-acoes .btn-ic:last-child { display: none; }
  .est-saldo b { font-size: 17px; }
  .est-hero { grid-template-columns: auto 1fr; gap: 14px; }
  .est-hero-info { grid-column: 1 / -1; }
  .est-hero-bt { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; }
  .est-hero-bt .btn { padding: 10px 6px; font-size: 13px; justify-content: center; }
  .est-hero-saldo > div b { font-size: 32px; }
}

/* Barras HTML (opBarras) */
.op-barras { height: 210px; gap: 8px; }
.op-barras .b .col { background: linear-gradient(180deg, color-mix(in srgb, var(--cb, #14b8a6) 70%, #fff), var(--cb, #14b8a6)); box-shadow: 0 8px 18px color-mix(in srgb, var(--cb, #14b8a6) 30%, transparent); }
.op-barras .b:last-child .col { background: linear-gradient(180deg, color-mix(in srgb, var(--cb, #14b8a6) 70%, #fff), var(--cb, #14b8a6)); }
.op-barras .b .col { cursor: pointer; }
.op-barras .b .v { font-size: 11.5px; white-space: nowrap; }
