/* admin-estoque.css — aba Estoque e bloco de material no agendamento. Mesmos tokens do admin.css. */
.est-subs button.is-ativo, .est-filtros .seg button.is-ativo { background: var(--accent); color: var(--accent-ink); }
.est-previa { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 8px 12px; margin: 0 0 12px; }
.est-vista { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.est-vista > *, .kit > *, .foto > * { min-width: 0; }

/* números do topo */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.kpi__rot { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--muted); }
.kpi__val { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1; letter-spacing: .02em; overflow-wrap: anywhere; }
.kpi__extra { color: var(--muted); font-size: 12.5px; }
.kpi.is-alerta { border-color: var(--aviso); } .kpi.is-alerta .kpi__val { color: var(--aviso); }
.kpi.is-ok .kpi__val { color: var(--ok); }

.est-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.est-grade .bloco { min-width: 0; }
.est-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.est-lista li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.est-lista li:last-child { border-bottom: 0; }
.est-lista li b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-lista li small { grid-column: 2; color: var(--muted); font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-lista li em { font-style: normal; font-family: var(--cond); font-weight: 700; letter-spacing: .04em; grid-column: 3; grid-row: 1; white-space: nowrap; }
.est-lista li:not(:has(> span)) { grid-template-columns: minmax(0, 1fr) auto; }
.est-lista li:not(:has(> span)) small { grid-column: 1; }
.est-lista li:not(:has(> span)) em { grid-column: 2; }
.est-lista li.vazio { display: block; color: var(--muted); border: 0; }
.est-lista--mov em.neg { color: #ff8b99; } .est-lista--mov em.pos { color: var(--ok); }
.est-lista--kits li { grid-template-columns: minmax(0, 1fr); } .est-lista--kits li span { color: var(--muted); font-size: 13px; }

.est-barras { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.est-barras li { display: grid; grid-template-columns: auto 92px minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 14px; text-transform: capitalize; }
.est-barras--ag li { grid-template-columns: 112px minmax(0, 1fr) 44px; text-transform: none; }
.est-barras li.vazio { display: block; color: var(--muted); text-transform: none; }
.est-barras .sw { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.18); }
.est-barras .med { font-family: var(--cond); font-weight: 700; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.est-barras .barra { position: relative; height: 10px; background: var(--bg-2); border-radius: 6px; overflow: visible; }
.est-barras .barra i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--fg); min-width: 4px; }
.est-barras--ag .barra i { background: var(--ok); } .est-barras--ag .barra i.is-baixo { background: var(--aviso); }
.est-barras .barra u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--fg); opacity: .7; text-decoration: none; }
.est-barras em { font-style: normal; font-family: var(--cond); font-weight: 700; text-align: right; }

/* selos */
.sit { display: inline-block; font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; padding: 3px 7px; border-radius: 3px; border: 1px solid; white-space: nowrap; }
.sit--ok { color: var(--ok); border-color: rgba(37,211,102,.4); }
.sit--repor, .sit--vence { color: var(--aviso); border-color: rgba(245,185,66,.5); }
.sit--zerado, .sit--vencido { color: #ff8b99; border-color: var(--accent); }
.sit--novo { color: var(--fg); border-color: var(--line-2); }
.mov { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; color: var(--muted); white-space: nowrap; }
.mov--uso, .mov--venda { color: var(--accent); } .mov--leitura_foto { color: var(--ok); } .mov--estorno { color: var(--aviso); }
.ex { color: var(--muted); border: 1px dashed var(--line-2); border-radius: 3px; padding: 0 4px; font-size: 11px; }

/* itens */
.est-filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.est-filtros .busca { flex: 1 1 220px; width: auto; }
#estTabela td small { color: var(--muted); }
.qtd { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; }
.qtd__b { width: 34px; height: 36px; font-size: 18px; } .qtd__b:hover { background: var(--surface-2); }
.qtd__v { width: 70px; border: 0; border-radius: 0; text-align: center; padding: 6px 4px; background: var(--bg-2); }

/* kits */
.kit { display: grid; gap: 12px; }
.kit__linhas, .mat__linhas { display: grid; gap: 8px; }
.kit__l, .mat__l { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto 34px; gap: 8px; align-items: center; }
.kit__l small, .mat__l small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.kit__acoes { display: flex; align-items: center; gap: 10px; } .kit__acoes .espaco { flex: 1; }
.kit-x, .mat-x { width: 34px; height: 36px; border: 1px solid var(--line-2); border-radius: 4px; font-size: 18px; line-height: 1; }
.kit-x:hover, .mat-x:hover { border-color: var(--accent); color: var(--accent); }

/* foto */
.foto { display: grid; gap: 12px; }
.foto__acoes { display: flex; flex-wrap: wrap; gap: 10px; }
.foto__escolher { cursor: pointer; }
.foto__lista { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.foto__modo { border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 14px; display: grid; gap: 8px; margin: 12px 0 6px; }
.foto__modo legend { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); padding: 0 6px; }
.foto__modo .check { text-transform: none; letter-spacing: 0; font-family: var(--body); font-size: 14px; color: var(--fg); display: flex; gap: 8px; align-items: flex-start; }
.foto__modo .check input { width: auto; margin-top: 3px; }
.tabela--foto { min-width: 980px; }
.tabela--foto input, .tabela--foto select { padding: 6px 8px; font-size: 14px; }
.tabela--foto input[type="checkbox"] { width: 18px; height: 18px; }
.tabela--foto .fr-q { width: 76px; }
.tabela--foto tr.is-duvida td { background: rgba(245,185,66,.06); }
.conf { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }
.conf--alta { color: var(--ok); } .conf--media { color: var(--fg); } .conf--baixa { color: var(--aviso); }

/* material dentro do agendamento */
.mat { border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px; display: block; }
.mat[open] { display: grid; gap: 8px; }
.mat summary { cursor: pointer; font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--fg); }
.mat summary span { color: var(--muted); text-transform: none; letter-spacing: 0; font-family: var(--body); font-weight: 400; }
.mat__kit { color: var(--muted); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.mat__h { margin: 6px 0 0; font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); }
.mat__l:has(.mat-p) { grid-template-columns: minmax(0, 1fr) 76px auto 92px 34px; }
.mat__l:has(.mat-nome) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 76px auto 92px 34px; }
.mat__l.is-pouco .mat-q { border-color: var(--aviso); }
.mat__aviso { grid-column: 1 / -1; color: var(--aviso); font-style: normal; font-size: 12.5px; margin-top: -4px; }
.mat .link { justify-self: start; }
.ev__mat { position: absolute; right: 5px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--surface-2); }

