/* ============================================================
   Sistema Press — protótipo · Press Metrologia
   Base do design system: a arrumação e os componentes que as telas usam. O VISUAL é o "Sereno" (decisão S21,
   Plano D): cores, fonte, raios e sombras vêm dos tokens do sereno.css (posto pelo shell.js logo depois deste arquivo),
   que também dá aos nomes usados aqui (--bg, --tx, --pn, --ln, --btn, --font-body...) os valores do Sereno, nos dois
   temas (data-tema no <html>) e nas 4 cores de destaque (data-acento).
   D5a (virada, 17/10): a Bancada (Task 8) saiu — os dois temas de token dela, o odômetro e a fonte IBM Plex. Ficam
   aqui só os tokens que o sereno.css não define. As classes de sigilo/trava (sp-sem-acesso etc.) NÃO mudam aqui.
   ============================================================ */

/* ---- Tokens que só existem aqui (o sereno.css não os define). Claro na raiz; o escuro troca só o que muda. ---- */
:root {
  /* logo da Press no menu (LOGO do shell.js) e nome da marca */
  --logo-a: #08C5E3; --logo-b: #053053; --logo-chev: #053053; --brand: #053053;
  /* ciano "terceiro / importação" em texto: o mesmo do --vio do Sereno (#096780 no claro, #08C5E3 no escuro) */
  --ciano: var(--vio);
  /* véu marinho sobre cores de dado (cabeçalho das colunas do CRM) para o texto branco passar AA */
  --veu-fill: rgb(4 31 54 / .32); --veu-fill-2: rgb(4 31 54 / .25);
  /* cabeçalho das colunas do CRM (data.js CRM_COLS.cor) — tons de estado escurecidos, iguais nos dois temas, com texto
     branco AA (azul Press, cinza Press, ciano, âmbar, laranja = âmbar+vermelho, verde) */
  --crm-novo: #1565A8; --crm-parado: #58595B; --crm-ativo: #096780; --crm-orc: #85570F; --crm-gerando: #9C411D; --crm-pedido: #136F47;
  /* Contas a Receber por atraso (Dashboards) e mix por origem do item (Visão comercial) — derivados dos estados */
  --df-atraso-1: var(--warn);
  --df-atraso-2: color-mix(in srgb, var(--warn) 66%, var(--danger));
  --df-atraso-3: color-mix(in srgb, var(--warn) 33%, var(--danger));
  --df-atraso-4: var(--danger);
  --orig-press: var(--info); --orig-imp: var(--df-cat-2); --orig-local: var(--tx-3); --orig-servico: var(--tx);
  /* tempos e curvas dos componentes deste arquivo (o movimento próprio do Sereno usa --s-ease/--s-spring) */
  --d1: 120ms; --d2: 180ms; --d3: 240ms; --d4: 320ms;
  --ease-out: cubic-bezier(.2, 0, 0, 1); --ease-in: cubic-bezier(.4, 0, 1, 1); --ease-emph: cubic-bezier(.05, .7, .1, 1);
  --spring: linear(0, 0.055, 0.169, 0.306, 0.442, 0.565, 0.671, 0.757, 0.825, 0.878, 0.917, 0.946, 0.966, 0.98, 0.989, 0.995, 0.999, 1.001, 1.002, 1.002, 1.002, 1.002, 1.002, 1.001, 1.001, 1.001, 1.001, 1, 1);
  --spring-soft: linear(0, 0.041, 0.134, 0.251, 0.365, 0.486, 0.597, 0.685, 0.767, 0.834, 0.886, 0.923, 0.954, 0.976, 0.991, 1.001, 1.007, 1.011, 1.012, 1.012, 1.011, 1.01, 1.009, 1.007, 1.006, 1.004, 1.003, 1.002, 1);
  scrollbar-color: var(--sbar) transparent;
}
:root[data-tema="escuro"] { --logo-b: #0E80C0; --logo-chev: #FFFFFF; --brand: #FFFFFF; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { background: var(--bg); }
body {
  font-family: var(--font-body); background: var(--bg); color: var(--tx);
  font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: color-mix(in srgb, var(--glow-c) 28%, transparent); color: var(--tx-hi); }
:focus-visible { outline: 1.5px solid var(--focus); outline-offset: 2px; }
::placeholder { color: var(--tx-3); opacity: 1; }
option, optgroup { background: var(--pn); color: var(--tx); }
/* troca de tema: as cores trocam de uma vez (sem transição de cor); só o seletor lua/sol se move */
html.tema-troca *:not(.thm, .thm *), html.tema-troca *:not(.thm, .thm *)::before, html.tema-troca *:not(.thm, .thm *)::after { transition: none !important; }

/* ---- Shell: o "rack" (menu lateral) ---- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns var(--d4) var(--spring); }
[data-menu="col"] .app { grid-template-columns: 64px minmax(0, 1fr); }
.sidebar {
  background: var(--rack); color: var(--tx);
  display: flex; flex-direction: column; padding: 0;
  border-right: 1px solid var(--ln);
  position: sticky; top: 0; height: 100vh; align-self: start; overflow: hidden; min-width: 0; z-index: 25;
}
.brand {
  display: flex; align-items: center; gap: 10px; flex: none;
  height: 52px; padding: 0 17px; border-bottom: 1px solid var(--ln); margin-bottom: 0;
}
.brand-mark { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 4px; }
.brand-mark svg { width: 28px; height: 28px; }
.sp-logo .mk0 { stop-color: var(--logo-a); }
.sp-logo .mk1 { stop-color: var(--logo-b); }
.sp-logo .mk-chev { stroke: var(--logo-chev); }
.brand-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.1; white-space: nowrap; min-width: 0; transition: opacity var(--d1) var(--ease-out); }
.brand-name { font-size: 14px; font-weight: 600; color: var(--brand); letter-spacing: .02em; }
.brand-sub { font-size: 11.5px; color: var(--tx-3); }
.nav { position: relative; display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 10px 10px; scrollbar-width: thin; }
.nav-label {
  position: relative; height: 28px; display: flex; align-items: flex-end; padding: 0 11px 6px; flex: none;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 400;
  color: var(--tx-3); white-space: nowrap;
}
.nav-label span { transition: opacity var(--d1) var(--ease-out); }
.nav a, .nav .nav-off {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; min-height: 32px; padding: 6px 40px 6px 11px; border-radius: 4px; flex: none;
  color: var(--tx-2); font-size: 13.5px; font-weight: 500; line-height: 1.25;
  transition: color var(--d1) var(--ease-out), background var(--d1) var(--ease-out);
}
.nav a svg, .nav .nav-off svg { width: 18px; height: 18px; flex-shrink: 0; transition: color var(--d1); }
.nav a .ni-txt { min-width: 0; }
.nav a:hover { background: var(--hov); color: var(--tx); }
.nav a.active { color: var(--tx); }
.nav a.active svg { color: var(--hl); }
/* sem o indicador (antes do JS medir): o item ativo pinta o próprio fundo */
.nav:not(.tem-ind) a.active { background: var(--ind-bg); box-shadow: inset 2px 0 0 var(--sig); }
.nav .nav-off { color: var(--tx-3); cursor: default; }  /* esmaecido pela cor (AA), não por opacidade */
/* indicador que desliza até o item ativo (posição pelo shell.js; entre páginas desliza pela View Transition) */
.nav-ind {
  position: absolute; left: 10px; right: 10px; top: 0; height: 32px; border-radius: 4px; z-index: 0;
  background: var(--ind-bg); pointer-events: none; opacity: 0;
  transition: transform 380ms var(--spring), height 380ms var(--spring);
}
.nav.tem-ind .nav-ind { opacity: 1; }
.nav-ind::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--sig); box-shadow: var(--glow-ind); }
/* Pendências no menu (revisão 24/08): o que precisa de ação p/ a esteira não parar */
/* o selo fica à direita, fora do fluxo (o espaço já está reservado no item): chegar depois não muda a altura do item */
.nav-badge {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  min-width: 22px; height: 18px; padding: 0 6px; border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn-ln); color: var(--warn);
  transition: opacity var(--d1);
}
.soon {
  margin-left: auto; font-size: 10.5px; font-weight: 500;
  border: 1px solid var(--ln-2); border-radius: 3px; padding: 1px 5px; color: var(--tx-3);
}
.sidebar-foot { border-top: 1px solid var(--ln); padding: 10px; margin-top: 0; flex: none; }
.sb-acoes { display: flex; align-items: center; gap: 6px; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; min-width: 0; flex: 1;
  border: 0; background: none; cursor: pointer; text-align: left; color: inherit;
  transition: background var(--d1) var(--ease-out);
}
.user-chip:hover { background: var(--hov); }
.sb-recolher {
  width: 32px; height: 32px; border-radius: 4px; display: grid; place-items: center; flex: none;
  border: 0; background: none; color: var(--tx-3); cursor: pointer;
  transition: background var(--d1), color var(--d1), transform var(--d1) var(--spring);
}
.sb-recolher:hover { background: var(--hov); color: var(--tx); }
.sb-recolher:active { transform: scale(.94); }
.sb-recolher svg { width: 18px; height: 18px; transition: transform var(--d4) var(--spring); }
[data-menu="col"] .sb-recolher svg { transform: rotate(180deg); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--pn-3); flex: none;
  color: var(--tx); display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--ln-3);
  font-size: 11px; font-weight: 600; letter-spacing: .03em; font-family: var(--font-body);
  transition: box-shadow var(--d1), transform var(--d2) var(--spring);
}
.user-chip:hover .avatar { box-shadow: inset 0 0 0 1px var(--sig); }
.user-chip:active .avatar { transform: scale(.94); }
.user-meta { display: flex; flex-direction: column; min-width: 0; transition: opacity var(--d1) var(--ease-out); }
.user-meta strong { font-size: 12.5px; font-weight: 600; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 11px; color: var(--tx-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* menu recolhido (64 px): só ícones; o texto some antes da largura (prancha) */
[data-menu="col"] .brand { padding: 0 18px; }
[data-menu="col"] .brand-text, [data-menu="col"] .nav-label span, [data-menu="col"] .nav-badge, [data-menu="col"] .soon,
[data-menu="col"] .perfil-faixa span, [data-menu="col"] .perfil-box, [data-menu="col"] .user-meta { opacity: 0; pointer-events: none; }
[data-menu="col"] .perfil-box { display: none; }
/* o nome do item some de vez no recolhido e só volta no fim da abertura ("abrindo"): sem quebrar linha a cada quadro */
[data-menu="col"] .nav a .ni-txt, [data-menu="abrindo"] .nav a .ni-txt { display: none; }
[data-menu="col"] .nav a { padding-left: 13px; }
[data-menu="col"] .nav a.nav-sub { padding-left: 13px; }
[data-menu="col"] .nav-label::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 12px; height: 1px; background: var(--ln-2); }
[data-menu="col"] .nav a.tem-badge::after { content: ""; position: absolute; left: 27px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
[data-menu="col"] .sb-acoes { flex-direction: column; }
[data-menu="col"] .user-chip { flex: none; padding: 6px; }
[data-menu="col"] .user-meta { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 52px; background: var(--top); border-bottom: 1px solid var(--ln);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px 0 28px; gap: 14px; position: sticky; top: 0; z-index: 20;
}
.crumb { font-size: 13px; color: var(--tx-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb b { color: var(--tx); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.live {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tx-2); white-space: nowrap;
  padding: 0 0 0 14px; border-left: 1px solid var(--ln); height: 18px;
}
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--sig); box-shadow: var(--glow-live); display: block; flex: none; }

/* ---- Tema: lua / sol (topbar) ---- */
.thm {
  position: relative; display: grid; grid-template-columns: 28px 28px; align-items: center; width: 60px; height: 30px; padding: 0 2px;
  border: 0; border-radius: 15px; background: var(--pn); box-shadow: inset 0 0 0 1px var(--ln-2); flex: none; cursor: pointer;
  transition: box-shadow var(--d1);
}
.thm:hover { box-shadow: inset 0 0 0 1px var(--ln-3); }
.thm-th {
  position: absolute; left: 2px; top: 2px; width: 28px; height: 26px; border-radius: 13px; background: var(--pn-3);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sig) 55%, transparent), var(--thumb-sh); transition: transform 420ms var(--spring);
}
:root[data-tema="claro"] .thm-th { transform: translateX(28px); }
.thm svg {
  position: relative; z-index: 1; justify-self: center; width: 15px; height: 15px; color: var(--tx-3);
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: color var(--d2) var(--ease-out), transform 520ms var(--spring-soft);
}
.thm .i-lua { color: var(--hl); }
.thm .i-sol { transform: rotate(-90deg) scale(.82); }
:root[data-tema="claro"] .thm .i-lua { color: var(--tx-3); transform: rotate(25deg) scale(.86); }
:root[data-tema="claro"] .thm .i-sol { color: var(--hl); transform: none; }
.thm::after {
  content: attr(data-tip); position: absolute; right: -6px; top: 38px; background: var(--tip-bg); color: var(--tip-tx); font-size: 12px;
  padding: 5px 9px; border-radius: 4px; white-space: nowrap; box-shadow: var(--float), inset 0 0 0 1px var(--ln-2);
  z-index: 9; pointer-events: none; opacity: 0; visibility: hidden;
}
.thm:hover::after, .thm:focus-visible::after { visibility: visible; animation: sp-tipd var(--d2) var(--ease-out) 300ms both; }
/* página sem topbar (hub): o seletor fica no canto, fixo */
.thm.thm-solto { position: fixed; top: 14px; right: 18px; z-index: 30; }

