/* Produção · extras pedidos nas reuniões com o Fabrício e a Márcia
   (costura externa, balanceamento com presença, prioridade da diretoria, custo real, período personalizado).
   Só tokens: funciona no tema escuro e no claro. Prefixo px-. */

/* ---------- utilidades ---------- */
@keyframes px-flash { 0% { box-shadow: 0 0 0 0 var(--red-line); background-color: var(--red-soft); } 100% { box-shadow: 0 0 0 10px transparent; } }
.px-flash { animation: px-flash 1.4s var(--ease) both; }
.px-noanim > *, .px-noanim > * > * { animation: none !important; opacity: 1; }
.px-moved { position: relative; z-index: 1; animation: px-flash 1.6s var(--ease) .35s both !important; }
.px-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: currentColor; animation: spin .7s linear infinite; flex: none; }

/* ---------- Costura · pacote que vai e volta do bordado ---------- */
.pk__st .px-back { background: var(--info-soft); color: var(--info); }

.px-parc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: var(--s2); border: 1px dashed var(--line-2); font-size: var(--fs-sm); }
.px-parc > div { display: grid; min-width: 0; } .px-parc b { font-weight: 500; } .px-parc b .mono { font-size: 11.5px; color: var(--tx-3); } .px-parc small { font-size: var(--fs-2xs); }
.px-parc__ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--s3); color: var(--tx-2); }
.px-parc__ic svg { width: 16px; height: 16px; }
.px-parc.sent { border-style: solid; border-color: var(--line); }
.px-parc.sent .px-parc__ic { background: var(--info-soft); color: var(--info); }

/* ---------- Costura externa ---------- */
.px-ext__list { padding: 10px 20px 16px; display: grid; gap: 8px; }
.px-ext__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "ic who val act" "ic prog prog act"; gap: 6px 16px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: var(--s2); border: 1px solid var(--line); font-size: var(--fs-sm); }
.px-ext__row > .px-ext__ic { grid-area: ic; align-self: start; } .px-ext__who { grid-area: who; } .px-ext__val { grid-area: val; } .px-ext__prog { grid-area: prog; }
.px-ext__row > .btn, .px-ext__row > .pill { grid-area: act; }
.px-ext__row.done { opacity: .78; }
.px-ext__ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); }
.px-ext__row.done .px-ext__ic { background: var(--ok-soft); color: var(--ok); }
.px-ext__ic svg { width: 16px; height: 16px; }
.px-ext__who { display: grid; min-width: 0; } .px-ext__who b { font-weight: 500; } .px-ext__who b .mono { font-size: 11.5px; color: var(--tx-3); } .px-ext__who small { font-size: var(--fs-2xs); }
.px-ext__prog { display: flex; align-items: center; gap: 10px; } .px-ext__prog .progress { flex: 1; } .px-ext__prog small { font-size: 11px; color: var(--tx-2); white-space: nowrap; min-width: 112px; }
.px-ext__val { display: grid; text-align: right; } .px-ext__val small { font-size: 10.5px; } .px-ext__val b { font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; }

/* ---------- Histórico por modelo ---------- */
.px-hist { padding: 10px 20px 8px; display: grid; gap: 6px; }
.px-hist > div { display: grid; grid-template-columns: minmax(0, 1fr) auto 52px; gap: 12px; align-items: center; padding: 9px 12px; border-radius: var(--r-sm); background: var(--s2); border: 1px solid var(--line); font-size: var(--fs-sm); }
.px-hist > div > span:first-child { display: grid; } .px-hist b { font-weight: 500; } .px-hist small { font-size: var(--fs-2xs); }
.px-hist__t { font-size: 12px; color: var(--tx-3); white-space: nowrap; } .px-hist__t b { font-weight: 600; color: var(--tx); } .px-hist__t i { font-style: normal; color: var(--tx-4); margin: 0 2px; }
.px-hist .pill { justify-content: center; }
.px-tip { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: start; margin: 8px 20px 18px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--warn-soft); font-size: var(--fs-xs); color: var(--tx-2); }
.px-tip > svg { width: 16px; height: 16px; color: var(--warn); margin-top: 1px; }
.px-tip .btn { grid-column: 2; justify-self: start; }

