/* Ficha Técnica — produto acabado × matérias-primas da ficha do ERP.
   Espaçamento em múltiplos de 4. Cor é semântica e sempre vem com texto ou
   ícone: âmbar = produção em aberto que depende do recorte, verde = nenhuma,
   azul = informação. Painel de filtro e tabelas rolam dentro do próprio
   contêiner; a página nunca rola na horizontal. */
.ftec-page {
  --ftec-ink:    #24313b;
  --ftec-muted:  #6b747b;
  --ftec-soft:   #8a949c;
  --ftec-line:   #e2e7eb;
  --ftec-good:   #147a4b;
  --ftec-warn:   #9b6414;
  --ftec-danger: #bd3d3a;
  --ftec-info:   #2f6f9f;
  --ftec-bg:     #f8fafb;
  --ftec-sel:    #eef5fa;
  color: var(--ftec-ink);
  min-width: 0;
}
.ftec-recarregando .ftec-corpo { opacity: .55; transition: opacity .15s; pointer-events: none; }

/* ── Cabeçalho + frescor ── */
.ftec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.ftec-eyebrow { color: #a23b36; font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.ftec-head h2 { margin: 4px 0; font-size: 1.5rem; font-weight: 750; }
.ftec-head p { margin: 0; color: var(--ftec-muted); font-size: .86rem; max-width: 70ch; }
.ftec-fresh { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--ftec-line);
              border-radius: 8px; background: var(--ftec-bg); font-size: .72rem; color: var(--ftec-muted); }
.ftec-fresh i { color: var(--ftec-info); font-size: 1rem; }
.ftec-fresh b { color: var(--ftec-ink); font-weight: 650; }
.ftec-fresh-linhas { display: flex; flex-direction: column; gap: 2px; }
.ftec-fresh button { white-space: nowrap; }