/* ---- Menu do perfil (Aparência, recolher) — abre a partir do cartão do usuário ---- */
.sp-pop {
  position: fixed; z-index: 95; width: 240px; background: var(--pn-3); color: var(--tx); border-radius: 6px; padding: 6px;
  box-shadow: var(--float), inset 0 0 0 1px var(--ln-2); transform-origin: 22px calc(100% + 20px);
  animation: sp-menu var(--d3) var(--spring) both;
}
.sp-pop.sai { animation: sp-fadeo 120ms var(--ease-in) both; }
.sp-pop-h { padding: 8px 10px; font-size: 12.5px; color: var(--tx-2); }
.sp-pop-h b { display: block; color: var(--tx); font-size: 14px; font-weight: 500; }
.sp-pop hr { border: 0; border-top: 1px solid var(--ln); margin: 6px 0; }
.sp-pop-i {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 36px; padding: 0 10px 0 12px; border-radius: 4px;
  border: 0; background: none; color: var(--tx); cursor: pointer; text-align: left; font-size: 13.5px;
  transition: background var(--d1);
}
.sp-pop-i:hover, .sp-pop-i:focus-visible { background: var(--hov-2); }
.sp-pop-i svg { width: 16px; height: 16px; color: var(--tx-2); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sp-pop-i .k { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--tx-3); }

/* ---- Botões: pressionar (spring), foco, carregando e sucesso ----
   Estados por classe: .carregando (anel girando, texto some sem mudar a largura) e .sucesso (check);
   o SP.botao(btn, 'carregando'|'sucesso'|'') do shell.js liga/desliga. */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 4px; border: 1px solid var(--ln-in); background: transparent;
  color: var(--tx); padding: 7px 12px; font-size: 13px; font-weight: 500; white-space: nowrap;
  cursor: pointer;
  transition: background var(--d1) var(--ease-out), color var(--d1), border-color var(--d1), box-shadow var(--d1), transform var(--d2) var(--spring);
}
.btn:hover { background: var(--pn-2); border-color: var(--tx-3); }
.btn:active { transform: scale(.97); }
.btn svg { width: 14px; height: 14px; }
.btn-primary { background: var(--btn); color: var(--on-btn); border-color: var(--btn); font-weight: 600; }
.btn-primary:hover { background: color-mix(in srgb, var(--btn) 85%, var(--btn-mix)); border-color: color-mix(in srgb, var(--btn) 85%, var(--btn-mix)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--tx-2); }
.btn-ghost:hover { background: var(--pn-2); border-color: transparent; color: var(--tx); }
.btn-danger { color: var(--danger); border-color: var(--danger-ln); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.carregando, .btn.sucesso { color: transparent !important; pointer-events: none; }
.btn.carregando::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--sig) 35%, transparent); border-top-color: var(--sig);
  animation: sp-pop var(--d2) var(--ease-out) both, sp-spin 820ms linear infinite;
}
.btn-primary.carregando { background: var(--pn-3); border-color: color-mix(in srgb, var(--sig) 60%, transparent); }
.btn.sucesso { border-color: var(--ok); }
.btn-primary.sucesso { background: var(--ok); }
.btn.sucesso::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 11px; margin: -8px 0 0 -3px;
  border: solid var(--ok); border-width: 0 2.4px 2.4px 0; transform: rotate(45deg);
  animation: sp-check var(--d3) var(--spring) both;
}
.btn-primary.sucesso::after { border-color: var(--on-ok); }

/* ---- Conteúdo ---- */
.content { padding: 24px 28px 56px; width: 100%; max-width: 1280px; margin: 0 auto; }
.content.wide { max-width: none; margin: 0; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.012em; line-height: 1.15; color: var(--tx-hi); }
.page-head p { margin: 5px 0 0; color: var(--tx-2); font-size: 13px; }
.eyebrow { font-size: 12.5px; font-weight: 500; color: var(--tx-2); margin: 0 0 6px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  color: var(--tx-2); margin-bottom: 14px; font-weight: 500; transition: color var(--d1);
}
.back:hover { color: var(--tx); }
.back svg { width: 14px; height: 14px; }

/* ---- KPIs (os únicos "cartões") ---- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi {
  position: relative; background: var(--pn); border: 1px solid var(--ln);
  border-radius: var(--radius); padding: 14px 16px; min-width: 0;
  transition: border-color var(--d1) var(--ease-out);
}
a.kpi:hover, .kpi.click:hover { border-color: color-mix(in srgb, var(--hl) 55%, transparent); }
.kpi-label { font-size: 13px; color: var(--tx-2); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value {
  margin-top: 10px; font-size: 28px; font-weight: 500; letter-spacing: -.02em; color: var(--tx-hi);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; line-height: 1;
  white-space: nowrap;
}
.kpi-meta { margin-top: 10px; font-size: 12px; color: var(--tx-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi-meta .up { color: var(--ok); font-weight: 500; }
.kpi-meta .down { color: var(--danger); font-weight: 500; }
.kpi-meta .warn { color: var(--warn); font-weight: 500; }

/* ---- Painéis e grades ---- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.grid-2b { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.card {
  background: var(--pn); border: 1px solid var(--ln);
  border-radius: var(--radius); min-width: 0;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--ln); min-height: 46px;
}
.card-head h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--tx); }
.card-head .hint { font-size: 12.5px; color: var(--tx-2); }
.card-head a.hint { transition: color var(--d1); }
.card-head a.hint:hover { color: var(--hl); }
.card-body { padding: 14px 18px; }

/* ---- Filtros ---- */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--pn); border: 1px solid var(--ln);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px;
}
.field {
  display: flex; align-items: center; gap: 6px;
  background: var(--pn-2); border: 1px solid var(--ln-in); border-radius: 4px; padding: 6px 10px;
  transition: border-color var(--d1) var(--ease-out), box-shadow var(--d1);
}
.field:hover { border-color: var(--tx-3); }
.field:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.field svg { width: 14px; height: 14px; color: var(--tx-3); flex-shrink: 0; }
.field input, .field select { border: 0; background: transparent; outline: none; font-size: 13px; min-width: 0; color: var(--tx); }
.field input:focus-visible, .field select:focus-visible { outline: none; }
.field input { width: 190px; }
.field select { min-width: 130px; cursor: pointer; }
.filters-meta { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--tx-2); flex-wrap: wrap; }
.filters-meta strong { font-family: var(--font-mono); font-weight: 500; color: var(--tx); font-variant-numeric: tabular-nums; }

/* ---- Tabelas: cabeçalho em sentence case, hairlines, hover de linha ---- */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; font-weight: 500; letter-spacing: 0;
  color: var(--tx-2); font-family: var(--font-body);
  padding: 9px 12px; border-bottom: 1px solid var(--ln);
  background: var(--pn); white-space: nowrap;
}
th.right, td.right { text-align: right; }
th.center, td.center { text-align: center; }
td { padding: 10px 12px; border-bottom: 1px solid var(--ln); vertical-align: middle; font-size: 13px; transition: background var(--d1) var(--ease-out); }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr:hover td { background: var(--row-hov); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 12.5px; letter-spacing: -.01em; }
.muted { color: var(--tx-2); }
.strong { font-weight: 600; }
.el-title { font-weight: 500; color: var(--tx); }
.el-sub { font-size: 12px; color: var(--tx-2); margin-top: 2px; }
.id-link { font-family: var(--font-mono); font-size: 11.5px; color: var(--tx-2); white-space: nowrap; }
.id-link:hover { color: var(--hl); text-decoration: underline; text-underline-offset: 2px; }
tfoot td {
  border-top: 1px solid var(--ln-2); border-bottom: 0;
  background: var(--pn-2); font-weight: 600;
}

/* ---- Pills de status (selo da prancha): cor do texto = cor do estado; fundo e contorno derivados ----
   Pulso só no que está "aguardando" (aprovação). */
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 22px;
  font-size: 12px; font-weight: 500; line-height: 1.2;
  padding: 2px 8px; border-radius: 3px; white-space: nowrap; color: var(--tx-2);
  background: color-mix(in srgb, currentColor 11%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 26%, transparent);
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: currentColor; position: relative; }
.pill-aguarda .pill-dot::after, .pill-aprov-aguardando .pill-dot::after, .pill-eq-aguardando .pill-dot::after, .pill-dot.pulso::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; animation: sp-pulso 2s var(--ease-out) infinite;
}
.pill-aberto { color: var(--info); }
.pill-parcial { color: var(--warn); }
.pill-faturado { color: var(--ok); }
.pill-cancelado { color: var(--tx-2); }
.pill-rascunho { color: var(--tx-2); }

/* ---- Chips de origem/tipo do item: azul (Press), ciano (importação), cinza (local), tinta (serviço) ---- */
.chip-tipo {
  display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 500;
  padding: 1px 6px; border-radius: 3px; white-space: nowrap; color: var(--tx-2);
  background: color-mix(in srgb, currentColor 9%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
}
.chip-press { color: var(--info); }
.chip-china { color: var(--ciano); }
.chip-local { color: var(--tx-2); }
.chip-servico { color: var(--tx); }

/* ---- Badge de pendência ---- */
.badge-pend {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500;
  color: var(--danger); border: 1px solid var(--danger-ln);
  background: var(--danger-bg); border-radius: 3px; padding: 1px 6px; white-space: nowrap;
}
.badge-pend::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--danger); }

/* ---- Selo do tipo de NF (Faturamento e Fiscal, Task 9): sentence case, cor = tipo — as mesmas da ficha do pedido:
   NF-e de venda verde, NFS-e (serviço) azul, retorno neutro ---- */
.tag-nf {
  display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 500; padding: 1px 7px; border-radius: 3px; white-space: nowrap;
  color: var(--tx-2); background: color-mix(in srgb, currentColor 9%, transparent); border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
}
.tag-nf.retorno { color: var(--tx-2); }
.tag-nf.venda { color: var(--ok); }
.tag-nf.servico, .tag-nf.nfse { color: var(--info); }

/* ---- Barras / progresso: trilho em segmentos (régua), preenchimento entra da esquerda ---- */
.status-bars { display: flex; flex-direction: column; gap: 12px; }
.status-row { display: grid; grid-template-columns: 150px 1fr 64px; gap: 10px; align-items: center; }
.status-name { font-size: 13px; font-weight: 400; color: var(--tx-2); }
.bar-track {
  position: relative; height: 10px; overflow: hidden; border: 0; border-radius: 0;
  background: repeating-linear-gradient(90deg, var(--seg-off) 0 4px, transparent 4px 6px);
}
.bar-fill {
  height: 100%; border-radius: 0; background: var(--bar);
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 6px);
  mask-image: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 6px);
  animation: sp-encher 560ms var(--ease-emph) both;
}
.bar-count { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--tx); }
.progress { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.progress .bar-track { flex: 1; }
.progress span { font-family: var(--font-mono); font-size: 11px; color: var(--tx-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Alertas / sinais ---- */
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: grid; grid-template-columns: 3px 1fr auto; gap: 10px; align-items: start;
  padding: 10px 12px; border: 1px solid var(--ln); border-radius: 4px; background: var(--pn-2);
}
.alert-item .bar { height: 100%; min-height: 32px; border-radius: 2px; }
.alert-item strong { display: block; font-size: 13px; font-weight: 500; }
.alert-item span { font-size: 12px; color: var(--tx-2); }
.alert-item a { font-size: 12px; color: var(--hl); font-weight: 500; white-space: nowrap; }
.alert-item a:hover { text-decoration: underline; text-underline-offset: 3px; }
.alert-box {
  border: 1px solid var(--danger-ln); background: var(--danger-bg);
  border-radius: 4px; padding: 12px; font-size: 12.5px; color: var(--danger);
}
.alert-box strong { display: block; font-size: 12.5px; margin-bottom: 4px; }
.alert-box.ok { border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: var(--ok-bg); color: var(--ok); }

/* ---- Formulários: borda → azul no foco, erro em vermelho com mensagem que entra (sem tremer) ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 14px; }
label.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
label.f > span { font-size: 13px; font-weight: 500; color: var(--tx); }
.control {
  border: 1px solid var(--ln-in); background: var(--pn-2); color: var(--tx); border-radius: 4px;
  padding: 8px 10px; font-size: 13px; outline: none; width: 100%;
  transition: border-color var(--d1) var(--ease-out), box-shadow var(--d1), background var(--d1);
}
.control:hover { border-color: var(--tx-3); }
.control:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.control:focus-visible { outline: none; }
.control:disabled, .control[readonly] { opacity: .7; }
select.control { cursor: pointer; }
textarea.control { min-height: 72px; resize: vertical; line-height: 1.45; }
.control.mono { font-family: var(--font-mono); }
.cel {
  width: 100%; background: transparent; border: 1px solid transparent;
  border-radius: 4px; padding: 5px 8px; font-size: 13px; color: var(--tx); min-width: 0;
  transition: border-color var(--d1), box-shadow var(--d1), background var(--d1);
}
.cel:hover { border-color: var(--ln-2); }
.cel:focus { outline: none; border-color: var(--focus); background: var(--pn-2); box-shadow: 0 0 0 3px var(--focus-ring); }
.add-row {
  display: flex; width: 100%; border: 0; border-top: 1px solid var(--ln);
  background: transparent; color: var(--tx-2); font-size: 13px; font-weight: 500;
  padding: 10px 14px; cursor: pointer; text-align: left;
  transition: color var(--d1), background var(--d1);
}
.add-row:hover { color: var(--hl); background: var(--hov); }
.drop {
  border: 1.5px dashed var(--ln-3); border-radius: 6px; background: var(--pn-2);
  padding: 18px; text-align: center; color: var(--tx-2); font-size: 12.5px; cursor: pointer;
  transition: border-color var(--d1), background var(--d1);
}
.drop:hover { border-color: var(--hl); background: var(--hov); }
.drop strong { color: var(--tx); font-weight: 500; }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  font-family: var(--font-mono); border: 1px solid var(--ln-2); background: var(--pn-2);
  border-radius: 4px; padding: 4px 8px; color: var(--tx);
}
.file-chip svg { width: 13px; height: 13px; color: var(--tx-3); }
.file-chip .x { cursor: pointer; color: var(--tx-2); font-weight: 600; padding: 0 2px; }
.file-chip .x:hover { color: var(--danger); }

/* ---- KV / resumo ---- */
.kv { display: flex; flex-direction: column; gap: 10px; }
.kv-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding-bottom: 8px; border-bottom: 1px solid var(--ln); font-size: 13px;
}
.kv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kv-row span { color: var(--tx-2); }
.kv-row b { font-weight: 500; text-align: right; font-family: var(--font-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---- Timeline ---- */
.timeline { display: flex; flex-direction: column; }
.t-item { display: grid; grid-template-columns: 18px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.t-item:last-child { padding-bottom: 0; }
.t-item::before { content: ''; position: absolute; left: 8px; top: 14px; bottom: 0; width: 1px; background: var(--ln-2); }
.t-item:last-child::before { display: none; }
.t-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ln-3); background: var(--pn); margin-top: 2px; z-index: 1; }
.t-dot.done { background: var(--ok); border-color: var(--ok); }
.t-dot.active { background: var(--warn); border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-ln); }
.t-body strong { display: block; font-size: 13px; font-weight: 500; }
.t-body span { font-size: 12px; color: var(--tx-2); }
.t-body time { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 11px; color: var(--tx-2); }

/* ---- Hero (detalhe) ---- */
.hero {
  background: var(--pn); border: 1px solid var(--ln);
  border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 12px;
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start;
}
.hero-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.mono-id { font-family: var(--font-mono); font-size: 12px; color: var(--tx-2); font-weight: 500; }
.hero h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.012em; line-height: 1.2; max-width: 52ch; color: var(--tx-hi); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-top: 12px; font-size: 12.5px; color: var(--tx-2); }
.hero-meta b { display: block; font-size: 12px; font-weight: 400; color: var(--tx-2); margin-bottom: 2px; }
.hero-meta span { color: var(--tx); font-weight: 500; }
.hero-meta .late { color: var(--danger); font-weight: 600; font-family: var(--font-mono); }
.hero-meta .money { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.hero-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 170px; }
.layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .9fr); gap: 12px; align-items: start; }
.side-stack { display: flex; flex-direction: column; gap: 12px; }

