/* Estoque do OdontoSys. Tudo com prefixo oe- para não interferir no resto da tela. */
#v-estoque { padding: 0 !important; color: var(--text); }
.oe { max-width: 1480px; margin: 0 auto; padding: 22px 24px 48px; box-sizing: border-box; }
.oe *, .oe *::before, .oe *::after { box-sizing: border-box; }

.oe-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.oe-head h1 { margin: 0; font-size: 1.45rem; line-height: 1.1; color: var(--text); }
.oe-head p { margin: 6px 0 0; font-size: .84rem; color: var(--muted); }
.oe-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* botões */
.oe-btn {
  height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border); background: #fff; color: var(--text);
  font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: border-color .15s, background .15s, color .15s; white-space: nowrap;
}
.oe-btn:hover:not(:disabled) { border-color: var(--primary); }
.oe-btn:focus-visible, .oe-tab:focus-visible, .oe-seg-b:focus-visible, .oe-kpi.clicavel:focus-visible, .oe-kit-li:focus-visible {
  outline: 3px solid rgba(47, 124, 246, .35); outline-offset: 2px;
}
.oe-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.oe-btn.primary:hover:not(:disabled) { filter: brightness(1.12); }
.oe-btn.danger { color: var(--danger); }
.oe-btn.danger:hover:not(:disabled) { border-color: var(--danger); background: #fef2f2; }
.oe-btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.oe-btn.ghost:hover:not(:disabled) { background: var(--bg-input); color: var(--text); border-color: transparent; }
.oe-btn.sm { height: 30px; padding: 0 10px; font-size: .74rem; border-radius: 8px; }
.oe-btn.icone { width: 30px; padding: 0; }
.oe-btn:disabled { opacity: .5; cursor: not-allowed; }

/* indicadores */
.oe-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.oe-kpi {
  background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px 16px; text-align: left;
  display: flex; flex-direction: column; gap: 4px; font: inherit; color: inherit; border-left: 4px solid var(--border);
}
.oe-kpi.clicavel { cursor: pointer; transition: border-color .15s, transform .15s; }
.oe-kpi.clicavel:hover { transform: translateY(-1px); border-color: var(--primary); }
.oe-kpi.alerta { border-left-color: #d97706; }
.oe-kpi.critico { border-left-color: var(--danger); }
.oe-kpi-l { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.oe-kpi strong { font-size: 1.5rem; line-height: 1.15; color: var(--text); font-variant-numeric: tabular-nums; }
.oe-kpi-s { font-size: .76rem; color: var(--muted); }

/* abas */
.oe-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-soft); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.oe-tabs::-webkit-scrollbar { display: none; }
.oe-tab {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; margin-bottom: -1px; font: inherit; font-size: .84rem;
  font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; border-radius: 6px 6px 0 0;
}
.oe-tab:hover { color: var(--text); }
.oe-tab.ativa { color: var(--primary); border-bottom-color: #2f7cf6; }

/* barra de filtros */
.oe-barra { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.oe-busca { position: relative; flex: 1 1 260px; max-width: 420px; display: block; margin: 0; }
.oe-busca svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.oe .oe-busca input, .oe-md input, .oe-md select, .oe-md textarea, .oe select, .oe input[type="date"], .oe-kit-novo input {
  margin: 0; width: 100%; height: 38px; padding: 0 12px; font: inherit; font-size: .85rem; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text);
}
.oe .oe-busca input { padding-left: 34px; }
.oe-barra select { width: auto; min-width: 190px; }
.oe-campo-inline { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .8rem; color: var(--muted); }
.oe-campo-inline input { width: 150px; }
.oe-check { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: .8rem; color: var(--muted); cursor: pointer; }
.oe-check input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--primary); }
.oe-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: #fff; }
.oe-seg-b { border: 0; background: transparent; padding: 0 13px; height: 36px; font: inherit; font-size: .78rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.oe-seg-b + .oe-seg-b { border-left: 1px solid var(--border-soft); }
.oe-seg-b:hover { color: var(--text); background: var(--bg-input); }
.oe-seg-b.ativa { background: var(--primary); color: #fff; }
.oe-chip-filtro { display: inline-flex; align-items: center; gap: 8px; background: var(--primary-dim); color: var(--primary); padding: 5px 6px 5px 12px; border-radius: 999px; font-size: .78rem; margin-bottom: 12px; }
.oe-chip-filtro button { border: 0; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; padding: 0; }
.oe-chip-filtro button:hover { background: rgba(30, 58, 95, .15); }

/* tabela */
.oe-tabela-wrap { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 12px; overflow-x: auto; }
.oe-tabela { width: 100%; border-collapse: collapse; font-size: .84rem; }
.oe-tabela th { text-align: left; padding: 11px 14px; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border-soft); background: var(--surface); white-space: nowrap; }
.oe-tabela td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.oe-tabela tbody tr:last-child td { border-bottom: 0; }
.oe-tabela tbody tr:hover td { background: #f8fafc; }
.oe-tabela tr.inativo td { opacity: .6; }
.oe-tabela tr.estornada td { opacity: .55; }
.oe-tabela tr.estornada .oe-nome, .oe-tabela tr.estornada .oe-det { text-decoration: line-through; }
.oe-col-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.oe-col-acoes { text-align: right; }
.oe-acoes-w { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.oe-col-item { min-width: 220px; }
.oe-col-saldo { white-space: nowrap; }
.oe-nowrap { white-space: nowrap; }
.oe-nome { font-weight: 700; color: var(--text); }
.oe-sub { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.oe-mudo { color: var(--muted); }
.oe-un { color: var(--muted); font-size: .76rem; }
.oe-saldo { font-size: 1.02rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.oe-saldo.baixo { color: #b45309; }
.oe-saldo.zerado, .oe-saldo.negativo { color: var(--danger); }
.oe-alerta-txt { color: #b45309; font-weight: 700; }
.oe-mais { color: #0f766e; font-weight: 800; }
.oe-menos { color: #b45309; font-weight: 800; }
.oe-det { color: var(--text); min-width: 180px; max-width: 460px; line-height: 1.4; }
.oe-nota { margin: 12px 2px 0; font-size: .76rem; color: var(--muted); line-height: 1.5; }

/* selos */
.oe-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .7rem; font-weight: 800; line-height: 1.5; border: 1px solid transparent; white-space: nowrap; }
.oe-pill.ok { background: #e9f7f3; color: #0f766e; border-color: #b9e2d5; }
.oe-pill.alerta { background: #fff4e0; color: #9a5b00; border-color: #f3d29b; }
.oe-pill.critico { background: #fdecec; color: #b42318; border-color: #f5c2c0; }
.oe-pill.info { background: #e8f0fd; color: #1e4fa3; border-color: #bcd1f5; }
.oe-pill.neutro { background: #eef3f8; color: #4b6079; border-color: #cbd8e6; }

/* estados vazios */
.oe-vazio { background: var(--bg-card); border: 1px dashed var(--border); border-radius: 12px; padding: 34px 20px; text-align: center; color: var(--muted); }
.oe-vazio h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--text); }
.oe-vazio p { margin: 0 auto 14px; max-width: 560px; line-height: 1.55; font-size: .86rem; }
.oe-vazio.grande { padding: 56px 20px; }
.oe-vazio-ico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-dim); color: var(--primary); }
.oe-vazio-acoes { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* menu de ações do item */
.oe-menu { position: fixed; z-index: 9500; min-width: 220px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 35, 60, .18); padding: 5px; }
.oe-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 7px; font: inherit; font-size: .82rem; color: var(--text); cursor: pointer; }
.oe-menu button:hover { background: var(--bg-input); }
.oe-menu button.perigo { color: var(--danger); }

/* kits */
.oe-kits { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.oe-kit-lista { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.oe-kit-lista .oe-busca { max-width: none; flex: none; }
.oe-kit-novo { display: flex; gap: 6px; }
.oe-kit-novo input { height: 32px; font-size: .8rem; }
.oe-kit-rolagem { max-height: 520px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.oe-kit-grupo { font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 6px 4px; }
.oe-kit-li { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid transparent; background: transparent; text-align: left; padding: 9px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); }
.oe-kit-li:hover { background: var(--bg-input); }
.oe-kit-li.ativa { background: var(--primary-dim); border-color: rgba(30, 58, 95, .25); }
.oe-kit-nome { font-size: .82rem; font-weight: 700; line-height: 1.3; }
.oe-kit-meta { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.oe-kit-editor { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 12px; padding: 18px; min-height: 280px; }
.oe-kit-editor .oe-vazio { border: 0; background: transparent; }
.oe-kit-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.oe-kit-cab h3 { margin: 0; font-size: 1.1rem; }
.oe-kit-cab p { margin: 4px 0 0; font-size: .8rem; color: var(--muted); }
.oe-kit-linhas { margin-bottom: 16px; }
.oe-kit-linha { display: grid; grid-template-columns: minmax(0, 1fr) 190px 100px 34px; gap: 10px; align-items: center; margin-bottom: 8px; }
.oe-kit-linha.cab { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.oe-kit-linha select, .oe-kit-linha input { margin: 0; }
.oe-qtd { display: flex; align-items: center; gap: 8px; }
.oe-qtd input { width: 110px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font: inherit; font-size: .85rem; }
.oe-kit-linha > select { height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font: inherit; font-size: .85rem; width: 100%; }
.oe-kit-custo { text-align: right; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.oe-kit-resumo { display: flex; gap: 28px; flex-wrap: wrap; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 10px; margin-bottom: 16px; }
.oe-kit-resumo > div { display: flex; flex-direction: column; gap: 3px; }
.oe-kit-resumo strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.oe-kit-rodape { display: flex; justify-content: space-between; gap: 10px; }

/* modais */
.oe-ov { position: fixed; inset: 0; z-index: 10000; background: rgba(13, 31, 53, .55); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px 16px; overflow-y: auto; }
.oe-md { width: 100%; background: #fff; border-radius: 14px; box-shadow: 0 24px 64px rgba(13, 31, 53, .35); border: 1px solid var(--border-soft); color: var(--text); animation: oe-in .16s ease-out; }
@keyframes oe-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.oe-md-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px 12px; }
.oe-md-h h2 { margin: 0; font-size: 1.12rem; }
.oe-md-h p { margin: 4px 0 0; font-size: .8rem; color: var(--muted); }
.oe-x { border: 0; background: transparent; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; flex: 0 0 auto; }
.oe-x:hover { background: var(--bg-input); color: var(--text); }
.oe-md-b { padding: 6px 22px 18px; max-height: calc(100vh - 220px); overflow-y: auto; }
.oe-md-f { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border-soft); background: var(--surface); border-radius: 0 0 14px 14px; }
.oe-form { display: flex; flex-direction: column; gap: 12px; }
.oe-f { display: flex; flex-direction: column; gap: 5px; position: relative; }
.oe-f label { margin: 0; font-size: .76rem; font-weight: 700; color: var(--text); }
.oe-f small { font-size: .72rem; color: var(--muted); line-height: 1.4; }
.oe-f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.oe-inicial { border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px 14px 14px; margin: 4px 0 0; display: flex; flex-direction: column; gap: 12px; }
.oe-inicial legend { padding: 0 6px; font-size: .76rem; font-weight: 800; color: var(--muted); }
.oe-info { display: none; padding: 9px 12px; border-radius: 8px; background: var(--primary-dim); color: var(--primary); font-size: .8rem; line-height: 1.45; }
.oe-info.on { display: block; }
.oe-info.erro { background: #fff4e0; color: #9a5b00; }
.oe-erro { background: #fdecec; color: #b42318; border: 1px solid #f5c2c0; padding: 9px 12px; border-radius: 8px; font-size: .82rem; margin-bottom: 12px; }
.oe-pac-sel { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-input); font-size: .85rem; }
.oe-pac-sel[hidden], .oe-sug[hidden] { display: none; }
.oe-pac-sel button { border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; }
.oe-pac-sel button:hover { background: #fff; color: var(--text); }
.oe-sug { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin-top: 4px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 28px rgba(15, 35, 60, .16); max-height: 220px; overflow-y: auto; }
.oe-sug button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 12px; font: inherit; font-size: .84rem; cursor: pointer; color: var(--text); }
.oe-sug button:hover { background: var(--bg-input); }

/* janela de materiais do atendimento */
.oe-at-dica { margin: 0 0 14px; font-size: .84rem; color: var(--muted); line-height: 1.5; }
.oe-at-grupo { border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.oe-at-grupo h3 { margin: 0 0 10px; font-size: .92rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.oe-at-dente { font-size: .7rem; font-weight: 800; color: var(--primary); background: var(--primary-dim); padding: 2px 8px; border-radius: 999px; }
.oe-at-linha { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px 30px; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--border-soft); }
.oe-at-linha:first-of-type { border-top: 0; }
.oe-at-linha.falta .oe-sub { color: #b45309; font-weight: 700; }
.oe-at-mat { display: flex; flex-direction: column; min-width: 0; }
.oe-step { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: #fff; }
.oe-step button { width: 34px; height: 34px; border: 0; background: var(--bg-input); color: var(--text); cursor: pointer; display: grid; place-items: center; padding: 0; }
.oe-step button:hover { background: #e3eaf3; }
.oe-step input { width: 66px; height: 34px; border: 0; border-left: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft); border-radius: 0; text-align: center; padding: 0 4px; margin: 0; font: inherit; font-size: .88rem; font-weight: 700; background: #fff; color: var(--text); }
.oe-at-un { text-align: left; }
.oe-at-grupo select[data-add] { margin: 8px 0 0; height: 34px; width: 100%; border-radius: 8px; border: 1px dashed var(--border); background: var(--surface); font: inherit; font-size: .8rem; padding: 0 10px; color: var(--muted); }
.oe-at-total { margin-right: auto; font-size: .82rem; font-weight: 700; color: var(--text); }

@media (max-width: 1280px) {
  .oe-tabela .oe-c-dura { display: none; }
}
@media (max-width: 1100px) {
  .oe-tabela .oe-c-custo { display: none; }
  .oe-col-item { min-width: 150px; }
}
@media (max-width: 900px) {
  .oe-tabela .oe-c-min { display: none; }
  .oe-tabela th, .oe-tabela td { padding: 10px 10px; }
  .oe-det { max-width: 240px; }
}
@media (max-width: 1100px) {
  .oe-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oe-kits { grid-template-columns: 1fr; }
  .oe-kit-rolagem { max-height: 260px; }
}
@media (max-width: 720px) {
  .oe { padding: 16px 12px 40px; }
  .oe-f2 { grid-template-columns: 1fr; }
  .oe-kit-linha { grid-template-columns: minmax(0, 1fr) 150px 34px; }
  .oe-kit-linha .oe-kit-custo { display: none; }
  .oe-kit-linha.cab span:nth-child(3) { display: none; }
  .oe-at-linha { grid-template-columns: minmax(0, 1fr) auto 30px; }
  .oe-at-un { display: none; }
}
@media (prefers-reduced-motion: reduce) { .oe-md { animation: none; } .oe-kpi.clicavel { transition: none; } }
