/* Ajustes locais sobre o Pico CSS (mobile-first). Sem estilos inline nos templates (CSP). */
:root { --pico-font-size: 100%; }
form.inline { display: inline; margin: 0; }
form.inline button { margin: 0; padding: 0.25rem 0.75rem; }
p.error { color: var(--ivp-bad); font-weight: 600; }
p.message.success { color: var(--ivp-ok); }
header.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
header.page-head h1 { margin: 0; }
tr.inactive, article.inactive { opacity: 0.55; }
mark.alert { background: var(--ivp-bad-soft); color: var(--ivp-bad); padding: 0 0.3rem; }
td.actions { white-space: nowrap; }
div.error { color: var(--ivp-bad); font-weight: 600; }
fieldset { margin-bottom: 1rem; }
@media (min-width: 768px) { form.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; } form.form-cols > button { grid-column: 1 / -1; } }
/* Fase 4 — produtos */
[hidden] { display: none !important; }
.muted { color: var(--ivp-ink-2); }
td.neg { color: var(--ivp-bad); }
tr.ref td { font-weight: 600; }
.viab { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 6px; font-size: 0.85em; font-weight: 600; white-space: nowrap; }
.viab-viavel { background: var(--ivp-ok-soft); color: var(--ivp-ok); }
.viab-atencao { background: var(--ivp-warn-soft); color: var(--ivp-warn); }
.viab-inviavel { background: var(--ivp-bad-soft); color: var(--ivp-bad); }
.produto-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.produto-layout > * { min-width: 0; }
@media (min-width: 1100px) { .produto-layout { grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); } #previa { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; } }
#previa h2 { font-size: 1.25rem; margin-bottom: 0.5rem; }
#previa table { font-size: 0.9em; }
#previa .resumo article { margin-bottom: 0.5rem; padding: 0.75rem; }
#previa .resumo article header { padding: 0 0 0.25rem; margin: 0; font-size: 0.85em; }
p.big { font-size: 1.4rem; font-weight: 700; margin: 0; }
table.composicao td:last-child, table.composicao th:last-child { text-align: right; white-space: nowrap; }
article.placa { padding: 1rem; margin-bottom: 1rem; }
header.placa-head { display: flex; gap: 1rem; align-items: flex-end; margin-bottom: 0.5rem; }
header.placa-head label { flex: 1; margin-bottom: 0; }
header.placa-head button { margin-bottom: 0; white-space: nowrap; }
table.filamentos td { vertical-align: top; }
table.filamentos select, table.filamentos input { margin-bottom: 0; }
table.filamentos button { margin: 0; padding: 0.25rem 0.6rem; }
ul.previa-erros { font-size: 0.9em; }
/* Fase 4b — insumos */
table.insumos td { vertical-align: top; }
table.insumos select, table.insumos input { margin-bottom: 0; }
table.insumos button { margin: 0; padding: 0.25rem 0.6rem; }
/* Fase 6 — produção, estoque, pedidos */
form.quick { max-width: 34rem; }
ul.compact { margin: 0 0 0.5rem 1rem; padding: 0; }
ul.compact li { margin: 0; }
p.big.neg { color: var(--ivp-bad); }
/* Fase 7 — dashboard */
nav.presets { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
nav.presets a { margin: 0; padding: 0.3rem 0.7rem; font-size: 0.9rem; }
form.period-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin-bottom: 1rem; }
form.period-form label { margin: 0; flex: 1 1 9rem; }
form.period-form input { margin: 0; }
form.period-form button { margin: 0; width: auto; }
.kpis article { padding: 0.9rem; margin-bottom: 0.5rem; }
.kpis article header { padding: 0 0 0.25rem; margin: 0; font-size: 0.85em; }
ul.alerts { padding-left: 1.2rem; }
ul.alerts li { margin-bottom: 0.25rem; }

/* ===== Design Oficina — Etapa 2: navegação, logo, tema, login ================================ */
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button.linkish { display: inline; width: auto; margin: 0; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ivp-ink); cursor: pointer; min-height: 0; box-shadow: none; }
button.linkish.gold { color: var(--ivp-gold-hi); }
button.linkish.bad { color: var(--ivp-bad); }

/* logo por tema: dois <img>, só CSS decide (mesmo seletor dos tokens) */
/* especificidade acima de ".x img" para que nenhum layout reexiba o par errado */
:root img.logo-escuro { display: none; }
:root[data-theme="dark"] img.logo-claro { display: none; }
:root[data-theme="dark"] img.logo-escuro { display: inline-block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) img.logo-claro { display: none; }
  :root:not([data-theme]) img.logo-escuro { display: inline-block; }
}

/* chips (Aparência); em Etapa 3 viram o padrão de escolha única */
.theme-form { display: flex; gap: 8px; margin: 0; }
.chip { display: inline-flex; align-items: center; justify-content: center; width: auto; min-height: 40px; margin: 0; padding: 0 14px; border-radius: 999px; border: 1px solid var(--ivp-field); background: var(--ivp-surface); color: var(--ivp-ink); font-size: 0.9rem; font-weight: 600; box-shadow: none; }
.chip.is-active { background: var(--ivp-sel); border-color: var(--ivp-sel); color: var(--ivp-on-sel); }

/* barra inferior (celular) */
body.with-nav { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
nav.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; background: var(--ivp-surface); border-top: 1px solid var(--ivp-line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px)); }
nav.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; text-decoration: none; font-size: 0.7rem; font-weight: 600; --pico-color: var(--ivp-ink-3); color: var(--ivp-ink-3); }
nav.bottom-nav a.is-active { --pico-color: var(--ivp-ink); color: var(--ivp-ink); font-weight: 700; }
nav.bottom-nav a.bn-plus { --pico-color: var(--ivp-on-gold); color: var(--ivp-on-gold); }
.plus-circle { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-top: -30px; border-radius: 50%; background: var(--ivp-gold); color: var(--ivp-on-gold); box-shadow: 0 6px 16px color-mix(in srgb, var(--ivp-ink) 22%, transparent); }
.plus-circle .icon { width: 26px; height: 26px; stroke-width: 2.4; }
.side { display: none; }

/* menu lateral (desktop) */
@media (min-width: 1024px) {
  nav.bottom-nav { display: none; }
  body.with-nav { display: grid; grid-template-columns: 248px minmax(0, 1fr); padding-bottom: 0; }
  body.with-nav > .main { max-width: none; width: auto; margin: 0; padding: 28px 32px 48px; }
  .side { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ivp-hero-3) transparent; padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--ivp-side); color: var(--ivp-side-text); }
  .side a, .side a:not([role="button"]) { --pico-color: var(--ivp-side-text); color: var(--ivp-side-text); text-decoration: none; }
  .side-logo { display: block; margin: 2px 0 14px 6px; }
  .side-logo img { display: block; width: 188px; height: auto; }
  .side-register { display: block; margin: 0 0 14px; padding: 11px 12px; border-radius: 12px; text-align: center; background: var(--ivp-gold); font-weight: 700; --pico-color: var(--ivp-on-gold); color: var(--ivp-on-gold); }
  .side a.side-register { color: var(--ivp-on-gold); }
  .side a.side-register:hover { background: var(--ivp-gold-strong); }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-link { display: block; padding: 10px 12px; border-radius: 12px; font-weight: 500; line-height: 1.3; }
  .side a.side-link:hover { background: color-mix(in srgb, var(--ivp-hero-2) 55%, transparent); }
  .side a.side-link.is-active { background: var(--ivp-hero-2); color: var(--ivp-hero-text); font-weight: 700; }
  .side-group { display: block; margin: 14px 12px 6px; color: var(--ivp-side-muted); }
  .side-foot { margin-top: auto; padding-top: 16px; }
  .side .theme-form .chip { min-height: 34px; padding: 0 12px; font-size: 0.82rem; background: transparent; border-color: var(--ivp-hero-3); color: var(--ivp-side-text); }
  .side .theme-form .chip.is-active { background: var(--ivp-hero-text); border-color: var(--ivp-hero-text); color: var(--ivp-hero); }
  .side-user { margin: 14px 0 0 4px; color: var(--ivp-side-muted); font-size: 0.9rem; }
}

/* página Mais (/menu/) */
.menu-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.menu-head h1 { margin: 0; font-size: 1.35rem; }
.menu-head p { margin: 0; font-size: 0.9rem; }
.menu-symbol { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 16px; background: var(--ivp-surface-2); flex: none; }
.menu-symbol img { height: 40px; width: auto; }
.menu-group { margin: 18px 0 8px; }
.menu-list { list-style: none; margin: 0 0 6px; padding: 0; background: var(--ivp-surface); border-radius: var(--ivp-r-lg); overflow: hidden; }
.menu-list li + li { border-top: 1px solid var(--ivp-line-2); }
.menu-list a { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 14px 12px 16px; text-decoration: none; font-weight: 600; --pico-color: var(--ivp-ink); color: var(--ivp-ink); }
.menu-list a > span:first-child { flex: 1; }
.menu-list a:hover { background: var(--ivp-surface-2); }
.menu-list small { font-weight: 500; }
.menu-list .chev { color: var(--ivp-chev); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; padding: 0 8px; border-radius: 8px; font-size: 0.8rem; font-weight: 700; background: var(--ivp-line-2); color: var(--ivp-ink); }
.count.bad { background: var(--ivp-bad-soft); color: var(--ivp-bad); }
.menu-card { padding: 12px 14px; margin: 0 0 12px; background: var(--ivp-surface); border-radius: var(--ivp-r-lg); }
.menu-exit { min-height: 52px; display: flex; align-items: center; }
.menu-exit button { font-size: 1rem; }