/* ---- Modal: fundo escurece (180 ms), painel cresce do centro (240 ms, ênfase); sai em ~70% do tempo ---- */
.modal-back {
  position: fixed; inset: 0; background: var(--scrim);
  display: none; align-items: flex-start; justify-content: center; z-index: 80;
  padding: 6vh 16px 16px; overflow-y: auto;
  opacity: 0; transition: opacity 140ms var(--ease-in), display 140ms allow-discrete;
}
.modal-back.show { display: flex; opacity: 1; transition: opacity var(--d2) var(--ease-out), display var(--d2) allow-discrete; }
@starting-style { .modal-back.show { opacity: 0; } }
.modal {
  background: var(--pn); border: 0; border-radius: 8px; color: var(--tx);
  box-shadow: var(--float), inset 0 0 0 1px var(--ln-2); width: 680px; max-width: 100%;
  transform: scale(.98) translateY(8px); opacity: 0;
  transition: transform 160ms var(--ease-in), opacity 160ms var(--ease-in);
}
.modal-back.show .modal { transform: none; opacity: 1; transition: transform var(--d3) var(--ease-emph), opacity var(--d2) var(--ease-out); }
@starting-style { .modal-back.show .modal { transform: scale(.98) translateY(8px); opacity: 0; } }
.modal-head {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--ln);
}
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--tx-hi); }
.modal-x { border: 0; background: none; cursor: pointer; color: var(--tx-2); font-size: 18px; line-height: 1; padding: 4px 6px; border-radius: 4px; transition: color var(--d1), background var(--d1); }
.modal-x:hover { color: var(--tx); background: var(--pn-2); }
.modal-body { padding: 16px 18px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--ln); background: var(--foot);
  border-radius: 0 0 8px 8px;
}

/* ---- Abas (seletor segmentado): o "polegar" desliza até a aba ativa (posição pelo shell.js) ---- */
.tabs {
  position: relative; display: flex; gap: 2px; border: 1px solid var(--ln-2); background: var(--bg);
  border-radius: 5px; padding: 3px; margin-bottom: 14px; width: fit-content; max-width: 100%;
}
.tab {
  position: relative; z-index: 1; border: 0; background: transparent; border-radius: 3px; padding: 6px 12px;
  font-size: 13px; font-weight: 500; color: var(--tx-2); cursor: pointer;
  transition: color var(--d1);
}
.tab:hover { color: var(--tx); }
.tab.active { color: var(--tx-hi); }
.tabs:not(.tem-ind) .tab.active { background: var(--pn-3); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--btn) 60%, transparent); }
.tab-ind {
  position: absolute; left: 0; top: 0; z-index: 0; border-radius: 3px; pointer-events: none;
  background: var(--pn-3); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--btn) 60%, transparent);
  transition: transform var(--d4) var(--spring), width var(--d4) var(--spring), height var(--d4) var(--spring);
}
.tab-ind.sem-anim { transition: none; }
/* variante sublinhada (prancha Aprovações, Task 9): hairline embaixo, o polegar vira um traço de 2 px que desliza */
.tabs.tabs-linha { display: flex; gap: 0; border: 0; border-bottom: 1px solid var(--ln); border-radius: 0; background: none; padding: 0; width: auto; margin-bottom: 16px; }
.tabs.tabs-linha .tab { height: 40px; min-width: 200px; display: inline-flex; align-items: center; gap: 0; padding: 0 4px; border-radius: 0; font-size: 14.5px; }
.tabs.tabs-linha:not(.tem-ind) .tab.active { background: none; box-shadow: inset 0 -2px 0 var(--btn); }
.tabs.tabs-linha .tab-ind { background: none; box-shadow: none; border-radius: 0; }
.tabs.tabs-linha .tab-ind::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--btn); }

/* ---- Matriz estilo planilha ---- */
.matrix-wrap { overflow-x: auto; }
.matrix { border-collapse: collapse; min-width: 900px; width: 100%; }
.matrix th, .matrix td {
  font-family: var(--font-mono); font-size: 11.5px; font-variant-numeric: tabular-nums;
  padding: 6px 8px; border: 1px solid var(--ln); white-space: nowrap;
}
.matrix th { background: var(--pn-2); text-align: right; }
.matrix th:first-child, .matrix td:first-child {
  text-align: left; font-family: var(--font-body); font-size: 12.5px; font-weight: 500;
  position: sticky; left: 0; background: var(--pn); min-width: 130px;
}
.matrix td { text-align: right; }
.matrix td.neg { color: var(--danger); font-weight: 600; }
.matrix td.pct { color: var(--tx-2); text-align: center; }
.matrix tr.total td { font-weight: 600; background: var(--pn-2); }

/* ---- Toast (ilha escura nos dois temas): entra de baixo com spring, sai para a direita ---- */
.toast {
  position: fixed; right: 24px; bottom: 24px; background: var(--pn-3);
  color: var(--tx); padding: 11px 14px; border-radius: 5px; max-width: 420px;
  font-size: 13px; box-shadow: var(--float), inset 0 0 0 1px color-mix(in srgb, var(--sig) 48%, transparent);
  opacity: 0; transform: translateX(24px); transition: opacity var(--d2) var(--ease-in), transform var(--d2) var(--ease-in);
  z-index: 90; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; animation: sp-toast 420ms var(--spring) both; }
.demo-note { margin-top: 18px; font-size: 12px; color: var(--tx-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.demo-note a { color: var(--hl); }
.demo-note code {
  font-family: var(--font-mono); font-size: 11px; background: var(--pn);
  border: 1px solid var(--ln-2); padding: 1px 5px; border-radius: 3px;
}
/* A9 (spec 1.10): em produção (shell.js põe .sp-producao no <html>) as notas do protótipo somem; só a legenda
   marcada data-producao="manter" fica */
.sp-producao .demo-note:not([data-producao="manter"]) { display: none !important; }
/* B9: no servidor (beta e produção — shell.js põe .sp-servidor) as notas do protótipo também somem */
.sp-servidor .demo-note:not([data-producao="manter"]) { display: none !important; }

/* ---- Seletor de perfil (shell) ---- */
.perfil-box {
  display: flex; flex-direction: column; gap: 6px; padding: 0 2px 10px;
  font-size: 12px; color: var(--tx-3); font-weight: 400;
}
.perfil-select {
  background: var(--pn-2); color: var(--tx);
  border: 1px solid var(--ln-in); border-radius: 4px;
  padding: 7px 8px; font-size: 12.5px; font-family: var(--font-body);
  cursor: pointer; outline: none; transition: border-color var(--d1), box-shadow var(--d1);
}
.perfil-select:hover { border-color: var(--tx-3); }
.perfil-select:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
/* 02/10: "Você está como: …" — discreta, no topo do menu (sempre visível) */
.perfil-faixa {
  display: flex; align-items: center; gap: 8px; margin: 10px 10px 4px; padding: 6px 10px; flex: none;
  border-radius: 4px; background: var(--pn-2); border: 1px solid var(--ln);
  font-size: 12px; color: var(--tx-2); cursor: pointer; line-height: 1.3; white-space: nowrap; overflow: hidden;
  transition: border-color var(--d1);
}
.perfil-faixa span { overflow: hidden; text-overflow: ellipsis; transition: opacity var(--d1); }
.perfil-faixa b { color: var(--tx); font-weight: 600; }
.perfil-faixa i { width: 6px; height: 6px; border-radius: 50%; background: var(--sig); box-shadow: var(--glow-live); flex-shrink: 0; }
.perfil-faixa:hover { border-color: var(--ln-3); }
[data-menu="col"] .perfil-faixa { margin: 10px 14px 4px; padding: 6px 12px; }
/* B9: "Ambiente de teste" (beta do servidor) — a mesma faixa discreta, com o ponto em aviso e sem cara de botão */
.perfil-faixa.amb-teste { cursor: default; }
.perfil-faixa.amb-teste:hover { border-color: var(--ln); }
.perfil-faixa.amb-teste i { background: var(--warn); box-shadow: none; }
/* Alertas do servidor (só master, modo servidor — shell.js): faixa discreta no topo da tela. Estado = cor de alerta
   fixa (--warn, tokens do Sereno nos dois temas), nunca o acento; quebra linha no celular */
.sp-alertas {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 10px; padding: 8px 14px;
  border-radius: var(--r-sm, 6px); background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn-ln); color: var(--warn);
  font-size: 12.5px; line-height: 1.4;
}
.sp-alertas-tit { font-weight: 700; }
.sp-alertas-lista { flex: 1 1 260px; margin: 0; padding: 0; list-style: none; color: var(--tx); }
.sp-alertas-lista li + li { margin-top: 2px; }
.sp-alertas-hora { font-size: 11.5px; color: var(--tx-2); white-space: nowrap; }
.brand-name { color: var(--brand); }
.brand-mark { cursor: pointer; }

/* ---- Board WorkManager ---- */
.grupo {
  background: var(--pn); border: 1px solid var(--ln);
  border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
}
.grupo.collapsed .tbl-wrap, .grupo.collapsed .add-row { display: none; }
.grupo-cab {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  cursor: pointer; user-select: none; border-bottom: 1px solid var(--ln);
  background: var(--pn-2); transition: background var(--d1);
}
.grupo-cab:hover { background: color-mix(in srgb, var(--pn-2) 70%, var(--ln-2)); }
.grupo-rail { width: 3px; align-self: stretch; border-radius: 2px; flex-shrink: 0; min-height: 22px; }
.chev { width: 16px; height: 16px; color: var(--tx-3); transition: transform var(--d3) var(--spring); flex-shrink: 0; }
.grupo.collapsed .chev { transform: rotate(-90deg); }
.grupo-cab h2 { margin: 0; font-size: 14px; font-weight: 600; }
.grupo-qtd { font-family: var(--font-mono); font-size: 12px; color: var(--tx-2); font-variant-numeric: tabular-nums; }
.grupo-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.mini-pill {
  font-size: 11.5px; font-weight: 500;
  padding: 1px 7px; border-radius: 3px; border: 1px solid var(--ln-2);
  background: var(--cnt-bg); color: var(--tx-2); font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.alca { color: var(--tx-3); cursor: grab; font-size: 14px; user-select: none; display: inline-block; padding: 4px 2px; line-height: 1; transition: color var(--d1); }
tbody tr:hover .alca { color: var(--tx-2); }
.status-select {
  width: 100%; border: 1px solid transparent; border-radius: 4px; padding: 6px 8px;
  font-size: 12px; font-weight: 600; text-align: center; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background: color-mix(in srgb, currentColor 12%, var(--pn)); border-color: color-mix(in srgb, currentColor 28%, transparent);
}
.status-select:focus { outline: 1.5px solid var(--focus); outline-offset: 1px; }
.status-andamento { color: var(--warn); }
.status-aguardando { color: var(--info); }
.status-fornecedor { color: var(--tx-2); }
.status-finalizada { color: var(--ok); }
.deadline { font-family: var(--font-mono); font-size: 11.5px; margin-top: 2px; padding-left: 8px; font-variant-numeric: tabular-nums; }
.deadline.late { color: var(--danger); font-weight: 600; }
.deadline.soon { color: var(--warn); font-weight: 500; }
tbody tr.row-late td:first-child { box-shadow: inset 2px 0 0 var(--danger); }
tbody tr.row-soon td:first-child { box-shadow: inset 2px 0 0 var(--warn); }
.baixar {
  border: 1px solid transparent; background: none; color: var(--tx-2);
  border-radius: 4px; padding: 4px 8px; cursor: pointer; font-size: 12px; font-weight: 500; white-space: nowrap;
  transition: color var(--d1), border-color var(--d1), background var(--d1);
}
tbody tr:hover .baixar { color: var(--hl); border-color: color-mix(in srgb, var(--hl) 40%, transparent); }
.baixar:hover { background: var(--hov-2); }

/* ---- Estoque Clientes (etapa 1): estados do equipamento ---- */
.pill-eq-recebido { color: var(--info); }
.pill-eq-identificado { color: var(--ciano); }
.pill-eq-avaliacao { color: var(--ciano); }
.pill-eq-liberado { color: var(--ok); }
.pill-eq-orcamento { color: var(--tx); }
.pill-eq-aguardando { color: var(--warn); }
.pill-eq-lote { color: var(--ok); }
.pill-eq-concluido { color: var(--info); }
.pill-eq-expedicao { color: var(--ciano); }
.pill-eq-expedido { color: var(--tx-2); }
.pill-eq-devolvido { color: var(--danger); }

/* ---- Contas a Receber (etapa 4): as cores da planilha (amarelo → laranja → vermelho) ---- */
.pill-rec-aberto { color: var(--info); }
.pill-rec-amarelo { color: var(--warn); }
.pill-rec-laranja { color: var(--laranja); }
.pill-rec-verm { color: var(--danger); }
.pill-rec-paga { color: var(--tx-2); }

.ped-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--info); background: color-mix(in srgb, currentColor 9%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 26%, transparent);
  border-radius: 3px; padding: 1px 6px; white-space: nowrap;
}
a.ped-chip:hover { border-color: currentColor; text-decoration: underline; text-underline-offset: 2px; }
.ped-chip.verde { color: var(--ok); }
a.ped-chip.verde:hover { border-color: currentColor; }
.ped-chip.roxo { color: var(--ciano); }

