/* Preço da MP na OF — cor × pai. Espaçamento em múltiplos de 4. Cor é semântica e
   sempre vem com texto ou ícone: âmbar = cor com preço diferente do pai esperando
   decisão, vermelho = fabricante pagou menos que pelo pai, verde = igual ou
   decidido, azul = informação e ação. O diálogo é filho do <body>: herda as
   variáveis pela própria classe. */
.pof-page, .pof-dlg {
  --pof-ink:    #24313b;
  --pof-muted:  #6b747b;
  --pof-soft:   #8a949c;
  --pof-line:   #e2e7eb;
  --pof-good:   #147a4b;
  --pof-warn:   #9b6414;
  --pof-danger: #bd3d3a;
  --pof-info:   #2f6f9f;
  --pof-bg:     #f8fafb;
  color: var(--pof-ink);
}
.pof-recarregando .pof-corpo { opacity: .55; transition: opacity .15s; pointer-events: none; }

/* ── Cabeçalho + frescor ── */
.pof-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.pof-eyebrow { color: #a23b36; font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.pof-head h2 { margin: 4px 0; font-size: 1.5rem; font-weight: 750; }
.pof-head p { margin: 0; color: var(--pof-muted); font-size: .86rem; max-width: 72ch; }
.pof-fresh { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--pof-line);
             border-radius: 8px; background: var(--pof-bg); font-size: .72rem; color: var(--pof-muted); }
.pof-fresh > i { color: var(--pof-info); font-size: 1rem; }
.pof-fresh b { color: var(--pof-ink); font-weight: 650; }
.pof-fresh-linhas { display: flex; flex-direction: column; gap: 2px; }
.pof-fresh button { white-space: nowrap; }

/* ── Avisos de fonte ── */
.pof-aviso { display: flex; gap: 12px; align-items: flex-start; padding: 8px 12px; border-radius: 8px; margin-bottom: 8px;
             font-size: .8rem; border: 1px solid; }