/* folha do "+" (/registrar/) */
.sheet { background: var(--ivp-surface); border-radius: var(--ivp-r-xl); padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
.sheet-handle { width: 44px; height: 5px; margin: 6px auto 10px; border-radius: 3px; background: var(--ivp-line); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-head h1 { margin: 0; font-size: 1.4rem; }
.sheet-close { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; --pico-color: var(--ivp-ink); color: var(--ivp-ink); }
.sheet-item { display: flex; align-items: center; gap: 14px; min-height: 72px; margin: 0 0 12px; padding: 14px 16px; border-radius: var(--ivp-r-lg); background: var(--ivp-surface-2); text-decoration: none; --pico-color: var(--ivp-ink); color: var(--ivp-ink); }
.sheet-item strong { display: block; font-size: 1.05rem; }
.sheet-item small { display: block; font-size: 0.85rem; color: var(--ivp-ink-2); }
.sheet-item.is-primary { background: var(--ivp-gold); color: var(--ivp-on-gold); }
.sheet-item.is-primary small { color: var(--ivp-on-gold); }
.sheet-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--ivp-surface); color: var(--ivp-ink); flex: none; }
.sheet-item:hover { filter: brightness(0.97); }
@media (max-width: 1023px) {
  body.sheet-page { min-height: 100vh; margin: 0; background: var(--ivp-scrim); padding-bottom: 0; }
  body.sheet-page .bottom-nav { display: none; }
  body.sheet-page > .main { padding: 0; max-width: none; }
  body.sheet-page .sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow: auto; border-radius: var(--ivp-r-xl) var(--ivp-r-xl) 0 0; }
}
@media (min-width: 1024px) {
  .sheet { max-width: 480px; margin: 40px auto; padding: 16px 20px 20px; }
  .sheet-handle { display: none; }
}

/* login */
.login-side { display: none; }
.login-logo { text-align: center; margin: 40px 0 24px; }
.login-logo img { max-width: 100%; height: auto; }
article.login { max-width: 420px; margin: 0 auto; padding: 22px 20px; border-radius: var(--ivp-r-xl); }
article.login h1 { font-size: 1.5rem; margin-bottom: 14px; }
article.login input { min-height: 52px; }
.login-button { min-height: 56px; font-size: 1.05rem; margin: 6px 0 12px; }
.login-foot { text-align: center; font-size: 0.8rem; margin: 24px 0 8px; }
@media (min-width: 1024px) {
  body.login-page > .main { max-width: none; padding: 0; margin: 0; }
  .login-wrap { display: grid; grid-template-columns: 620px minmax(0, 1fr); min-height: 100vh; }
  .login-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 48px; background: var(--ivp-side); color: var(--ivp-side-text); text-align: center; }
  .login-side img { width: 360px; height: auto; }
  .login-side p { max-width: 360px; margin: 0; font-size: 1.05rem; color: var(--ivp-side-text); }
  .login-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 32px; }
  .login-logo { display: none; }
  article.login { width: 420px; }
}

/* ===== Design Oficina — Etapa 3: componentes (docs/design.md, seção 5) ======================= */
/* cartões, herói e KPIs */
.card { background: var(--ivp-surface); border-radius: var(--ivp-r-lg); padding: 16px; margin: 0 0 12px; }
.card > :last-child { margin-bottom: 0; }
fieldset.card { border: 0; }
fieldset.card > legend { float: left; width: 100%; margin: 0 0 12px; padding: 0; font-size: 1.05rem; font-weight: 700; }
fieldset.card > legend + * { clear: both; }
.hero { background: var(--ivp-hero); color: var(--ivp-hero-text); border-radius: var(--ivp-r-lg); padding: 18px 20px; margin: 0 0 12px; }
.hero .eyebrow, .hero .muted { color: var(--ivp-gold-hi); }
.hero .num-big { font-size: 2.75rem; font-weight: 800; line-height: 1.05; margin: 2px 0 6px; }
.kpi .eyebrow { display: block; margin-bottom: 2px; }
.kpi .value { font-size: 1.25rem; font-weight: 700; line-height: 1.2; margin: 0; }
@media (min-width: 1024px) { .card { padding: 20px; } .hero { padding: 22px 24px; } .hero .num-big { font-size: 3rem; } }
header.page-head { margin-bottom: 12px; }
header.page-head [role="button"] { margin: 0; }

/* chips (escolha única: radio + label, ou links) e segmentado */
.chips, .chips-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chips input[type="radio"], .seg input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
label.chip { display: inline-flex; margin: 0; cursor: pointer; user-select: none; }
.chips input:checked + .chip, .seg input:checked + .chip { background: var(--ivp-sel); border-color: var(--ivp-sel); color: var(--ivp-on-sel); }
.chips input:focus-visible + .chip, .seg input:focus-visible + .chip { outline: 2px solid var(--ivp-gold); outline-offset: 2px; }
a.chip, a.chip:hover { text-decoration: none; --pico-color: var(--ivp-ink); color: var(--ivp-ink); }
a.chip:hover { border-color: var(--ivp-ink-3); }
a.chip.is-active, a.chip.is-active:hover { --pico-color: var(--ivp-on-sel); color: var(--ivp-on-sel); }
.chip.dashed { border-style: dashed; border-color: var(--ivp-dash); background: transparent; }
fieldset.choice { margin: 0 0 4px; padding: 0; border: 0; }
fieldset.choice legend { font-weight: 500; margin-bottom: 6px; padding: 0; }
.seg { display: flex; gap: 4px; padding: 4px; margin: 0 0 14px; background: var(--ivp-track); border-radius: 14px; }
.seg .chip, .seg > a { flex: 1; justify-content: center; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--ivp-ink-2); font-weight: 600; text-decoration: none; }
.seg input:checked + .chip, .seg > a.is-active { background: var(--ivp-surface); color: var(--ivp-ink); font-weight: 700; box-shadow: 0 1px 2px color-mix(in srgb, var(--ivp-ink) 12%, transparent); }

/* stepper (contagens inteiras) */
.stepper { display: inline-flex; align-items: stretch; max-width: 100%; margin: 0 0 var(--pico-spacing); border: 1px solid var(--ivp-field); border-radius: var(--ivp-r-md); background: var(--ivp-surface); overflow: hidden; }
.stepper.wide { display: flex; }
.stepper button { flex: none; width: 52px; min-height: 48px; margin: 0; padding: 0; border: 0; border-radius: 0; background: var(--ivp-surface-2); color: var(--ivp-ink); font-size: 1.35rem; font-weight: 700; line-height: 1; box-shadow: none; }
.stepper button:hover { background: var(--ivp-track); }
.stepper input { flex: 1; width: 4.5rem; min-width: 0; height: auto; margin: 0; padding: 0 6px; border: 0; border-radius: 0; background: transparent; text-align: center; font-size: 1.1rem; font-weight: 700; box-shadow: none; appearance: textfield; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; box-shadow: none; }
.stepper:focus-within { border-color: var(--ivp-gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ivp-gold) 30%, transparent); }

/* campo com sufixo de unidade (R$, %, g…) — a unidade vem do atributo data-suffix, via CSS */
.field { position: relative; display: flex; align-items: center; margin: 0 0 var(--pico-spacing); }
.field > input { margin: 0; padding-right: 4.2rem; }
.field::after { content: attr(data-suffix); position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ivp-ink-2); font-size: 0.9rem; font-weight: 500; pointer-events: none; }

/* badges (estado com palavra ou sinal, nunca só cor) e etiquetas neutras */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px; font-size: 0.8rem; font-weight: 700; line-height: 1.4; white-space: nowrap; vertical-align: middle; }
.badge.ok { background: var(--ivp-ok-soft); color: var(--ivp-ok); }
.badge.warn { background: var(--ivp-warn-soft); color: var(--ivp-warn); }
.badge.bad { background: var(--ivp-bad-soft); color: var(--ivp-bad); }
.badge.neutral { background: var(--ivp-line-2); color: var(--ivp-ink-2); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 8px; background: var(--ivp-line-2); color: var(--ivp-ink-2); font-size: 0.75rem; font-weight: 600; line-height: 1.5; vertical-align: middle; white-space: nowrap; }

/* barras e medidores em SVG (largura por atributo, nunca por style) */
.bar, .meter { display: block; width: 100%; max-width: 100%; }
.bar .track, .meter .track { fill: var(--ivp-track); }
.bar .fill, .meter .fill { fill: var(--ivp-c-main); }
.bar.ok .fill, .meter.ok .fill { fill: var(--ivp-ok); }
.bar.warn .fill, .meter.warn .fill { fill: var(--ivp-gold); }
.bar.bad .fill, .meter.bad .fill { fill: var(--ivp-bad-mark); }
.meter .limit { fill: var(--ivp-ink); }
td .cell { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 120px; }