.foto-thumb {
  width: 34px; height: 34px; border-radius: 4px; flex-shrink: 0;
  border: 1px solid var(--ln-2); background: var(--pn-2);
  display: grid; place-items: center; color: var(--tx-3);
}
.foto-thumb svg { width: 18px; height: 18px; }
.foto-hero {
  width: 96px; height: 96px; border-radius: 6px;
  border: 1px solid var(--ln-2); background: var(--pn-2);
  display: grid; place-items: center; color: var(--tx-3); position: relative;
}
.foto-hero svg { width: 44px; height: 44px; }
.foto-hero::after {
  content: 'foto simulada'; position: absolute; bottom: 4px; left: 0; right: 0;
  text-align: center; font-size: 10px; color: var(--tx-3);
}

.qr-box {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 1.5px dashed var(--ln-3); border-radius: 6px; background: var(--pn-2);
  padding: 14px; color: var(--tx);
}
.qr-box .qr-id { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.qr-box .qr-sub { font-size: 11.5px; color: var(--tx-2); text-align: center; }

.labels-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.label-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  border: 1.5px dashed var(--ln-3); border-radius: 6px; background: var(--pn); padding: 12px 8px;
}
.label-card .qr-id { font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.label-card .qr-cli { font-size: 11.5px; font-weight: 500; }
.label-card .qr-eq { font-size: 11px; color: var(--tx-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sel-row { display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--ln-2); border-radius: 4px; background: var(--pn-2); margin-bottom: 6px; }
.sel-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--btn); cursor: pointer; }
.sel-row .el-sub { margin-top: 0; }
/* linha desligada: apagada pela cor (texto 3 passa AA), sem opacidade */
.sel-row.off { background: transparent; border-style: dashed; }
.sel-row.off .el-title, .sel-row.off .el-sub, .sel-row.off a { color: var(--tx-3); }

/* ---- Avaliação p/ orçamento (etapa 1b · WorkManager) ---- */
.aval-row {
  display: grid; grid-template-columns: 40px 110px minmax(190px, 1fr) minmax(260px, 1.2fr) auto;
  gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--ln);
}
.aval-row:last-child { border-bottom: 0; }
.desc-in {
  width: 100%; border: 1px solid var(--ln-in); background: var(--pn-2); color: var(--tx); border-radius: 4px;
  padding: 7px 9px; font-size: 12.5px; outline: none; resize: none; line-height: 1.4;
  transition: border-color var(--d1), box-shadow var(--d1);
}
.desc-in:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.aval-acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.copiar-btn {
  border: 1px solid var(--ln-2); background: var(--pn); color: var(--tx-2);
  border-radius: 4px; padding: 4px 8px; cursor: pointer; font-size: 11.5px; white-space: nowrap;
  transition: color var(--d1), border-color var(--d1);
}
.copiar-btn:hover { color: var(--tx); border-color: var(--tx-3); }

/* ---- Orçamentos modelo 2.0 (etapa 1b) ---- */
.chip-orc-tipo {
  display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 500;
  padding: 1px 6px; border-radius: 3px; white-space: nowrap; color: var(--tx-2);
  background: color-mix(in srgb, currentColor 9%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
}
.chip-orc-manutencao { color: var(--tx); }
.chip-orc-venda { color: var(--info); }
.item-orc {
  display: grid; grid-template-columns: 26px 110px minmax(220px, 1fr) 90px 70px 110px 110px 30px;
  gap: 8px; align-items: start; padding: 10px 12px; border: 1px solid var(--ln-2);
  border-radius: 6px; background: var(--pn-2); margin-bottom: 8px;
}
.item-orc .rm { border: 0; background: none; color: var(--tx-2); cursor: pointer; font-size: 15px; padding: 4px; line-height: 1; }
.item-orc .rm:hover { color: var(--danger); }
.orc-totalbar {
  display: flex; justify-content: flex-end; align-items: baseline; gap: 14px;
  border-top: 1px dashed var(--ln-3); padding-top: 12px; margin-top: 4px;
}
.orc-totalbar .lbl { font-size: 13px; color: var(--tx-2); font-weight: 400; }
.orc-totalbar .val { font-size: 24px; font-weight: 500; font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--tx-hi); }