.pof-aviso > i { font-size: 1rem; line-height: 1.2; }
.pof-aviso > div { flex: 1 1 0; min-width: 0; }
.pof-aviso.warn { background: #fdf6ea; border-color: #f0dcb4; color: #6d4a10; }
.pof-aviso.danger { background: #fbeeee; border-color: #f0c9c8; color: #7c2725; }

/* ── KPIs: (rótulo, valor, legenda, estado) — clicáveis filtram a tabela ── */
.pof-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 16px; }
.pof-kpi { position: relative; text-align: left; background: #fff; border: 1px solid var(--pof-line); border-radius: 10px;
           padding: 12px 12px 12px 16px; overflow: hidden; color: inherit; cursor: pointer; }
.pof-kpi:hover { border-color: #c9d2d9; }
.pof-kpi:focus-visible { outline: 2px solid var(--pof-info); outline-offset: 1px; }
.pof-kpi.pof-on { border-color: var(--pof-info); box-shadow: 0 0 0 1px var(--pof-info) inset; }
.pof-kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #adb5bd; }
.pof-kpi.good::before { background: var(--pof-good); }
.pof-kpi.warn::before { background: var(--pof-warn); }
.pof-kpi.danger::before { background: var(--pof-danger); }
.pof-kpi.neutral::before { background: var(--pof-info); }
.pof-kpi > span { display: block; color: var(--pof-muted); font-size: .72rem; }
.pof-kpi strong { display: block; margin: 4px 0; font-size: 1.22rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pof-kpi.danger strong { color: var(--pof-danger); }
.pof-kpi small { display: block; color: var(--pof-soft); font-size: .68rem; line-height: 1.35; }

/* ── Filtros ── */
.pof-filtros { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; background: #fff; border: 1px solid var(--pof-line);
               border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.pof-campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pof-campo > label, .pof-campo > span { font-size: .7rem; font-weight: 650; color: #555; }
.pof-campo select, .pof-campo input { padding: 5px 8px; border: 1px solid #ced4da; border-radius: 6px; font-size: .82rem;
                                      background: #fff; color: var(--pof-ink); max-width: 100%; }
.pof-campo select:focus-visible, .pof-campo input:focus-visible { outline: 2px solid var(--pof-info); outline-offset: 1px; }
.pof-busca { flex: 1 1 220px; }
.pof-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pof-chip { border: 1px solid #ced4da; background: #fff; border-radius: 999px; padding: 4px 10px; font-size: .76rem; color: #52616d; cursor: pointer; }
.pof-chip.pof-on { background: var(--pof-info); border-color: var(--pof-info); color: #fff; }
.pof-chip:focus-visible { outline: 2px solid var(--pof-info); outline-offset: 1px; }

/* ── Cards e tabelas (materiais; as OFs do material abrem em diálogo) ── */
.pof-card { background: #fff; border: 1px solid var(--pof-line); border-radius: 10px; margin-bottom: 16px; }
.pof-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px;
                 padding: 12px 16px; border-bottom: 1px solid #eef1f3; }
.pof-card-head h3 { margin: 0; font-size: .98rem; font-weight: 700; }
.pof-card-head p { margin: 2px 0 0; font-size: .74rem; color: var(--pof-muted); }
.pof-conta { font-size: .74rem; color: var(--pof-muted); white-space: nowrap; }
.pof-scroll { overflow-x: auto; position: relative; }
.pof-tab { width: 100%; min-width: 920px; border-collapse: collapse; font-size: .8rem; }
.pof-tab-of { min-width: 680px; }
.pof-tab th { font-size: .68rem; font-weight: 650; color: var(--pof-muted); text-transform: uppercase; letter-spacing: .04em;
              padding: 8px 12px; border-bottom: 1px solid #eef1f3; background: #fbfcfd; text-align: left; white-space: nowrap; vertical-align: bottom; }
.pof-tab th.pof-num { text-align: right; }
.pof-tab thead th:has(.pof-ord) { padding: 0; }
.pof-ord { display: block; width: 100%; padding: 8px 12px; border: 0; background: none; font: inherit; color: inherit;
           text-transform: inherit; letter-spacing: inherit; text-align: inherit; cursor: pointer; white-space: nowrap; }
.pof-ord:hover, .pof-ord.pof-on { color: var(--pof-info); }
.pof-ord:focus-visible { outline: 2px solid var(--pof-info); outline-offset: -2px; }
.pof-ord i { font-size: .62rem; margin-left: 2px; }
.pof-tab td { padding: 8px 12px; border-bottom: 1px solid #f2f4f6; vertical-align: top; }
.pof-tab tr:last-child td { border-bottom: none; }
.pof-tab .pof-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pof-tab small { display: block; color: var(--pof-soft); font-size: .7rem; line-height: 1.35; white-space: normal; }
.pof-tab td.pof-num small { max-width: 190px; margin-left: auto; }
.pof-tab tfoot td { font-weight: 700; border-top: 1px solid var(--pof-line); background: #fbfcfd; }
.pof-tab td.pof-col-mat { min-width: 240px; }
.pof-tab td.pof-col-sit { min-width: 210px; }
.pof-nome { display: block; max-width: 320px; font-weight: 650; overflow-wrap: anywhere; }
.pof-grupo { display: inline-block; margin-top: 2px; padding: 1px 6px; border-radius: 999px; background: #eef2f5; color: #52616d;
             font-size: .66rem; font-weight: 650; letter-spacing: .02em; }
.pof-neg { color: var(--pof-danger); }
.pof-pos { color: var(--pof-ink); }
.pof-zero { color: var(--pof-soft); }
.pof-est { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font-size: .7rem; font-weight: 650; white-space: nowrap; }
.pof-est.pend { color: var(--pof-warn); }
.pof-est.ok { color: var(--pof-good); }
.pof-est.mudou { color: var(--pof-danger); }
.pof-link { background: none; border: 0; padding: 0; color: var(--pof-info); font-size: .76rem; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.pof-link:focus-visible { outline: 2px solid var(--pof-info); outline-offset: 2px; }
.pof-acoes { display: flex; flex-wrap: wrap; gap: 6px; }
.pof-acoes .btn { white-space: nowrap; }
.pof-motivo { max-width: 260px; }

/* ── Vazio, erro, carregando, procedência ── */
.pof-vazio { text-align: center; padding: 32px 16px; color: var(--pof-muted); }
.pof-vazio.pof-solto { background: #fff; border: 1px dashed #cfd6dc; border-radius: 10px; }
.pof-vazio > i { font-size: 1.6rem; display: block; margin-bottom: 8px; }
.pof-vazio.good > i { color: var(--pof-good); }
.pof-vazio.danger > i { color: var(--pof-danger); }
.pof-vazio b { display: block; color: var(--pof-ink); margin-bottom: 4px; }
.pof-carregando { padding: 40px 16px; text-align: center; color: var(--pof-muted); font-size: .84rem; }
.pof-metodo { font-size: .76rem; color: var(--pof-muted); background: #fff; border: 1px solid var(--pof-line); border-radius: 10px; padding: 12px 16px; }
.pof-metodo p { margin: 0 0 8px; }
.pof-metodo details summary { cursor: pointer; color: var(--pof-info); font-weight: 650; }
.pof-metodo ul { margin: 8px 0 0; padding-left: 18px; }
.pof-metodo li { margin-bottom: 4px; }

/* ── Diálogos: igualar no ERP · manter preço da cor ── */
.pof-dlg .modal-header { align-items: flex-start; gap: 16px; padding: 16px 20px; }
.pof-dlg .modal-body { padding: 16px 20px; font-size: .86rem; }
.pof-dlg .modal-footer { gap: 8px; }
.pof-dlg h5 { margin: 2px 0 4px; font-size: 1.08rem; font-weight: 700; overflow-wrap: anywhere; }
.pof-ident { display: block; color: var(--pof-muted); font-size: .76rem; }
.pof-par { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.pof-par > div { border: 1px solid var(--pof-line); border-radius: 8px; padding: 8px 12px; }
.pof-par span { display: block; font-size: .7rem; color: var(--pof-muted); }
.pof-par b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.pof-passos { margin: 0 0 12px; padding-left: 20px; }
.pof-passos li { margin-bottom: 6px; }
.pof-codigo { display: inline-flex; align-items: center; gap: 8px; padding: 2px 8px; border: 1px solid var(--pof-line); border-radius: 6px;
              background: var(--pof-bg); font-variant-numeric: tabular-nums; font-weight: 650; }
.pof-dlg textarea { width: 100%; min-height: 84px; padding: 6px 8px; border: 1px solid #ced4da; border-radius: 6px; font-size: .84rem; }
.pof-dlg textarea:focus-visible { outline: 2px solid var(--pof-info); outline-offset: 1px; }
.pof-dlg textarea[aria-invalid=true] { border-color: var(--pof-danger); }
.pof-msg { margin-top: 8px; padding: 8px 12px; border: 1px solid #f0c9c8; border-radius: 6px; background: #fbeeee; color: #7c2725; font-size: .78rem; }
.pof-nota { margin: 8px 0 0; font-size: .74rem; color: var(--pof-muted); }
.pof-dlg .pof-scroll-dlg { border: 1px solid var(--pof-line); border-radius: 8px; }
.pof-opcoes { margin: 0 0 12px; padding: 0; border: 0; }
.pof-opcoes legend { font-size: .86rem; font-weight: 700; margin-bottom: 8px; }
.pof-opcao { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; margin-bottom: 8px; border: 1px solid var(--pof-line);
             border-radius: 8px; cursor: pointer; }
.pof-opcao:has(input:checked) { border-color: var(--pof-info); background: #f2f8fc; }
.pof-opcao input { margin-top: 4px; }
.pof-opcao small { display: block; color: var(--pof-muted); font-size: .76rem; }
.pof-impacto { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border: 1px solid var(--pof-line); border-radius: 8px;
               background: var(--pof-bg); font-size: .8rem; }
.pof-impacto.warn { background: #fdf6ea; border-color: #f0dcb4; color: #6d4a10; }

@media (max-width: 700px) {
  .pof-head h2 { font-size: 1.25rem; }
  .pof-fresh { width: 100%; }
  .pof-filtros { padding: 12px; }
  .pof-card-head { padding: 12px; }
  .pof-dlg .modal-header, .pof-dlg .modal-body { padding: 12px 16px; }
  .pof-par { grid-template-columns: minmax(0, 1fr); }
  .pof-nome { max-width: 220px; }
}