@media (max-width: 760px) {
  .est-barras li { grid-template-columns: auto 74px minmax(0, 1fr) 40px; }
  .est-barras--ag li { grid-template-columns: 96px minmax(0, 1fr) 40px; }
  .kit__l, .mat__l, .mat__l:has(.mat-p), .mat__l:has(.mat-nome) { grid-template-columns: minmax(0, 1fr) 70px 34px; }
  .kit__l small, .mat__l small { display: none; }
  .mat__l .mat-nome, .mat__l .mat-p { grid-column: span 1; }
  .mat__l:has(.mat-p) .mat-p { grid-column: 2; } .mat__l:has(.mat-p) .mat-x { grid-row: 1; grid-column: 3; }
  .est-filtros > * { flex: 1 1 100%; }
  .est-subs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .est-subs button { border-bottom: 1px solid var(--line-2); }
}

/* senha (admin-senha.js) */
body:not([data-modo="banco"]) .so-banco { display: none !important; }
.link--esqueci { justify-self: start; margin-top: 4px; font-size: 13.5px; color: var(--muted); text-decoration: underline; }
.link--esqueci:hover { color: var(--fg); }
#formEsqueci, #formNovaSenha { display: grid; gap: 8px; }
#formEsqueci[hidden], #formNovaSenha[hidden] { display: none !important; }
#formEsqueci .link { justify-self: start; color: var(--muted); text-decoration: underline; font-size: 13.5px; }
.ok { margin: 0; color: var(--ok); font-size: 14px; }
.senha-bloco .campos { align-items: end; }

/* ---------- plano de material pela foto (diálogo de agendamento) ---------- */
.plano { border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: var(--r); padding: 12px; display: grid; gap: 10px; background: var(--bg-2); }
.plano__cab { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.plano__cab h3 { margin: 0; font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--fg); }
.plano__cab .nota { margin: 0; font-size: 13px; }
.plano__entrada { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 12px; align-items: start; }
.plano__foto { width: 116px; height: 116px; border: 1px dashed var(--line-2); border-radius: var(--r); display: grid; place-items: center; cursor: pointer; overflow: hidden; background: var(--surface); text-transform: none; letter-spacing: 0; font-family: var(--body); font-size: 13px; color: var(--muted); text-align: center; padding: 6px; }
.plano__foto:hover, .plano__foto:focus-within { border-color: var(--accent); color: var(--fg); }
.plano__foto img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.plano__foto:has(img:not([hidden])) { padding: 0; border-style: solid; }
.plano__campos { display: grid; gap: 8px; min-width: 0; }
.plano__dica { margin: 0; font-size: 12.5px; }
.plano__acoes { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.plano__acoes .btn[disabled] { opacity: .5; cursor: not-allowed; }
.plano__privacidade { margin: 0; font-size: 12px; }
.plano__res { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.plano__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.plano__chips li { border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; font-size: 13px; color: var(--fg); white-space: nowrap; }
.plano__chips li b { color: var(--muted); font-weight: 600; margin-right: 4px; font-family: var(--cond); text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }
.plano__h { margin: 2px 0 0; font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); }
.plano__lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plano__lista li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.plano__lista li.sem-sw { grid-template-columns: minmax(0, 1fr) auto; }
.plano__lista .sw { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.18); }
.plano__lista b { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.plano__lista small { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
.plano__lista li:not(.sem-sw) small { grid-column: 2 / -1; }
.plano__lista .sit { justify-self: end; }
.plano__lista--texto li { display: block; }
.plano__compras { border: 1px solid rgba(245,185,66,.5); border-radius: var(--r); padding: 8px 10px; }
.plano__compras .plano__h { color: var(--aviso); margin: 0 0 6px; }
.plano__ok { margin: 0; color: var(--ok); font-size: 13.5px; }
@media (max-width: 560px) {
  .plano__entrada { grid-template-columns: 88px minmax(0, 1fr); }
  .plano__foto { width: 88px; height: 88px; }
  .plano__entrada .campos--2 { grid-template-columns: 1fr 1fr; }
}
/* celular: medida e botão do plano cabem na caixa (o botão quebra linha em vez de vazar) */
.plano__entrada .campos--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.plano__entrada input { min-width: 0; }
.plano__acoes .btn { white-space: normal; max-width: 100%; text-align: center; }