/* ---- CRM · Funil kanban (etapa 2) ---- */
.kb-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: start; }
.kb-col {
  background: var(--pn); border: 1px solid var(--ln);
  border-radius: var(--radius); min-width: 0;
}
.kb-col-head {
  display: flex; align-items: center; gap: 7px; padding: 10px 12px;
  border-bottom: 1px solid var(--ln); background: var(--pn-2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.kb-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.kb-col-head h2 { margin: 0; font-size: 13px; font-weight: 600; }
.kb-col-head .n { font-family: var(--font-mono); font-size: 11.5px; color: var(--tx-2); font-variant-numeric: tabular-nums; }
.kb-col-head .soma { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--tx-2); white-space: nowrap; }
.kb-col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 90px; }
.kb-card {
  border: 1px solid var(--ln-2); border-radius: 6px; background: var(--pn-2);
  padding: 10px 11px; cursor: pointer; transition: border-color var(--d1), transform var(--d2) var(--spring);
}
.kb-card:hover { border-color: color-mix(in srgb, var(--hl) 55%, transparent); }
.kb-card:active { transform: scale(.985); }
.kb-card .kb-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.kb-card .kb-num { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.kb-card .kb-cli { font-size: 13px; font-weight: 500; }
.kb-card .kb-val { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kb-card .kb-sub { font-size: 11px; color: var(--tx-2); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
.kb-card .venc { color: var(--danger); font-weight: 600; }
.kb-vazio { font-size: 12px; color: var(--tx-2); text-align: center; padding: 14px 6px; }
@media (max-width: 1100px) { .kb-board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .kb-board { grid-template-columns: 1fr; } }

/* ---- Cotações China (etapa 5) ---- */
.kb-scroll { overflow-x: auto; padding-bottom: 6px; }
.kb-board-ch { display: grid; grid-auto-flow: column; grid-auto-columns: 186px; gap: 10px; min-width: max-content; align-items: start; }
.mail-item {
  border: 1px solid var(--ln-2); border-radius: 6px; padding: 10px 12px; margin-bottom: 10px;
  background: var(--pn-2); font-size: 12.5px;
}
.mail-item.press { border-left: 3px solid var(--btn); }
.mail-item.forn { border-left: 3px solid var(--info); background: color-mix(in srgb, var(--info) 5%, var(--pn)); }
.mail-item .mail-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.mail-item .mail-de { font-weight: 600; font-size: 12.5px; }
.mail-item .mail-data { font-family: var(--font-mono); font-size: 11px; color: var(--tx-2); margin-left: auto; }
.mail-item .mail-ass { font-size: 12.5px; font-weight: 500; color: var(--info); }
.mail-item pre {
  margin: 6px 0 0; font-family: var(--font-mono); font-size: 11.5px; white-space: pre-wrap;
  color: var(--tx-2); line-height: 1.5;
}
.ptax-box {
  border: 1px solid color-mix(in srgb, var(--ciano) 30%, transparent); background: color-mix(in srgb, var(--ciano) 7%, var(--pn)); border-radius: 6px;
  padding: 12px 14px; font-size: 13px;
}
.ptax-box .calc { font-family: var(--font-mono); font-size: 15px; font-weight: 600; margin: 6px 0; }
.ptax-box .fonte { font-size: 11.5px; color: var(--tx-2); }
.rmb-alert {
  border: 1px solid var(--danger-ln); background: var(--danger-bg); border-radius: 6px;
  padding: 12px 14px; font-size: 12.5px; color: var(--danger);
}

/* ---- CRM 2.0 · Esteira de clientes (decisão 26/08 — prancha aprovada) ---- */
.crm-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 12px; align-items: start; }
.crm-scroll { overflow-x: scroll; padding-bottom: 4px; cursor: grab; }
.crm-scroll.panning { cursor: grabbing; user-select: none; }
.crm-scroll::-webkit-scrollbar { height: 11px; }
.crm-scroll::-webkit-scrollbar-track { background: var(--pn-2); border-radius: 99px; }
.crm-scroll::-webkit-scrollbar-thumb { background: var(--sbar); border-radius: 99px; border: 2px solid var(--pn-2); }
.crm-scroll::-webkit-scrollbar-thumb:hover { background: var(--tx-3); }
.crm-board { display: grid; grid-auto-flow: column; grid-auto-columns: 200px; gap: 10px; align-items: start; min-width: max-content; }
.crm-col { background: var(--pn-2); border: 1px solid var(--ln); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; height: clamp(430px, calc(100vh - 330px), 680px); }
/* cabeçalho pintado com a cor da coluna (data.js): texto branco sobre a cor */
.crm-col-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px 7px; color: var(--on-fill); box-shadow: inset 0 0 0 999px var(--veu-fill); }
.crm-col-head .ch-top { display: flex; align-items: center; gap: 8px; }
.crm-col-head h2 { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--on-fill); white-space: nowrap; }
.crm-col-head .n { margin-left: auto; font-family: var(--font-mono); font-size: 11px; font-weight: 600; background: var(--veu-fill-2); border-radius: 3px; padding: 1px 7px; }
.crm-col-head .ch-val { font-family: var(--font-mono); font-size: 11px; color: color-mix(in srgb, var(--on-fill) 90%, transparent); white-space: nowrap; }
.crm-col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--sbar) transparent; }
.crm-col-body > * { flex-shrink: 0; }
.crm-col-body::-webkit-scrollbar { width: 9px; }
.crm-col-body::-webkit-scrollbar-track { background: transparent; }
.crm-col-body::-webkit-scrollbar-thumb { background: var(--sbar); border-radius: 99px; border: 2px solid var(--pn-2); }
.crm-col-body::-webkit-scrollbar-thumb:hover { background: var(--tx-3); }
.crm-card { border: 1px solid var(--ln-2); border-radius: 6px; background: var(--pn); padding: 10px 11px; cursor: grab; transition: border-color var(--d1), opacity var(--d1); }
.crm-card:hover { border-color: color-mix(in srgb, var(--hl) 55%, transparent); }
.crm-card .kc-top { display: flex; align-items: center; gap: 6px; }
.crm-card .kc-num { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.crm-card .kc-cli { font-size: 13px; font-weight: 500; }
.crm-card .kc-val { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; margin-top: 3px; font-variant-numeric: tabular-nums; }
.crm-card .kc-sub { font-size: 11px; color: var(--tx-2); margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.crm-card .kc-obs { font-size: 11.5px; color: var(--tx-2); margin-top: 3px; line-height: 1.4; }
.crm-av { width: 20px; height: 20px; border-radius: 50%; background: var(--pn-3); box-shadow: inset 0 0 0 1px var(--ln-3); color: var(--tx); display: grid; place-items: center; font-size: 9px; font-weight: 600; margin-left: auto; flex-shrink: 0; }
.acao { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 3px; border: 1px solid var(--ln-2); background: var(--pn-2); color: var(--tx-2); margin-top: 7px; max-width: 100%; }
.acao svg { width: 11px; height: 11px; flex-shrink: 0; }
.acao span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acao.late { background: var(--danger-bg); border-color: var(--danger-ln); color: var(--danger); font-weight: 600; }
.tarja-4m { display: flex; align-items: center; gap: 5px; background: var(--danger-bg); color: var(--danger); font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 3px; margin-bottom: 7px; border: 1px solid var(--danger-ln); }
.crm-chip-aviso { display: inline-flex; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--warn-ln); background: var(--warn-bg); color: var(--warn); margin-bottom: 6px; }
.crm-col.leads { background: var(--bg); border: 1.5px dashed var(--ln-3); }
.crm-col.leads .crm-col-head { color: var(--tx-2); background: var(--pn-2); box-shadow: none; }
.crm-col.leads .crm-col-head h2 { color: var(--tx); }
.crm-col.leads .crm-col-head .n { background: var(--cnt-bg); color: var(--tx-2); }
.crm-col.leads .crm-col-head .ch-val { color: var(--tx-2); font-family: var(--font-body); white-space: normal; }
.lead-card { border: 1px dashed var(--ln-3); border-radius: 6px; padding: 8px 10px; background: var(--pn); }
.lead-card .lc-nome { font-size: 13px; font-weight: 500; }
.lead-card .lc-sub { font-size: 11px; color: var(--tx-2); margin-top: 1px; }
.lead-card .lc-feito { font-size: 11px; color: var(--ok); margin-top: 4px; }
.lead-card .lc-acts { display: flex; gap: 6px; margin-top: 8px; }
.lc-btn { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 3px; border: 1px solid var(--ln-2); color: var(--tx-2); background: var(--pn); cursor: pointer; transition: color var(--d1), border-color var(--d1); }
.lc-btn:hover { color: var(--tx); border-color: var(--tx-3); }
.lc-btn.ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-bg); color: var(--ok); }
.crm-mais { font-size: 11.5px; color: var(--tx-2); text-align: center; padding: 8px 6px; }
/* Agrupador por empresa — compacta 2+ cards da mesma empresa na coluna */
.crm-grupo { border: 1px solid var(--ln-2); border-radius: 6px; background: var(--pn); overflow: hidden; }
.crm-grupo-head { display: flex; align-items: center; gap: 7px; width: 100%; padding: 8px 10px; background: var(--pn); border: 0; cursor: pointer; text-align: left; font-family: inherit; color: inherit; transition: background var(--d1); }
.crm-grupo-head:hover { background: var(--hov-2); }
.crm-grupo-head .g-car { width: 12px; height: 12px; color: var(--tx-3); transition: transform var(--d3) var(--spring); flex-shrink: 0; }
.crm-grupo.aberto .g-car { transform: rotate(90deg); }
.crm-grupo-head .g-mid { flex: 1; min-width: 0; }
.crm-grupo-head .g-l1 { display: flex; align-items: center; gap: 6px; }
.crm-grupo-head .g-cli { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-grupo-head .g-n { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; background: var(--cnt-bg); border-radius: 3px; padding: 1px 6px; color: var(--tx-2); flex-shrink: 0; }
.crm-grupo-head .g-late { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }
.crm-grupo-head .g-val { font-family: var(--font-mono); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; margin-top: 2px; }
.crm-grupo-head .g-val small { font-family: var(--font-body); font-weight: 500; color: var(--tx-2); font-size: 10.5px; }
.crm-grupo-body { display: none; flex-direction: column; gap: 8px; padding: 8px; border-top: 1px dashed var(--ln-2); background: var(--pn-2); }
.crm-grupo.aberto .crm-grupo-body { display: flex; animation: sp-sobe var(--d3) var(--ease-out) both; }
.crm-rail { background: var(--pn); border: 1px solid var(--ln); border-radius: var(--radius); position: sticky; top: 70px; }
.rail-head { padding: 10px 12px; border-bottom: 1px solid var(--ln); display: flex; align-items: center; gap: 8px; background: var(--pn-2); border-radius: var(--radius) var(--radius) 0 0; }
.rail-head svg { width: 14px; height: 14px; color: var(--tx-3); }
.rail-head h2 { font-size: 13px; font-weight: 600; margin: 0; }
.rail-head .n { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--tx-2); }
.rail-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--ln); align-items: center; }
.rail-row:last-of-type { border-bottom: 0; }
.rail-num { font-family: var(--font-mono); font-size: 11px; color: var(--tx-2); }
.rail-row strong { font-size: 13px; font-weight: 500; display: block; }
.rail-row span { font-size: 11px; color: var(--tx-2); display: block; }
.rail-row span.red { color: var(--danger); font-weight: 600; }
.rail-go { font-size: 11px; font-weight: 600; border: 1px solid color-mix(in srgb, var(--hl) 40%, transparent); border-radius: 3px; padding: 3px 7px; color: var(--hl); background: transparent; white-space: nowrap; cursor: pointer; transition: background var(--d1); }
.rail-go:hover { background: var(--hov-2); }
.rail-foot { padding: 9px 12px; font-size: 11px; color: var(--tx-2); border-top: 1px solid var(--ln); }
.rail-vazio { padding: 16px 12px; font-size: 12px; color: var(--tx-2); text-align: center; }
/* Gaveta (ficha do cliente e as gavetas de Terceirização/Fornecedores/Compras): entra da direita com spring, sai em 280 ms */
.crm-drawer-back {
  position: fixed; inset: 0; background: var(--scrim); display: none; z-index: 80;
  opacity: 0; transition: opacity 180ms var(--ease-in), display 180ms allow-discrete;
}
.crm-drawer-back.show { display: block; opacity: 1; transition: opacity var(--d2) var(--ease-out), display var(--d2) allow-discrete; }
@starting-style { .crm-drawer-back.show { opacity: 0; } }
.crm-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 96vw; background: var(--pn); color: var(--tx);
  border-left: 1px solid var(--ln-2); z-index: 81; box-shadow: var(--drawer-sh); display: none; flex-direction: column;
  transform: translateX(100%); transition: transform 280ms var(--ease-in), display 280ms allow-discrete;
}
.crm-drawer.show { display: flex; transform: none; transition: transform 420ms var(--spring), display 420ms allow-discrete; }
@starting-style { .crm-drawer.show { transform: translateX(100%); } }
.crm-drawer-head { position: relative; padding: 14px 18px; border-bottom: 1px solid var(--ln); display: flex; align-items: center; gap: 10px; }
/* linha de "calibração" que corre sob o título quando a gaveta abre (prancha) */
.crm-drawer.show .crm-drawer-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--sig);
  transform-origin: left; animation: sp-cal 640ms var(--ease-emph) 150ms both;
}
.crm-drawer-head h2 { margin: 0; font-size: 17px; font-weight: 600; color: var(--tx-hi); }
.crm-drawer-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.crm-fatos { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 14px; font-size: 12.5px; color: var(--tx-2); }
.crm-fatos b { display: block; font-size: 12px; font-weight: 400; color: var(--tx-2); margin-bottom: 2px; }
.crm-fatos span { color: var(--tx); font-weight: 500; }
.crm-fatos span.red { color: var(--danger); font-weight: 600; }
/* Presets de próxima ação no modal */
.acao-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.acao-preset { font-size: 12px; font-weight: 500; padding: 4px 9px; border-radius: 3px; border: 1px solid var(--ln-2); background: var(--pn-2); color: var(--tx-2); cursor: pointer; transition: color var(--d1), border-color var(--d1), background var(--d1); }
.acao-preset:hover, .acao-preset.on { border-color: color-mix(in srgb, var(--btn) 60%, transparent); color: var(--tx); background: color-mix(in srgb, var(--btn) 10%, var(--pn)); }

/* ---- Responsivo ---- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-wrap { grid-template-columns: 1fr; }
  .crm-rail { position: static; }
  .grid-2, .grid-2b, .grid-3 { grid-template-columns: 1fr; }
  .layout, .hero { grid-template-columns: minmax(0, 1fr); } /* D5c: minmax(0,…) — a tabela larga rola no cartão, não a página */
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 860px) {
  .app, [data-menu="col"] .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .field input { width: 140px; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 48px; }
}

/* ---- Beta local (porta 8481) ---- */
.beta-tag {
  display: inline-block; margin-left: 4px; padding: 0 5px;
  border-radius: 3px; font-size: 10px; font-weight: 600; letter-spacing: .06em; font-family: var(--font-mono);
  color: var(--warn); border: 1px solid var(--warn-ln);
  background: var(--warn-bg);
}

/* ============================================================
   23/09 — Clientes, tabela de preços, sigilo, lotes, receber
   ============================================================ */
.sem-acesso { max-width: 460px; margin: 80px auto; text-align: center; color: var(--tx-2); }
.sem-acesso h2 { color: var(--tx-hi); margin: 0 0 8px; font-size: 18px; }
.sem-acesso .btn { margin-top: 14px; }
a.cli-link { color: inherit; text-decoration: underline; text-decoration-color: var(--ln-3); text-underline-offset: 3px; transition: text-decoration-color var(--d1); }
a.cli-link:hover { text-decoration-color: currentColor; }
.selo { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500;
  padding: 1px 7px; border-radius: 3px; white-space: nowrap; color: var(--tx-2);
  background: color-mix(in srgb, currentColor 9%, transparent); border: 1px solid color-mix(in srgb, currentColor 24%, transparent); }
.selo.inc { color: var(--warn); }
.selo.semtab { color: var(--danger); }
.selo.ok { color: var(--ok); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--row-hov); }
.ct-row { display: grid; grid-template-columns: 42px 1.3fr 1fr 1fr 1fr 1.4fr 24px; gap: 6px; align-items: center; margin-bottom: 6px; }
.ct-row .control { padding: 6px 8px; font-size: 12.5px; }
.ct-princ { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--warn); cursor: pointer; }
.ct-princ input { accent-color: var(--btn); }
.rm { border: 0; background: none; color: var(--tx-2); cursor: pointer; font-size: 15px; line-height: 1; padding: 4px 0; transition: color var(--d1); }
.rm:hover { color: var(--danger); }
.cart-row { display: grid; grid-template-columns: 1fr 90px 24px; gap: 8px; align-items: center; margin-bottom: 6px; }
.falta-lista { margin: 8px 0 0; padding-left: 18px; font-size: 12px; color: var(--warn); }
@media (max-width: 1100px) { .ct-row { grid-template-columns: 1fr; } }

/* Tabela de preços — editor (Task 10) */
.tp-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.tp-toolbar .tp-cont { margin-left: auto; font-size: 12px; color: var(--tx-2); font-family: var(--font-mono); }
.tp-tab td { vertical-align: top; }
.tp-tab .cel { width: 100%; }
.tp-tab .cel.right { text-align: right; }
.tp-tab .cel.center { text-align: center; }
.tp-tab tr.tp-erro td { background: var(--danger-bg); }
.tp-vazio { text-align: center; color: var(--tx-2); padding: 22px !important; }
.mini-btn { border: 1px solid var(--ln-2); background: var(--pn); color: var(--tx-2); border-radius: 4px;
  padding: 3px 8px; cursor: pointer; font-size: 12px; font-weight: 500; white-space: nowrap;
  transition: color var(--d1), border-color var(--d1), transform var(--d2) var(--spring); }
.mini-btn:hover { color: var(--tx); border-color: var(--tx-3); }
.mini-btn:active { transform: scale(.96); }
.mini-btn.perigo:hover { color: var(--danger); border-color: var(--danger-ln); }

/* Página do cliente (Task 11) */
.cli-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.cli-top h1 { margin: 2px 0 2px; font-size: 22px; letter-spacing: -.012em; color: var(--tx-hi); }
.cli-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.cli-head { padding: 16px 18px; margin-bottom: 12px; }
.cli-head .crm-fatos { margin: 14px 0 0; }
details.ent-linha { border-top: 1px solid var(--ln); padding: 8px 0; font-size: 12.5px; }
details.ent-linha:first-child { border-top: 0; }
details.ent-linha summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ent-os { padding: 8px 0 2px 26px; line-height: 1.9; }
.vazio-aba { text-align: center; color: var(--tx-2); padding: 28px; font-size: 13px; }

/* Painel lateral "Tabela do cliente" (Task 12) */
.tp-foot { padding: 12px 18px; border-top: 1px solid var(--ln); display: flex; gap: 8px; align-items: center; background: var(--foot); }
.tp-foot #tp-resumo { margin-right: auto; font-size: 12px; font-family: var(--font-mono); }
.tp-sec { font-size: 12px; font-weight: 500; color: var(--tx-2); margin: 14px 0 6px; }
.tp-sec:first-child { margin-top: 0; }
.tp-linha { display: grid; grid-template-columns: auto 1fr 60px auto; gap: 10px; align-items: center; padding: 8px 10px;
  border: 1px solid var(--ln-2); border-radius: 5px; margin-bottom: 6px; cursor: pointer; background: var(--pn-2);
  transition: border-color var(--d1), background var(--d1); }
.tp-linha:hover { border-color: var(--tx-3); }
.tp-linha.on { border-color: var(--btn); background: color-mix(in srgb, var(--btn) 7%, var(--pn-2)); }
.tp-linha input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--btn); }
.tp-l1 { font-size: 13px; font-weight: 500; }
.tp-l2 { font-size: 12px; color: var(--tx-2); margin-top: 2px; }
.tp-qtd { width: 60px; border: 1px solid var(--ln-in); background: var(--pn); color: var(--tx); border-radius: 4px; padding: 4px 6px; text-align: center; font-size: 12.5px; }
.tp-val { font-size: 12px; white-space: nowrap; }