/* tabelas → cartões no celular: <table class="list-cards">, <td data-label="…">, <td class="title">, <td class="actions"> */
table.list-cards th.num, table.list-cards td.num { text-align: right; white-space: nowrap; }
table.list-cards td.actions a { white-space: nowrap; }
@media (max-width: 767px) {
  table.list-cards, table.list-cards tbody { display: block; width: 100%; }
  table.list-cards thead { display: none; }
  table.list-cards tr { display: flex; flex-direction: column; margin: 0 0 10px; padding: 12px 14px; background: var(--ivp-surface); border-radius: var(--ivp-r-lg); }
  table.list-cards td { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; background: transparent; text-align: right; white-space: normal; }
  table.list-cards td[data-label]::before { content: attr(data-label); flex: none; color: var(--ivp-ink-2); font-size: 0.85rem; text-align: left; }
  table.list-cards td.title { order: -1; display: block; padding: 0 0 6px; font-size: 1.05rem; font-weight: 700; text-align: left; }
  table.list-cards td.title a { text-decoration: none; }
  table.list-cards td.actions { justify-content: flex-start; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--ivp-line-2); }
  table.list-cards td:empty { display: none; }
  td .cell { min-width: 0; width: 60%; }
}

/* barra de ação fixa no rodapé do formulário */
.action-bar { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 5; display: flex; gap: 10px; align-items: center; margin: 16px -4px 0; padding: 10px 4px 12px; background: var(--ivp-bg); border-top: 1px solid var(--ivp-line); }
.action-bar > button, .action-bar > [role="button"] { margin: 0; }
.action-bar > button[type="submit"] { flex: 1; min-height: 52px; font-size: 1.05rem; }
.action-bar > [role="button"].secondary { width: auto; }
@media (min-width: 1024px) { .action-bar { position: static; border: 0; padding: 8px 0 0; margin: 8px 0 0; } .action-bar > button[type="submit"] { flex: 0 1 auto; min-width: 220px; } }

/* toast (mensagens do Django) */
.toasts { position: fixed; left: 16px; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-radius: 14px; background: var(--ivp-sel); color: var(--ivp-on-sel); font-weight: 600; box-shadow: 0 8px 24px color-mix(in srgb, var(--ivp-ink) 25%, transparent); pointer-events: auto; transition: opacity 0.35s, transform 0.35s; }
.toast > span { flex: 1; }
.toast.error, .toast.warning { background: var(--ivp-bad-soft); color: var(--ivp-bad); }
.toast.is-hidden { opacity: 0; transform: translateY(8px); }
.toast-close { width: 36px; min-height: 36px; margin: 0; padding: 0; border: 0; border-radius: 10px; background: transparent; color: inherit; box-shadow: none; display: flex; align-items: center; justify-content: center; }
.toast-close .icon { width: 18px; height: 18px; }
@media (min-width: 1024px) { .toasts { left: auto; right: 24px; bottom: 24px; width: 380px; } }

/* estado vazio, "como calculamos", botões de risco e tracejado */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 16px; margin: 0 0 12px; text-align: center; background: var(--ivp-surface); border-radius: var(--ivp-r-lg); }
.empty .icon { width: 40px; height: 40px; color: var(--ivp-ink-3); stroke-width: 1.5; }
.empty p { margin: 0; color: var(--ivp-ink-2); }
.empty [role="button"] { margin: 4px 0 0; width: auto; }
details.howto { margin: 8px 0 20px; }
details.howto summary { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--ivp-ink-2); cursor: pointer; }
details.howto p { margin: 6px 0 0; font-size: 0.875rem; color: var(--ivp-ink-2); }
button.danger, [role="button"].danger { --pico-background-color: var(--ivp-bad-soft); --pico-border-color: var(--ivp-bad-line); --pico-color: var(--ivp-bad); background: var(--ivp-bad-soft); border-color: var(--ivp-bad-line); color: var(--ivp-bad); }
button.danger:hover, [role="button"].danger:hover { background: var(--ivp-bad-line); color: var(--ivp-bad-strong); border-color: var(--ivp-bad-line); }
button.dashed, [role="button"].dashed { background: transparent; border: 1.5px dashed var(--ivp-dash); color: var(--ivp-ink); box-shadow: none; }

/* ===== Design Oficina — Etapa 4: Painel (docs/design.md, seção 6) =========================== */
.only-desktop { display: none; }
.neg { color: var(--ivp-bad); }
.pos { color: var(--ivp-ok); }
.painel-head .eyebrow { display: block; margin-bottom: 2px; }
.painel-head h1 { margin: 0; }
[role="button"].vender { display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 0; padding: 0 18px; }
[role="button"].vender .icon { width: 18px; height: 18px; stroke-width: 2.4; }
details.chip-details { margin: 0; }
details.chip-details > summary { list-style: none; }
details.chip-details > summary::-webkit-details-marker { display: none; }
details.chip-details > summary::marker { content: ""; }
details.chip-details[open] { flex-basis: 100%; }
details.chip-details .period-form { margin: 10px 0 0; }

.painel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.painel > * { grid-column: 1 / -1; margin: 0; }
.painel > .painel-maq, .painel > .painel-perdas { grid-column: auto; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.card-head h2 { margin: 0; font-size: 1.15rem; }
.card-head a { font-weight: 600; }
.row-between { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }

/* herói */
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hero-badge { display: inline-block; padding: 3px 10px; border-radius: 8px; background: var(--ivp-hero-2); color: var(--ivp-hero-text); font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.hero-badge.down { background: var(--ivp-bad-mark); }
.hero .num-big.neg { color: color-mix(in srgb, var(--ivp-bad-mark) 55%, var(--ivp-hero-text)); }
.hero-chart { display: block; width: 100%; height: auto; margin: 4px 0 6px; }
.hero-chart .base { stroke: var(--ivp-hero-2); stroke-width: 1; }
.hero-chart .area { fill: color-mix(in srgb, var(--ivp-gold-hi) 16%, transparent); }
.hero-chart .cur { fill: none; stroke: var(--ivp-gold-hi); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.hero-chart .prev { fill: none; stroke: var(--ivp-hero-3); stroke-width: 2; stroke-dasharray: 5 4; stroke-linejoin: round; }
.hero-chart .dot { fill: var(--ivp-gold-hi); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 12px; font-size: 0.8rem; color: var(--ivp-ink-2); }
.hero .legend { color: var(--ivp-hero-muted); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .key::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--ivp-ink-2); }
.legend .key.cur::before { background: var(--ivp-gold-hi); }
.legend .key.prev::before { height: 0; background: transparent; border-top: 2px dashed var(--ivp-hero-3); }
.legend .key.lucro::before { width: 10px; height: 10px; border-radius: 3px; background: var(--ivp-c-main); }
.legend .key.rest::before { width: 10px; height: 10px; border-radius: 3px; background: var(--ivp-c-rest); }
.hero-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-top: 12px; border-top: 1px solid var(--ivp-hero-2); }
.hero .kpi .eyebrow { color: var(--ivp-hero-muted); font-size: 0.68rem; letter-spacing: 0.6px; overflow-wrap: normal; }
.hero .kpi .value { color: var(--ivp-hero-text); font-size: 1rem; }
.hero-kpis .kpi { min-width: 0; }

/* precisa de atenção */
.attn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
a.attn, a.attn:hover { display: flex; flex-direction: column; gap: 4px; min-height: 108px; padding: 14px; border-radius: var(--ivp-r-lg); text-decoration: none; }
a.attn.bad, a.attn.bad:hover { background: var(--ivp-bad-soft); --pico-color: var(--ivp-bad); color: var(--ivp-bad); }
a.attn.warn, a.attn.warn:hover { background: var(--ivp-warn-soft); --pico-color: var(--ivp-warn); color: var(--ivp-warn); }
.attn .icon { width: 22px; height: 22px; }
.attn-num { font-size: 2rem; font-weight: 800; line-height: 1; margin-top: 4px; }
.attn > span { font-size: 0.9rem; font-weight: 600; line-height: 1.25; }
.allgood { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--ivp-r-lg); background: var(--ivp-ok-soft); color: var(--ivp-ok); }
.allgood .icon { flex: none; }

/* saúde, barras horizontais, ranking */
.hbar { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 6px 0; }
.hbar .bar { width: 100%; }
.bar.ref .fill { fill: var(--ivp-c-ref); }
.painel-saude h3 { font-size: 1rem; margin: 14px 0 6px; }
.rank { margin: 0 0 12px; }
.rank-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-weight: 600; }
.rank-top .num { white-space: nowrap; }
.rank.fil { display: flex; gap: 10px; align-items: flex-start; }
.rank-body { flex: 1; min-width: 0; }
.dot { display: inline-block; flex: none; width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; background: var(--ivp-track); box-shadow: 0 0 0 1px rgba(128, 128, 128, 0.5); }
/* bolinha de cor do filamento (Etapa 8): círculo SVG com fill por atributo; sem cor = neutra */
svg.dot { border-radius: 0; background: transparent; box-shadow: none; overflow: visible; vertical-align: -2px; }
svg.dot circle { stroke: color-mix(in srgb, var(--ivp-ink) 35%, transparent); stroke-width: 1; }
svg.dot.none circle { fill: var(--ivp-track); }
h1 svg.dot { width: 20px; height: 20px; margin: 0; vertical-align: -1px; }
td.title svg.dot, .previa-fil svg.dot, table svg.dot { margin: 0; }
a.insight, a.insight:hover { display: flex; align-items: flex-start; gap: 10px; margin-top: 6px; padding: 12px 14px; border-radius: 14px; font-size: 0.9rem; text-decoration: none; }
a.insight.bad, a.insight.bad:hover { background: var(--ivp-bad-soft); --pico-color: var(--ivp-bad); color: var(--ivp-bad); }
.insight .icon { flex: none; }
.insight u { font-weight: 700; }

