/* Sistema de produção — visual de chão de fábrica: denim, fita-métrica, amarelo de viés */
:root {
  --denim: #1c2a44;
  --denim-2: #2b3d61;
  --denim-ink: #e8edf6;
  --bg: #eceff4;
  --surface: #ffffff;
  --line: #d5dbe6;
  --ink: #17202f;
  --ink-2: #536078;
  --tape: #f4c20d;          /* marcador da hora atual */
  --ok: #1d8a52;  --ok-bg: #dff3e8;
  --warn: #b97800; --warn-bg: #fdf0cf;
  --bad: #c0392b; --bad-bg: #fbe1dd;
  --idle: #8793a8; --idle-bg: #e4e8ef;
  --radius: 6px;
  --num: "Bahnschrift", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; }
body { margin: 0; font: 400 1rem/1.5 var(--text); color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.125rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
a { color: var(--denim-2); }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.muted { color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; }

/* estrutura */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--denim); color: var(--denim-ink); padding: 1.25rem 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; position: sticky; top: 0; height: 100vh; }
.brand { padding: 0 0.75rem 1.25rem; font-family: var(--num); font-size: 1.35rem; font-weight: 700; letter-spacing: 0.02em; }
.brand span { display: block; font: 400 0.8rem var(--text); opacity: 0.7; letter-spacing: 0; }
.side a { color: inherit; text-decoration: none; padding: 0.6rem 0.75rem; border-radius: var(--radius); display: block; }
.side a:hover { background: var(--denim-2); }
.side a[aria-current="page"] { background: var(--denim-2); box-shadow: inset 3px 0 0 var(--tape); }
.side .quem { margin-top: auto; padding: 0.75rem; font-size: 0.875rem; opacity: 0.85; border-top: 1px solid var(--denim-2); }
.side .quem button { margin-top: 0.5rem; }
main { padding: 1.5rem 2rem 3rem; max-width: 1280px; width: 100%; }
.head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.head .grow { flex: 1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
.card + .card { margin-top: 1rem; }
.stack { display: grid; gap: 1rem; }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

/* botoes e campos */
.btn { border: 1px solid var(--line); background: var(--surface); padding: 0.5rem 0.9rem; border-radius: var(--radius); cursor: pointer; font-weight: 600; min-height: 2.5rem; }
.btn:hover { background: #f4f6fa; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--denim); border-color: var(--denim); color: #fff; }
.btn.primary:hover { background: var(--denim-2); }
.btn.go { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.stop { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.big { min-height: 3.25rem; padding: 0.6rem 1.4rem; font-size: 1.1rem; }
.btn.small { min-height: 2rem; padding: 0.2rem 0.6rem; font-size: 0.875rem; }
.side .btn { background: transparent; color: var(--denim-ink); border-color: var(--denim-2); }
label.f { display: grid; gap: 0.25rem; font-size: 0.875rem; color: var(--ink-2); font-weight: 600; }
input, select, textarea { border: 1px solid #b9c2d2; border-radius: var(--radius); padding: 0.5rem 0.6rem; background: #fff; min-height: 2.5rem; width: 100%; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; }
input[type="file"] { padding: 0.35rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; align-items: end; }

/* status */
.pill { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 99px; font-size: 0.8rem; font-weight: 650; background: var(--idle-bg); color: #3b4659; }
.pill.verde, .pill.liberado, .pill.trabalhando { background: var(--ok-bg); color: #14653b; }
.pill.amarelo, .pill.pausada, .pill.rascunho { background: var(--warn-bg); color: #7a5000; }
.pill.vermelho, .pill.parado, .pill.cancelado { background: var(--bad-bg); color: #8f2218; }
.pill.concluido, .pill.finalizada { background: #dbe6fb; color: #1e3e7a; }
.pill.andamento { background: var(--ok-bg); color: #14653b; }

/* linha do tempo do dia: a "fita" de horas */
.fita { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(84px, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; background: var(--surface); }
.hora { padding: 0.5rem 0.6rem 0.6rem; border-right: 1px solid var(--line); position: relative; display: grid; gap: 0.15rem; min-width: 84px; }
.hora:last-child { border-right: 0; }
.hora .rot { font-size: 0.75rem; color: var(--ink-2); font-weight: 600; }
.hora .q { font: 700 1.9rem/1 var(--num); }
.hora .meta { font-size: 0.75rem; color: var(--ink-2); }
.hora .barra { height: 6px; background: var(--idle-bg); border-radius: 3px; overflow: hidden; margin-top: 0.25rem; }
.hora .barra i { display: block; height: 100%; background: var(--idle); }
.hora.verde .barra i { background: var(--ok); }
.hora.amarelo .barra i { background: #d99a00; }
.hora.vermelho .barra i { background: var(--bad); }
.hora.verde .q { color: var(--ok); }
.hora.vermelho .q { color: var(--bad); }
.hora.futura { opacity: 0.45; }
.hora.vazia .q { color: var(--idle); }
.hora.fora { background: repeating-linear-gradient(135deg, #fff, #fff 6px, #f2f4f8 6px, #f2f4f8 12px); }
.hora.atual { box-shadow: inset 0 4px 0 var(--tape); background: #fffdf2; }
.hora.atual .rot::after { content: " · agora"; color: #8a6a00; }
.hora.com-ops { cursor: pointer; }
.hora.com-ops:hover { background: #f4f6fa; }
.ops-hora { list-style: none; margin: 0.3rem 0 0; padding: 0.25rem 0 0; border-top: 1px dashed var(--line); display: grid; gap: 0.1rem; font-size: 0.72rem; }
.ops-hora li { display: flex; justify-content: space-between; gap: 0.3rem; color: var(--ink-2); }
.ops-hora li strong { color: var(--ink); }
.ops-hora li.mais { color: var(--denim-2); font-weight: 600; }
.hora.aguardando .q { color: var(--denim-2); }
.hora.aguardando .meta { color: var(--denim-2); font-weight: 600; }
.hora.aguardando .barra i { width: 100% !important; background: repeating-linear-gradient(90deg, #9fb0cf 0 6px, transparent 6px 10px); }
.resumo-dia { display: flex; gap: 2rem; flex-wrap: wrap; margin: 0.75rem 0 1.25rem; }
.resumo-dia div { display: grid; }
.resumo-dia .v { font: 700 1.75rem/1.1 var(--num); }
.resumo-dia .l { font-size: 0.8rem; color: var(--ink-2); }

/* fila de tarefas: um cartao por pedido na etapa */
.tarefa { display: grid; grid-template-columns: 132px 1fr; gap: 0.75rem 1.25rem; align-items: start; border: 1px solid var(--line); border-left: 6px solid var(--idle); border-radius: var(--radius); background: var(--surface); padding: 1rem 1.25rem; }
.tarefa + .tarefa { margin-top: 0.75rem; }
.tarefa.andamento { border-left-color: var(--ok); background: #f6fbf8; }
.tarefa.pausada { border-left-color: #d99a00; background: #fffaf0; }
.tarefa .titulo { font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.tarefa .titulo .op-n { font: 700 1.6rem/1 var(--num); margin-right: 0.25rem; }
.tarefa .titulo .op-n small { font: 600 0.8rem var(--text); color: var(--ink-2); }
.tarefa .corpo { display: grid; gap: 0.35rem; min-width: 0; }
.ficha-capa { width: 132px; height: 112px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #f4f6fa; overflow: hidden; cursor: zoom-in; position: relative; display: grid; place-items: center; }
.ficha-capa img { width: 100%; height: 100%; object-fit: contain; }
.ficha-capa span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 0.7rem; font-weight: 650; background: rgba(28, 42, 68, 0.85); color: #fff; padding: 0.1rem 0.3rem; text-align: center; }
.ficha-capa.vazia { cursor: default; } .ficha-capa.vazia span { position: static; background: none; color: var(--idle); }
.itens-tarefa { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; font-size: 0.85rem; color: var(--ink-2); }
.itens-tarefa li { background: #f4f6fa; border-radius: 4px; padding: 0.05rem 0.45rem; }
.tarefa .pendente { font-size: 0.85rem; font-weight: 650; color: #7a5000; background: var(--warn-bg); padding: 0.2rem 0.5rem; border-radius: 4px; justify-self: start; }
.tarefa .aviso { font-size: 0.85rem; }
input.pecas { font: 700 1.4rem var(--num); text-align: center; width: 7rem; min-height: 3rem; }
input.pecas.falta-campo { width: 5.5rem; }
input.pecas.falta-txt { color: var(--bad); border-color: #efb7af; }
.numeros { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.numeros > div { display: grid; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.3rem 0.8rem; background: #fff; min-width: 6.5rem; }
.numeros small { font-size: 0.7rem; font-weight: 650; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.numeros strong { font-size: 1.6rem; line-height: 1.1; }
.numeros span { font-size: 0.75rem; color: var(--ink-2); }
.numeros .falta { border-color: #efb7af; background: var(--bad-bg); } .numeros .falta strong { color: var(--bad); }
.numeros .ok strong { color: var(--ok); }
.numeros.grande strong { font-size: 2.2rem; }
.tabela-prontas td { vertical-align: middle; }
.tabela-prontas td:first-child { font-weight: 600; }
.falta-txt { color: var(--bad); font-weight: 700; }
.pendencias { border: 1px solid #efb7af; background: var(--bad-bg); color: #7d1f15; border-radius: var(--radius); padding: 0.4rem 0.7rem; font-size: 0.9rem; }
.pendencias ul { margin: 0.2rem 0 0; padding-left: 1.1rem; }
.itens-tarefa li.completo { background: var(--ok-bg); color: #14653b; }
.itens-tarefa li.faltando { background: var(--bad-bg); color: #8f2218; }
.antes { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
.pronto-destaque { background: var(--ok); color: #fff; font-weight: 700; padding: 0.3rem 0.7rem; border-radius: var(--radius); }
.bloco-chegada { border: 1px solid #f0d27a; background: var(--warn-bg); border-radius: var(--radius); padding: 0.6rem 0.8rem; display: grid; gap: 0.4rem; }
.bloco-chegada ul { margin: 0; padding-left: 1.1rem; }
.bloco-chegada button[aria-pressed="true"] { background: var(--denim); color: #fff; border-color: var(--denim); }
.pagamento-costureira { border-top: 2px solid var(--line); padding-top: 0.75rem; break-inside: avoid; }
.lista-chegada { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.5rem; }
.faltas-pedido { border-left: 6px solid #3f6fc4; }
tr.atrasada td { background: var(--bad-bg); }
.onde-estao { border: 1px solid #c9d6ee; background: #f3f6fc; border-radius: var(--radius); padding: 0.4rem 0.7rem; font-size: 0.88rem; }
.onde-estao ul { margin: 0.2rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.2rem; }
.onde-estao .pill { margin-right: 0.25rem; }
.todos-itens { padding: 0.75rem; background: #f4f6fa; border-radius: var(--radius); margin-bottom: 1rem; display: grid; gap: 0.5rem; }
.todos-itens summary { cursor: pointer; color: var(--ink-2); font-size: 0.9rem; }
select.roteiro { width: auto; min-width: 12rem; font-weight: 600; }
.pendencias-pedido { border-color: #efb7af; border-left: 6px solid var(--bad); }
.etapa-c.com-pendencia { border-top-color: var(--bad); background: #fff6f5; }
.zona-ficha { border: 2px dashed #9fb0cf; border-radius: var(--radius); padding: 1rem; display: grid; gap: 0.2rem; text-align: center; background: #fff; cursor: copy; }
.zona-ficha.sobre, .zona-ficha:focus { border-color: var(--denim-2); background: #eef2fa; outline: none; }
.fichas-coladas { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.fichas-coladas figure { margin: 0; width: 120px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 0.3rem; display: grid; gap: 0.25rem; font-size: 0.75rem; }
.fichas-coladas img { width: 100%; height: 80px; object-fit: contain; background: #f4f6fa; }
.fichas-coladas figcaption { overflow-wrap: anywhere; }
.pdf-mini { display: grid; place-items: center; height: 80px; background: #f4f6fa; font: 700 1.2rem var(--num); color: var(--bad); }
.ajustada { color: var(--denim-2); font-weight: 700; }
textarea { min-height: 6rem; resize: vertical; }
.corte-grupo td { background: #f4f6fa; font-weight: 650; }
.corte-grupo.sem-material td { background: var(--warn-bg); }
tr.ordem-inicio td { border-top: 2px solid var(--line); }
.material-cor { font-size: 0.85rem; font-weight: 600; color: var(--denim-2); }
.corte-grupo td .muted { font-weight: 400; }
.origem { font-size: 0.75rem; font-weight: 650; padding: 0.05rem 0.45rem; border-radius: 99px; background: var(--idle-bg); }
.origem.estoque { background: #dbe6fb; color: #1e3e7a; } .origem.separacao { background: var(--warn-bg); color: #7a5000; }
input.cortar { width: 5.5rem; text-align: right; }
.zona-ficha.feito { border-color: var(--ok); background: var(--ok-bg); }
.comprovantes { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.conta { margin: 0; padding: 0.5rem 0.75rem; background: #f4f6fa; border-radius: var(--radius); font-size: 1.05rem; font-weight: 700; }
.aguardando-ficha { font-weight: 650; color: #7a5000; background: var(--warn-bg); padding: 0.35rem 0.7rem; border-radius: var(--radius); }
.tarefa.esperando { opacity: 0.8; }
.envio-ficha { padding: 0.75rem; background: #f4f6fa; border-radius: var(--radius); }
.tarefa .sub { color: var(--ink-2); font-size: 0.9rem; }
.tarefa .tempo { font: 700 1.1rem/1 var(--num); color: var(--ink); }
.tarefa .acoes { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; justify-content: flex-start; grid-column: 2; padding-top: 0.25rem; border-top: 1px solid var(--line); }
.tarefa .prog { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.tarefa .prog .barra { flex: 1; height: 8px; background: var(--idle-bg); border-radius: 4px; overflow: hidden; }
.tarefa .prog .barra i { display: block; height: 100%; background: var(--denim-2); }
.vazio { text-align: center; padding: 2.5rem 1rem; color: var(--ink-2); border: 2px dashed var(--line); border-radius: var(--radius); background: transparent; }

/* tabelas */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.8rem; color: var(--ink-2); font-weight: 650; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover { background: #f4f6fa; }
.scroll { overflow-x: auto; }

/* painel ao vivo */
.painel { display: grid; gap: 0.75rem; }
.op { display: grid; grid-template-columns: 200px 1fr 130px; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--idle); border-radius: var(--radius); padding: 0.85rem 1rem; }
.op.verde { border-left-color: var(--ok); } .op.amarelo { border-left-color: #d99a00; } .op.vermelho { border-left-color: var(--bad); }
.op .nome { font-weight: 700; font-size: 1.05rem; }
.op .pct { font: 700 2rem/1 var(--num); text-align: right; }
.op .pct small { display: block; font: 400 0.75rem var(--text); color: var(--ink-2); }
.alertas { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.alerta { background: var(--bad-bg); border: 1px solid #efb7af; color: #7d1f15; padding: 0.6rem 0.9rem; border-radius: var(--radius); font-weight: 600; }

/* abas, graficos, modal, aviso */
.abas { display: flex; gap: 0.25rem; border-bottom: 2px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.abas button { border: 0; background: none; padding: 0.6rem 1rem; cursor: pointer; font-weight: 650; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.abas button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--tape); }
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 11px var(--text); fill: var(--ink-2); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .meta-line { stroke: var(--ok); stroke-dasharray: 5 4; stroke-width: 1.5; }
.chart .linha { fill: none; stroke: var(--denim-2); stroke-width: 2.5; }
.chart .ponto { fill: var(--denim-2); }
.chart .barra-ok { fill: var(--ok); } .chart .barra-warn { fill: #d99a00; } .chart .barra-bad { fill: var(--bad); } .chart .barra-idle { fill: var(--idle); }
.delta.up { color: var(--ok); font-weight: 700; } .delta.down { color: var(--bad); font-weight: 700; }
.dialog-fundo { position: fixed; inset: 0; background: rgba(15, 22, 36, 0.55); display: grid; place-items: center; padding: 1rem; z-index: 50; }
.dialog { background: var(--surface); border-radius: 10px; padding: 1.5rem; width: min(560px, 100%); max-height: 90vh; overflow: auto; display: grid; gap: 1rem; }
.dialog.largo { width: min(920px, 100%); }
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: 0.5rem; z-index: 60; }
.toast { background: var(--denim); color: #fff; padding: 0.75rem 1rem; border-radius: var(--radius); max-width: 380px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.erro { background: var(--bad); }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
.galeria figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.galeria img { width: 100%; height: 130px; object-fit: contain; background: #f4f6fa; display: block; cursor: zoom-in; }
.galeria figcaption { font-size: 0.8rem; padding: 0.4rem 0.5rem; display: grid; gap: 0.15rem; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--denim); }
.login form { background: #fff; padding: 2rem; border-radius: 10px; width: min(400px, 100%); display: grid; gap: 1rem; }
.login .brand { color: var(--denim); padding: 0; }
.erro-msg { color: var(--bad); font-weight: 600; min-height: 1.5rem; }
.etapas-sel { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.etapas-sel label { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }

/* lista de pedidos */
.filtros { display: flex; gap: 1rem; align-items: end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.filtros .fields { flex: 1; max-width: 560px; }
.lista-pedidos { display: grid; gap: 0.75rem; }
.ped { display: grid; grid-template-columns: 112px 1fr auto; gap: 1.25rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--idle); border-radius: var(--radius); padding: 0.75rem 1.25rem 0.75rem 0.75rem; cursor: pointer; }
.ped:hover { border-color: #b9c2d2; box-shadow: 0 2px 10px rgba(23, 32, 47, 0.08); }
.ped.liberado { border-left-color: var(--ok); } .ped.rascunho { border-left-color: #d99a00; }
.ped.concluido { border-left-color: #3f6fc4; } .ped.cancelado { border-left-color: var(--bad); opacity: 0.75; }
.ped .capa { width: 112px; height: 96px; border-radius: var(--radius); background: #f4f6fa; display: grid; place-items: center; overflow: hidden; color: var(--idle); font-size: 0.75rem; }
.ped .capa img { width: 100%; height: 100%; object-fit: contain; }
.ped .meio { display: grid; gap: 0.3rem; min-width: 0; }
.op-num { font: 700 1.5rem/1 var(--num); }
.op-num small { font: 600 0.8rem var(--text); color: var(--ink-2); }
.ped .cli { font-size: 1.1rem; font-weight: 650; }
.ped .lado { display: grid; gap: 0.4rem; justify-items: end; min-width: 150px; }
.prazo-l { display: grid; justify-items: end; }
.prazo-l small, .dado small { font-size: 0.75rem; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.prazo-l strong { font-size: 1.25rem; }
.prazo-tag { font-size: 0.8rem; font-weight: 650; padding: 0.05rem 0.5rem; border-radius: 99px; background: var(--idle-bg); color: #3b4659; }
.prazo-tag.perto, .prazo-tag.hoje { background: var(--warn-bg); color: #7a5000; }
.prazo-tag.atrasado { background: var(--bad-bg); color: #8f2218; }
.andam { display: flex; align-items: center; gap: 0.5rem; width: 150px; }
.barra { flex: 1; height: 8px; background: var(--idle-bg); border-radius: 4px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--denim-2); }

/* trilha de etapas */
.trilha { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 0; }
.trilha li { display: grid; grid-template-columns: auto 1fr; column-gap: 0.5rem; align-items: center; position: relative; padding-right: 2rem; }
.trilha li:not(:last-child)::after { content: ""; position: absolute; right: 0.5rem; top: 0.85rem; width: 1rem; height: 2px; background: var(--line); }
.trilha .marca { grid-row: span 2; width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--idle); background: #fff; color: #fff; font-weight: 700; font-size: 0.9rem; }
.trilha .nome { font-weight: 650; }
.trilha .det { font-size: 0.8rem; color: var(--ink-2); }
.trilha li.feita .marca { background: var(--ok); border-color: var(--ok); }
.trilha li.andamento .marca { border-color: var(--ok); box-shadow: inset 0 0 0 4px #fff; background: var(--ok); }
.trilha li.pausada .marca { border-color: #d99a00; box-shadow: inset 0 0 0 4px #fff; background: #d99a00; }
.trilha li.parcial .marca { border-color: var(--ok); background: linear-gradient(90deg, var(--ok) 50%, #fff 50%); }
.trilha li.fila .nome { color: var(--ink-2); }
.trilha.compacta { gap: 0.25rem 0; }
.trilha.compacta li { padding-right: 1.4rem; column-gap: 0.3rem; }
.trilha.compacta li:not(:last-child)::after { right: 0.35rem; top: 0.6rem; width: 0.7rem; }
.trilha.compacta .marca { grid-row: auto; width: 1.2rem; height: 1.2rem; font-size: 0.7rem; }
.trilha.compacta .nome { font-size: 0.85rem; font-weight: 600; }

/* detalhe do pedido */
.ped-cab { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.ped-cab .grow { flex: 1; }
.op-grande { display: flex; align-items: center; gap: 0.6rem; }
.op-grande small { font: 700 1rem var(--num); color: var(--ink-2); letter-spacing: 0.06em; }
.op-grande .num { font-size: 2.6rem; font-weight: 700; line-height: 1; }
.ped-cab .cliente { font-size: 1.6rem; margin-top: 0.3rem; }
.ped-dados { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.dado { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 1rem; display: grid; gap: 0.3rem; align-content: start; }
.dado strong { font: 700 1.35rem/1.15 var(--num); overflow-wrap: anywhere; }
.dado .prazo-tag { justify-self: start; }
.item { padding: 1rem 0; border-top: 1px solid var(--line); }
.item-cab { display: flex; gap: 0.9rem; align-items: center; flex-wrap: wrap; }
.item-cab .grow { flex: 1; min-width: 200px; }
.item-cab strong { font-size: 1.05rem; }
.item-n { width: 2rem; height: 2rem; border-radius: 50%; background: var(--denim); color: #fff; display: grid; place-items: center; font-weight: 700; }
.mini { display: flex; gap: 0.4rem; }
.mini button { padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #f4f6fa; cursor: zoom-in; width: 56px; height: 48px; overflow: hidden; }
.mini img { width: 100%; height: 100%; object-fit: contain; }
.etapas-item { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.6rem; }
.etapa-c { border: 1px solid var(--line); border-top: 4px solid var(--idle); border-radius: var(--radius); padding: 0.6rem 0.75rem; display: grid; gap: 0.25rem; font-size: 0.9rem; }
.etapa-c .q { font-size: 1.1rem; font-weight: 700; }
.etapa-c.andamento { border-top-color: var(--ok); background: #f6fbf8; }
.etapa-c.pausada { border-top-color: #d99a00; background: #fffaf0; }
.etapa-c.finalizada { border-top-color: #3f6fc4; }
.etapa-c .barra { flex: none; height: 6px; }
.etapa-c.finalizada .barra i { background: #3f6fc4; } .etapa-c.andamento .barra i { background: var(--ok); }
.envio { margin-top: 0.75rem; padding: 0.75rem; background: #f4f6fa; border-radius: var(--radius); }
.galeria.grande { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.galeria .foto { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.galeria.grande img { height: 190px; }
.galeria .pdf { display: grid; place-items: center; align-content: center; gap: 0.25rem; height: 130px; background: #f4f6fa; text-decoration: none; font-weight: 600; }
.galeria.grande .pdf { height: 190px; }
.galeria .pdf span { font: 700 1.4rem var(--num); color: var(--bad); }

/* quantidade por etapa e estoque */
.qtd-etapas { display: flex; gap: 0.75rem 1.25rem; align-items: end; flex-wrap: wrap; margin-top: 1rem; padding: 0.75rem; background: #f4f6fa; border-radius: var(--radius); }
.qtd-etapas input { width: 7rem; }
.estoque { font-size: 0.8rem; font-weight: 650; padding: 0.15rem 0.55rem; border-radius: 99px; background: var(--idle-bg); color: #3b4659; }
.estoque.ok { background: var(--ok-bg); color: #14653b; }
.estoque.falta, strong.falta { background: var(--bad-bg); color: #8f2218; }
strong.falta { padding: 0.1rem 0.45rem; border-radius: 4px; }

/* visualizador de imagens */
.visor { position: fixed; inset: 0; background: rgba(10, 15, 26, 0.92); z-index: 70; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.visor-topo { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; color: #fff; }
.visor-info { flex: 1; display: grid; min-width: 0; }
.visor-info .muted { color: #b9c2d2; font-size: 0.85rem; }
.visor-topo .btn { background: transparent; color: #fff; border-color: #536078; text-decoration: none; display: inline-flex; align-items: center; }
.visor-palco { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0 0.5rem 1rem; min-height: 0; }
.visor-palco img { max-width: calc(100% - 7rem); max-height: calc(100vh - 5.5rem); object-fit: contain; background: #fff; border-radius: 4px; }
.visor-seta { flex: none; width: 3rem; height: 4.5rem; border: 0; border-radius: var(--radius); background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 2.5rem; line-height: 1; cursor: pointer; }
.visor-seta:hover { background: rgba(255, 255, 255, 0.25); }

@media (max-width: 860px) {
  .ped { grid-template-columns: 80px 1fr; padding-right: 0.75rem; }
  .ped .capa { width: 80px; height: 72px; }
  .ped .lado { grid-column: 1 / -1; justify-items: start; grid-auto-flow: column; align-items: center; justify-content: start; gap: 0.75rem; }
  .prazo-l { justify-items: start; }
  .op-grande .num { font-size: 2rem; }
  .visor-palco img { max-width: calc(100% - 5rem); }
  .visor-seta { width: 2.25rem; }
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 0.5rem; }
  .brand { padding: 0 0.5rem; } .side .quem { margin: 0 0 0 auto; border: 0; }
  main { padding: 1rem; }
  .op { grid-template-columns: 1fr; }
  .tarefa { grid-template-columns: 96px 1fr; } .tarefa .acoes { grid-column: 1 / -1; justify-content: flex-start; }
  .ficha-capa { width: 96px; height: 88px; } .tarefa .aviso { text-align: left; }
}
@media (prefers-reduced-motion: no-preference) { .btn { transition: background 0.12s; } }
@media print {
  .side, .no-print, .toasts { display: none !important; }
  .shell { display: block; } main { padding: 0; max-width: none; } body { background: #fff; }
  .card { break-inside: avoid; border-color: #bbb; }
}

/* folha de impressao da ordem de corte */
body.folha { background: #fff; }
body.folha main { max-width: 900px; margin: 0 auto; padding: 1.5rem; }
.folha-cab { display: flex; gap: 2rem; align-items: flex-end; border-bottom: 3px solid var(--ink); padding-bottom: 0.75rem; flex-wrap: wrap; }
.folha-cab div { display: grid; }
.folha-cab small { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); font-weight: 650; }
.folha-cab h1 { font-size: 2.2rem; }
.folha-cab strong { font-size: 1.4rem; }
.folha-grupo { margin-top: 1.25rem; break-inside: avoid; }
.folha-grupo h2 { font-size: 1.25rem; border-left: 6px solid var(--ink); padding-left: 0.5rem; margin-bottom: 0.4rem; }
.folha-grupo th, .folha-grupo td { border: 1px solid #999; }
.campo-mao { display: inline-block; width: 4rem; border-bottom: 1px solid #333; }
.folha-rodape { margin-top: 2rem; display: grid; gap: 1.25rem; }
.linha-mao { display: inline-block; width: 18rem; border-bottom: 1px solid #333; }
.linha-mao.curta { width: 7rem; }
@media print { body.folha main { padding: 0; } }