/* WorkManager · Orçamentos — avaliação pela tabela (Task 13) */
.linha-chip { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; padding: 1px 8px; margin: 0 4px 4px 0;
  border: 1px solid color-mix(in srgb, var(--info) 28%, transparent); background: color-mix(in srgb, var(--info) 8%, transparent); border-radius: 3px; color: var(--info); }
.aval-row.foco { background: var(--warn-bg); }
.btn-lib { border: 1px solid var(--btn); background: var(--btn); color: var(--on-btn); border-radius: 4px;
  padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background var(--d1), transform var(--d2) var(--spring); }
.btn-lib:hover { background: color-mix(in srgb, var(--btn) 85%, var(--btn-mix)); }
.btn-lib:active { transform: scale(.97); }
.btn-lib:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* Estoque Clientes — pastas de lote (Task 17) */
.lote-pastas { padding: 4px 12px 10px; }
.grupo.collapsed .lote-pastas, .grupo.collapsed [data-view] { display: none; }
.lote-pasta { border: 1px solid var(--ln-2); border-radius: 5px; margin-top: 8px; overflow: hidden; background: var(--pn); }
.lote-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; cursor: pointer; background: var(--pn-2); transition: background var(--d1); }
.lote-cab:hover { background: var(--hov-2); }
.lote-pasta.fechada .tbl-wrap { display: none; }
.lote-pasta .chev { transform: none; }
.lote-pasta.fechada .chev { transform: rotate(-90deg); }
.lote-wm { margin-left: auto; font-size: 12px; color: var(--hl); text-decoration: underline; text-underline-offset: 2px; }

/* Expedição — busca nos envios (Task 18) */
.filtro-chip { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; padding: 1px 4px 1px 8px;
  border: 1px solid color-mix(in srgb, var(--info) 35%, transparent); border-radius: 3px; background: color-mix(in srgb, var(--info) 8%, transparent); color: var(--info); }

/* Fiscal — duplicatas (parcelas) na emissão (Task 19) */
.dup-box { border: 1px dashed var(--ln-3); border-radius: 5px; padding: 8px 10px; margin: 8px 0; }
.dup-head { font-size: 12.5px; }
.dup-row { display: grid; grid-template-columns: 44px 160px 130px; gap: 8px; align-items: center; margin-top: 6px; }
.dup-row .control { padding: 4px 7px; font-size: 12.5px; }
.filtro-chip button { border: 0; background: none; cursor: pointer; color: inherit; font-size: 14px; line-height: 1; padding: 0 3px; }

/* Contas a Receber mensal — faixa de meses (Task 20) */
.mes-faixa { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.mes-chip { flex: 0 0 auto; min-width: 150px; text-align: left; border: 1px solid var(--ln); background: var(--pn); color: var(--tx);
  border-radius: 6px; padding: 9px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
  transition: border-color var(--d1), box-shadow var(--d1); }
.mes-chip:hover { border-color: var(--ln-3); }
.mes-chip.on { border-color: var(--btn); box-shadow: 0 0 0 3px var(--focus-ring); background: color-mix(in srgb, var(--btn) 6%, var(--pn)); }
.mes-chip.atras { border-color: var(--danger-ln); background: color-mix(in srgb, var(--danger) 5%, var(--pn)); }
.mes-rot { font-size: 12px; color: var(--tx-2); }
.mes-tot { font-size: 17px; font-weight: 500; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.mes-sub { font-size: 11px; color: var(--tx-2); font-family: var(--font-mono); }
.veio-de { font-size: 11.5px; color: var(--warn); margin-top: 3px; }
.conf-info { font-size: 11.5px; color: var(--tx-2); margin-top: 3px; }
.hist-link { font-size: 11.5px; color: var(--hl); cursor: pointer; font-weight: 500; }
.hist-link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Aprovação interna (25/09) — pills, faixa da diretoria, linhas aguardando */
.pill-aprov-aguardando { color: var(--danger); }
.pill-aprov-devolvido { color: var(--danger); font-weight: 600; border-style: dashed; }
.pill-aprov-confirmado { color: var(--ok); }
.faixa-dir { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--danger-ln);
  background: var(--danger-bg); color: var(--danger); border-radius: 6px; padding: 10px 14px; margin: 0 0 14px; font-size: 13px; }
.faixa-dir b { font-size: 15px; font-family: var(--font-mono); }
.faixa-dir a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.row-aprov td { background: color-mix(in srgb, var(--danger) 5%, transparent); }

/* Tela Aprovações (25/09) */
.aprov-card { margin-bottom: 12px; border-left: 2px solid var(--danger); }
.aprov-card.devolvido { border-left-color: var(--danger-ln); opacity: .92; }
.aprov-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 16px; margin-bottom: 12px; }
.aprov-meta b { display: block; font-size: 12px; color: var(--tx-2); font-weight: 400; }
.aprov-meta span { font-size: 13px; }
.aprov-lado { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.aprov-lado h3 { margin: 0 0 6px; font-size: 12.5px; font-weight: 500; color: var(--tx-2); }
.aprov-lado table { width: 100%; font-size: 12.5px; }
.aprov-dif { color: var(--danger); font-weight: 600; }
.aprov-acoes { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 16px; border-top: 1px solid var(--ln); }
.aprov-hist { font-size: 12px; color: var(--tx-2); margin-top: 10px; }
.aprov-hist div { padding: 3px 0; border-top: 1px dashed var(--ln-2); }
@media (max-width: 860px) { .aprov-meta { grid-template-columns: 1fr 1fr; } .aprov-lado { grid-template-columns: 1fr; } }

/* Baixa manual de parcelas (25/09) */
.baixa-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--ln); background: var(--pn-2); font-size: 12.5px; }
.baixa-bar .btn { margin-left: auto; }
td.ck, th.ck { width: 34px; text-align: center; }
td.ck input, th.ck input { width: 15px; height: 15px; accent-color: var(--btn); }
.baixa-info { font-size: 11.5px; color: var(--tx-2); margin-top: 3px; }

/* Novo pedido — 3 caminhos da origem (25/09) */
.origem-opcoes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.origem-op { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--ln-2); border-radius: 5px; padding: 10px 12px; cursor: pointer; background: var(--pn-2);
  transition: border-color var(--d1), background var(--d1); }
.origem-op:hover { border-color: var(--tx-3); }
.origem-op b { display: block; font-size: 13px; }
.origem-op span { font-size: 12px; color: var(--tx-2); }
.origem-op.on { border-color: var(--btn); background: color-mix(in srgb, var(--btn) 7%, var(--pn-2)); }
/* opção travada pelo projeto: tracejada e no texto 3 (legível, AA), sem opacidade */
.origem-op.trava { cursor: not-allowed; background: transparent; border-style: dashed; }
.origem-op.trava:hover { border-color: var(--ln-2); }
.origem-op.trava b, .origem-op.trava span { color: var(--tx-3); }
@media (max-width: 760px) { .origem-opcoes { grid-template-columns: 1fr; } }

/* Importação (25/09) */
.imp-contadores { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.imp-cont { border: 1px solid var(--ln); border-top: 2px solid var(--c, var(--ln-2)); background: var(--pn); color: var(--tx); border-radius: 6px;
  padding: 8px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 128px; text-align: left;
  transition: border-color var(--d1), box-shadow var(--d1); }
.imp-cont b { font-size: 20px; font-family: var(--font-mono); font-weight: 500; }
.imp-cont > span { font-size: 12px; color: var(--tx-2); }
.imp-cont.on { box-shadow: 0 0 0 3px var(--focus-ring); border-color: var(--btn); }
/* contador zerado: apagado pela cor (texto 3 passa AA nos dois temas), sem opacidade */
.imp-cont.zero { border-top-color: var(--ln-3); }
.imp-cont.zero b, .imp-cont.zero > span { color: var(--tx-3); }
.imp-barra { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.imp-chegadas .che { display: grid; grid-template-columns: minmax(220px, 1.4fr) 1fr 190px; gap: 12px; align-items: center;
  padding: 9px 14px; border-top: 1px solid var(--ln); font-size: 12.5px; color: inherit; text-decoration: none; transition: background var(--d1); }
.imp-chegadas .che:first-child { border-top: 0; }
.imp-chegadas .che:hover { background: var(--row-hov); }
.che-bar { height: 8px; border-radius: 0; background: repeating-linear-gradient(90deg, var(--seg-off) 0 4px, transparent 4px 6px); overflow: hidden; margin-top: 6px; }
.che-bar i { display: block; height: 100%; background: var(--ciano);
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 6px); mask-image: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 6px); }
.che.late .che-bar i { background: var(--danger); }
.che-quando { font-family: var(--font-mono); text-align: right; }
.che.late .che-quando { color: var(--danger); font-weight: 600; }
.imp-quadro { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.imp-bloco { border: 1px solid var(--ln); border-radius: 6px; background: var(--pn-2); padding: 10px; }
.imp-bloco > h2 { margin: -10px -10px 12px; padding: 11px 14px 10px; border-bottom: 1px solid var(--ln); font-size: 14px; font-weight: 600; color: var(--tx); }
.imp-grupo { margin-bottom: 12px; }
.imp-grupo h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font-size: 12px; font-weight: 500; color: var(--tx-2); min-height: 18px; }
.imp-grupo h3 i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); flex: none; }
.imp-grupo h3 .n { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--tx-2); }
/* cartão (prancha): contorno fino + barra do tom à esquerda, sem sombra parado */
.imp-card { display: block; background: var(--pn); border: 0; box-shadow: inset 0 0 0 1px var(--ln-2), inset 3px 0 0 var(--c, var(--ln-2));
  border-radius: 5px; padding: 9px 12px 9px 14px; margin-bottom: 8px; color: inherit; text-decoration: none; transition: box-shadow var(--d1); }
.imp-card:hover { box-shadow: inset 0 0 0 1px var(--ln-3), inset 3px 0 0 var(--c, var(--ln-2)); }
.imp-card .t1 { font-weight: 600; font-size: 13px; }
.imp-card .t2 { font-size: 12px; margin-top: 2px; }
.imp-card .t3 { font-size: 12px; color: var(--tx-2); margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--ln-2); }
.imp-alerta { display: block; margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--danger);
  background: var(--danger-bg); border-radius: 3px; padding: 3px 6px; }
.imp-vazio { font-size: 12px; color: var(--tx-2); padding: 9px 10px; margin-bottom: 8px; border: 1px dashed var(--ln-2); border-radius: 5px; text-align: center; }
/* selo de situação (prancha): o texto na cor do tom, fundo e contorno derivados dela (como o .pill) */
.imp-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; font-size: 12px; font-weight: 500; border-radius: 3px;
  padding: 1px 8px; color: var(--c, var(--tx-2)); white-space: nowrap;
  background: color-mix(in srgb, var(--c, var(--tx-2)) 11%, transparent); border: 1px solid color-mix(in srgb, var(--c, var(--tx-2)) 28%, transparent); }
.imp-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.imp-desc { white-space: pre-wrap; font-size: 13px; line-height: 1.55; margin: 0; }
.imp-tl .ev { padding: 8px 0; border-top: 1px solid var(--ln); font-size: 12.5px; }
.imp-tl .ev:first-child { border-top: 0; }
.imp-tl .ev .q { color: var(--tx-2); font-size: 12px; }
.imp-acoes .btn { width: 100%; justify-content: center; margin-bottom: 6px; }
.anexos-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.empty-page { text-align: center; padding: 60px 20px; color: var(--tx-2); }
@media (max-width: 1100px) { .imp-quadro { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .imp-chegadas .che { grid-template-columns: 1fr; } .che-quando { text-align: left; } }

/* Armazenamento do navegador cheio (25/09 — revisão final): faixa fixa, fica até "Entendi" */
.alert-box.ls-cheio { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 200;
  width: min(680px, calc(100vw - 32px)); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  background: var(--pn-3); border-color: var(--danger); box-shadow: var(--float); font-weight: 500;
  animation: sp-faixa var(--d3) var(--ease-emph) both; }
.alert-box.ls-cheio strong { margin: 0; color: var(--danger); }
.alert-box.ls-cheio span { flex: 1 1 320px; color: var(--tx); }
.alert-box.ls-cheio .mini-btn { margin-left: auto; }

/* ============================================================
   02/10 — Importação: precificação, amarrações, aviso ao vendedor, parâmetros
   ============================================================ */
.prec-card { margin-bottom: 12px; border-color: color-mix(in srgb, var(--ciano) 35%, transparent); box-shadow: inset 2px 0 0 var(--ciano); }
.prec-topo { display: grid; grid-template-columns: 1.2fr 1fr 0.8fr; gap: 14px; margin-bottom: 14px; }
.prec-campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.prec-rot { font-size: 12.5px; font-weight: 500; color: var(--tx-2); }
.prec-linha { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.prec-campo .anexos-list { margin-top: 0; }
.prec-cambio { display: grid; grid-template-columns: 1fr 150px; gap: 6px; }
.prec-nota { font-size: 12px; color: var(--tx-2); margin: 2px 0 0; line-height: 1.4; }
.prec-tab { min-width: 1080px; }
.prec-tab td { vertical-align: top; padding: 6px 6px; }
.prec-tab th { padding-left: 6px; padding-right: 6px; }
.prec-tab textarea.cel { resize: vertical; min-height: 34px; line-height: 1.35; font-size: 12.5px; }
.prec-tab .cel.right { text-align: right; }
.prec-tab select.cel { font-size: 12px; padding: 5px 4px; cursor: pointer; border-color: var(--ln-2); background: var(--pn-2); }
.prec-sec { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 8px; font-size: 13px; font-weight: 600; color: var(--tx); }
.prec-sec .muted { font-weight: 400; font-size: 12px; }
.prec-prev { font-size: 12.5px; }
.prec-prev td, .prec-prev th { padding: 7px 8px; }
.prec-prev tr.prec-erro td { background: var(--danger-bg); color: var(--danger); font-weight: 500; }
.prec-resumo { margin: 12px 0 0; padding: 10px 12px; border: 1px dashed var(--ln-3); border-radius: 6px; background: var(--pn-2); }
/* A2 (09/10): conta de chegada — do preço ao lucro líquido (só diretoria) */
.prec-chegada td:first-child { white-space: nowrap; }
.prec-chegada .sinal { display: inline-block; width: 1.3em; color: var(--tx-2); font-family: var(--font-mono); }
.prec-chegada tr.lucro td { font-weight: 600; border-top: 1px solid var(--ln-3); }
.prec-chegada tr.lucro .el-sub { font-weight: 500; }
.prec-erros { margin-top: 12px; line-height: 1.6; }
.prec-avisos { margin-top: 12px; border-color: var(--warn-ln); background: var(--warn-bg); color: var(--warn); }
.prec-avisos ul { margin: 4px 0 0; padding-left: 18px; line-height: 1.5; }
.prec-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--ln); background: var(--foot); border-radius: 0 0 var(--radius) var(--radius); }
.prec-foot #pr-vincular { margin-right: auto; color: var(--tx-2); }
.prec-foot .btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.amarra-row { display: grid; grid-template-columns: 82px 1fr; gap: 10px; align-items: center; padding: 8px 0;
  border-top: 1px solid var(--ln); font-size: 12.5px; }