/* vendas por dia */
.cols { display: block; width: 100%; height: auto; }
.cols .grid { stroke: var(--ivp-line); stroke-width: 1; stroke-dasharray: 3 3; }
.cols .grid.strong { stroke-dasharray: none; }
.cols .axis { fill: var(--ivp-ink-2); font-size: 9px; font-family: inherit; }
.cols .axis.hoje { fill: var(--ivp-ink); font-weight: 700; }
.cols .lucro { fill: var(--ivp-c-main); }
.cols .rest { fill: var(--ivp-c-rest); }

/* impressora e perdas */
.painel-maq .value.big, .painel-perdas .value.big { font-size: 1.6rem; margin: 2px 0 8px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }

@media (min-width: 1024px) {
  .only-desktop { display: block; }
  .painel { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; grid-template-areas: "hero hero saude" "dia dia atencao" "canal itens fil" "maq perdas ."; }
  .painel > * { grid-column: auto; }
  .painel > .painel-hero { grid-area: hero; }
  .painel > .painel-saude { grid-area: saude; }
  .painel > .painel-dia { grid-area: dia; }
  .painel > .painel-atencao { grid-area: atencao; }
  .painel > .painel-canal { grid-area: canal; }
  .painel > .painel-itens { grid-area: itens; }
  .painel > .painel-fil { grid-area: fil; }
  .painel > .painel-maq { grid-area: maq; }
  .painel > .painel-perdas { grid-area: perdas; }
  .painel-atencao h2 { font-size: 1.15rem; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; }
  .attn-grid { grid-template-columns: 1fr; }
  a.attn { flex-direction: row; align-items: center; gap: 12px; min-height: 0; padding: 12px 14px; }
  .attn-num { margin: 0; font-size: 1.5rem; min-width: 2rem; }
  .hero-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero .num-big { font-size: 3rem; }
}

/* ===== Design Oficina — Etapa 5: fluxos rápidos (docs/design.md, seção 7) ==================== */
header.page-head.flow-head { justify-content: flex-start; gap: 10px; }
.flow-head .back { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--ivp-surface); --pico-color: var(--ivp-ink); color: var(--ivp-ink); text-decoration: none; }
.field-title { margin: 0 0 8px; font-weight: 600; }
.picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.picks .pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 64px; margin: 0; padding: 10px 12px; border: 1px solid var(--ivp-field); border-radius: 14px; background: var(--ivp-surface); color: var(--ivp-ink); text-align: left; font-weight: 700; line-height: 1.25; box-shadow: none; }
.picks .pick small { font-weight: 500; font-size: 0.8rem; color: var(--ivp-ink-2); }
.picks .pick.is-active { background: var(--ivp-sel); border-color: var(--ivp-sel); color: var(--ivp-on-sel); }
.picks .pick.is-active small { color: var(--ivp-on-sel); opacity: 0.85; }
.picks .pick-other { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; min-height: 52px; border-style: dashed; border-color: var(--ivp-dash); background: transparent; font-weight: 600; color: var(--ivp-ink-2); }
.picks .pick-other.is-active { background: var(--ivp-surface); border-style: solid; color: var(--ivp-ink); }
.pick-select select { margin-bottom: 14px; }
.date-pick .date-input { margin-top: 8px; }
details.more { margin: 0 0 14px; }
details.more > summary { list-style: none; display: inline-flex; width: auto; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::marker { content: ""; }
details.more[open] > summary { margin-bottom: 10px; }
form.quick .grid { gap: 0 12px; }
/* barra de lucro da venda */
.profit-bar { flex-direction: column; align-items: stretch; gap: 8px; }
.profit-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.profit-row .eyebrow { display: block; }
.profit-value { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--ivp-ok); }
.profit-value.neg { color: var(--ivp-bad); }
.profit-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 0.85rem; color: var(--ivp-ink-2); }
.profit-hint { display: block; font-size: 0.85rem; color: var(--ivp-ink-2); }
.profit-hint.bad { color: var(--ivp-bad); font-weight: 600; }
/* cartão "Ao registrar" e "saldo depois" */
.effects .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 7px 0; border-top: 1px solid var(--ivp-line-2); }
.effects .row:first-of-type { border-top: 0; }
.effects .row.stack { flex-wrap: wrap; }
.effects .row.stack small { flex-basis: 100%; }
.effects strong.pos { color: var(--ivp-ok); }
.saldo-depois { display: flex; justify-content: space-between; align-items: center; background: var(--ivp-surface-2); margin: 4px 0 14px; }
.saldo-depois strong { font-size: 1.25rem; }
.saldo-depois strong.neg { color: var(--ivp-bad); }
form.sheet { margin: 0; }
form.sheet h1 { font-size: 1.25rem; margin: 0; }
form.sheet .sheet-head { align-items: flex-start; }
form.sheet .action-bar { bottom: 0; margin: 12px 0 0; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--ivp-surface); }
@media (max-width: 1023px) { body.sheet-page form.sheet { padding-bottom: 0; } }
@media (min-width: 1024px) { .picks { grid-template-columns: repeat(4, minmax(0, 1fr)); } .picks .pick-other { grid-column: 1 / -1; } .profit-bar { flex-direction: row; align-items: center; justify-content: space-between; } .profit-bar > button[type="submit"] { flex: 0 0 auto; } }

/* ===== Design Oficina — Etapa 6: listas (docs/design.md, seção 7) ============================== */
.only-wide, .only-wide-inline, .only-wide-text { display: none; }
.only-narrow { display: block; }
@media (min-width: 768px) { .only-wide { display: block; } .only-wide-inline { display: inline-flex; } .only-wide-text { display: inline; } .only-narrow { display: none; } }
.head-actions { display: flex; gap: 8px; align-items: center; }
.head-actions [role="button"] { margin: 0; width: auto; }
.flow-head .head-btn { margin-left: auto; width: auto; }
.flow-head > div h1 { margin: 0; }
.center { text-align: center; }
.day-label { margin: 14px 0 6px; }
.card-list { display: flex; flex-direction: column; gap: 8px; }
.card.table-card { padding: 8px 16px 4px; overflow-x: auto; }
td .badges { display: inline-flex; flex-wrap: nowrap; gap: 4px; }
.card.table-card table { margin-bottom: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; margin: 0 0 6px; }
.filters .chips-nav { margin: 0; flex: 1 1 auto; }
.filters .search { margin: 0; flex: 1 1 220px; max-width: 320px; }
.filters .search input { margin: 0; min-height: 40px; border-radius: 999px; padding: 0 16px; }
/* resumo do mês: faixa marinho no celular, cartões no desktop */
.summary-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; padding: 14px 16px; background: var(--ivp-hero); color: var(--ivp-hero-text); border-radius: var(--ivp-r-lg); }
.summary-band .kpi { min-width: 0; }
.summary-band .kpi .eyebrow { color: var(--ivp-hero-muted); font-size: 0.68rem; letter-spacing: 0.6px; overflow-wrap: normal; }
.summary-band .kpi .value { color: var(--ivp-hero-text); font-size: 1.05rem; }
.summary-band .kpi .value.pos { color: var(--ivp-gold-hi); }
.summary-band .kpi .value.neg { color: color-mix(in srgb, var(--ivp-bad-mark) 55%, var(--ivp-hero-text)); }
@media (min-width: 768px) {
  .summary-band { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 0; background: transparent; color: inherit; }
  .summary-band .kpi { padding: 14px 16px; background: var(--ivp-surface); border-radius: var(--ivp-r-lg); }
  .summary-band .kpi .eyebrow { color: var(--ivp-ink-2); font-size: 0.75rem; letter-spacing: 1px; }
  .summary-band .kpi .value { color: var(--ivp-ink); font-size: 1.5rem; }
  .summary-band .kpi .value.pos { color: var(--ivp-ok); }
  .summary-band .kpi .value.neg { color: var(--ivp-bad); }
}
/* cartões de pedido e de impressão (celular) */
a.order-card, a.order-card:hover { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--ivp-surface); border-radius: 16px; text-decoration: none; --pico-color: var(--ivp-ink); color: var(--ivp-ink); }
.order-main { min-width: 0; flex: 1; }
.order-main > strong { display: block; line-height: 1.3; }
.order-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; font-size: 0.8rem; }
.order-main > small { display: block; margin-top: 4px; }
.order-money { flex: none; text-align: right; white-space: nowrap; }
.order-money strong { display: block; font-size: 1.05rem; }
.order-money span { font-size: 0.85rem; font-weight: 600; }
.tag.gold { background: var(--ivp-warn-soft); color: var(--ivp-warn); }
/* abas do estoque */
.tabs { display: flex; gap: 4px; margin: 0 0 12px; padding: 4px; background: var(--ivp-track); border-radius: 14px; overflow-x: auto; }
.tabs a, .tabs a:hover { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 8px; border-radius: 10px; text-decoration: none; --pico-color: var(--ivp-ink-2); color: var(--ivp-ink-2); font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.tabs a.is-active { background: var(--ivp-surface); --pico-color: var(--ivp-ink); color: var(--ivp-ink); font-weight: 700; box-shadow: 0 1px 2px color-mix(in srgb, var(--ivp-ink) 12%, transparent); }
.tabs .count { min-width: 20px; height: 20px; padding: 0 6px; font-size: 0.7rem; }
@media (max-width: 767px) { .tabs a { font-size: 0.85rem; } }
.kpi-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.kpi-row .card { margin: 0; padding: 12px 14px; }
.kpi-row .value { font-size: 1.25rem; }
@media (min-width: 768px) { .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* linhas de estoque (peças, partes, insumos) */
.stock-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.stock-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; background: var(--ivp-surface); border-radius: 16px; }
.stock-row .name { font-weight: 700; text-decoration: none; min-width: 0; }
.stock-row .qty { font-weight: 700; white-space: nowrap; text-align: right; }
.stock-row .links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.85rem; }
@media (min-width: 768px) { .stock-row { grid-template-columns: minmax(0, 1fr) auto auto; } .stock-row .links { grid-column: auto; } }
/* cartões de filamento */
.fil-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0 0 10px; }
@media (min-width: 768px) { .fil-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .fil-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fil-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 12px 14px; background: var(--ivp-surface); border-radius: 16px; }
.fil-card .dot { margin: 0; }
.fil-card .name { font-weight: 700; text-decoration: none; min-width: 0; }
.fil-card .grams { white-space: nowrap; }
.fil-card .grams.bad { color: var(--ivp-bad); }
.fil-card .grams.warn { color: var(--ivp-warn); }
.fil-card .bar { grid-column: 1 / -1; }
.fil-card .links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 0.8rem; }
/* linha do tempo dos históricos */
.timeline { list-style: none; margin: 0 0 8px; padding: 8px 16px; }
.timeline li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--ivp-line-2); }
.timeline li:first-child { border-top: 0; }
.tl-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 800; grid-row: 1 / span 2; }
.tl-icon.up { background: var(--ivp-ok-soft); color: var(--ivp-ok); }
.tl-icon.down { background: color-mix(in srgb, var(--ivp-c-main) 15%, transparent); color: var(--ivp-c-main); }
.tl-icon.x { background: var(--ivp-bad-soft); color: var(--ivp-bad); }
.tl-icon.adj { background: var(--ivp-warn-soft); color: var(--ivp-warn); }
.tl-main { min-width: 0; }
.tl-qty { font-weight: 700; white-space: nowrap; text-align: right; }
.tl-meta { grid-column: 2 / -1; font-size: 0.85rem; color: var(--ivp-ink-2); }
/* cartões de produto/kit (celular) */
.item-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 12px 14px; margin: 0 0 8px; background: var(--ivp-surface); border-radius: 16px; }
.item-card .name { font-weight: 700; text-decoration: none; }
.item-card .price { font-size: 1.05rem; white-space: nowrap; }
.item-card .profit { font-size: 0.9rem; }
.item-card .stock { text-align: right; }
.item-card .badges { grid-column: 1 / -1; margin: 2px 0 0; }
.badges .badge { padding: 1px 7px; font-size: 0.72rem; }
.badge.strike { text-decoration: line-through; background: var(--ivp-line-2); color: var(--ivp-ink-3); }