/* ---------- Balanceamento com presença ---------- */
.px-bal-top { display: grid; grid-template-columns: auto 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.px-step { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--s3); border: 1px solid var(--line); font-size: var(--fs-sm); color: var(--tx-2); }
.px-step b { font-size: 20px; font-weight: 600; color: var(--tx); margin-right: 2px; }
.px-step__b { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--s4); color: var(--tx); border: 1px solid var(--line-2); cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); }
.px-step__b:hover:not(:disabled) { border-color: var(--red-line); background: var(--red-soft); }
.px-step__b:disabled { opacity: .35; cursor: not-allowed; }
.px-step__b svg { width: 16px; height: 16px; }
.px-bal-kpi { display: grid; align-content: center; gap: 1px; padding: 8px 14px; border-radius: var(--r-sm); background: var(--s3); border: 1px solid var(--line); }
.px-bal-kpi small { font-size: 10.5px; color: var(--tx-3); } .px-bal-kpi b { font-size: 17px; font-weight: 600; } .px-bal-kpi em { font-style: normal; font-size: 11px; color: var(--tx-3); }
.cel-bal.px-live .cel-bal__bar i { animation: none; transition: width .45s var(--ease), background var(--t-fast); }
.cel-bal > div { transition: opacity var(--t-med); }
.cel-bal > div.px-off { opacity: .45; }
.cel-bal > div.px-off .cel-bal__ops em { background: transparent; border: 1px dashed var(--line-2); }

/* ---------- Prioridade da diretoria (corte e qualidade) ---------- */
.px-up { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; color: var(--tx-2); background: var(--s3); border: 1px solid var(--line-2); cursor: pointer; transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast), transform var(--t-fast); }
.px-up:hover { color: var(--red-tx); background: var(--red-soft); border-color: var(--red-line); transform: translateY(-2px); }
.px-up svg { width: 16px; height: 16px; }
.px-side-top { display: flex; align-items: center; gap: 10px; }
.ct-tag.px-prio-tag { background: var(--red-soft); color: var(--red-tx); } .ct-tag.px-prio-tag svg { color: var(--red-tx); }
.qa-fila.px-fila li { grid-template-columns: 58px minmax(0, 1fr) auto; }
.qa-fila.px-fila .px-fila-pills { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.qa-fila.px-fila .px-fila-pills .pill { grid-column: auto; }
.qa-fila.px-fila .px-up { grid-column: 3; grid-row: 1 / span 2; align-self: center; }

/* ---------- Corte · custo real por peça ---------- */
.ct-conf > .px-cost { grid-template-columns: auto minmax(0, 1fr) auto; }
.px-cost > span:nth-child(2) { display: grid; }

/* ---------- Qualidade · período personalizado ---------- */
#qa-period button svg { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.px-fmt span { display: inline-flex; align-items: center; gap: 8px; } .px-fmt span svg { width: 16px; height: 16px; color: var(--tx-3); }

/* ---------- Bordado ---------- */
.px-esp-pz { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.px-esp-pz .pill { height: 22px; font-size: 11px; }
.px-dst { flex: none; white-space: nowrap; }
.px-dst.px-done { color: var(--ok); border-color: var(--ok-soft); }

@media (max-width: 760px) {
  .px-bal-top { grid-template-columns: 1fr 1fr; } .px-step { grid-column: 1 / -1; justify-content: space-between; }
  .px-parc { grid-template-columns: auto 1fr; } .px-parc > .btn, .px-parc > .pill { grid-column: 1 / -1; }
  .px-ext__row { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ic who" "prog prog" "val act"; } .px-ext__val { text-align: left; } .px-ext__row > .btn, .px-ext__row > .pill { justify-self: end; }
  .px-hist > div { grid-template-columns: 1fr 52px; } .px-hist__t { grid-column: 1; grid-row: 2; }
}

/* Qualidade e Expedição: lista de OS para entregar */
.px-exp { padding: 8px 12px 14px; display: grid; gap: 6px; }
.px-exp__r { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg-2); transition: opacity .5s, transform .5s; }
.px-exp__r > div { display: grid; gap: 1px; min-width: 0; }
.px-exp__r b { font-weight: 500; }
.px-exp__r small { font-size: var(--fs-2xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-exp__done { opacity: 0; transform: translateX(20px); }
.px-exp__chk { display: grid; gap: 8px; font-size: var(--fs-sm); color: var(--tx-2); }
.px-exp__chk input { accent-color: var(--red); margin-right: 6px; }