.amarra-row:first-child { border-top: 0; padding-top: 0; }
.amarra-row > b { font-size: 12px; font-weight: 500; color: var(--tx-2); }
.amarra-row > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.amarra-val { font-family: var(--font-mono); font-size: 12px; font-weight: 600; margin-left: auto; }
.selo.novo { color: var(--ciano); }
.crm-card .kc-novo { margin-bottom: 6px; }
.aviso-novo { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.aviso-novo > div { flex: 1 1 320px; }
.param-ncm td { padding: 6px 8px; }
.param-ncm .control { padding: 5px 8px; font-size: 12.5px; }
.param-ncm .control.right { text-align: right; }
@media (max-width: 1100px) { .prec-topo { grid-template-columns: 1fr; } }

/* ===== Financeiro (Task 6) ===== */
/* a planilha do mês dentro do sistema: resumo, abas, gastos, Total, conciliação semanal e "A identificar" */
.fin-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.fin-kpis .kpi { padding: 11px 13px; }
.fin-kpis .kpi-value { font-size: 18px; letter-spacing: -.02em; }
.fin-kpis .kpi-value.neg { color: var(--danger); }
.fin-abas { flex-wrap: wrap; }
.fin-abas .tab b { font-family: var(--font-mono); font-size: 11px; margin-left: 4px; color: var(--danger); }
.fin-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fin-toolbar h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--tx-hi); }
.fin-acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* cores da planilha no valor do recebível: verde = a receber, cinza = pago */
td.val-receber { color: var(--ok); font-weight: 600; }
td.val-pago { color: var(--tx-3); }
.fin-aviso-ant { border-color: var(--warn-ln); background: var(--warn-bg); color: var(--warn); }
/* Gastos: sub-abas das 8 categorias */
.fin-subabas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.fin-subaba { border: 1px solid var(--ln-2); background: var(--pn); color: var(--tx); border-radius: 5px; padding: 6px 10px; cursor: pointer;
  display: flex; flex-direction: column; gap: 1px; text-align: left; min-width: 118px; transition: border-color var(--d1), box-shadow var(--d1); }
.fin-subaba span { font-size: 12px; font-weight: 500; }
.fin-subaba b { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; }
.fin-subaba i { font-style: normal; font-size: 11px; color: var(--tx-2); font-family: var(--font-mono); }
.fin-subaba:hover { border-color: var(--tx-3); }
.fin-subaba.on { border-color: var(--btn); box-shadow: 0 0 0 3px var(--focus-ring); background: color-mix(in srgb, var(--btn) 6%, var(--pn)); }
tr.fin-prevista td { background: var(--pn-2); color: var(--tx-3); }
tr.fin-prevista td .mini-btn { color: var(--tx); }
.fin-tab td.acoes { text-align: right; white-space: nowrap; }
.fin-tab td.acoes .mini-btn + .mini-btn { margin-left: 4px; }
/* Total: a linha A3..E3 como na planilha */
.fin-total { border-collapse: collapse; width: 100%; min-width: 640px; }
.fin-total th, .fin-total td { border: 1px solid var(--ln); padding: 8px 10px; text-align: right; white-space: nowrap; }
.fin-total th { text-transform: none; letter-spacing: 0; font-size: 12px; font-family: var(--font-body); color: var(--tx-2); }
.fin-total th small { display: block; font-family: var(--font-mono); font-size: 11px; }
.fin-total td { font-family: var(--font-mono); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.fin-total td.neg { color: var(--danger); }
.fin-linha { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 4px 0; border-top: 1px dashed var(--ln-2); }
.fin-linha:first-child { border-top: 0; }
.fin-linha b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.fin-linha.total { border-top: 1px solid var(--ln-2); font-weight: 600; margin-top: 4px; padding-top: 7px; }
.fin-linha .muted { font-size: 12px; }
.fin-blocos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.fin-bloco { border: 1px solid var(--ln); border-radius: 6px; padding: 10px 12px; background: var(--pn-2); font-size: 12.5px; }
.fin-bloco h3 { margin: 0 0 6px; font-size: 13px; }
.fin-bloco.zerou h3 { color: var(--ok); }
.fin-bloco.quebra h3 { color: var(--danger); }
.fin-bloco .origem { font-size: 11.5px; color: var(--tx-2); margin-top: 6px; }
/* Conciliar semana: os 4 passos */
.fin-passo { margin-bottom: 12px; }
.fin-passo-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--ln); flex-wrap: wrap; }
.fin-passo-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.fin-passo-head .st { margin-left: auto; font-size: 12px; color: var(--tx-2); font-family: var(--font-mono); }
.fin-passo-head .st.ok { color: var(--ok); font-weight: 600; }
.fin-num { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; background: var(--pn-3); color: var(--tx); box-shadow: inset 0 0 0 1px var(--ln-3); display: grid;
  place-items: center; font-family: var(--font-mono); font-weight: 600; font-size: 13px; }
.fin-num.ok { background: var(--ok); color: var(--on-ok); box-shadow: none; }
.fin-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.fin-slot { border: 1.5px dashed var(--ln-3); border-radius: 6px; padding: 10px 12px; background: var(--pn-2); font-size: 12.5px; transition: border-color var(--d1), background var(--d1); }
.fin-slot.arrastando { border-color: var(--hl); background: var(--hov-2); }
.fin-slot.ok { border-style: solid; border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.fin-slot strong { display: block; font-size: 13px; }
.fin-slot .sub { display: block; font-size: 12px; color: var(--tx-2); margin-top: 3px; }
.fin-slot .saldo { display: block; font-family: var(--font-mono); font-size: 13px; font-weight: 500; margin-top: 6px; }
.fin-slot .fin-saldo-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-top: 8px; }
.fin-slot .fin-saldo-form .control { padding: 5px 7px; font-size: 12px; }
.fin-slot .fin-slot-acoes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.fin-mov { border-top: 1px solid var(--ln); padding: 10px 16px; font-size: 12.5px; }
.fin-mov:first-child { border-top: 0; }
.fin-mov-top { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.fin-mov-top .nome { font-weight: 600; font-size: 13px; }
.fin-mov-top .valor { font-family: var(--font-mono); font-weight: 500; }
.fin-mov-top .valor.pos { color: var(--ok); }
.fin-mov-top .valor.neg { color: var(--danger); }
.fin-mov-top .meta { color: var(--tx-2); font-size: 12px; }
.fin-memo { font-family: var(--font-mono); font-size: 11px; color: var(--tx-2); margin-top: 2px; word-break: break-word; }
.fin-sugs { margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.fin-sug { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: start; padding: 6px 8px; border: 1px solid var(--ln-2);
  border-radius: 4px; background: var(--pn); cursor: pointer; transition: border-color var(--d1), background var(--d1); }
.fin-sug:hover { border-color: var(--tx-3); }
.fin-sug.on { border-color: var(--btn); background: color-mix(in srgb, var(--btn) 7%, var(--pn)); }
.fin-sug input { margin-top: 2px; accent-color: var(--btn); }
.fin-sug .eq { font-weight: 600; }
.fin-sug .tx { display: block; font-size: 12px; color: var(--tx-2); margin-top: 2px; }
.fin-mov-acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.fin-saida { display: grid; grid-template-columns: minmax(200px, 1.4fr) 110px minmax(170px, 1fr) minmax(130px, 0.9fr) minmax(130px, 0.9fr) auto;
  gap: 8px; align-items: center; border-top: 1px solid var(--ln); padding: 9px 16px; font-size: 12.5px; }
.fin-saida:first-child { border-top: 0; }
.fin-saida .control { padding: 5px 7px; font-size: 12px; }
.fin-saida .valor { font-family: var(--font-mono); font-weight: 500; color: var(--danger); text-align: right; }
.fin-saida .sug { font-size: 11.5px; color: var(--tx-2); margin-top: 2px; }
.fin-saida .sug.forte { color: var(--ok); }
.fin-feitos { border-top: 1px solid var(--ln); background: var(--pn-2); }
.fin-feitos summary { cursor: pointer; padding: 8px 16px; font-size: 12.5px; color: var(--tx-2); font-weight: 500; }
.fin-feito { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 6px 16px; border-top: 1px dashed var(--ln-2); font-size: 12px; }
.fin-feito .valor { font-family: var(--font-mono); font-weight: 500; }
.fin-feito .mini-btn { margin-left: auto; }
.fin-fc-campos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.fin-dif { border-radius: 6px; padding: 14px 16px; margin-top: 12px; text-align: center; font-size: 14px; font-weight: 600; border: 1px solid; }
.fin-dif .num { display: block; font-family: var(--font-mono); font-size: 22px; font-weight: 500; margin-top: 4px; }
.fin-dif.zero { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); }
.fin-dif.quebra { background: var(--danger-bg); border-color: var(--danger-ln); color: var(--danger); }
.fin-pistas { margin: 10px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.6; }
.fin-imp details { margin-top: 6px; }
.fin-imp summary { cursor: pointer; font-weight: 500; }
.fin-imp ul { margin: 4px 0 0 18px; padding: 0; max-height: 240px; overflow-y: auto; }
.fin-outra-lista { max-height: 320px; overflow-y: auto; border: 1px solid var(--ln-2); border-radius: 4px; margin-top: 8px; }
.fin-outra-lista td, .fin-outra-lista th { padding: 6px 8px; font-size: 12px; }
.fin-outra-pe { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; font-family: var(--font-mono); }
.fin-tipo-op { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--ln-2); border-radius: 5px; padding: 8px 10px;
  margin-bottom: 6px; cursor: pointer; font-size: 12.5px; transition: border-color var(--d1), background var(--d1); }
.fin-tipo-op:hover { border-color: var(--tx-3); }
.fin-tipo-op.on { border-color: var(--btn); background: color-mix(in srgb, var(--btn) 6%, var(--pn)); }
.fin-tipo-op span { display: block; color: var(--tx-2); font-size: 12px; }
@media (max-width: 1100px) {
  .fin-saida { grid-template-columns: 1fr 110px; }
  .fin-fc-campos { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .fin-slots { grid-template-columns: 1fr; }
  .fin-saida, .fin-fc-campos { grid-template-columns: 1fr; }
}

/* ===== Terceirização (Task 12) ===== */
/* "Em terceiro": equipamento do cliente no fornecedor — ciano (em serviço fora) com borda tracejada (fora da Press) */
.pill-eq-terceiro { color: var(--ciano); border-style: dashed; border-color: color-mix(in srgb, currentColor 55%, transparent); }

/* ===== Dashboard financeiro (Task 7) ===== */
/* aba "Financeiro" do dashboards.html (só diretoria): KPIs, 3 camadas, projeção de 90 dias, resultado por mês, ralos,
   atrasados e concentração. As cores de série são os tokens --df-* dos dois temas (no topo deste arquivo). */
.df-wrap { position: relative; }
a.df-link { display: block; color: inherit; text-decoration: none; }
a.kpi.df-link:hover { border-color: color-mix(in srgb, var(--hl) 55%, transparent); }
a.df-txt { text-decoration: underline; text-underline-offset: 2px; }
a.df-txt:hover { color: var(--hl); }
.df-kpis { margin-bottom: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.df-kpis .kpi-value { font-size: 20px; }
@media (max-width: 1100px) { .df-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.df-kpis .kpi-meta { font-size: 12px; }
.df-alerta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; border: 1px solid; border-radius: 6px;
  padding: 10px 12px; font-size: 12.5px; margin-bottom: 12px; }
.df-alerta b { font-weight: 600; }
.df-alerta.ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-bg); color: var(--ok); }
.df-alerta.amarelo { border-color: var(--warn-ln); background: var(--warn-bg); color: var(--warn); }
.df-alerta.vermelho { border-color: var(--danger-ln); background: var(--danger-bg); color: var(--danger); }
.df-alerta a { text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; font-weight: 500; }
.df-nota { font-size: 12px; color: var(--tx-2); margin: 8px 0 0; line-height: 1.5; }
.df-nota.aviso { color: var(--warn); }
.df-svg { display: block; width: 100%; height: auto; overflow: visible; }
.df-svg text { font-family: var(--font-mono); font-size: 11px; fill: var(--tx-2); }
.df-svg .df-grade { stroke: var(--df-grade); stroke-width: 1; }
.df-svg .df-eixo { stroke: var(--ln-3); stroke-width: 1; }
.df-svg .df-val { fill: var(--tx); font-weight: 600; }
.df-svg .df-pos { fill: var(--ok); font-weight: 600; }
.df-svg .df-neg { fill: var(--danger); font-weight: 600; }
.df-svg a { cursor: pointer; }
.df-svg a:hover text { text-decoration: underline; }
.df-svg [data-tip]:hover { filter: brightness(1.08); }
.df-hach { stroke: var(--df-receita); stroke-width: 1.4; }
.df-legenda { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--tx-2); margin-bottom: 8px; }
.df-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.df-sw { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; display: inline-block; }
.df-sw.linha { height: 2px; width: 14px; border-radius: 2px; }
.df-sw.trac { height: 0; width: 14px; border-top: 1px dashed var(--tx-2); border-radius: 0; }
.df-tip { position: absolute; z-index: 30; pointer-events: none; background: var(--pn-3); color: var(--tx); border: 0; border-radius: 4px;
  box-shadow: var(--float), inset 0 0 0 1px var(--ln-2); padding: 8px 11px 9px; font-size: 12px; line-height: 1.45; max-width: 260px; display: none; }