/* ===== Design Oficina — Etapa 7: editores e cadastros (docs/design.md, seção 7) =============== */
/* utilitários */
.only-narrow-inline { display: inline; }
.only-narrow-flex { display: inline-flex; }
@media (min-width: 768px) { .only-narrow-inline, .only-narrow-flex { display: none; } }
.crumbs { margin: 0 0 2px; font-size: 0.85rem; color: var(--ivp-ink-2); }
.crumbs a { color: var(--ivp-ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.sec-head h2, .card > h2 { font-size: 1.15rem; margin: 0 0 10px; }
.sec-head h2 { margin: 0; }
.f2, .f3, .f4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.f2 > *, .f3 > *, .f4 > * { min-width: 0; }
@media (min-width: 768px) { .f3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .f4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.align-end { align-items: end; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 4px 0 8px; }
.checks label.check { margin: 0; }
.value.pos, strong.pos { color: var(--ivp-ok); }
.value.neg, strong.neg, td.neg { color: var(--ivp-bad); }
.value.gold { color: var(--ivp-warn); }
.tag.gold { background: var(--ivp-warn-soft); color: var(--ivp-warn); }

/* cabeçalho do editor: Cancelar · título · Salvar (fixo no topo do celular) */
body.editor-page { padding-bottom: 0; }
body.editor-page nav.bottom-nav { display: none; }
.editor { margin: 0; padding-bottom: 120px; }
.editor-head { position: sticky; top: 0; z-index: 7; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: -16px -16px 12px; padding: 10px 16px; background: var(--ivp-bg); }
.editor-head .editor-title { text-align: center; min-width: 0; }
.editor-head h1 { font-size: 1.1rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-cancel { justify-self: start; font-weight: 600; text-decoration: none; }
.editor-save { justify-self: end; width: auto; margin: 0; padding: 8px 18px; min-height: 44px; }
.editor-tabs { position: sticky; top: 64px; z-index: 6; }
@media (max-width: 1099px) { .editor-sec:not(.is-current) { display: none; } }
@media (min-width: 1100px) {
  .editor { padding-bottom: 24px; }
  .editor-head { position: static; grid-template-columns: minmax(0, 1fr) auto auto; margin: 0 0 16px; padding: 0; background: transparent; }
  .editor-head .editor-title { text-align: left; order: -1; }
  .editor-head h1 { font-size: 1.75rem; white-space: normal; }
  .editor-cancel { justify-self: end; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--ivp-c-main); border-radius: var(--ivp-r-md); color: var(--ivp-c-main); }
  .editor-tabs { display: none; }
  .editor-sec { display: block; }
}
.produto-layout { gap: 16px; }
@media (min-width: 1100px) { .produto-layout { grid-template-columns: minmax(0, 1fr) 400px; } }

/* linhas de formset (filamentos, insumos, componentes, faixas) */
.line-head { display: grid; gap: 0 10px; margin: 0 0 4px; font-size: 0.8rem; font-weight: 600; color: var(--ivp-ink-2); }
.line { display: grid; gap: 6px 10px; align-items: start; margin: 0 0 8px; }
.line select, .line input:not([type=checkbox]) { margin: 0; }
.line .field { margin: 0; }
.line .stepper { margin: 0; }
.line .cell-main { min-width: 0; }
.line .errorlist { grid-column: 1 / -1; margin: 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; margin: 0; padding: 0; border: 1px solid var(--ivp-field); border-radius: var(--ivp-r-md); background: var(--ivp-surface); color: var(--ivp-ink-2); font-size: 1.2rem; line-height: 1; box-shadow: none; }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn.danger { color: var(--ivp-bad); background: var(--ivp-bad-soft); border-color: var(--ivp-bad-line); }
.empty-hint { margin: 0 0 10px; font-size: 0.9rem; }
button.dashed.small { width: auto; padding: 6px 14px; min-height: 40px; font-size: 0.9rem; }
button.dashed { width: auto; }
button.dashed.add-wide { width: 100%; margin: 4px 0 12px; }
.sup-row, .sup-head { grid-template-columns: minmax(0, 1fr) 84px 40px; }
.sup-row .cell-role { grid-column: 1 / -1; }
.comp-row, .comp-head { grid-template-columns: minmax(0, 1fr) auto 40px; }
.comp-row .stepper input { width: 3rem; }
.fil-row, .fil-head { grid-template-columns: minmax(0, 1fr) 104px 40px; align-items: center; }
.fil-row .dot { display: none; margin: 0; }
.fil-head span:first-child { display: none; }
.line .icon-btn { width: 40px; }
@media (min-width: 768px) {
  .fil-row, .fil-head { grid-template-columns: 14px minmax(0, 1fr) 120px 44px; }
  .fil-row .dot, .fil-head span:first-child { display: inline-block; }
  .line .icon-btn { width: 44px; }
}
@media (min-width: 768px) {
  .sup-row, .sup-head { grid-template-columns: minmax(0, 1fr) 110px 190px 44px; }
  .sup-row .cell-role { grid-column: auto; }
}

/* placas */
article.placa { padding: 14px; margin: 0 0 12px; border: 2px solid var(--ivp-gold); }
article.placa > header.placa-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 0; background: transparent; border: 0; }
.placa-head .grow { flex: 1 1 auto; min-width: 0; }
.placa-head > .printer-label { flex: 0 0 auto; font-size: 0.85rem; }
.placa-head > .icon-btn { flex: none; }
.placa-head .grow > input { width: 100%; }
.placa-head input { margin: 0; font-weight: 600; }
.placa-head .printer-pick { flex: 0 0 40%; }
.placa-head .printer-pick select { margin: 0; }
.placa-n { flex: none; background: var(--ivp-c-main); color: var(--ivp-on-sel); }
.fil-box { margin: 4px 0 0; padding: 12px; background: var(--ivp-surface-2); border-radius: var(--ivp-r-md); }
.fil-box .field-title { margin: 0 0 8px; }
.fil-box .dashed { margin: 2px 0 0; }
.fil-box select { background-color: var(--ivp-surface); }

/* prévia: painel à direita no desktop; barra fixa que vira folha no celular */
.previa .previa-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.previa .previa-head h2 { font-size: 1.15rem; margin: 0; flex: 1; color: inherit; }
.previa-close { width: 40px; min-height: 40px; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font-size: 1.4rem; box-shadow: none; }
.previa-bar { display: grid; grid-template-columns: 1fr 1fr auto; gap: 2px 14px; align-items: end; width: 100%; margin: 0; padding: 12px 16px 14px; border: 0; border-radius: 18px 18px 0 0; background: var(--ivp-hero); color: var(--ivp-hero-text); text-align: left; box-shadow: 0 -8px 24px color-mix(in srgb, var(--ivp-ink) 25%, transparent); }
.previa-bar::before { content: ""; grid-column: 1 / -1; justify-self: center; width: 40px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ivp-hero-text) 40%, transparent); }
.previa-bar .pb-item { display: flex; flex-direction: column; gap: 0; }
.previa-bar .pb-item small { font-size: 0.75rem; color: var(--ivp-hero-muted); }
.previa-bar .pb-item strong { font-size: 1.25rem; line-height: 1.2; }
.previa-bar .pb-item:nth-child(3) strong { color: var(--ivp-gold-hi); }
.previa-bar .badge { align-self: center; }
.previa-bar .pb-hint { grid-column: 1 / -1; font-size: 0.78rem; color: var(--ivp-hero-muted); }
.previa-scrim { position: fixed; inset: 0; z-index: 8; background: var(--ivp-scrim); }
@media (max-width: 1099px) {
  .previa { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; display: flex; flex-direction: column; max-height: 88vh; background: var(--ivp-hero); color: var(--ivp-hero-text); border-radius: 18px 18px 0 0; }
  .previa .previa-head, .previa #previa-conteudo { display: none; }
  .previa.is-open .previa-head { display: flex; padding: 0 16px; color: var(--ivp-hero-text); }
  .previa.is-open .previa-bar .pb-hint { display: none; }
  .previa.is-open #previa-conteudo { display: block; flex: 1; overflow: auto; padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .previa.is-open .previa-body { --pico-color: var(--ivp-ink); --pico-muted-color: var(--ivp-ink-2); --pico-accordion-close-summary-color: var(--ivp-ink); --pico-accordion-open-summary-color: var(--ivp-ink); --pico-table-border-color: var(--ivp-line-2); color: var(--ivp-ink); background: var(--ivp-bg); border-radius: var(--ivp-r-lg); padding: 12px; }
}
@media (min-width: 1100px) {
  .previa { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; padding: 18px 20px; background: var(--ivp-hero); color: var(--ivp-hero-text); border-radius: var(--ivp-r-lg); }
  .previa .previa-bar, .previa .previa-close, .previa-scrim { display: none !important; }
  .previa .previa-head small { color: var(--ivp-hero-muted); }
}
.previa-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 0 0 12px; }
.previa-kpis .kpi .eyebrow { color: var(--ivp-hero-muted); font-size: 0.72rem; letter-spacing: 0.6px; }
.previa-kpis .kpi .value { font-size: 1.35rem; }
.previa-kpis .value.gold { color: var(--ivp-gold-hi); }
.previa-kpis .value.pos { color: var(--ivp-gold-hi); }
.previa-kpis .value.neg { color: color-mix(in srgb, var(--ivp-bad-mark) 55%, var(--ivp-hero-text)); }
.previa .previa-body { --pico-color: var(--ivp-hero-text); --pico-muted-color: var(--ivp-hero-muted); --pico-accordion-close-summary-color: var(--ivp-hero-text); --pico-accordion-open-summary-color: var(--ivp-hero-text); --pico-table-border-color: color-mix(in srgb, var(--ivp-hero-text) 20%, transparent); color: var(--ivp-hero-text); }
.previa-canais { margin: 0 0 12px; font-size: 0.92rem; --pico-background-color: transparent; }
.previa-canais th, .previa-canais td { padding: 6px 4px; border-color: color-mix(in srgb, var(--ivp-hero-text) 20%, transparent); background: transparent; color: inherit; }
.previa-canais th { font-size: 0.75rem; font-weight: 600; color: var(--ivp-hero-muted); }
.previa-canais td.pos { color: var(--ivp-gold-hi); font-weight: 600; }
.previa-canais td.neg { color: color-mix(in srgb, var(--ivp-bad-mark) 55%, var(--ivp-hero-text)); font-weight: 600; }
.mk { display: inline-block; font-weight: 800; font-size: 0.85em; }
.mk-viavel { color: var(--ivp-gold-hi); }
.mk-inviavel { color: color-mix(in srgb, var(--ivp-bad-mark) 55%, var(--ivp-hero-text)); }
.mk-atencao { color: var(--ivp-gold-hi); }
.previa-fil { margin: 0 0 12px; padding: 12px; border-radius: var(--ivp-r-md); background: color-mix(in srgb, var(--ivp-hero-text) 10%, transparent); font-size: 0.92rem; }
.previa-fil > strong { display: block; margin: 0 0 4px; }
.previa-fil .row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.previa-more { margin: 0 0 8px; padding: 0; border: 0; }
.previa-more > summary { padding: 8px 0; font-size: 0.9rem; font-weight: 600; color: inherit; }
.previa-more table { font-size: 0.85rem; }
.previa .previa-more table th, .previa .previa-more table td { color: inherit; background: transparent; border-color: color-mix(in srgb, var(--ivp-hero-text) 20%, transparent); }
.previa .previa-more .howto p, .previa .previa-more .howto summary, .previa .table-intro { color: var(--ivp-hero-muted); }
.previa .badge { filter: none; }
.previa .previa-more a { color: var(--ivp-gold-hi); }
@media (max-width: 1099px) {
  .previa.is-open .previa-body, .previa.is-open .previa-canais td, .previa.is-open .previa-canais th, .previa.is-open .previa-more table th, .previa.is-open .previa-more table td { color: var(--ivp-ink); border-color: var(--ivp-line-2); }
  .previa.is-open .previa-kpis .kpi .eyebrow, .previa.is-open .previa-canais th, .previa.is-open .table-intro, .previa.is-open .howto p, .previa.is-open .howto summary { color: var(--ivp-ink-2); }
  .previa.is-open .previa-kpis .value.gold { color: var(--ivp-warn); }
  .previa.is-open .previa-kpis .value.pos, .previa.is-open .previa-canais td.pos, .previa.is-open .mk-viavel { color: var(--ivp-ok); }
  .previa.is-open .previa-kpis .value.neg, .previa.is-open .previa-canais td.neg, .previa.is-open .mk-inviavel { color: var(--ivp-bad); }
  .previa.is-open .mk-atencao { color: var(--ivp-warn); }
  .previa.is-open .previa-fil { background: var(--ivp-surface); }
  .previa.is-open .previa-more a { color: var(--ivp-c-main); }
}
ul.previa-erros { font-size: 0.9em; margin: 0 0 0 1rem; }