/* ── Abas do menu ── */
.ftec-abas { display: flex; gap: 4px; border-bottom: 1px solid var(--ftec-line); margin-bottom: 16px; overflow-x: auto; }
.ftec-aba { border: 0; background: none; padding: 8px 12px; font-size: .84rem; font-weight: 600; color: var(--ftec-muted);
            border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ftec-aba:hover { color: var(--ftec-ink); }
.ftec-aba.ftec-on { color: var(--ftec-ink); border-bottom-color: #a23b36; }

/* ── Avisos (fonte atrasada, leitura que falhou) ── */
.ftec-aviso { display: flex; gap: 12px; align-items: flex-start; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px;
              font-size: .8rem; border: 1px solid; }
.ftec-aviso i { font-size: 1rem; line-height: 1.2; }
.ftec-aviso > div { flex: 1 1 0; min-width: 0; }
.ftec-aviso.warn { background: #fdf6ea; border-color: #f0dcb4; color: #6d4a10; }
.ftec-aviso.danger { background: #fbeeee; border-color: #f0c9c8; color: #7c2725; }
.ftec-aviso.good { background: #edf7f0; border-color: #c4e3cd; color: #1d5a32; }
.ftec-aviso button { margin-left: auto; white-space: nowrap; }
.ftec-aviso small { display: block; opacity: .85; margin-top: 2px; }
/* Conferir no ERP: o botão vira "lendo" sem apagar a ficha que está na tela */
.ftec-vivo-btn[aria-busy="true"] { pointer-events: none; opacity: .7; }
.ftec-recarregando { opacity: .55; transition: opacity .15s; }
@media (max-width: 600px) {
  .ftec-aviso { flex-wrap: wrap; gap: 8px; }
  .ftec-aviso > div { flex-basis: calc(100% - 28px); }
  .ftec-aviso button { margin-left: 28px; }
}

/* ── Filtros: dois grupos (produto, matéria-prima), todos de múltipla escolha.
   No celular ficam recolhidos atrás de um botão que diz quantos estão ativos. ── */
.ftec-filtros-toggle { display: none; }
.ftec-filtros { background: #fff; border: 1px solid var(--ftec-line); border-radius: 10px; padding: 12px 16px; margin-bottom: 12px;
                display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); gap: 12px 24px; }
/* Cada grupo é uma caixa própria com ícone, nome e o que ele filtra: produto
   acabado (vinho) × matéria-prima (azul). A cor só reforça — o nome diz. */
.ftec-fgrupo { min-width: 0; border: 1px solid var(--ftec-line); border-top: 3px solid; border-radius: 8px; padding: 8px 12px 12px; }
.ftec-fgrupo-prod { border-top-color: #a23b36; background: #fdf9f8; }
.ftec-fgrupo-mp   { border-top-color: var(--ftec-info); background: #f5f9fc; }
.ftec-fgrupo-tit { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ftec-fgrupo-tit > div:not(.ftec-modo) { flex: 1 1 180px; min-width: 0; }
.ftec-fgrupo-tit > i { font-size: 1.1rem; line-height: 1; }
.ftec-fgrupo-prod .ftec-fgrupo-tit > i { color: #a23b36; }
.ftec-fgrupo-mp .ftec-fgrupo-tit > i { color: var(--ftec-info); }
.ftec-fgrupo-tit b { display: block; font-size: .84rem; font-weight: 750; color: var(--ftec-ink); }
.ftec-fgrupo-tit small { display: block; font-size: .7rem; color: var(--ftec-muted); }
.ftec-fgrupo-campos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; }
.ftec-modo { display: inline-flex; border: 1px solid #cbd3da; border-radius: 6px; overflow: hidden; margin-left: auto; }
.ftec-modo button { border: 0; background: #fff; font-size: .7rem; padding: 2px 8px; color: var(--ftec-muted); font-weight: 600;
                    text-transform: none; letter-spacing: 0; white-space: nowrap; }
.ftec-modo button + button { border-left: 1px solid #cbd3da; }
.ftec-modo button.ftec-on { background: var(--ftec-info); color: #fff; }

.ftec-ms { position: relative; min-width: 0; }
.ftec-ms-rot { display: block; font-size: .7rem; color: var(--ftec-muted); margin-bottom: 2px; }
.ftec-ms-btn { width: 100%; height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 6px;
               border: 1px solid #cbd3da; border-radius: 6px; background: #fff; padding: 0 8px; font-size: .78rem; color: var(--ftec-ink);
               text-align: left; }
.ftec-ms-btn:hover { border-color: #9aa5ae; }
.ftec-ms-btn:focus-visible { outline: 2px solid var(--ftec-info); outline-offset: 1px; }
.ftec-ms-btn.ftec-on { border-color: var(--ftec-info); color: var(--ftec-info); font-weight: 650; background: var(--ftec-sel); }
.ftec-ms-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ftec-ms-btn i { font-size: .7rem; color: var(--ftec-soft); flex-shrink: 0; }
.ftec-ms-painel { position: absolute; z-index: 1050; top: calc(100% + 4px); left: 0; width: max(100%, 300px); max-width: calc(100vw - 32px);
                  background: #fff; border: 1px solid #cbd3da; border-radius: 8px; box-shadow: 0 8px 24px rgba(36, 49, 59, .16);
                  padding: 8px; }
.ftec-ms-painel.ftec-dir { left: auto; right: 0; }
.ftec-ms-painel.ftec-largo { width: max(100%, 380px); }
.ftec-ms-busca { width: 100%; height: 30px; border: 1px solid #cbd3da; border-radius: 6px; padding: 0 8px; font-size: .78rem; margin-bottom: 6px; }
.ftec-ms-ops { max-height: 280px; overflow-y: auto; }
.ftec-ms-op { display: flex; align-items: flex-start; gap: 8px; padding: 4px 6px; border-radius: 4px; font-size: .78rem; cursor: pointer; margin: 0; }
.ftec-ms-op:hover { background: #f3f5f7; }
.ftec-ms-op input { margin-top: 2px; width: 14px; height: 14px; flex-shrink: 0; }
.ftec-ms-op-txt { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ftec-ms-op-txt small { display: block; color: var(--ftec-soft); font-size: .66rem; }
.ftec-ms-op-n { flex-shrink: 0; color: var(--ftec-muted); font-variant-numeric: tabular-nums; font-size: .72rem; }
.ftec-ms-op.ftec-zero { color: var(--ftec-soft); }
.ftec-ms-vazio { padding: 12px 6px; font-size: .74rem; color: var(--ftec-muted); }
.ftec-ms-rodape { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--ftec-line);
                  margin-top: 6px; padding-top: 6px; font-size: .68rem; color: var(--ftec-soft); }
.ftec-ms-rodape button { border: 0; background: none; color: var(--ftec-info); font-size: .74rem; font-weight: 650; padding: 2px 4px; }

.ftec-ativos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; grid-column: 1 / -1; border-top: 1px dashed var(--ftec-line);
               padding-top: 8px; font-size: .74rem; color: var(--ftec-muted); }
.ftec-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; background: var(--ftec-sel); border: 1px solid #cfe1ee;
             color: #234f70; border-radius: 999px; padding: 2px 4px 2px 10px; font-size: .72rem; }
.ftec-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 38ch; }
.ftec-chip button { border: 0; background: none; color: #234f70; padding: 0 4px; line-height: 1; font-size: .9rem; }
.ftec-limpar { border: 0; background: none; color: var(--ftec-danger); font-weight: 650; font-size: .74rem; padding: 2px 4px; }

/* ── KPIs: (rótulo, valor, legenda, estado) ── */
.ftec-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ftec-kpi { position: relative; background: #fff; border: 1px solid var(--ftec-line); border-radius: 10px; padding: 12px 12px 12px 16px; overflow: hidden; }
.ftec-kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--ftec-info); }
.ftec-kpi.good::before { background: var(--ftec-good); }
.ftec-kpi.warn::before { background: var(--ftec-warn); }
.ftec-kpi.danger::before { background: var(--ftec-danger); }
.ftec-kpi span { display: block; color: var(--ftec-muted); font-size: .72rem; }
.ftec-kpi strong { display: block; margin: 4px 0; font-size: 1.22rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ftec-kpi.good strong { color: var(--ftec-good); }
.ftec-kpi.warn strong { color: var(--ftec-warn); }
.ftec-kpi small { display: block; color: var(--ftec-soft); font-size: .68rem; line-height: 1.35; }

/* ── Cartões de tabela: título, descrição, contador; tabela rola dentro ── */
.ftec-resumos { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.ftec-soma { display: block; }
.ftec-card { background: #fff; border: 1px solid var(--ftec-line); border-radius: 10px; padding: 12px 16px; min-width: 0; }
.ftec-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 8px; }
.ftec-card-head h3 { margin: 0; font-size: .95rem; font-weight: 700; }
.ftec-card-head p { margin: 2px 0 0; font-size: .74rem; color: var(--ftec-muted); max-width: 70ch; }
.ftec-cont { font-size: .72rem; color: var(--ftec-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ftec-card-acoes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ftec-busca { height: 30px; min-width: 220px; border: 1px solid #cbd3da; border-radius: 6px; padding: 0 8px; font-size: .78rem; }
.ftec-rola { overflow-x: auto; max-width: 100%; }
.ftec-rola.ftec-alto { max-height: 360px; overflow-y: auto; }
.ftec-tab { width: 100%; border-collapse: collapse; font-size: .78rem; }
.ftec-tab th { position: sticky; top: 0; background: #f6f8f9; color: var(--ftec-muted); font-weight: 650; font-size: .7rem;
               padding: 6px 8px; border-bottom: 1px solid var(--ftec-line); white-space: nowrap; text-align: left; z-index: 1; }
.ftec-tab td { padding: 6px 8px; border-bottom: 1px solid #eef1f3; vertical-align: top; text-align: left; }
.ftec-tab .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ftec-tab th.ftec-sort { cursor: pointer; user-select: none; }
.ftec-tab th.ftec-sort:hover { color: var(--ftec-ink); }
.ftec-tab th.ftec-sort i { font-size: .62rem; margin-left: 2px; opacity: .45; }
.ftec-tab th.ftec-sorted { color: var(--ftec-ink); }
.ftec-tab th.ftec-sorted i { opacity: 1; }
.ftec-tab tr.ftec-clica { cursor: pointer; }
.ftec-tab tr.ftec-clica:hover td { background: #f6f9fb; }
.ftec-tab tr.ftec-clica:focus-visible td { background: var(--ftec-sel); outline: none; }
.ftec-tab tr.ftec-atual td { background: var(--ftec-sel); }
.ftec-tab td small { display: block; color: var(--ftec-soft); font-size: .66rem; line-height: 1.35; }
.ftec-tab td.num small { white-space: normal; }
.ftec-tab th.ftec-th-quebra { white-space: normal; min-width: 104px; }
.ftec-nome { font-weight: 600; overflow-wrap: anywhere; }
.ftec-col-mp { min-width: 200px; }
.ftec-fab { display: block; max-width: 22ch; overflow-wrap: anywhere; }
.ftec-nada { color: var(--ftec-soft); }
.ftec-op { color: var(--ftec-warn); font-weight: 650; }
.ftec-op i { margin-right: 2px; }

.ftec-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--ftec-bg); border: 1px solid var(--ftec-line); display: block; }
.ftec-thumb-vazio { display: flex; align-items: center; justify-content: center; color: var(--ftec-soft); font-size: 1rem; }
.ftec-col-foto { width: 56px; }
.ftec-abre { border: 0; background: none; color: var(--ftec-muted); padding: 0 2px; font-size: .8rem; }

.ftec-usos { display: flex; flex-direction: column; gap: 2px; min-width: 220px; }
.ftec-uso { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.ftec-uso b { font-weight: 600; }
.ftec-uso .ftec-qtd { color: var(--ftec-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ftec-via { display: inline-flex; align-items: center; gap: 2px; font-size: .66rem; color: #234f70; background: var(--ftec-sel);
            border-radius: 4px; padding: 0 4px; white-space: nowrap; }

/* Ficha aberta na linha */
.ftec-ficha-linha > td { background: var(--ftec-bg); padding: 8px 12px 12px 64px; }
.ftec-ficha { width: 100%; border-collapse: collapse; font-size: .74rem; background: #fff; border: 1px solid var(--ftec-line); border-radius: 6px; }
.ftec-ficha th { background: #fff; color: var(--ftec-muted); font-size: .66rem; font-weight: 650; padding: 4px 8px; border-bottom: 1px solid var(--ftec-line); text-align: left; }
.ftec-ficha td { padding: 4px 8px; border-bottom: 1px solid #f0f2f4; text-align: left; }
.ftec-ficha .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ftec-ficha tr.ftec-dentro td:first-child { padding-left: 24px; }
.ftec-ficha tr.ftec-casa td { background: #fffaf0; }
.ftec-ficha-rodape { font-size: .68rem; color: var(--ftec-soft); margin-top: 6px; }
.ftec-ficha tfoot td { border-top: 1px solid var(--ftec-line); border-bottom: 0; font-weight: 650; padding-top: 6px; }
.ftec-ficha tfoot td small { font-weight: 400; }
.ftec-ja-incluso { color: var(--ftec-soft); }
.ftec-falta-preco, .ftec-tab td small.ftec-falta-preco,
.ftec-difere, .ftec-tab td small.ftec-difere { color: var(--ftec-warn); }
.ftec-falta-preco .bi, .ftec-difere .bi { margin-right: 2px; }

.ftec-mais { display: flex; justify-content: center; gap: 8px; align-items: center; padding: 8px 0 2px; font-size: .74rem; color: var(--ftec-muted); }

/* ── Vazio, erro, carregando ── */
.ftec-vazio { text-align: center; padding: 28px 16px; color: var(--ftec-muted); }
.ftec-vazio i { font-size: 1.6rem; color: var(--ftec-soft); display: block; margin-bottom: 6px; }
.ftec-vazio b { display: block; color: var(--ftec-ink); font-size: .9rem; margin-bottom: 4px; }
.ftec-vazio span { display: block; font-size: .78rem; max-width: 60ch; margin: 0 auto 10px; }
.ftec-vazio .ftec-vazio-acoes { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.ftec-carregando { padding: 40px 16px; text-align: center; color: var(--ftec-muted); font-size: .84rem; }
.ftec-erro { background: #fff; border: 1px solid #f0c9c8; border-left: 4px solid var(--ftec-danger); border-radius: 8px; padding: 16px; }
.ftec-erro b { display: block; color: #7c2725; margin-bottom: 4px; }
.ftec-erro span { display: block; font-size: .8rem; color: var(--ftec-muted); margin-bottom: 10px; }
.ftec-erro details { font-size: .7rem; color: var(--ftec-soft); margin-top: 8px; }

/* ── Procedência: a regra em português ── */
.ftec-metodo { font-size: .72rem; color: var(--ftec-muted); line-height: 1.55; margin-top: 10px; padding-top: 8px; border-top: 1px solid #eef1f3; }
.ftec-como { margin-top: 16px; font-size: .76rem; color: var(--ftec-muted); }
.ftec-como summary { cursor: pointer; font-weight: 650; color: var(--ftec-ink); }
.ftec-como ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.6; }

/* ── Entrada da ficha completa, na lista ── */
.ftec-link { border: 0; background: none; padding: 0; margin-top: 2px; color: var(--ftec-info); font-size: .7rem; font-weight: 650; }
.ftec-link:hover { text-decoration: underline; }
.ftec-link i { font-size: .62rem; }
.ftec-ficha-acoes { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 8px; font-size: .7rem; color: var(--ftec-muted); }
.ftec-img-vazia { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; color: var(--ftec-soft);
                  background: var(--ftec-bg); border: 1px solid var(--ftec-line); }

/* ── Ficha completa de um produto ── */
.ftec-d-barra { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ftec-d-impresso { display: none; }
.ftec-d-sec, .ftec-d-pend { margin-bottom: 16px; }
.ftec-d-hero { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px 24px; margin-bottom: 16px; padding: 16px; }
.ftec-d-hero-foto { min-width: 0; }
.ftec-d-foto { width: 280px; height: 280px; object-fit: contain; border-radius: 8px; background: var(--ftec-bg); border: 1px solid var(--ftec-line); display: block; }
.ftec-d-foto.ftec-img-vazia { font-size: .74rem; text-align: center; padding: 16px; }
.ftec-d-foto.ftec-img-vazia i { font-size: 2rem; }
.ftec-d-minis { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ftec-d-mini { width: 48px; height: 48px; padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; overflow: hidden; }
.ftec-d-mini img, .ftec-d-mini .ftec-img-vazia { width: 100%; height: 100%; object-fit: cover; display: block; border: 0; }
.ftec-d-mini.ftec-on { border-color: var(--ftec-info); }
.ftec-d-hero-info { min-width: 0; }
.ftec-d-nome { margin: 4px 0; font-size: 1.15rem; font-weight: 750; overflow-wrap: anywhere; }
.ftec-d-meta { font-size: .78rem; color: var(--ftec-muted); line-height: 1.5; }
.ftec-d-dados { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 16px; margin: 12px 0; }
.ftec-d-dados div { min-width: 0; }
.ftec-d-dados dt { font-size: .68rem; font-weight: 600; color: var(--ftec-muted); }
.ftec-d-dados dd { margin: 0; font-size: .9rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.ftec-d-dados dd small { display: block; font-size: .64rem; font-weight: 400; color: var(--ftec-soft); }
.ftec-d-obs { font-size: .76rem; background: var(--ftec-bg); border: 1px solid var(--ftec-line); border-radius: 6px; padding: 6px 8px; margin-bottom: 12px; }
.ftec-d-cores-tit { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ftec-muted);
                    display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.ftec-d-cores-tit .ftec-cont { text-transform: none; letter-spacing: 0; font-weight: 400; }
.ftec-d-cores { display: flex; flex-wrap: wrap; gap: 6px; }
.ftec-d-cor { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 6px; align-items: center; text-align: left;
              border: 1px solid #cbd3da; border-radius: 6px; background: #fff; padding: 4px 8px; font-size: .76rem; color: var(--ftec-ink); max-width: 100%; }
.ftec-d-cor small { grid-column: 2; color: var(--ftec-soft); font-size: .64rem; white-space: nowrap; }
.ftec-d-cor:hover { border-color: #9aa5ae; }
.ftec-d-cor.ftec-on { border-color: var(--ftec-info); background: var(--ftec-sel); font-weight: 650; }
.ftec-d-cor.ftec-d-inativa span { color: var(--ftec-soft); text-decoration: line-through; }
.ftec-d-sw { width: 14px; height: 14px; grid-row: span 2; }
.ftec-d-sw rect { stroke: rgba(36, 49, 59, .25); stroke-width: 1; }
.ftec-d-sw-sem rect { fill: #fff; stroke-dasharray: 2 1; }

.ftec-d-pend { border-left: 4px solid var(--ftec-warn); }
.ftec-d-pend-lista { list-style: none; margin: 0; padding: 0; }
.ftec-d-pend-lista li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid #eef1f3; font-size: .8rem; }
.ftec-d-pend-lista li:first-child { border-top: 0; }
.ftec-d-pend-lista li > i { color: var(--ftec-warn); font-size: 1rem; }
.ftec-d-pend-lista li > div { flex: 1 1 auto; min-width: 0; }
.ftec-d-pend-lista small { display: block; color: var(--ftec-muted); font-size: .7rem; overflow-wrap: anywhere; }
.ftec-d-pend-lista li > .btn, .ftec-d-verbo { flex-shrink: 0; white-space: nowrap; }
.ftec-d-verbo { font-size: .74rem; font-weight: 650; color: var(--ftec-warn); }

.ftec-d-tab tr.ftec-d-dentro td { background: #fbfcfd; color: var(--ftec-muted); }
.ftec-d-tab tr.ftec-d-dentro .ftec-nome { font-weight: 500; }
/* subtotal da ficha do componente: fecha o bloco do MPC (matéria-prima + serviços dele) */
.ftec-d-tab tr.ftec-d-subtotal td { background: #f3f6f8; font-weight: 650; border-top: 1px solid var(--ftec-line); }
.ftec-d-tab tr.ftec-d-subtotal small { font-weight: 400; }
.ftec-tab tfoot td { border-top: 1px solid var(--ftec-line); border-bottom: 0; font-weight: 650; padding-top: 8px; }
.ftec-tab tfoot td small { font-weight: 400; }
.ftec-d-grade { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 16px; align-items: start; }
.ftec-d-comp td { padding: 4px 8px; }
.ftec-d-comp tr.ftec-d-total td { font-weight: 700; border-top: 1px solid var(--ftec-line); }
.ftec-d-opcores { display: flex; flex-wrap: wrap; gap: 4px; min-width: 180px; }
.ftec-d-opcor { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--ftec-line); border-radius: 6px; padding: 2px 6px 2px 2px;
                font-size: .7rem; white-space: nowrap; background: #fff; }
.ftec-d-opcor b { font-variant-numeric: tabular-nums; }
.ftec-d-opthumb { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; display: flex; align-items: center; justify-content: center;
                  font-size: .8rem; background: var(--ftec-bg); }
.ftec-tab td small.ftec-d-atraso { color: var(--ftec-danger); font-weight: 650; }
.ftec-tab td.ftec-d-op { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.ftec-tab td.ftec-d-op small { font-weight: 400; }

@media (max-width: 1180px) {
  .ftec-filtros { grid-template-columns: 1fr; }
  .ftec-resumos { grid-template-columns: 1fr; }
  .ftec-d-grade { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .ftec-d-hero { grid-template-columns: 1fr; padding: 12px; }
  .ftec-d-foto { width: 100%; max-width: 240px; height: auto; aspect-ratio: 1; margin: 0 auto; }
  .ftec-d-minis { justify-content: center; }
  .ftec-d-pend-lista li { flex-wrap: wrap; }
  .ftec-d-pend-lista li > .btn, .ftec-d-verbo { margin-left: 28px; }
}

/* ── Folha única (A4 em pé): montada para o papel, medida em pt/mm. Fica fora
   da tela; aparece só na impressão "1 folha" e enquanto o JS mede a altura.
   --ftec-escala (ajustarFolha) reduz tudo até caber; a largura cresce na mesma
   proporção para a folha continuar ocupando os 190 mm úteis. ── */
.ftec-folha { display: none; width: calc(190mm / var(--ftec-escala, 1)); zoom: var(--ftec-escala, 1);
              color: #1d262d; font-size: 8pt; line-height: 1.3; background: #fff; }
body.ftec-medindo .ftec-folha { display: block; position: fixed; left: -10000px; top: 0; zoom: 1; width: 190mm; }
.ftec-f-cab { display: grid; grid-template-columns: 38mm minmax(0, 1fr) auto; gap: 4mm; align-items: start;
              padding-bottom: 3mm; border-bottom: 1.5pt solid #1d262d; }
.ftec-f-foto { width: 38mm; height: 38mm; object-fit: contain; border: .5pt solid #cfd6dc; border-radius: 2mm; display: block; }
.ftec-f-foto.ftec-img-vazia { font-size: 7pt; }
.ftec-f-id { min-width: 0; }
.ftec-f-cod { font-size: 7pt; color: #5d6870; font-weight: 600; letter-spacing: .02em; }
.ftec-f-id h1 { font-size: 12.5pt; font-weight: 800; margin: 1mm 0; line-height: 1.15; }
.ftec-f-meta { font-size: 7.5pt; color: #5d6870; }
.ftec-f-nums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2mm; margin-top: 2.5mm; }
.ftec-f-nums div { border: .5pt solid #cfd6dc; border-radius: 1.5mm; padding: 1.2mm 2mm; }
.ftec-f-nums span, .ftec-f-nums small { display: block; font-size: 6.5pt; color: #5d6870; }
.ftec-f-nums b { display: block; font-size: 10pt; font-variant-numeric: tabular-nums; }
.ftec-f-doc { text-align: right; font-size: 6.5pt; color: #5d6870; display: flex; flex-direction: column; gap: .5mm; }
.ftec-f-doc b { font-size: 8pt; color: #1d262d; text-transform: uppercase; letter-spacing: .06em; }
.ftec-f-pend { margin-top: 2mm; padding: 1.2mm 2mm; border-left: 1mm solid var(--ftec-warn); background: #fdf6ea; font-size: 7.5pt; }
.ftec-f-sec { margin-top: 3mm; break-inside: avoid; }
.ftec-f-sec h2 { font-size: 8.5pt; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 1.2mm; }
.ftec-f-sec h2 small { font-weight: 400; text-transform: none; letter-spacing: 0; color: #5d6870; font-size: 7pt; margin-left: 1mm; }
/* Cores na folha: só amostra + nome (a foto do produto já está no cabeçalho) */
.ftec-f-cores { display: flex; flex-wrap: wrap; gap: 1.2mm; }
.ftec-f-cor { display: inline-flex; align-items: center; gap: 1mm; border: .5pt solid #cfd6dc; border-radius: 1.2mm; padding: .6mm 1.6mm;
              font-size: 7pt; font-weight: 650; white-space: nowrap; }
.ftec-f-cor.ftec-on { border: 1.2pt solid var(--ftec-info); }
.ftec-f-cor small { color: #5d6870; font-size: 6.5pt; font-weight: 400; }
.ftec-f-cor .ftec-d-sw { width: 2.6mm; height: 2.6mm; flex-shrink: 0; }
.ftec-f-tab { width: 100%; border-collapse: collapse; font-size: 7.5pt; }
.ftec-f-tab th { text-align: left; font-size: 6.5pt; font-weight: 700; color: #5d6870; border-bottom: .75pt solid #1d262d; padding: .8mm 1.2mm; }
.ftec-f-tab td { padding: .7mm 1.2mm; border-bottom: .5pt solid #e3e8ec; vertical-align: top; }
.ftec-f-tab td small { color: #7b858d; font-size: 6.5pt; }
.ftec-f-tab .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ftec-f-tab tr.ftec-d-dentro td { color: #5d6870; }
.ftec-f-tab tr.ftec-d-dentro td:first-child { padding-left: 4mm; }
.ftec-f-tab tr.ftec-d-subtotal td { font-weight: 650; border-top: 1px solid #c9d1d8; }
.ftec-f-tab tr.ftec-d-subtotal td:first-child { padding-left: 4mm; }
.ftec-f-tab tfoot td { font-weight: 700; border-top: .75pt solid #1d262d; border-bottom: 0; }
.ftec-f-tab tfoot td small { font-weight: 400; }
.ftec-f-tab td.ftec-d-op { white-space: nowrap; font-weight: 650; }
.ftec-f-duas { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 4mm; }
.ftec-f-atraso { color: var(--ftec-danger); font-weight: 700; white-space: nowrap; }
.ftec-f-vazio { margin: 0; color: #5d6870; font-size: 7.5pt; }
.ftec-d-barra-acoes { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Foto ampliada: fora da .ftec-page (no <body>), por isso cores literais ── */
.ftec-d-foto-btn { position: relative; padding: 0; border: 0; background: none; display: block; cursor: zoom-in; width: fit-content; }
@media (max-width: 760px) { .ftec-d-foto-btn { width: 100%; max-width: 240px; margin: 0 auto; } }
.ftec-d-foto-btn > i { position: absolute; right: 8px; bottom: 8px; background: rgba(255, 255, 255, .9); border: 1px solid #e2e7eb;
                       border-radius: 6px; padding: 2px 6px; font-size: .8rem; color: #24313b; }
.ftec-d-foto-btn:focus-visible { outline: 2px solid #2f6f9f; outline-offset: 2px; border-radius: 8px; }
.ftec-det [data-amp] { cursor: zoom-in; }
.ftec-zoom { position: fixed; inset: 0; z-index: 2000; background: rgba(20, 27, 33, .82); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ftec-zoom-caixa { position: relative; margin: 0; background: #fff; border-radius: 10px; padding: 12px; max-width: min(92vw, 960px);
                   display: flex; flex-direction: column; align-items: center; gap: 8px; }
/* tamanho fixo: a caixa não encolhe enquanto a foto carrega nem pula entre fotos */
.ftec-zoom-vista { width: min(86vw, 900px); height: min(calc(100vh - 168px), 900px); overflow: hidden; background: #fff;
                   touch-action: none; cursor: zoom-in; border-radius: 6px; }
.ftec-zoom-vista.ftec-ampliada { cursor: grab; }
.ftec-zoom-vista.ftec-arrastando { cursor: grabbing; }
.ftec-zoom-vista img { width: 100%; height: 100%; object-fit: contain; display: block; transform-origin: center;
                       transition: transform .08s ease-out; user-select: none; }
.ftec-zoom-vista.ftec-arrastando img { transition: none; }
/* barra de zoom: menos, faixa, mais, porcentagem e Ajustar (volta a 100%) */
.ftec-zoom-barra { display: flex; align-items: center; gap: 8px; width: min(100%, 420px); }
.ftec-zoom-barra button { border: 1px solid #e2e7eb; background: #fff; color: #24313b; border-radius: 6px; height: 32px; min-width: 32px;
                          display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; font-size: .85rem; }
.ftec-zoom-barra button:disabled { color: #b6bec4; cursor: default; }
.ftec-zoom-faixa { flex: 1; min-width: 80px; accent-color: #2f6f9f; }
.ftec-zoom-pct { font-size: .8rem; color: #24313b; min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.ftec-zoom-caixa figcaption { font-size: .8rem; color: #6b747b; text-align: center; overflow-wrap: anywhere; }
.ftec-zoom-fechar, .ftec-zoom-nav { position: absolute; border: 1px solid #e2e7eb; background: #fff; color: #24313b; border-radius: 999px;
                                    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }
.ftec-zoom-fechar { top: -14px; right: -14px; }
.ftec-zoom-nav { top: 50%; transform: translateY(-50%); }
.ftec-zoom-ant { left: -18px; }
.ftec-zoom-prox { right: -18px; }
.ftec-zoom button:focus-visible { outline: 2px solid #2f6f9f; outline-offset: 2px; }
@media (max-width: 600px) {
  .ftec-zoom-fechar { top: 4px; right: 4px; }
  .ftec-zoom-ant { left: 4px; }
  .ftec-zoom-prox { right: 4px; }
}

/* ── Impressão: só a ficha aberta, tabelas inteiras, sem botões ── */
@media print {
  @page { size: A4; margin: 10mm; }
  /* O app rola dentro de .page-content: solto só enquanto a ficha imprime. O resto
     sai com display:none (escondido com visibility, o menu ainda ocuparia altura
     e podia gerar uma folha em branco no fim). */
  body.ftec-imprimindo, body.ftec-imprimindo #appShell, body.ftec-imprimindo .app-body, body.ftec-imprimindo .page-content {
    overflow: visible !important; height: auto !important; display: block !important; padding: 0 !important;
    margin: 0 !important; background: #fff !important; }
  body.ftec-imprimindo > :not(#appShell), body.ftec-imprimindo .app-nav, body.ftec-imprimindo #sidebar,
  body.ftec-imprimindo #navBackdrop, body.ftec-imprimindo #ftec-head, body.ftec-imprimindo .ftec-abas { display: none !important; }
  body.ftec-imprimindo .ftec-page, body.ftec-imprimindo .ftec-corpo { opacity: 1 !important; }
  body.ftec-imprimindo.ftec-1folha .ftec-det { display: none !important; }
  body.ftec-imprimindo.ftec-1folha .ftec-folha { display: block; }
  .ftec-noprint { display: none !important; }
  .ftec-card-head { break-after: avoid; }
  .ftec-d-impresso { display: block; font-size: .7rem; color: var(--ftec-muted); margin-bottom: 8px; }
  .ftec-rola, .ftec-rola.ftec-alto { overflow: visible; max-height: none; }
  .ftec-card, .ftec-kpi { box-shadow: none; break-inside: avoid; }
  .ftec-d-sec { break-inside: auto; }
  .ftec-tab th { position: static; }
  .ftec-tab tr { break-inside: avoid; }
  .ftec-d-hero { grid-template-columns: 200px minmax(0, 1fr); }
  .ftec-d-foto { width: 200px; height: 200px; }
  .ftec-d-grade { grid-template-columns: 1fr; }
  .ftec-kpis { grid-template-columns: repeat(4, 1fr); }
  .ftec-det, .ftec-folha { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 600px) {
  .ftec-head h2 { font-size: 1.25rem; }
  .ftec-head p { display: none; }
  .ftec-fresh { width: 100%; }
  .ftec-filtros { padding: 12px; }
  .ftec-filtros-toggle { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; margin-bottom: 12px; padding: 0 12px;
                         background: #fff; border: 1px solid var(--ftec-line); border-radius: 10px; font-size: .82rem; color: var(--ftec-ink); }
  .ftec-filtros-toggle.ftec-on { border-color: var(--ftec-info); color: var(--ftec-info); font-weight: 650; }
  .ftec-filtros-toggle .bi-chevron-down { margin-left: auto; transition: transform .15s; }
  .ftec-filtros-aberto .ftec-filtros-toggle .bi-chevron-down { transform: rotate(180deg); }
  .ftec-page:not(.ftec-filtros-aberto) .ftec-filtros { display: none; }
  .ftec-fgrupo-campos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ftec-ms-painel, .ftec-ms-painel.ftec-largo, .ftec-ms-painel.ftec-dir { position: fixed; left: 12px; right: 12px; top: 18vh;
                                                                          width: auto; max-width: none; }
  .ftec-ms-ops { max-height: 50vh; }
  .ftec-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ftec-kpi { padding: 8px 8px 8px 12px; }
  .ftec-kpi strong { font-size: 1.05rem; }
  .ftec-card { padding: 12px; }
  .ftec-busca { min-width: 0; width: 100%; }
  .ftec-card-acoes { width: 100%; }
  .ftec-ficha-linha > td { padding-left: 12px; }
}

/* Folha: preço de custo diferente do custo da ficha — borda e texto âmbar, com "≠" no texto */
.ftec-f-nums div.ftec-f-alerta { border-color: var(--ftec-warn); border-width: 1pt; }
.ftec-f-nums div.ftec-f-alerta small { color: var(--ftec-warn); font-weight: 650; }
.ftec-d-dados dd small.ftec-difere { color: var(--ftec-warn); font-weight: 650; }

/* ── Imprimir OP (aba da Ficha Técnica): busca, lista e a folha da OP ──
   A folha é medida em mm/pt para sair igual no papel; na tela aparece como
   uma A4 com borda. Imprime pelo mesmo body.ftec-imprimindo da ficha. */
.ftop-abrir { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--ftec-line);
              border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.ftop-abrir label { font-weight: 650; font-size: .84rem; }
.ftop-abrir small { color: var(--ftec-muted); font-size: .72rem; }
.ftop-input { height: 32px; border: 1px solid #cbd3da; border-radius: 6px; padding: 0 8px; font-size: .82rem; background: #fff; max-width: 100%; }
.ftop-abrir .ftop-input { width: 140px; font-variant-numeric: tabular-nums; }
select.ftop-input { max-width: 280px; }
.ftop-sw { width: 10px; height: 10px; flex-shrink: 0; vertical-align: -1px; }
.ftop-sw rect { stroke: rgba(36, 49, 59, .3); stroke-width: 1; }
.ftop-sw-sem rect { fill: #fff; stroke-dasharray: 2 1; }
/* Entregas por dia e OFs: linha do grupo + itens recuados */
.ftop-grupo-tab tr.ftop-grupo td { background: #f4f6f8; border-top: 1px solid var(--ftec-line); }
.ftop-grupo-tab td.ftop-grupo-nota { color: var(--ftec-soft); font-size: .74rem; }
.ftop-grupo-tab tr.ftop-grupo-item td:first-child { padding-left: 22px; }
.ftop-neg { color: var(--ftec-danger); }
/* Grade entregue: colunas de tamanho sob um título de grupo */
.ftec-tab th.ftop-tam-grupo { text-align: center; border-bottom: 1px solid var(--ftec-line); }
.ftec-tab .ftop-tam { min-width: 38px; padding-left: 4px; padding-right: 4px; }
.ftec-tab td.ftop-tam-falta { background: #fdf6ea; }
.ftec-tab td.ftop-tam-falta small { display: block; color: var(--ftec-warn); font-weight: 650; white-space: nowrap; }
.ftop-falta-lista { margin-bottom: 10px; padding: 2px 12px; border-left: 4px solid var(--ftec-warn); background: #fffaf2; border-radius: 4px; }

.ftop-folha { background: #fff; border: 1px solid var(--ftec-line); width: 100%; max-width: 210mm; margin: 0 auto; padding: 10mm;
              color: #1d262d; font-size: 9pt; line-height: 1.3; }
.ftop-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 4mm; border-bottom: 1.5pt solid #1d262d; padding-bottom: 2mm; }
.ftop-empresa b { display: block; font-size: 10.5pt; }
.ftop-empresa span { font-size: 8.5pt; color: #5d6870; text-transform: uppercase; letter-spacing: .04em; }
.ftop-num { text-align: right; }
.ftop-num span { font-size: 8pt; color: #5d6870; margin-right: 1mm; }
.ftop-num b { font-size: 20pt; font-weight: 800; font-variant-numeric: tabular-nums; }
.ftop-num small { display: block; font-size: 8pt; color: #5d6870; }
.ftop-dados { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 2mm 4mm; margin: 3mm 0 0; }
.ftop-dados div { min-width: 0; }
.ftop-dados dt { font-size: 7pt; color: #5d6870; font-weight: 600; }
.ftop-dados dd { margin: 0; font-size: 9.5pt; font-weight: 700; overflow-wrap: anywhere; }
.ftop-dados dd small { display: block; font-size: 7pt; font-weight: 400; color: #5d6870; }
.ftop-dados dd small.ftop-atraso, .ftop-atraso { color: var(--ftec-danger); font-weight: 700; }
.ftop-prod { display: grid; grid-template-columns: 40mm minmax(0, 1fr); gap: 5mm; margin-top: 4mm; padding: 3mm 0; border-top: .5pt solid #cfd6dc; border-bottom: .5pt solid #cfd6dc; }
.ftop-prod-foto small { display: block; font-size: 6.5pt; color: var(--ftec-warn); margin-top: 1mm; }
.ftop-foto { width: 40mm; height: 40mm; object-fit: contain; border: .5pt solid #cfd6dc; border-radius: 2mm; display: flex; background: #fff; font-size: 14pt; }
.ftop-cod { font-size: 8pt; font-weight: 700; color: #5d6870; }
.ftop-prod-id h1 { font-size: 14pt; font-weight: 800; margin: 1mm 0; line-height: 1.15; overflow-wrap: anywhere; }
.ftop-meta { font-size: 8pt; color: #5d6870; }
.ftop-totais { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2mm; margin-top: 3mm; }
.ftop-totais div { border: .5pt solid #cfd6dc; border-radius: 1.5mm; padding: 1.5mm 2mm; }
.ftop-totais span { display: block; font-size: 7pt; color: #5d6870; }
.ftop-totais b { font-size: 12pt; font-variant-numeric: tabular-nums; }
.ftop-sec { margin-top: 4mm; }
.ftop-sec h2 { font-size: 9.5pt; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 1.5mm; break-after: avoid; }
.ftop-nota { font-size: 7.5pt; color: #5d6870; margin: -.5mm 0 1.5mm; }
.ftop-tab { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
.ftop-tab th { text-align: left; font-size: 7pt; font-weight: 700; color: #5d6870; border-bottom: .75pt solid #1d262d; padding: 1mm 1.5mm; }
.ftop-tab td { padding: .8mm 1.5mm; border-bottom: .5pt solid #e3e8ec; vertical-align: middle; }
.ftop-tab td small { display: block; font-size: 7pt; color: #7b858d; }
.ftop-tab .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ftop-tab tfoot td { font-weight: 800; border-top: .75pt solid #1d262d; border-bottom: 0; }
.ftop-tab tr { break-inside: avoid; }
.ftop-col-foto { width: 11mm; }
.ftop-sem-foto .ftop-col-foto { display: none; }
.ftop-thumb { width: 9mm; height: 9mm; object-fit: contain; border: .5pt solid #e3e8ec; border-radius: 1mm; display: flex; background: #fff; font-size: 8pt; }
.ftop-thumb-p { width: 7mm; height: 7mm; margin-left: 2mm; }
.ftop-cor { display: inline-flex; align-items: center; gap: 1.5mm; white-space: nowrap; }
.ftop-tab tr.ftop-tem-cor td { border-bottom: 0; }
.ftop-tab tr.ftop-sub td { font-size: 8pt; color: #36434d; padding-top: .4mm; padding-bottom: .4mm; }
.ftop-obs-txt { min-height: 10mm; border: .5pt solid #cfd6dc; border-radius: 1.5mm; padding: 1.5mm 2mm; font-size: 8.5pt; }
.ftop-assina { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 6mm; margin-top: 8mm; }
.ftop-obs { break-inside: avoid; }
.ftop-assina div { border-top: .75pt solid #1d262d; padding-top: 1mm; font-size: 7pt; color: #5d6870; }
.ftop-impresso { margin-top: 4mm; font-size: 6.5pt; color: #7b858d; text-align: right; }

@media (max-width: 760px) {
  .ftop-folha { padding: 12px; font-size: 8pt; }
  .ftop-dados { grid-template-columns: 1fr 1fr; }
  .ftop-dados .ftop-largo { grid-column: 1 / -1; }
  .ftop-prod { grid-template-columns: 1fr; }
  .ftop-foto { width: 100%; max-width: 200px; height: auto; aspect-ratio: 1; }
  .ftop-assina { grid-template-columns: 1fr; gap: 8mm; }
  .ftop-folha .ftop-tab { display: block; overflow-x: auto; }
}
@media print {
  body.ftec-imprimindo .ftop-folha { border: 0; padding: 0; max-width: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Imprimir OP: grade de tamanhos e encaixe em 1 folha (--ftop-escala vem de ajustarUmaFolha) */
.ftop-tab .ftop-tam { width: 7mm; padding-left: .8mm; padding-right: .8mm; text-align: center; }
.ftop-tab th.ftop-tam { border-left: .5pt solid #e3e8ec; }
.ftop-tab td.ftop-tam { border-left: .5pt solid #f0f2f4; }
.ftop-zero { color: #b6bec4; }
body.ftop-medindo .ftop-folha { position: fixed; left: -10000px; top: 0; width: 190mm; max-width: none; padding: 0; border: 0; zoom: 1; }
@media print {
  body.ftec-imprimindo .ftop-folha { zoom: var(--ftop-escala, 1); width: calc(190mm / var(--ftop-escala, 1)); }
}

/* ── Imprimir OP: tela completa da OP e janela de impressão por cima ── */
.ftop-hero { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px 24px; padding: 16px; margin-bottom: 16px; }
.ftop-hero-foto { position: relative; width: 200px; height: 200px; padding: 0; border: 1px solid var(--ftec-line); border-radius: 8px;
                  background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; }
.ftop-hero-foto img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ftop-hero-foto > i { position: absolute; right: 6px; bottom: 6px; background: rgba(255, 255, 255, .9); border: 1px solid var(--ftec-line);
                      border-radius: 6px; padding: 2px 6px; font-size: .8rem; color: var(--ftec-ink); }
span.ftop-hero-foto { cursor: default; flex-direction: column; gap: 4px; font-size: .74rem; }
.ftop-hero-foto:focus-visible { outline: 2px solid var(--ftec-info); outline-offset: 2px; }
.ftop-hero-info { min-width: 0; }
.ftop-estado { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1px solid; margin: 2px 0 4px; }
.ftop-estado.good { color: var(--ftec-good); border-color: #b9dcc9; background: #eef8f2; }
.ftop-estado.warn { color: var(--ftec-warn); border-color: #f0dcb4; background: #fdf6ea; }
.ftop-estado.danger { color: var(--ftec-danger); border-color: #f0c9c8; background: #fbeeee; }
.ftop-estado.neutral { color: var(--ftec-muted); border-color: var(--ftec-line); background: var(--ftec-bg); }
.ftop-sec-tela { margin-bottom: 16px; }
[data-op-zoom] { cursor: zoom-in; }

.ftop-modal { position: fixed; inset: 0; z-index: 1900; background: rgba(20, 27, 33, .6); overflow: auto; padding: 24px 16px; }
.ftop-modal[hidden] { display: none; }
.ftop-modal-caixa { max-width: calc(210mm + 2px); margin: 0 auto; }
.ftop-modal-barra { position: sticky; top: -24px; z-index: 1; display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; background: #fff;
                    border-radius: 10px 10px 0 0; padding: 10px 16px; border-bottom: 1px solid var(--ftec-line); }
.ftop-modal-acoes { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.ftop-modal-barra small { flex-basis: 100%; color: var(--ftec-muted); font-size: .7rem; }
.ftop-modal .ftop-folha { border-radius: 0 0 10px 10px; }
body.ftop-modal-aberto .page-content { overflow: hidden; }

@media (max-width: 760px) {
  .ftop-hero { grid-template-columns: 1fr; padding: 12px; }
  .ftop-hero-foto { width: 100%; max-width: 220px; height: auto; aspect-ratio: 1; margin: 0 auto; }
  .ftop-modal { padding: 8px; }
}
/* Janela aberta de outra tela (ficha completa), presa ao <body> fora do app */
.ftop-solto-msg { background: #fff; border-radius: 0 0 10px 10px; padding: 24px 16px; }
@media print {
  /* id na regra: vence o "body.ftec-imprimindo > :not(#appShell)" que esconde o que está fora do app */
  body.ftec-imprimindo.ftop-solto #appShell { display: none !important; }
  body.ftec-imprimindo.ftop-solto > div#ftop-solto.ftop-modal-solto { display: block !important; }
}
@media print {
  body.ftec-imprimindo .ftop-tela, body.ftec-imprimindo .ftop > .ftec-d-barra { display: none !important; }
  body.ftec-imprimindo .ftop-modal { position: static; background: none; padding: 0; overflow: visible; }
  body.ftec-imprimindo .ftop-modal-caixa { max-width: none; }
}

/* ── Custo × fornecedor: ficha de produto pronto × preço do fornecedor da OP ── */
.ftcu-recarregando { opacity: .55; transition: opacity .15s; }
.ftcu-pend { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: .82rem; }
.ftcu-pend > i { color: var(--ftec-warn); font-size: 1.1rem; }
.ftcu-pend > div { flex: 1 1 auto; min-width: 0; }
.ftcu-pend small { display: block; color: var(--ftec-muted); font-size: .72rem; margin-top: 2px; }
.ftcu-pend > .btn { flex-shrink: 0; white-space: nowrap; }
.ftcu-filtros { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ftcu-sits { display: inline-flex; flex-wrap: wrap; border: 1px solid #cbd3da; border-radius: 6px; overflow: hidden; }
.ftcu-sits button { border: 0; background: #fff; font-size: .74rem; padding: 5px 10px; color: var(--ftec-muted); font-weight: 600; white-space: nowrap; }
.ftcu-sits button + button { border-left: 1px solid #cbd3da; }
.ftcu-sits button.ftec-on { background: var(--ftec-info); color: #fff; }
.ftcu-sits button:focus-visible { outline: 2px solid var(--ftec-info); outline-offset: -2px; }
.ftcu-filtros .btn { margin-left: auto; }
.ftcu-tab .ftcu-ops { white-space: nowrap; }
.ftcu-tab .ftcu-prod { min-width: 240px; }
.ftcu-tab .ftcu-forn { min-width: 150px; }
.ftcu-tab .ftcu-ops small { display: inline; }
.ftcu-falta { color: var(--ftec-warn); font-weight: 650; }
.ftcu-selo { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 650; padding: 1px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.ftcu-selo-dif { color: var(--ftec-warn); border-color: #f0dcb4; background: #fdf6ea; }
.ftcu-selo-sem { color: var(--ftec-danger); border-color: #f0c9c8; background: #fbeeee; }
.ftcu-selo-ok { color: var(--ftec-good); border-color: #b9dcc9; background: #eef8f2; }
/* KPIs clicáveis filtram a lista; tolerância editável; tipo do fornecedor (pronto × mão de obra) */
button.ftcu-kpi { text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; }
button.ftcu-kpi:focus-visible { outline: 2px solid var(--ftec-info); outline-offset: 1px; }
button.ftcu-kpi.ftec-on { border-color: var(--ftec-info); box-shadow: 0 0 0 1px var(--ftec-info) inset; }
.ftcu-tol { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .74rem; font-weight: 650; color: var(--ftec-muted); white-space: nowrap; }
.ftcu-tol input { width: 76px; padding: 4px 6px; border: 1px solid #cbd3da; border-radius: 6px; text-align: right; font-size: .82rem;
                  font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ftec-ink); }
.ftcu-tol input:focus-visible { outline: 2px solid var(--ftec-info); outline-offset: 1px; }
.ftcu-tol-ajuda { margin: -4px 0 8px; font-size: .7rem; color: var(--ftec-muted); }
.ftcu-tab .ftcu-ops small.ftcu-pecas { display: block; }
.ftcu-tipo { display: block; margin-top: 2px; font-size: .7rem; color: var(--ftec-muted); }
.ftcu-tipo-sem { color: var(--ftec-warn); font-weight: 650; }
.ftcu-tipo-btns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ftcu-tipo-btns .btn { padding: 1px 8px; font-size: .72rem; white-space: nowrap; }
@media (max-width: 760px) {
  .ftcu-pend { flex-wrap: wrap; }
  .ftcu-filtros .btn { margin-left: 0; }
  .ftcu-filtros .ftec-busca { min-width: 0; flex: 1 1 100%; }
}

/* Preço no cadastro de fornecimento: grava no ERP (alterar, incluir, igualar o fornecedor 1) */
.ftfo-acoes { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.ftfo-acoes .btn { padding: 1px 8px; font-size: .72rem; white-space: nowrap; }
.ftfo-gravado { display: block; margin-top: 2px; font-size: .7rem; font-weight: 650; color: var(--ftec-good); white-space: nowrap; }
.ftfo-f1-falta { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: 8px; padding: 8px 12px; border-radius: 8px;
                 font-size: .78rem; background: #fdf6ea; border: 1px solid #f0dcb4; color: #6d4a10; }
.ftfo-f1-falta > span { flex: 1 1 280px; min-width: 0; }
.ftfo-f1-falta .btn { white-space: nowrap; }
/* diálogo */
.ftfo-de-para { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ftfo-de-para div { border: 1px solid #e3e8ec; border-radius: 6px; padding: 6px 10px; }
.ftfo-de-para span { display: block; font-size: .7rem; color: var(--ftec-muted); }
.ftfo-de-para strong { font-size: .95rem; font-variant-numeric: tabular-nums; }
.ftfo-valor { max-width: 160px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.ftfo-sugestoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ftfo-sugestoes .btn { padding: 1px 8px; font-size: .74rem; }
.ftfo-escolhido { font-size: .8rem; font-weight: 650; }
.ftfo-escolhido small { font-weight: 400; color: var(--ftec-muted); margin-left: 6px; }
.ftfo-aviso-erp { font-size: .74rem; color: var(--ftec-muted); }
@media (max-width: 560px) { .ftfo-de-para { grid-template-columns: 1fr; } }

/* Cadastro do produto no topo da ficha: preço, coleção e cor nova (grava no ERP) */
.ftca-link { background: none; border: none; padding: 0 0 0 6px; font-size: .74rem; font-weight: 650; color: var(--ftec-info);
             cursor: pointer; white-space: nowrap; vertical-align: baseline; }
.ftca-link:hover { text-decoration: underline; }
.ftca-link:focus-visible { outline: 2px solid var(--ftec-info); outline-offset: 1px; border-radius: 3px; }
.ftca-link .bi { margin-right: 2px; }
.ftca-cores-tit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ftca-cores-tit .btn { padding: 1px 8px; font-size: .72rem; text-transform: none; letter-spacing: 0; font-weight: 500; }
.ftca-gravado { display: block; font-size: .7rem; font-weight: 650; color: var(--ftec-good); }
.ftca-novas { margin-top: 8px; display: grid; gap: 6px; }
.ftca-nova { padding: 6px 10px; border-radius: 8px; font-size: .76rem; background: #edf7f0; border: 1px solid #c4e3cd; color: #1d5a32; }
.ftca-nova code { font-size: .74rem; color: inherit; }
.ftca-nova small { display: block; opacity: .85; }
/* diálogos */
.ftca-linha2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ftca-linha2 input { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.ftca-atual { display: block; font-size: .7rem; color: var(--ftec-muted); margin-top: 2px; }
.ftca-proprias { border: 1px solid #f0dcb4; background: #fdf6ea; border-radius: 6px; padding: 8px 10px; font-size: .76rem; color: #6d4a10; }
.ftca-proprias label { display: flex; gap: 6px; align-items: flex-start; font-weight: 400; margin: 4px 0 0; color: inherit; font-size: .76rem; }
.ftca-proprias table { width: 100%; margin-top: 6px; font-size: .74rem; }
.ftca-proprias td { padding: 2px 4px; }
.ftca-proprias td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ftca-previa { font-size: .78rem; }
.ftca-previa code { font-size: .78rem; }
/* promoção no topo e no diálogo de preços */
.ftca-promo-val { display: block; font-size: .7rem; font-weight: 650; color: #8a3b12; }
.ftca-promo-val .bi, .ftca-promo-on .bi { margin-right: 2px; }
.ftca-promo-on { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  background: #fdeee4; color: #8a3b12; border: 1px solid #f2c9ad; }
.ftca-promo-off { font-weight: 500; color: var(--ftec-muted); }
.ftca-bloco { border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 6px; padding: 8px 10px; margin: 0; display: grid; gap: 8px; }
/* .bon-form label (diálogo comum) põe display:block e negrito em todo label */
.bon-form .ftca-flag { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-weight: 400; color: inherit; cursor: pointer; }
.ftca-flag input { margin-top: 3px; flex: none; width: 15px; height: 15px; }
.ftca-flag b { display: block; font-size: .82rem; color: #222; }
.ftca-flag small { display: block; font-size: .72rem; font-weight: 400; color: var(--ftec-muted); }
.ftca-promo-campos input { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.ftca-nota { margin: 0; font-size: .74rem; color: #6d4a10; }
.ftca-agenda-campo { display: grid; gap: 2px; max-width: 260px; }
.ftca-agenda-campo label { font-size: .76rem; margin: 0; }
/* ajustes agendados no topo da ficha */
.ftca-agendas { margin-top: 8px; display: grid; gap: 6px; }
.ftca-ag { display: flex; align-items: flex-start; gap: 8px; padding: 6px 10px; border-radius: 8px; font-size: .76rem;
  background: #eef4fb; border: 1px solid #c9dbef; color: #1b3f66; }
.ftca-ag > .bi { flex: none; margin-top: 2px; }
.ftca-ag > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ftca-ag small { display: block; opacity: .85; }
.ftca-ag .btn { flex: none; padding: 1px 8px; font-size: .72rem; }
.ftca-ag-ok { background: #edf7f0; border-color: #c4e3cd; color: #1d5a32; }
.ftca-ag-warn { background: #fdf6ea; border-color: #f0dcb4; color: #6d4a10; }
.ftca-ag-erro { background: #fdeeee; border-color: #f1c4c4; color: #8a1f1f; }
.ftca-ag-off { background: #f4f4f5; border-color: #e1e1e4; color: #5d5d66; }
.ftca-ag-motivo { font-weight: 650; opacity: 1 !important; }
@media (max-width: 560px) { .ftca-linha2 { grid-template-columns: 1fr; } .ftca-agenda-campo { max-width: none; } }

/* Preços do produto: opções compactas, campos alinhados e confirmação sempre visível. */
.ftca-precos-modal { --ftec-muted: #64748b; --ftec-ink: #243449; }
.ftca-precos-modal .modal-dialog { width: calc(100% - 32px); max-width: 600px; margin: 24px auto; }
.ftca-precos-modal .modal-dialog-scrollable { height: calc(100% - 48px); }
.ftca-precos-modal .modal-content { border: 0; border-radius: 12px; }
.ftca-precos-modal form { display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 48px); overflow: hidden; }
.ftca-precos-modal .modal-header { align-items: flex-start; flex-shrink: 0; padding: 16px 20px; background: #f8fafc; }
.ftca-precos-modal .modal-title { min-width: 0; color: var(--ftec-ink); font-size: 1.08rem; font-weight: 700; }
.ftca-precos-produto { display: block; margin-top: 4px; color: var(--ftec-muted); font-size: .74rem; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.ftca-precos-modal .btn-close { margin-top: 0; }
.ftca-precos-modal .modal-body { min-height: 0; padding: 16px 20px; overflow-y: auto; }
.ftca-precos-modal .bon-form { gap: 12px; }
.ftca-precos-modal .ftca-linha2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ftca-precos-modal .ftca-linha2 > div { min-width: 0; }
.ftca-precos-modal .bon-form label { color: #526175; line-height: 1.35; }
.ftca-precos-modal .form-control { min-width: 0; min-height: 38px; border-radius: 6px; border-color: #cbd5e1; font-size: .96rem; }
.ftca-precos-modal .ftca-atual { color: var(--ftec-muted); font-size: .7rem; margin-top: 4px; }
.ftca-precos-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 10px; }
.ftca-precos-section-head h6 { margin: 0; font-size: .82rem; font-weight: 700; color: var(--ftec-ink); }
.ftca-precos-section-head > span { color: var(--ftec-muted); font-size: .72rem; }
.ftca-precos-section-head > span > b { color: #526175; font-weight: 600; margin-left: 4px; }
.ftca-precos-modal .ftca-bloco { padding: 12px; gap: 12px; border: 1px solid #dbe3ec; border-radius: 8px; background: #f8fafc; }
.ftca-precos-modal .ftca-bloco.is-active { background: #f5f9ff; border-color: #bfd4f2; }
.ftca-precos-modal .ftca-flag { justify-content: space-between; align-items: center; padding-left: 0; gap: 12px; }
.ftca-precos-modal .ftca-flag b { color: var(--ftec-ink); font-size: .83rem; font-weight: 700; }
.ftca-precos-modal .ftca-flag small { margin-top: 2px; color: var(--ftec-muted); font-size: .72rem; }
.ftca-precos-modal .ftca-flag .form-check-input { float: none; width: 36px; height: 20px; margin: 0; cursor: pointer; }
.ftca-precos-modal .ftca-promo-campos { border-top: 1px solid #dbe5f1; padding-top: 10px; }
.ftca-precos-modal .ftca-agenda-campo { max-width: none; gap: 4px; }
.ftca-precos-modal .ftca-agenda-campo input { width: 100%; }
.ftca-precos-modal .ftca-proprias { border-radius: 8px; padding: 10px 12px; }
.ftca-precos-cores-table { max-width: 100%; overflow-x: auto; }
.ftca-precos-modal .ftca-proprias label { color: inherit; margin: 8px 0 0; cursor: pointer; }
.ftca-precos-modal .ftca-proprias input { margin-top: 2px; }
.ftca-precos-aviso { margin: 0; font-size: .73rem; line-height: 1.5; color: var(--ftec-muted); }
.ftca-precos-modal .modal-footer { flex-shrink: 0; padding: 12px 20px; gap: 8px; background: #f8fafc; }
.ftca-precos-modal .modal-footer .btn { min-height: 36px; margin: 0; padding: 6px 14px; font-size: .81rem; }
@media (max-width: 575.98px) {
  .ftca-precos-modal .modal-dialog { width: calc(100% - 16px); margin: 8px auto; }
  .ftca-precos-modal .modal-dialog-scrollable { height: calc(100% - 16px); }
  .ftca-precos-modal form { max-height: calc(100dvh - 16px); }
  .ftca-precos-modal .modal-header, .ftca-precos-modal .modal-body { padding: 12px 14px; }
  .ftca-precos-modal .modal-footer { padding: 10px 14px; }
  .ftca-precos-modal .ftca-linha2 { gap: 10px; }
  .ftca-precos-modal .ftca-bloco { padding: 10px; }
  .ftca-precos-modal .bon-form label { font-size: .72rem; }
  .ftca-precos-modal .ftca-proprias tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ftca-precos-modal .ftca-proprias td { display: block; font-size: .7rem; }
  .ftca-precos-modal .ftca-proprias td:first-child, .ftca-precos-modal .ftca-proprias td:nth-child(4) { grid-column: 1 / -1; text-align: left; }
}

/* Materiais da ficha: incluir, alterar/trocar e remover linha — grava no ERP pela ficha completa.
   O diálogo abre no <body>, fora de .ftec-page: as cores vêm declaradas no próprio modal. */
.ftmt-modal { --ftec-muted: #6b747b; --ftmt-ink: #24313b; --ftmt-muted: #6b747b; --ftmt-line: #e2e7eb; --ftmt-good: #147a4b;
  --ftmt-warn: #9b6414; --ftmt-danger: #bd3d3a; --ftmt-info: #2f6f9f; --ftmt-bg: #f8fafb; }
.ftmt-lendo { display: flex; gap: 8px; align-items: center; font-size: .8rem; color: var(--ftmt-muted); padding: 8px 0; }
.ftmt-material { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between;
  border: 1px solid var(--ftmt-line); border-radius: 6px; padding: 8px 10px; background: var(--ftmt-bg); }
.ftmt-material > div { min-width: 0; }
.ftmt-material b { display: block; font-size: .86rem; color: var(--ftmt-ink); overflow-wrap: anywhere; }
.ftmt-material small { display: block; font-size: .72rem; color: var(--ftmt-muted); }
.ftmt-material .bon-link { flex: none; }
.ftmt-de { font-size: .72rem; color: var(--ftmt-muted); margin-top: 4px; }
.ftmt-qtd { display: grid; grid-template-columns: minmax(0, 180px) auto; gap: 8px; align-items: center; justify-content: start; }
.ftmt-qtd input { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.ftmt-un { font-size: .8rem; font-weight: 650; color: var(--ftmt-ink); }
.ftmt-ajuda { display: block; font-size: .72rem; color: var(--ftmt-muted); margin-top: 2px; }
.ftmt-cores { border: 1px solid var(--ftmt-line); border-radius: 6px; padding: 8px 10px; display: grid; gap: 6px; }
.ftmt-cores-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ftmt-cores-head b { font-size: .8rem; color: var(--ftmt-ink); }
.ftmt-cores-grade { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); gap: 6px 10px; align-items: center;
  max-height: 240px; overflow: auto; }
.bon-form label.ftmt-cor { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .78rem; font-weight: 500;
  color: var(--ftmt-ink); min-width: 0; }
.ftmt-cor span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftmt-cor svg { width: 12px; height: 12px; flex: none; }
.ftmt-cores-grade select { font-size: .76rem; }
.ftmt-previa { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ftmt-previa > div { border: 1px solid var(--ftmt-line); border-radius: 6px; padding: 6px 10px; min-width: 0; }
.ftmt-previa span { display: block; font-size: .7rem; color: var(--ftmt-muted); }
.ftmt-previa strong { display: block; font-size: .92rem; font-variant-numeric: tabular-nums; color: var(--ftmt-ink); }
.ftmt-previa small { display: block; font-size: .7rem; color: var(--ftmt-muted); font-variant-numeric: tabular-nums; }
.ftmt-neg { color: var(--ftmt-danger); }
.ftmt-avisos { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ftmt-avisos:empty { display: none; }
.ftmt-avisos li { display: flex; gap: 6px; align-items: flex-start; font-size: .74rem; padding: 6px 8px; border-radius: 6px;
  background: #fdf6ea; border: 1px solid #f0dcb4; color: #6d4a10; }
.ftmt-avisos li .bi { flex: none; margin-top: 1px; }
.ftmt-avisos li.ftmt-info { background: #eef4fb; border-color: #c9dbef; color: #1b3f66; }
.bon-form .ftmt-flag { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-weight: 400; color: inherit;
  cursor: pointer; font-size: .76rem; }
.ftmt-flag input { margin-top: 2px; flex: none; }
.ftmt-erp { font-size: .74rem; color: var(--ftmt-muted); margin: 0; }
.ftmt-remover p { margin: 0 0 6px; font-size: .82rem; }
/* tabela de materiais da ficha completa */
.ftec-tab .ftmt-col-acoes { width: 68px; text-align: right; white-space: nowrap; padding-left: 4px; }
.ftmt-acao { border: 1px solid transparent; background: none; width: 30px; height: 30px; border-radius: 6px;
  color: var(--ftec-muted); padding: 0; }
.ftmt-acao:hover { background: var(--ftec-sel); color: var(--ftec-info); border-color: #c9dbef; }
.ftmt-acao:focus-visible { outline: 2px solid var(--ftec-info); outline-offset: 1px; }
.ftmt-acao-perigo:hover { color: var(--ftec-danger); background: #fdf3f3; border-color: #f1c9c7; }
.ftmt-gravado { font-size: .7rem; font-weight: 650; color: var(--ftec-good); }
.ftmt-hist { margin: 8px 0 0; padding: 8px 10px; border: 1px solid var(--ftec-line); border-radius: 8px; background: var(--ftec-bg);
  font-size: .74rem; }
.ftmt-hist > b { font-size: .76rem; }
.ftmt-hist ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.ftmt-hist li { color: var(--ftec-ink); }
.ftmt-hist small { color: var(--ftec-muted); }
.ftmt-hist-erro { color: var(--ftec-warn); }
/* tela estreita: a tabela rola dentro do card; alterar/remover ficam presos na borda direita */
@media (max-width: 760px) {
  .ftec-d-tab .ftmt-col-acoes { position: sticky; right: 0; z-index: 1; background: #fff; box-shadow: -6px 0 6px -6px rgba(36, 49, 59, .35); }
  .ftec-d-tab th.ftmt-col-acoes { background: #f6f8f9; z-index: 2; }
  .ftec-d-tab tr.ftec-d-subtotal td.ftmt-col-acoes { background: #f3f6f8; }
  #ftec-d-mat .ftec-cont { white-space: normal; }
}
@media (max-width: 560px) {
  .ftmt-previa { grid-template-columns: 1fr; }
  .ftmt-cores-grade { grid-template-columns: 1fr; max-height: none; overflow: visible; }   /* o quadro já rola */
  .ftmt-acao { width: 36px; height: 36px; }
  .ftec-tab .ftmt-col-acoes { width: 80px; }
}
@media print { .ftmt-hist, .ftmt-col-acoes { display: none; } }

/* Recalcular o total da ficha no ERP — uma ficha (ficha completa) ou em lote (lista com o
   filtro "Desatualizado"). Os quadros abrem no <body>: herdam as cores de .ftmt-modal. */
/* .bon-form é grid: sem min-width 0 o corpo cresce até a tabela e o quadro rola de lado na tela estreita */
.ftrc-corpo { min-width: 0; display: grid; gap: 8px; }
.ftrc-corpo > * { min-width: 0; }
.ftrc-comp { width: 100%; border-collapse: collapse; font-size: .78rem; font-variant-numeric: tabular-nums; }
.ftrc-comp th, .ftrc-comp td { padding: 4px 8px; border-bottom: 1px solid var(--ftmt-line); }
.ftrc-comp th { font-size: .68rem; font-weight: 650; color: var(--ftmt-muted); text-transform: uppercase; letter-spacing: .02em; }
.ftrc-comp th:first-child, .ftrc-comp td:first-child { text-align: left; }
.ftrc-comp th:not(:first-child), .ftrc-comp td:not(:first-child) { text-align: right; white-space: nowrap; }
.ftrc-comp tr.ftrc-total td { font-weight: 750; color: var(--ftmt-ink); border-bottom-width: 2px; }
.ftrc-sec { font-size: .78rem; font-weight: 700; color: var(--ftmt-ink); margin: 10px 0 4px; }
.ftrc-sec small { font-weight: 400; color: var(--ftmt-muted); }
.ftrc-linhas { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: .74rem; }
.ftrc-linhas li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dashed var(--ftmt-line); }
.ftrc-linhas li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.ftrc-linhas li > span:last-child { flex: none; font-variant-numeric: tabular-nums; text-align: right; }
.ftrc-nada { font-size: .74rem; color: var(--ftmt-muted); margin: 0; }
.ftrc-bloq { display: flex; gap: 6px; align-items: flex-start; font-size: .76rem; padding: 8px 10px; border-radius: 6px;
  background: #fdf3f3; border: 1px solid #f1c9c7; color: #7a2522; }
.ftrc-bloq .bi { flex: none; margin-top: 1px; }
/* lote: quatro números, cada um no seu campo */
.ftrc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ftrc-kpi { border: 1px solid var(--ftmt-line); border-left: 4px solid var(--ftmt-line); border-radius: 6px; padding: 6px 10px; min-width: 0; }
.ftrc-kpi span { display: block; font-size: .68rem; color: var(--ftmt-muted); }
.ftrc-kpi strong { display: block; font-size: 1rem; font-variant-numeric: tabular-nums; color: var(--ftmt-ink); }
.ftrc-kpi small { display: block; font-size: .68rem; color: var(--ftmt-muted); font-variant-numeric: tabular-nums; }
.ftrc-kpi.ftrc-good { border-left-color: var(--ftmt-good); }
.ftrc-kpi.ftrc-warn { border-left-color: var(--ftmt-warn); }
.ftrc-kpi.ftrc-danger { border-left-color: var(--ftmt-danger); }
.ftrc-kpi.ftrc-neutral { border-left-color: var(--ftmt-info); }
.ftrc-rola { max-height: 260px; overflow: auto; border: 1px solid var(--ftmt-line); border-radius: 6px; }
/* lote do recálculo: todas as que mudam, para escolher uma a uma */
.ftrc-rola--alto { max-height: min(48vh, 460px); }
.ftrc-marcadas { float: right; font-size: .72rem; font-weight: 600; color: var(--ftmt-muted); font-variant-numeric: tabular-nums; }
.ftrc-tab { width: 100%; border-collapse: collapse; font-size: .74rem; }
.ftrc-tab th, .ftrc-tab td { padding: 4px 8px; border-bottom: 1px solid var(--ftmt-line); vertical-align: top; text-align: left; }
.ftrc-tab thead th { position: sticky; top: 0; background: #f6f8f9; font-size: .68rem; font-weight: 650; color: var(--ftmt-muted); text-align: left; }
.ftrc-tab .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ftrc-tab td small { display: block; color: var(--ftmt-muted); }
.ftrc-progresso { font-size: .78rem; color: var(--ftmt-muted); display: flex; gap: 8px; align-items: center; }
/* barra da fila na lista (filtro "Desatualizado") */
.ftrc-fila { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 8px; border: 1px solid #f0dcb4; border-radius: 8px; background: #fdf8ef; font-size: .78rem; }
.ftrc-fila b { color: var(--ftec-ink); }
.ftrc-fila small { display: block; color: var(--ftec-muted); }
.ftrc-feito { display: block; font-size: .7rem; font-weight: 650; color: var(--ftec-good); }
@media (max-width: 560px) {
  .ftrc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ftrc-fila .btn { width: 100%; }
}

/* Trocar / incluir material em várias fichas — faixa acima da tabela de Produtos, quadro com a
   prévia (abre no <body>: cores de .ftmt-modal) e o resultado da gravação, que fica na lista. */
.ftlt-barra { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 8px; border: 1px solid #c9dbef; border-radius: 8px; background: #f3f8fc; font-size: .78rem; }
.ftlt-barra > div:first-child { min-width: 0; flex: 1 1 280px; }
.ftlt-barra b { color: var(--ftec-ink); overflow-wrap: anywhere; }
.ftlt-barra small { display: block; color: var(--ftec-muted); }
.ftlt-barra-acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.ftlt-marca { display: block; font-size: .7rem; font-weight: 650; color: var(--ftec-good); }
.ftlt-marca.ftlt-nao { color: var(--ftec-warn); }
/* quadro */
.ftlt-corpo { min-width: 0; display: grid; gap: 10px; }
.ftlt-corpo > * { min-width: 0; }
.ftlt-passo { display: grid; gap: 4px; min-width: 0; }
.ftlt-opcoes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ftlt-grupo { border: 1px solid var(--ftmt-line); border-radius: 6px; padding: 8px 10px; margin: 0; min-width: 0; display: grid; gap: 4px; }
.ftlt-grupo legend { float: none; width: auto; font-size: .78rem; font-weight: 700; color: var(--ftmt-ink); margin: 0; padding: 0 4px; }
.bon-form label.ftlt-radio { display: flex; gap: 6px; align-items: flex-start; margin: 0; font-size: .76rem; font-weight: 400;
  color: var(--ftmt-ink); cursor: pointer; }
.ftlt-radio input { margin-top: 3px; flex: none; }
.ftlt-radio small { display: block; color: var(--ftmt-muted); font-size: .7rem; }
.ftlt-qtd { display: flex; gap: 6px; align-items: center; margin-left: 22px; }
.ftlt-qtd input { width: 110px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.ftlt-qtd span { font-size: .76rem; font-weight: 650; color: var(--ftmt-ink); }
.ftlt-tab .ftlt-col-sel { width: 28px; text-align: center; }
.ftlt-tab .ftlt-col-sel input { margin: 0; }
.ftlt-tab tr.ftlt-desmarcada td:not(.ftlt-col-sel) { opacity: .5; }
.ftlt-tab td b { font-weight: 600; color: var(--ftmt-ink); }
.ftlt-desat { display: block; font-size: .68rem; color: var(--ftmt-warn); }
.ftlt-sit { font-weight: 650; color: var(--ftmt-ink); }
/* resultado na lista */
.ftlt-res { border: 1px solid var(--ftec-line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: #fff;
  display: grid; gap: 8px; font-size: .78rem; }
.ftlt-res-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ftlt-res-head > div { min-width: 0; }
.ftlt-res-head b { color: var(--ftec-ink); overflow-wrap: anywhere; }
.ftlt-res-head small { display: block; color: var(--ftec-muted); }
.ftlt-res .ftrc-kpis { --ftmt-line: var(--ftec-line); --ftmt-muted: var(--ftec-muted); --ftmt-ink: var(--ftec-ink);
  --ftmt-good: var(--ftec-good); --ftmt-warn: var(--ftec-warn); --ftmt-danger: var(--ftec-danger); --ftmt-info: var(--ftec-info); }
.ftlt-res .ftrc-rola, .ftlt-res .ftrc-tab { --ftmt-line: var(--ftec-line); --ftmt-muted: var(--ftec-muted); }
.ftlt-res details summary { cursor: pointer; color: var(--ftec-info); font-size: .76rem; }
@media (max-width: 560px) {
  .ftlt-opcoes { grid-template-columns: 1fr; }
  .ftlt-barra-acoes, .ftlt-barra-acoes .btn { width: 100%; }
}
@media print { .ftlt-barra, .ftlt-res { display: none; } }
.ftlt-velha { opacity: .5; transition: opacity .15s; }
/* Alterar preços: o que fazer com as cores de preço próprio (aplicar / tirar / deixar) */
.ftca-proprias-ops { border: 0; margin: 6px 0 0; padding: 0; min-width: 0; display: grid; gap: 2px; }
.ftca-precos-modal .ftca-proprias .ftca-proprias-op { margin: 2px 0 0; }
.ftca-proprias-op small { display: block; font-size: .7rem; opacity: .85; }
.ftlt-res-head { flex-wrap: wrap; }
.ftlt-res-head > div:first-child { flex: 1 1 260px; }