.df-tip.on { display: block; animation: sp-pop var(--d2) var(--ease-out) both; }
.df-tip b { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--tx-hi); }
.df-tip .t { font-weight: 600; margin-bottom: 2px; }
.df-camada { display: grid; grid-template-columns: 12px 1fr auto; gap: 4px 10px; align-items: baseline; padding: 7px 0; border-top: 1px dashed var(--ln-2);
  font-size: 12.5px; }
.df-camadas > .df-camada:first-child { border-top: 0; }
.df-camada .sub { grid-column: 2 / 4; font-size: 12px; color: var(--tx-2); margin-top: -2px; }
.df-camada b { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.df-camada b.neg, .df-neg-txt { color: var(--danger); }
.df-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.df-stat { border: 1px solid var(--ln); border-radius: 6px; padding: 9px 12px; background: var(--pn-2); }
.df-stat .r { font-size: 12px; color: var(--tx-2); font-weight: 400; }
.df-stat .v { font-family: var(--font-mono); font-size: 16px; font-weight: 500; margin-top: 4px; font-variant-numeric: tabular-nums; }
.df-stat .v.neg { color: var(--danger); }
.df-stat .m { font-size: 12px; color: var(--tx-2); margin-top: 2px; }
.df-big { font-family: var(--font-mono); font-size: 26px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--tx-hi); }
.df-bloco { padding: 12px 0; border-top: 1px solid var(--ln); }
.df-bloco:first-child { border-top: 0; padding-top: 0; }
.df-bloco h3 { margin: 0 0 6px; font-size: 12.5px; color: var(--tx-2); font-weight: 500; }
.df-barra { height: 10px; background: repeating-linear-gradient(90deg, var(--seg-off) 0 4px, transparent 4px 6px); border: 0; border-radius: 0; overflow: hidden; margin: 8px 0 4px; }
.df-barra > i { display: block; height: 100%; border-radius: 0; background: var(--sig);
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 6px); mask-image: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 6px);
  animation: sp-encher 680ms var(--ease-emph) both; }
.df-linha-bar { display: grid; grid-template-columns: minmax(130px, 220px) 1fr 134px; gap: 10px; align-items: center; padding: 5px 4px; font-size: 12.5px;
  color: inherit; text-decoration: none; border-radius: 4px; transition: background var(--d1); }
a.df-linha-bar:hover { background: var(--row-hov); }
.df-linha-bar .nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-linha-bar .nome small { display: block; color: var(--tx-2); font-size: 11.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.df-linha-bar .trilho { height: 10px; background: repeating-linear-gradient(90deg, var(--seg-off) 0 4px, transparent 4px 6px); border: 0; border-radius: 0; overflow: hidden; }
.df-linha-bar .trilho > i { display: block; height: 100%; border-radius: 0;
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 6px); mask-image: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 6px);
  animation: sp-encher 560ms var(--ease-emph) both; }
.df-linha-bar .num { font-family: var(--font-mono); font-size: 12px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.df-linha-bar .num small { color: var(--tx-2); font-size: 11px; margin-left: 3px; }
.df-tab { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 12.5px; }
.df-tab th, .df-tab td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--ln); white-space: nowrap; }
.df-tab th { font-size: 12px; font-weight: 500; color: var(--tx-2); font-family: var(--font-body); text-transform: none; letter-spacing: 0; }
.df-tab th:first-child, .df-tab td:first-child { text-align: left; }
.df-tab td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.df-tab td:first-child { font-family: var(--font-body); }
.df-tab tr.tot td { font-weight: 600; background: var(--pn-2); }
.df-tab tr.mut td { color: var(--tx-2); }
.df-tab td.neg { color: var(--danger); }
.df-tab td.zero { color: var(--tx-3); }
.df-tab a { color: inherit; text-decoration: none; }
.df-tab a:hover { text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 900px) {
  .df-linha-bar { grid-template-columns: minmax(90px, 1fr) 90px; }
  .df-linha-bar .trilho { grid-column: 1 / 3; grid-row: 2; }
}

/* ===== Terceirização (Task 13) ===== */
/* gaveta com rodapé fixo (Terceirização e Fornecedores): "Fechar" à esquerda, ações à direita */
.ter-dw-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--ln);
  background: var(--foot); flex-wrap: wrap; }
.ter-dw-foot .dir { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ter-dw-foot .nota-foot { font-size: 12.5px; color: var(--tx-2); }
.ter-dw-foot .btn-primary { min-width: 150px; }
/* campo inválido: borda vermelha + linha de erro com ícone (entra de cima, sem tremer) */
.control.erro, .control[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--err-ring); }
.campo-erro { display: none; align-items: center; gap: 5px; font-size: 12px; color: var(--danger); font-weight: 500; }
.campo-erro.on { display: flex; animation: sp-erro var(--d2) var(--ease-out) both; }
.campo-erro svg { width: 13px; height: 13px; flex: none; }
/* aviso (toast) de duas linhas, ~5 s, com "Fechar" */
.toast.ter-toast { display: flex; flex-direction: column; gap: 2px; max-width: 400px; padding-right: 76px; }
.toast.ter-toast.show { pointer-events: auto; }
.ter-t-tit { font-size: 13px; font-weight: 500; }
.ter-t-txt { font-size: 12.5px; color: var(--tx-2); line-height: 1.4; }
.ter-t-fechar { position: absolute; top: 9px; right: 10px; border: 0; background: transparent; color: var(--hl);
  font-size: 13px; font-weight: 500; cursor: pointer; padding: 2px 4px; }
.ter-t-fechar:hover { text-decoration: underline; text-underline-offset: 3px; }
/* "Quem faz: Press | Terceirização" (Entrada da NF) */
.quem-faz { display: inline-flex; gap: 2px; border: 1px solid var(--ln-2); background: var(--bg); border-radius: 5px; padding: 2px; }
.quem-faz button { border: 0; background: transparent; border-radius: 3px; padding: 4px 10px; font-size: 12.5px; font-weight: 500; color: var(--tx-2); cursor: pointer; transition: color var(--d1), background var(--d1); }
.quem-faz button.on { background: var(--pn-3); color: var(--tx-hi); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--btn) 60%, transparent); }
.quem-faz button.on[data-qf="ter"] { color: var(--ciano); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ciano) 60%, transparent); }

/* ===== Compras (Task 15) ===== */
/* menu: Compras recuado debaixo de Estoque Press; selo calmo (cinza) — o que espera o perfil sem travar a esteira */
.nav a.nav-sub { padding-left: 28px; font-size: 13px; }
.nav a.nav-sub svg { width: 15px; height: 15px; }
.nav-badge.calmo { background: var(--cnt-bg); box-shadow: inset 0 0 0 1px var(--ln-2); color: var(--tx-2); }
/* Estoque Press: botão Compras com "N abertas", aviso do mínimo, selo do tipo e "Pedir compra" na linha */
.ep-abertas { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--tx-2); border: 1px solid var(--ln-2);
  border-radius: 3px; padding: 0 6px; background: var(--cnt-bg); }
.alert-box.ep-aviso strong { display: inline; font-size: 12.5px; margin: 0; }
.selo.ep-insumo { color: var(--info); }
a.baixar.ep-pedir, button.baixar.ep-pedir { color: var(--hl); border-color: color-mix(in srgb, var(--hl) 40%, transparent); display: inline-block; }
button.baixar.ep-pedir:disabled { color: var(--tx-3); border-color: var(--ln-2); cursor: not-allowed; background: none; }
/* Financeiro (Conciliar semana / A identificar): o débito que pode ser uma linha já lançada — "Vincular" */
.fin-vinc { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; border: 1px dashed color-mix(in srgb, var(--info) 40%, transparent);
  background: color-mix(in srgb, var(--info) 5%, var(--pn)); border-radius: 5px; padding: 7px 10px; font-size: 12px; }
.fin-vinc .rot { font-size: 12px; font-weight: 500; color: var(--tx-2); }
.fin-vinc-l { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.fin-vinc-l .btn { padding: 4px 10px; font-size: 12px; }
.fin-vinc.conferir { border-color: var(--warn-ln); background: var(--warn-bg); }

/* ============================================================
   Motion base (Task 8 — prancha Bancada). Regras: motion responde a uma ação; micro 120 ms, padrão 180,
   ênfase 240, superfícies 320; saída ~70% da entrada; spring só no que a pessoa "toca" e nos números.
   ============================================================ */
/* Skeleton: bloco com o tamanho do conteúdo final (nunca spinner de tela cheia) */
.skeleton {
  display: block; border-radius: 4px; color: transparent !important; user-select: none;
  background: linear-gradient(90deg, var(--seg-off) 25%, var(--hov-2) 50%, var(--seg-off) 75%);
  background-size: 200% 100%; animation: sp-shimmer 1.4s linear infinite;
}

@keyframes sp-spin { to { transform: rotate(360deg); } }
@keyframes sp-pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
@keyframes sp-check { from { opacity: 0; transform: rotate(45deg) scale(.5); } to { opacity: 1; transform: rotate(45deg) scale(1); } }
@keyframes sp-pulso { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(3); opacity: 0; } }
@keyframes sp-encher { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes sp-toast { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes sp-menu { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes sp-fadeo { to { opacity: 0; } }
@keyframes sp-tipd { from { opacity: 0; visibility: visible; transform: translateY(-4px); } to { opacity: 1; visibility: visible; transform: none; } }
@keyframes sp-cal { 0% { transform: scaleX(0); opacity: 1; } 62% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes sp-erro { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes sp-sobe { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sp-faixa { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes sp-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---- Troca de página (View Transitions entre documentos, Chrome/Edge): o menu e a topbar ficam parados,
   o indicador do menu desliza até o novo item e o conteúdo entra subindo 5 px (300 ms) ---- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.sidebar { view-transition-name: sp-menu; }
.topbar { view-transition-name: sp-topo; }
.nav-ind { view-transition-name: sp-ind; }
/* tela de detalhe (sem item ativo no menu): o indicador fica sem nome — nada "fantasma" desliza para o topo */
.nav:not(.tem-ind) .nav-ind { view-transition-name: none; }
::view-transition-old(sp-menu), ::view-transition-old(sp-topo) { display: none; }
::view-transition-new(sp-menu), ::view-transition-new(sp-topo) { animation: none; mix-blend-mode: normal; }
::view-transition-group(sp-menu), ::view-transition-group(sp-topo) { animation: none; }
::view-transition-group(sp-ind) { animation-duration: 380ms; animation-timing-function: var(--spring); }
::view-transition-old(root) { animation: sp-vt-sai 120ms var(--ease-in) both; }
::view-transition-new(root) { animation: sp-vt-entra 300ms var(--ease-out) both; }
@keyframes sp-vt-sai { to { opacity: 0; } }
@keyframes sp-vt-entra { from { opacity: 0; transform: translateY(5px); } }

/* ---- Troca de tema: revelação circular saindo do botão lua/sol (a página inteira vira uma imagem só) ---- */
html.tema-vt .sidebar, html.tema-vt .topbar, html.tema-vt .nav-ind { view-transition-name: none; }
html.tema-vt::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
html.tema-vt::view-transition-new(root) { animation: sp-revela 520ms var(--ease-emph) both; mix-blend-mode: normal; }
@keyframes sp-revela {
  from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0)); }
  to { clip-path: circle(150% at var(--vt-x, 50%) var(--vt-y, 0)); }
}

/* ---- Movimento reduzido: tudo vira troca instantânea; a contagem dos números (MOV.contar) já escreve o valor final ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important;
  }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* B7 (Plano B): trava de sigilo da página ("Sem acesso") — o shell põe a classe sp-travada no <html>; só o aviso fica.
   Antes era um <style> criado por script (sumiria em silêncio com uma CSP de estilo mais estrita). */
html.sp-travada .main > :not(.sp-sem-acesso) { display: none !important; }