/* detalhe de produto/kit */
.detail-head > div { min-width: 0; flex: 1; }
.detail-head .head-actions { margin-left: auto; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.detail-layout > * { min-width: 0; margin: 0; }
.kpi-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kpi-strip .card { margin: 0; padding: 12px 14px; }
.kpi-strip .value { font-size: 1.2rem; white-space: nowrap; }
.kpi-strip .value small { font-size: 0.75rem; font-weight: 500; color: var(--ivp-ink-2); }
@media (min-width: 1100px) {
  .detail-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 340px; grid-template-areas: "kpis kpis kpis sim" "table table table sim" "comp fil stock sim" "more more more sim"; gap: 14px; }
  .price-card table { font-size: 0.875rem; }
  .price-card th, .price-card td { padding: 8px 6px; white-space: nowrap; }
  .price-card .badge { font-size: 0.72rem; }
  .kpi-strip { grid-area: kpis; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-strip .value { font-size: 1.5rem; }
  .comp-card { grid-area: comp; } .fil-unit-card { grid-area: fil; } .stock-card { grid-area: stock; } .price-card { grid-area: table; } .detail-more { grid-area: more; } .sim { grid-area: sim; position: sticky; top: 16px; }
}
@media (min-width: 1100px) and (max-width: 1399px) {
  .detail-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 340px; grid-template-areas: "kpis kpis sim" "comp fil sim" "stock stock sim" "table table table" "more more more"; }
}
@media (min-width: 1100px) { .comp-legend small { display: none; } .tile .eyebrow { white-space: nowrap; } }
@media (min-width: 1400px) { .detail-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 400px; } .price-card table { font-size: 0.8125rem; } }
.comp-bar .mat { fill: var(--ivp-c-main); }
.comp-bar .maq { fill: var(--ivp-gold); }
.comp-bar .rest { fill: var(--ivp-track); }
.comp-legend { list-style: none; margin: 10px 0 0; padding: 0; }
.comp-legend li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.comp-legend .lbl { flex: 1; min-width: 0; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.sw.mat { background: var(--ivp-c-main); } .sw.maq { background: var(--ivp-gold); } .sw.rest { background: var(--ivp-track); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--ivp-r-md); background: var(--ivp-surface-2); }
.tile .eyebrow { font-size: 0.7rem; }
.tile strong { font-size: 1.5rem; line-height: 1.1; }
.tile strong.neg { color: var(--ivp-bad); }
.tile a, .tile small { font-size: 0.8rem; }
.tile.gold { background: var(--ivp-warn-soft); }
.tile-actions { display: flex; gap: 8px; margin: 0 0 8px; }
.tile-actions [role="button"] { flex: 1; margin: 0; padding: 8px 10px; font-size: 0.95rem; }
.stock-note { margin: 4px 0; }
.assemble { margin: 8px 0; }
.assemble > summary[role="button"] { display: inline-flex; width: auto; }
.assemble form { margin: 12px 0 0; }
.assemble form button[type="submit"] { width: auto; }
.fil-list, .comp-list { list-style: none; margin: 0 0 8px; padding: 0; }
.fil-list li, .comp-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--ivp-line-2); }
.fil-list li:first-child, .comp-list li:first-child { border-top: 0; }
.fil-list .name, .comp-list .name { flex: 1; min-width: 0; font-weight: 600; text-decoration: none; }
.comp-list .meta { font-size: 0.8rem; color: var(--ivp-ink-2); }
.comp-list li { flex-wrap: wrap; }
.comp-list .meta { flex-basis: 100%; order: 3; }
.detail-more details.card { margin: 0 0 8px; padding: 12px 16px; }
.detail-more details.card > summary { font-weight: 600; }
.detail-meta { margin: 6px 0 0; }
table.precos td.num, table.precos th.num { text-align: right; white-space: nowrap; }
.table-intro { margin: 0 0 6px; }

/* simulador de preço */
.sim { padding: 18px; }
.sim-head { display: flex; align-items: baseline; justify-content: space-between; }
.sim-head h2 { font-size: 1.15rem; margin: 0; color: inherit; }
.previa-canais td:first-child { white-space: nowrap; }
.sim-head small { color: var(--ivp-hero-muted); }
.sim-price { font-size: 2.6rem; font-weight: 800; line-height: 1.1; margin: 6px 0 8px; color: var(--ivp-gold-hi); }
.sim input[type="range"] { width: 100%; margin: 0; accent-color: var(--ivp-gold); }
.sim-ticks { display: block; margin: 2px 0 0; }
.sim-ticks line { stroke: var(--ivp-gold-hi); stroke-width: 2; }
.sim-legend { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 2px 0 0; font-size: 0.72rem; color: var(--ivp-gold-hi); }
.sim-axis { display: flex; justify-content: space-between; margin: 4px 0 10px; font-size: 0.75rem; color: var(--ivp-hero-muted); }
.sim-canais { list-style: none; margin: 0 0 10px; padding: 4px 12px; background: var(--ivp-surface); color: var(--ivp-ink); border-radius: var(--ivp-r-md); }
.sim-canais li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--ivp-line-2); }
.sim-canais li:first-child { border-top: 0; }
.sim-canais .name { flex: 1; font-weight: 600; }
.sim-canais strong { white-space: nowrap; }
.sim-note { display: block; margin: 0 0 12px; font-size: 0.8rem; color: var(--ivp-hero-muted); }
.sim-use { width: 100%; margin: 0; }

/* plataformas */
.ruler { display: flex; gap: 3px; margin: 0 0 14px; }
.rseg { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 6px; background: var(--ivp-c-main); color: var(--ivp-on-sel); line-height: 1.25; }
.rseg small { display: block; font-size: 0.7rem; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rseg b { display: block; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rseg:nth-child(2) { background: color-mix(in srgb, var(--ivp-c-main) 82%, var(--ivp-surface)); }
.rseg:nth-child(3) { background: color-mix(in srgb, var(--ivp-c-main) 64%, var(--ivp-surface)); }
.rseg:nth-child(n+4) { background: color-mix(in srgb, var(--ivp-c-main) 48%, var(--ivp-surface)); }
.rseg:last-child:not(:first-child) { background: var(--ivp-warn-soft); color: var(--ivp-ink); }
.rseg.is-empty { background: var(--ivp-track); color: var(--ivp-ink-2); }
.rseg:first-child { border-radius: 10px 6px 6px 10px; }
.rseg:last-child { border-radius: 6px 10px 10px 6px; }
.tier-row { grid-template-columns: repeat(2, minmax(0, 1fr)) 40px; padding: 10px 12px; border-radius: var(--ivp-r-md); background: var(--ivp-surface-2); }
.tier-row .icon-btn { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
.tier-row .lbl { display: block; font-size: 0.75rem; font-weight: 600; color: var(--ivp-ink-2); margin: 0 0 2px; }
.field.ro input { background: var(--ivp-surface-2); color: var(--ivp-ink-2); font-weight: 600; }
.tier-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.tier-foot .dashed { margin: 0; }
.toggle-card { margin: 4px 0 0; }
.toggle-card label.check { font-weight: 600; }
@media (max-width: 767px) { .rseg { padding: 6px 6px; } .rseg small { font-size: 0.62rem; } .rseg b { font-size: 0.7rem; white-space: normal; } .dumbbells li { grid-template-columns: minmax(0, 44%) minmax(0, 1fr); } .panel-products .axis { margin-left: 44%; } }
@media (min-width: 768px) {
  .tier-row, .tier-head { grid-template-columns: repeat(4, minmax(0, 1fr)) 44px; padding: 0; background: transparent; }
  .tier-row .icon-btn { grid-column: auto; grid-row: auto; }
  .tier-row .lbl { display: none; }
}
.side-panel .card { margin: 0; }
@media (min-width: 1100px) { .side-panel { position: sticky; top: 16px; } }
.panel-products .legend { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 0.8rem; color: var(--ivp-ink-2); }
.panel-products .sw { border-radius: 50%; width: 10px; height: 10px; }
.panel-products .sw.full { background: var(--ivp-c-main); }
.panel-products .sw.ring { border: 2px solid var(--ivp-gold); background: transparent; }
.panel-products .sw.ring + * { margin-left: 0; }
.dumbbells { list-style: none; margin: 0; padding: 0; }
.dumbbells li { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); gap: 8px; align-items: center; padding: 3px 0; }
.dumbbells .name { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dumbbell .span { stroke: color-mix(in srgb, var(--ivp-gold) 60%, transparent); stroke-width: 3; }
.dumbbell .preco { fill: var(--ivp-c-main); }
.dumbbell .preco.ok { fill: var(--ivp-ok); }
.dumbbell .min { fill: var(--ivp-surface); stroke: var(--ivp-gold); stroke-width: 2; }
.dumbbell .lbl { font-size: 10px; font-weight: 700; fill: var(--ivp-ink-2); }
.panel-products .axis { display: flex; justify-content: space-between; margin: 4px 0 0 40%; font-size: 0.72rem; color: var(--ivp-ink-2); }
.panel-products .axis span:first-child { transform: translateX(0); }
.insight { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--ivp-r-md); background: var(--ivp-warn-soft); font-size: 0.9rem; }
.chan-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 900px) { .chan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chan-card { margin: 0; }
.chan-card h2 { font-size: 1.1rem; margin: 0; }
.chan-card h2 a { text-decoration: none; }
.chan-card .ruler { margin: 4px 0 8px; }
.chan-card .tags { display: inline-flex; gap: 6px; }
.page-intro { margin: -4px 0 12px; }

/* importar */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; list-style: none; margin: 0 0 6px; padding: 0; counter-reset: none; }
.steps li { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 0.85rem; color: var(--ivp-ink-3); }
.steps li .n { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--ivp-track); font-size: 0.75rem; font-weight: 700; }
.steps li .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps li.is-current { color: var(--ivp-ink); font-weight: 700; }
.steps li.is-current .n { background: var(--ivp-gold); color: var(--ivp-on-gold); }
.steps li.is-done { color: var(--ivp-ok); }
.steps li.is-done .n { background: var(--ivp-ok-soft); color: var(--ivp-ok); }
.steps-bar { margin: 0 0 14px; }
@media (max-width: 767px) { .steps { gap: 4px; } .steps li { gap: 4px; font-size: 0.75rem; } .steps li .n { width: 22px; height: 22px; font-size: 0.7rem; } }
.import-form .chips { margin-bottom: 10px; }
.file-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 0 8px; padding: 26px 16px; border: 2px dashed var(--ivp-dash); border-radius: var(--ivp-r-lg); background: var(--ivp-surface-2); text-align: center; cursor: pointer; }
.file-drop .icon { width: 32px; height: 32px; color: var(--ivp-ink-3); }
.file-drop strong { font-size: 1rem; }
.file-drop small { color: var(--ivp-ink-2); }
.file-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.file-drop.has-file { border-style: solid; border-color: var(--ivp-gold); background: var(--ivp-warn-soft); }
.file-drop:focus-within { outline: 2px solid var(--ivp-gold); outline-offset: 2px; }
.import-form details.more { margin: 4px 0 12px; }
.import-form button[type="submit"] { width: auto; min-width: 200px; }
.badges.wrap { flex-wrap: wrap; }
.kpi-row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .kpi-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.item-map .map-row { grid-template-columns: minmax(0, 1fr); padding: 10px 0; margin: 0; border-top: 1px solid var(--ivp-line-2); }
.item-map .map-row:first-child { border-top: 0; }
.item-map .cell-main small { display: block; }
.item-map select { margin: 0; }
@media (min-width: 768px) { .item-map .map-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; } }
.action-bar a.muted { margin-left: auto; font-size: 0.9rem; }
.preview-table { font-size: 0.85rem; }
/* utilitários de largura vencem qualquer display de componente */
@media (max-width: 767px) { .only-wide, .only-wide-inline, .only-wide-text { display: none !important; } }
@media (min-width: 768px) { .only-narrow, .only-narrow-inline, .only-narrow-flex { display: none !important; } }
/* campos compactos das linhas: sufixo mais perto da borda */
.line .field > input { padding-right: 2.1rem; }
.line .field::after { right: 10px; font-size: 0.8rem; }
/* segmentado de seções e steppers compactos nas linhas */
.editor-tabs > a { font-size: 0.85rem; padding: 0 4px; white-space: nowrap; }
.line .stepper button { width: 40px; min-height: 44px; font-size: 1.2rem; }
.line .stepper input { width: 2.4rem; font-size: 1rem; }

/* ===== Design Oficina — Etapa 8: cor do filamento ============================================ */
.color-choice legend { font-weight: 600; }
.color-chip svg.dot { margin: 0 6px 0 0; }
.chips input:checked + .color-chip svg.dot circle { stroke: var(--ivp-on-sel); stroke-width: 1.5; }
.color-custom { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.color-custom label { margin: 0; }
.color-custom input[type="color"] { width: 64px; height: 44px; margin: 0; padding: 2px; border-radius: var(--ivp-r-md); }
.filament-form .action-bar { margin-top: 12px; }
.effects .row svg.dot { margin: 0 6px 0 0; }

/* fotos de produto (D30) */
.thumb { display: inline-flex; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--ivp-track); color: var(--ivp-ink-2); align-items: center; justify-content: center; text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .icon { width: 20px; height: 20px; opacity: 0.6; }
.item-card.with-thumb { grid-template-columns: auto minmax(0, 1fr) auto; }
.item-card.with-thumb .thumb { grid-row: 1 / 3; }
.item-card.with-thumb .badges { grid-column: 2 / -1; }
td.title .thumb { width: 36px; height: 36px; border-radius: 8px; margin-right: 8px; vertical-align: middle; }
.photo-card .photo-cover { display: block; border-radius: var(--ivp-r-md); overflow: hidden; background: var(--ivp-track); }
.photo-card .photo-cover img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-strip { display: flex; gap: 8px; margin: 10px 0 0; overflow-x: auto; padding-bottom: 2px; }
.photo-strip .thumb { width: 64px; height: 64px; }
.photo-none { display: flex; align-items: center; gap: 8px; margin: 0; }
.photo-none .icon { width: 20px; height: 20px; flex: 0 0 auto; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 0 0 12px; }
.photo-grid[hidden] { display: none; }
.photo-item { position: relative; margin: 0; border-radius: var(--ivp-r-md); overflow: hidden; background: var(--ivp-track); }
.photo-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-item figcaption { display: flex; gap: 6px; padding: 6px; background: var(--ivp-surface-2); font-size: 0.8rem; }
.photo-item input[type="radio"]:checked + .chip { background: var(--ivp-sel); border-color: var(--ivp-sel); color: var(--ivp-on-sel); }
.photo-item figcaption input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.photo-item figcaption .chip { flex: 1; justify-content: center; margin: 0; min-height: 36px; }
.photo-item figcaption .chip.danger { color: var(--ivp-bad); }
.photo-item:has(input[name="fotos_excluir"]:checked) img { opacity: 0.3; }
.photo-item:has(input[name="fotos_excluir"]:checked) .chip.danger { background: var(--ivp-bad-soft); border-color: var(--ivp-bad-line); }
.photo-item.pending figcaption { justify-content: center; color: var(--ivp-ink-2); }
.photo-drop { display: grid; justify-items: center; gap: 4px; padding: 20px 16px; margin: 0 0 10px; border: 2px dashed var(--ivp-field); border-radius: var(--ivp-r-md); text-align: center; cursor: pointer; }
.photo-drop:hover, .photo-drop:focus-within { border-color: var(--ivp-c-main); }
.photo-drop .icon { width: 28px; height: 28px; color: var(--ivp-c-main); }
.photo-drop small { color: var(--ivp-ink-2); }
.photo-drop input[type="file"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
@media (min-width: 1100px) {
  .photo-card { grid-area: fotos; }
  .detail-layout { grid-template-areas: "kpis kpis kpis sim" "fotos comp fil sim" "table table table sim" "stock more more sim"; }
}
@media (min-width: 1100px) and (max-width: 1399px) {
  .detail-layout { grid-template-areas: "kpis kpis sim" "fotos comp sim" "fil stock sim" "table table table" "more more more"; }
}

/* contagem de estoque em lote (O12) */
.count-form .seg { margin: 0 0 8px; }
.count-hint { margin: 0 0 12px; }
.count-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.count-row, .count-head { grid-template-columns: minmax(0, 1fr) auto 112px; align-items: center; }
.count-row { margin: 0; padding: 10px 12px; background: var(--ivp-surface); border: 1px solid transparent; border-radius: 14px; }
.count-row.changed { border-color: var(--ivp-gold); }
.count-row.bad { border-color: var(--ivp-bad-line); }
.count-row .cell-main { display: block; margin: 0; font-weight: 700; line-height: 1.3; }
.count-row .cell-main .dot { margin: 0 4px 0 0; vertical-align: -1px; }
.count-row .cell-main small { display: block; font-weight: 500; }
.count-row .saldo { white-space: nowrap; color: var(--ivp-ink-2); font-size: 0.9rem; }
.count-row .field > input { text-align: right; }
.count-row .diff { grid-column: 1 / -1; min-height: 1em; text-align: right; font-weight: 600; color: var(--ivp-ink-2); }
.count-row.changed .diff { color: var(--ivp-c-main); }
.count-row.bad .diff { color: var(--ivp-bad); }
.count-note { margin: 0 0 8px; }
.count-exit-hint { margin: -4px 0 10px; }
@media (min-width: 768px) {
  .count-row, .count-head { grid-template-columns: minmax(0, 1fr) 140px 140px 120px; }
  .count-row .diff { grid-column: auto; }
  .count-head span:last-child { grid-column: span 2; }
}

/* produção por produto (D31): linhas por placa e formulários embutidos na página do produto (O13) */
fieldset.plate-rows { margin: 0 0 12px; padding: 0; border: 0; }
fieldset.plate-rows > legend { padding: 0; }
.plate-line { margin: 0 0 10px; }
.plate-line.multi { padding: 10px 12px 4px; border: 1px solid var(--ivp-line-2); border-radius: var(--ivp-r-md); background: var(--ivp-surface-2); }
.plate-line.multi.is-off { opacity: 0.55; }
.plate-line .plate-name { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.plate-line .plate-name small { font-size: 0.8rem; }
.plate-line .grid { margin: 0; }
.plate-line .chips { margin: 2px 0 6px; }
.plate-line.multi .stepper.wide input { min-width: 2.6rem; }
.locked-product { margin: 0 0 12px; }
details.inline-form { margin: 8px 0; }
details.inline-form > summary[role="button"] { display: inline-flex; width: auto; }
details.inline-form form { margin: 12px 0 4px; padding: 14px; border: 1px solid var(--ivp-line-2); border-radius: var(--ivp-r-md); background: var(--ivp-surface); }
details.inline-form form button[type="submit"] { width: auto; }
details.inline-form form .effects { margin: 0 0 12px; }
details.inline-form .alvo-pick { margin: 0 0 10px; }
.run-card { display: flex; flex-direction: column; gap: 6px; }
.run-card .order-main { color: inherit; text-decoration: none; }
.run-again { align-self: flex-start; font-size: 0.85rem; }
.detail-actions { margin: 10px 0 0; font-size: 0.9rem; }
.danger-link { color: var(--ivp-bad); }
.copy-of { display: block; font-size: 0.8rem; font-weight: 500; }
.danger-zone { margin: 18px 0 0; padding-top: 12px; border-top: 1px dashed var(--ivp-line-2); }
.danger-zone a { color: var(--ivp-bad); }
@media (min-width: 1024px) { .run-card { flex-direction: row; align-items: center; } .run-again { align-self: center; white-space: nowrap; } }
/* página do filamento/insumo (O13): movimentar + histórico + cadastro recolhido */
.item-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.item-layout > * { min-width: 0; margin: 0; }
.item-layout form.embedded button[type="submit"] { width: auto; }
.cadastro-details > summary { display: flex; align-items: baseline; gap: 10px; cursor: pointer; }
.cadastro-details > summary h2 { margin: 0; }
.cadastro-details > summary small { font-size: 0.85rem; }
.cadastro-details[open] > summary { margin-bottom: 12px; }
.form-actions { display: flex; gap: 8px; margin: 12px 0 0; }
.form-actions [role="button"], .form-actions button { width: auto; margin: 0; }
.timeline .tl-meta { font-size: 0.8rem; }
@media (min-width: 1024px) { .item-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .item-layout .cadastro-details { grid-column: 1 / -1; } }
/* multipart: as duas contagens lado a lado também no celular (6 placas cabem numa tela) */
.plate-line.multi .grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; }
.plate-line.multi .grid label { font-size: 0.8rem; margin-bottom: 2px; }
.plate-line.multi .stepper.wide { margin-bottom: 6px; }
.plate-line.multi .stepper.wide button { min-height: 40px; width: 40px; }
.plate-line.multi .stepper.wide input { min-height: 40px; }
.plate-line.multi .chips .chip { min-height: 32px; font-size: 0.8rem; }
