/* Sistema do estilo · visual Kaisan (preto é a cor de ação e da marca).
   Tudo sai dos tokens do :root; nenhuma cor solta no meio do arquivo.
   Fonte só local (pilha do sistema): nada de Google Fonts nem CDN. */
:root {
  color-scheme: light;

  /* marca */
  --preto: #0a0a0a;
  --preto-hover: #2b2a27;
  --no-preto: #ffffff;
  --no-preto-2: #b4b1a9;       /* texto secundário sobre preto */

  /* neutros quentes */
  --texto: #1a1917;
  --texto-2: #5c5952;          /* secundário: 6,6:1 no branco */
  --texto-3: #6e6b64;          /* placeholder: 5,1:1 no branco */
  --fundo: #f6f5f2;            /* página */
  --superficie: #ffffff;       /* cartões e campos */
  --superficie-2: #faf9f7;     /* cabeçalho de tabela, insumo */
  --superficie-3: #f0eee9;     /* hover */
  --linha: #e2e0da;            /* borda de cartão */
  --linha-suave: #ecebe6;      /* divisórias */
  --borda-forte: #c4c0b7;      /* botão secundário, foto vazia */
  --borda-campo: #8b877e;      /* campos: 3,6:1 no branco */
  --foco: #0a0a0a;             /* anel de foco (vira branco no fundo preto) */
  --foco-claro: #ffffff;

  /* menu lateral */
  --lateral: #0a0a0a;
  --lateral-hover: #1b1a18;
  --lateral-ativo: #2a2926;
  --lateral-linha: #262522;
  --lateral-texto: #f5f4f1;
  --lateral-muted: #a6a39b;

  /* estados: uma cor só para cada (ok, atenção, erro) */
  --ok-texto: #126b3a;
  --ok-fundo: #e7f4ec;
  --ok-linha: #b4dcc3;
  --atencao-texto: #8a4a0c;
  --atencao-fundo: #fcf0de;
  --atencao-linha: #ecc896;
  --atencao-borda: #b06a16;
  --erro-texto: #b42318;
  --erro-fundo: #fdeceb;
  --erro-linha: #f1b8b1;
  --erro-escuro: #912018;
  /* E-19: o que veio da planilha (só leitura). Azul calmo, que não é estado: 7,4:1 no fundo dele */
  --planilha-texto: #1f4f8a;
  --planilha-fundo: #e9f1fb;
  --planilha-linha: #b9d0ee;

  /* transparências */
  --veu: rgb(10 10 10 / 46%);
  --veu-claro: rgb(255 255 255 / 92%);
  --branco-14: rgb(255 255 255 / 14%);
  --branco-60: rgb(255 255 255 / 60%);
  --anel-campo: rgb(10 10 10 / 9%);
  --fundo-vidro: rgb(246 245 242 / 90%);

  /* tipografia */
  --fonte: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --fonte-titulo: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --t-1: 11px;   /* rótulos em maiúsculas */
  --t-2: 12px;   /* auxiliar, selos */
  --t-3: 13px;   /* tabela, rótulos de campo, detalhes */
  --t-4: 14px;   /* corpo, campos, botões */
  --t-5: 16px;   /* título de seção e de cartão */
  --t-6: 18px;   /* marca */
  --t-7: 23px;   /* título da página no celular */
  --t-8: 28px;   /* título da página */

  /* espaço, raio, sombra, medidas */
  --e-1: 4px;
  --e-2: 8px;
  --e-3: 12px;
  --e-4: 16px;
  --e-5: 20px;
  --e-6: 24px;
  --e-8: 32px;
  --e-10: 40px;
  --r-1: 6px;
  --r-2: 8px;
  --r-3: 12px;
  --r-4: 14px;
  --r-pilula: 999px;
  --sombra-1: 0 1px 2px rgb(20 18 15 / 6%);
  --sombra-2: 0 1px 2px rgb(20 18 15 / 6%), 0 6px 18px rgb(20 18 15 / 8%);
  --sombra-3: 0 18px 44px rgb(20 18 15 / 24%), 0 2px 6px rgb(20 18 15 / 10%);
  --alto: 38px;          /* altura de botão e campo (44 px no celular) */
  --alto-p: 32px;        /* campo pequeno (quantidade do SKU) */
  --alvo-link: 28px;     /* altura mínima de botão-link */
  --lateral-largura: 232px;
  --pad-main: 40px;
  --pad-topo: 32px;

  /* ícones (máscara: a cor vem de currentColor) */
  --icone-grade: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5'%3E%3Crect x='1.75' y='1.75' width='5' height='5' rx='1.25'/%3E%3Crect x='9.25' y='1.75' width='5' height='5' rx='1.25'/%3E%3Crect x='1.75' y='9.25' width='5' height='5' rx='1.25'/%3E%3Crect x='9.25' y='9.25' width='5' height='5' rx='1.25'/%3E%3C/svg%3E");
  --icone-tabela: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5'%3E%3Crect x='1.75' y='2.25' width='12.5' height='11.5' rx='1.75'/%3E%3Cpath d='M1.75 6.25h12.5M1.75 10h12.5M6 6.25v7.5'/%3E%3C/svg%3E");
  --icone-seta: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4'/%3E%3C/svg%3E");
  --icone-imagem: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h7'/%3E%3Cpath d='m4 16 4.5-4.5a1.5 1.5 0 0 1 2 0L16 17'/%3E%3Cpath d='M18 3v6M15 6h6'/%3E%3C/svg%3E");
  --icone-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 8.5 3 3 6-7'/%3E%3C/svg%3E");
  --icone-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3.5 10.5 8 6 12.5'/%3E%3C/svg%3E");
  --icone-alerta: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' fill-rule='evenodd' d='M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm-.9 3.5h1.8l-.25 5h-1.3l-.25-5ZM8 10.6a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z'/%3E%3C/svg%3E");
  --icone-lista: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M6 4h8M6 8h8M6 12h8'/%3E%3Ccircle cx='2.75' cy='4' r='.6'/%3E%3Ccircle cx='2.75' cy='8' r='.6'/%3E%3Ccircle cx='2.75' cy='12' r='.6'/%3E%3C/svg%3E");

  font-family: var(--fonte);
  color: var(--texto);
  background: var(--fundo);
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { scroll-padding-top: 150px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; display: flex; min-height: 100vh;
  font-family: var(--fonte); font-size: var(--t-4); line-height: 1.5; color: var(--texto);
  /* a coluna preta acompanha a página inteira, mesmo em página longa */
  background: linear-gradient(to right, var(--lateral) var(--lateral-largura), var(--fundo) 0);
}
::selection { background: var(--preto); color: var(--no-preto); }
button, input, select, textarea { font: inherit; }
a { color: var(--texto); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; }

h1 {
  font-family: var(--fonte-titulo); font-size: var(--t-8); line-height: 1.15; font-weight: 650;
  letter-spacing: -0.02em; margin: 6px 0 8px;
}
h2 { font-family: var(--fonte-titulo); font-size: var(--t-5); line-height: 1.3; font-weight: 650; letter-spacing: -0.005em; margin: 0; }
p { font-size: var(--t-4); line-height: 1.55; }
.muted { color: var(--texto-2); font-size: var(--t-3); }
.eyebrow { font-size: var(--t-1); font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--texto-2); }
.eyebrow a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-height: 24px; }
input[type="date"]:invalid { color: var(--texto-3); }   /* data vazia não parece preenchida */
.eyebrow a:hover { color: var(--texto); text-decoration: underline; }

/* ------------------------------------------------------------------ botões */
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--alto); padding: 0 16px; border: 1px solid var(--preto); border-radius: var(--r-2);
  background: var(--preto); color: var(--no-preto); font-size: var(--t-4); font-weight: 600; line-height: 1.2;
  white-space: nowrap; cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s;
}
button:hover:not(:disabled) { background: var(--preto-hover); border-color: var(--preto-hover); }
button:active:not(:disabled) { transform: translateY(1px); }
/* desabilitado com cores próprias, sem opacidade (era .45: 3,24:1 no primário). Claro, tracejado, texto 6:1 (B-290 F0) */
button:disabled { opacity: 1; background: var(--superficie-3); border: 1px dashed var(--borda-campo); color: var(--texto-2); box-shadow: none; cursor: not-allowed; }
button.secondary { background: var(--superficie); color: var(--texto); border-color: var(--borda-forte); box-shadow: var(--sombra-1); }
button.secondary:hover:not(:disabled) { background: var(--superficie-3); border-color: var(--borda-campo); }
button.link {
  min-height: var(--alvo-link); padding: 2px 4px; border: 0; border-radius: var(--r-1); background: none; box-shadow: none;
  color: var(--texto); font-size: inherit; font-weight: 600; white-space: normal; text-align: left;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--borda-forte);
}
button.link:hover:not(:disabled) { background: none; text-decoration-color: currentColor; }
button.link:active:not(:disabled) { transform: none; }
/* link com cara de botão (navegar ou baixar arquivo: é link de verdade, não botão) */
a.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--alto); padding: 0 16px; border: 1px solid var(--preto); border-radius: var(--r-2);
  background: var(--preto); color: var(--no-preto); font-size: var(--t-4); font-weight: 600; line-height: 1.2;
  white-space: nowrap; text-decoration: none; transition: background-color .12s, border-color .12s;
}
a.botao:hover { background: var(--preto-hover); border-color: var(--preto-hover); }
a.botao.secondary { background: var(--superficie); color: var(--texto); border-color: var(--borda-forte); box-shadow: var(--sombra-1); }
a.botao.secondary:hover { background: var(--superficie-3); border-color: var(--borda-campo); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* gancho: botão que apaga/cancela no diálogo de confirmação (notas/visual-sugestoes-html.md) */
button.perigo { background: var(--erro-texto); border-color: var(--erro-texto); }
button.perigo:hover:not(:disabled) { background: var(--erro-escuro); border-color: var(--erro-escuro); }
/* o desabilitado das 3 variantes (especificidade maior que button.secondary, .perigo e .link; sem :where) */
button.secondary:disabled { background: var(--superficie-2); border-color: var(--borda-campo); color: var(--texto-2); box-shadow: none; }
button.perigo:disabled { background: var(--superficie-3); border-color: var(--borda-campo); color: var(--texto-2); }
button.link:disabled { background: none; border: 0; color: var(--texto-2); text-decoration-style: dotted; text-decoration-color: var(--borda-campo); }
/* ações que apagam ficam quietas até o mouse chegar */
.modelo-topo button.link, .lista-skus button.link, .insumo-topo > button.link { color: var(--texto-2); font-weight: 500; }
.modelo-topo button.link:hover:not(:disabled), .lista-skus button.link:hover:not(:disabled),
.insumo-topo > button.link:hover:not(:disabled) { color: var(--erro-texto); }

/* ------------------------------------------------------------------ campos */
input, select, textarea {
  width: 100%; min-width: 0; min-height: var(--alto); padding: 8px 11px;
  border: 1px solid var(--borda-campo); border-radius: var(--r-2);
  background-color: var(--superficie); color: var(--texto); font-size: var(--t-4); line-height: 20px;
  transition: border-color .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover { border-color: var(--texto-2); }
/* campo travado: não pode parecer editável (fundo claro, borda suave, texto 6,6:1, sem escurecer no hover: D-3 do E-19) */
input:disabled, select:disabled, textarea:disabled { background-color: var(--superficie-2); border-color: var(--linha); color: var(--texto-2); cursor: not-allowed; }
input:disabled:hover, select:disabled:hover, textarea:disabled:hover { border-color: var(--linha); }
input::placeholder, textarea::placeholder { color: var(--texto-3); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 1.5px solid var(--foco); outline-offset: 0; border-color: var(--foco); box-shadow: 0 0 0 5px var(--anel-campo);
}
textarea { resize: vertical; min-height: 68px; }
select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--texto-2) 50%), linear-gradient(135deg, var(--texto-2) 50%, transparent 50%);
  background-position: right 17px center, right 12px center; background-size: 5px 5px; background-repeat: no-repeat;
}
input[type="checkbox"] {
  width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: var(--preto); cursor: pointer;
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--erro-texto); box-shadow: inset 0 0 0 1px var(--erro-texto);
}
label { display: flex; flex-direction: column; gap: 6px; font-size: var(--t-3); font-weight: 600; color: var(--texto); }
/* gap 0: o texto "Só os novos (0)" tem um <span> no meio e não pode ganhar espaços */
label.inline { flex-direction: row; align-items: center; gap: 0; font-weight: 600; min-width: 0; cursor: pointer; white-space: nowrap; }
label.inline input { width: auto; margin-right: var(--e-2); }
kbd {
  display: inline-block; min-width: 20px; padding: 0 5px; font-family: inherit; font-size: var(--t-1); font-weight: 600;
  line-height: 17px; text-align: center; color: var(--texto); background: var(--superficie);
  border: 1px solid var(--borda-forte); border-bottom-width: 2px; border-radius: 5px;
}

/* ------------------------------------------------------------------ casca: menu lateral preto */
.sidebar {
  --foco: var(--foco-claro);
  position: sticky; top: 0; align-self: flex-start; height: 100vh;
  width: var(--lateral-largura); flex: 0 0 var(--lateral-largura);
  display: flex; flex-direction: column; padding: var(--e-6) 14px var(--e-5);
  background: var(--lateral); color: var(--lateral-texto);
}
.brand {
  display: flex; gap: var(--e-3); align-items: center; padding: 2px 8px; border-radius: var(--r-2);
  color: inherit; text-decoration: none; font-family: var(--fonte-titulo); font-size: var(--t-6); font-weight: 650;
  letter-spacing: -0.01em; line-height: 1.1;
}
.brand small {
  display: block; margin-top: 5px; font-family: var(--fonte); font-size: 10px; font-weight: 600;
  letter-spacing: .16em; color: var(--lateral-muted);
}
.mark {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--r-2);
  background: var(--no-preto); color: var(--preto); font-size: 19px; font-weight: 800; letter-spacing: -0.03em;
}
.sidebar nav { margin-top: var(--e-8); display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 12px; border-radius: var(--r-2);
  color: var(--lateral-muted); text-decoration: none; font-size: var(--t-4); font-weight: 500;
  transition: background-color .12s, color .12s;
}
.sidebar nav a::before {
  content: ""; width: 16px; height: 16px; flex: none; background: currentColor;
  -webkit-mask: var(--icone-grade) center / contain no-repeat; mask: var(--icone-grade) center / contain no-repeat;
}
.sidebar nav a[href^="/visao-geral"]::before { -webkit-mask-image: var(--icone-tabela); mask-image: var(--icone-tabela); }
/* E-19 (F8): o "Conferir" (ícone de lista, C-9) e o selo do que atrapalha coleção a lançar (P-4; zero não aparece) */
.sidebar nav a[href="/conferir"]::before { -webkit-mask-image: var(--icone-lista); mask-image: var(--icone-lista); }
.sidebar nav a .n {
  margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: var(--r-pilula); background: var(--no-preto); color: var(--preto);
  font-size: var(--t-2); font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.sidebar nav a:hover { background: var(--lateral-hover); color: var(--lateral-texto); }
.sidebar nav a[aria-current="page"] { background: var(--lateral-ativo); color: var(--lateral-texto); font-weight: 600; }
.sidebar .rodape {
  margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--lateral-linha);
  font-size: var(--t-2); line-height: 1.55; color: var(--lateral-muted);
}
.sidebar .rodape strong { color: var(--lateral-texto); font-weight: 600; }
main { flex: 1 1 auto; min-width: 0; max-width: 1400px; padding: var(--pad-topo) var(--pad-main) 64px; }

/* ------------------------------------------------------------------ cabeçalho, cartões */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--e-5); flex-wrap: wrap; margin-bottom: var(--e-6); }
.page-header p { margin: 0; color: var(--texto-2); max-width: 660px; }
.card { background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--r-3); padding: var(--e-5) var(--e-6); box-shadow: var(--sombra-1); }
.stack > * + * { margin-top: var(--e-4); }
.stack > p { margin-bottom: 0; }
.acoes-linha { display: flex; gap: var(--e-2); flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------ avisos, toasts, diálogos */
.aviso {
  padding: 12px 14px; border: 1px solid var(--linha); border-left: 3px solid var(--borda-campo); border-radius: var(--r-2);  /* faixa cinza; erro e atenção pintam a deles (era preta: B5) */
  background: var(--superficie); color: var(--texto); font-size: var(--t-3); line-height: 1.5;
}
.aviso.erro { background: var(--erro-fundo); border-color: var(--erro-linha); border-left-color: var(--erro-texto); color: var(--erro-texto); }
.aviso.atencao { background: var(--atencao-fundo); border-color: var(--atencao-linha); border-left-color: var(--atencao-borda); color: var(--atencao-texto); }
.aviso button.link { color: inherit; }
/* B-290: a faixa de alertas no topo do main (comum.js, F5): fina e clara, só avisa */
.faixa-alertas { display: grid; gap: var(--e-2); margin: 0 0 var(--e-4); }
.faixa-alerta {
  margin: 0; padding: 7px 12px; border: 1px solid var(--atencao-linha); border-left: 3px solid var(--atencao-borda); border-radius: var(--r-2);
  background: var(--atencao-fundo); color: var(--atencao-texto); font-size: var(--t-3); line-height: 1.5; overflow-wrap: anywhere;
}
.faixa-alerta b { font-weight: 650; }
.faixa-alerta a { color: inherit; font-weight: 600; }
.faixa-alerta.erro { border-color: var(--erro-linha); border-left-color: var(--erro-texto); background: var(--erro-fundo); color: var(--erro-texto); }
.faixa-alerta.ok { border-color: var(--ok-linha); border-left-color: var(--ok-texto); background: var(--ok-fundo); color: var(--ok-texto); }
.faixa-alerta.info { border-color: var(--linha); border-left-color: var(--borda-campo); background: var(--superficie); color: var(--texto); }

/* o aviso é claro (era um bloco preto: regra de 16/10, decidido pela recomendação M6): branco com a faixa verde; erro e
   atenção nos fundos claros deles, como os .aviso */
.toast {
  --foco: var(--preto);
  position: fixed; right: var(--e-6); bottom: var(--e-6); z-index: 30;
  display: flex; gap: var(--e-3); align-items: center; max-width: min(460px, calc(100vw - 32px));
  padding: 12px 12px 12px 14px; border-radius: var(--r-3);
  background: var(--superficie); color: var(--texto); font-size: var(--t-4); line-height: 1.45;
  border: 1px solid var(--linha); border-left: 4px solid var(--ok-texto);
  box-shadow: var(--sombra-3); animation: entrar .18s ease-out;
}
.toast::before {
  content: ""; width: 18px; height: 18px; flex: none; align-self: flex-start; margin-top: 1px; background: var(--ok-texto);
  -webkit-mask: var(--icone-ok) center / contain no-repeat; mask: var(--icone-ok) center / contain no-repeat;
}
.toast.erro { background: var(--erro-fundo); color: var(--erro-texto); border-color: var(--erro-linha); border-left-color: var(--erro-texto); }
.toast.erro::before, .toast.atencao::before { -webkit-mask-image: var(--icone-alerta); mask-image: var(--icone-alerta); background: currentColor; }
/* a atenção usa a região do erro (#toast-erro, classes "toast erro atencao"): o seletor mais forte não depende da ordem
   das regras (A-3 da revisão do cartão) */
.toast.erro.atencao, .toast.atencao { background: var(--atencao-fundo); color: var(--atencao-texto); border-color: var(--atencao-linha); border-left-color: var(--atencao-borda); }
/* com o botão, a linha fica mais alta e o texto vai para o meio: o ícone vai junto (A-1) */
.toast:has(.toast-acao)::before { align-self: center; margin-top: 0; }
.toast .toast-acao {
  flex: none; margin-left: auto; padding: 4px 10px; color: inherit; font-weight: 650;
  text-decoration-color: var(--borda-forte);
}
.toast.erro .toast-acao, .toast.atencao .toast-acao { text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }  /* A-2 */
.toast .toast-acao:hover:not(:disabled) { background: var(--superficie-3); color: var(--texto); text-decoration-color: currentColor; }
.toast.erro .toast-acao:hover:not(:disabled), .toast.atencao .toast-acao:hover:not(:disabled) { background: var(--branco-60); color: inherit; }

.dialogo {
  max-width: min(460px, calc(100vw - 32px)); padding: var(--e-6); border: 0; border-radius: var(--r-4);
  background: var(--superficie); color: var(--texto); box-shadow: var(--sombra-3);
}
.dialogo[open] { animation: entrar .16s ease-out; }
.dialogo::backdrop { background: var(--veu); backdrop-filter: blur(2px); }
.dialogo p { margin: 0 0 var(--e-5); font-size: 15px; line-height: 1.5; }
.dialogo-acoes { display: flex; gap: var(--e-2); justify-content: flex-end; flex-wrap: wrap; }
.foto-dialogo { max-width: min(720px, calc(100vw - 32px)); padding: var(--e-4); }
.foto-dialogo img { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto var(--e-3); border-radius: var(--r-2); }
@keyframes entrar { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ selos de estado da planilha (texto + ponto, nunca só cor) */
.selo {
  display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px 1px 8px;
  border: 1px solid var(--linha); border-radius: var(--r-pilula); background: var(--superficie-2); color: var(--texto-2);
  font-size: var(--t-2); font-weight: 600; line-height: 18px; letter-spacing: 0; text-transform: none;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.selo::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.selo.enviado, .selo.ja_existia { background: var(--ok-fundo); border-color: var(--ok-linha); color: var(--ok-texto); }
.selo.pendente { background: var(--atencao-fundo); border-color: var(--atencao-linha); color: var(--atencao-texto); }
.selo.erro { background: var(--erro-fundo); border-color: var(--erro-linha); color: var(--erro-texto); }
.selo.novo { margin-left: 6px; background: var(--preto); border-color: var(--preto); color: var(--no-preto); padding: 1px 8px; }
.selo.novo::before { display: none; }
/* E-19: o que veio da planilha (Dev. Produto) e só muda lá */
.selo.planilha { background: var(--planilha-fundo); border-color: var(--planilha-linha); color: var(--planilha-texto); }
/* Prazos, passo 1 (só leitura): as duas datas limite e a chegada do tecido, iguais no Calendário, nas Etapas e no
   briefing. Estados do R-PZ-7: passou (âmbar forte), em risco (âmbar), no prazo, feita (verde), sem data (cinza) */
.pz-datas { display: flex; flex-wrap: wrap; gap: 6px 8px; list-style: none; margin: 0; padding: 0; }
/* (".pz-datas > ": a lista do Calendário pinta todo li de dentro; aqui o seletor ganha dela) */
.pz-datas > .pz { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; margin: 0; padding: 2px 11px 2px 9px;
  border: 1px solid var(--linha); border-radius: var(--r-pilula); background: var(--superficie); color: var(--texto);
  font-size: var(--t-2); font-weight: 600; line-height: 20px; box-shadow: none; }
.pz-ic { width: 7px; height: 7px; flex: none; border-radius: 50%; background: currentColor; }
.pz-datas > .pz-atrasada { background: var(--atencao-fundo); border-color: var(--atencao-borda); color: var(--atencao-texto); }
.pz-datas > .pz-em-risco { background: var(--atencao-fundo); border-color: var(--atencao-linha); color: var(--atencao-texto); }
.pz-datas > .pz-no-prazo .pz-ic { background: var(--borda-campo); }
.pz-datas > .pz-feita { background: var(--ok-fundo); border-color: var(--ok-linha); color: var(--ok-texto); }
.pz-datas > .pz-sem, .pz-datas > .pz-lancada { background: var(--superficie-2); color: var(--texto-2); font-weight: 500; }
.pz-datas > .pz-sem .pz-ic, .pz-datas > .pz-lancada .pz-ic { background: none; box-shadow: inset 0 0 0 1.5px currentColor; }
.pz-tecidos { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: var(--t-3); line-height: 1.45; color: var(--texto-2); }
.pz-tecidos > li { margin: 0; padding: 0; background: none; }
.pz-tecidos b { color: var(--texto); font-weight: 650; }
.pz-tec.vazio { font-style: italic; }
.pz-tec.vazio b { font-style: normal; }
.pz-aviso { display: block; color: var(--atencao-texto); font-weight: 600; }
/* no briefing: as datas no topo e, em cada cor, a chegada do tecido do piloto */
.prazos-colecao { max-width: 1040px; margin: 0 0 var(--e-5); padding: 12px 16px 14px; background: var(--superficie); border: 1px solid var(--linha);
  border-radius: var(--r-3); box-shadow: var(--sombra-1); }
.prazos-colecao > h2 { margin: 0 0 8px; font-family: var(--fonte); font-size: var(--t-1); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--texto-2); }
.lista-skus .tecido-cor b { color: var(--texto); font-weight: 650; }
.lista-skus .tecido-cor.atraso, .lista-skus .tecido-cor.atraso b { color: var(--atencao-texto); }
/* selo que é botão (ex.: "2 pendência(s)" abre a lista): parece selo, a área de toque é maior que o desenho */
button.selo {
  min-height: 0; padding: 1px 9px 1px 8px; box-shadow: none; font-size: var(--t-2); line-height: 18px;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 2px;
}
button.selo, a.selo { position: relative; cursor: pointer; }
button.selo::after, a.selo::after { content: ""; position: absolute; inset: -6px -4px; }
a.selo { text-underline-offset: 2px; }
button.selo:hover:not(:disabled) { text-decoration-color: currentColor; }
button.selo.pendente:hover:not(:disabled) { background: var(--atencao-fundo); border-color: var(--atencao-borda); }
button.selo.erro:hover:not(:disabled) { background: var(--erro-fundo); border-color: var(--erro-texto); }

/* ------------------------------------------------------------------ lista de coleções */
.form-linha { display: grid; grid-template-columns: 2fr 1fr auto; gap: var(--e-3); align-items: end; }
/* nova coleção e editar coleção (E-13): ID sozinho, nome, lançamento, linha, série; conceito e observações embaixo */
.form-colecao { display: grid; grid-template-columns: 80px minmax(0, 2fr) minmax(150px, 1fr) minmax(130px, 1fr) minmax(150px, 1fr); gap: var(--e-3); align-items: end; }
.form-colecao .largo { grid-column: 1 / -1; }
.form-colecao textarea { resize: vertical; }
.campo-id { display: flex; flex-direction: column; gap: 6px; }
.campo-id output { display: inline-flex; align-items: center; min-height: var(--alto); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.acoes-colecao { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.editar-colecao.form-colecao { grid-template-columns: minmax(0, 2fr) minmax(150px, 1fr) minmax(130px, 1fr) minmax(150px, 1fr); }
.colecao-item .linha-serie { font-size: var(--t-2); font-weight: 600; color: var(--texto-2); letter-spacing: .02em; }
.sobre-colecao { max-width: 72ch; margin: calc(-1 * var(--e-3)) 0 var(--e-4); }
.sobre-colecao:empty { display: none; }
.editar-colecao.card { margin: 0 0 var(--e-5); }
.editar-colecao h2 { margin: 0; }
.campo-id small { font-size: var(--t-1); color: var(--texto-2); }
/* E-14/E-17: modelo em várias coleções e "+ Modelo existente" */
.tambem-em { margin: 0 0 var(--e-2); font-size: var(--t-2); }
.ja-lancadas { margin: 0 0 var(--e-3); font-size: var(--t-3); }
.ja-lancadas ul { margin: 6px 0 0; padding-left: 18px; color: var(--texto-2); }
.dialogo-existente { width: min(720px, calc(100vw - 32px)); max-height: min(80vh, 760px); padding: var(--e-5); border: 1px solid var(--linha); border-radius: var(--r-3); background: var(--superficie); color: var(--texto); }
.dialogo-existente::backdrop { background: rgb(0 0 0 / .45); }
.dialogo-existente h2 { margin: 0 0 var(--e-3); }
.lista-existente { list-style: none; margin: var(--e-3) 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.lista-existente li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--linha-suave); border-radius: var(--r-2); }
.lista-existente img, .lista-existente .sem-foto { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--superficie-2); }
.lista-existente .texto { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lista-existente .texto strong, .lista-existente .texto span { overflow-wrap: anywhere; }
.por-na-colecao { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 var(--e-4); }
.lista-modelos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--e-3); }
.lista-modelos > .vazio, .lista-modelos > .aviso, .lista-modelos > .muted { grid-column: 1 / -1; }
.item-modelo { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; color: inherit; text-decoration: none;
  background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--r-3); }
.item-modelo:hover { border-color: var(--borda-forte); }
.item-modelo img, .item-modelo .sem-foto { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--superficie-2); }
.item-modelo .texto { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item-modelo .texto > * { overflow-wrap: anywhere; }
.item-modelo .selo { align-self: flex-start; }

/* ------------------------------------------------------------------ aba Modelos (E-39): pai (modelo) e filho (SKU) */
/* revisão de design de 16/10: linhas (abrir não muda nada de lugar), grupos por coleção, painel compacto, tabela no filho */
.mod-barra { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-3) var(--e-5); margin-bottom: var(--e-4); }
.mod-busca { flex: 1 1 320px; max-width: 480px; }
.mod-busca input { width: 100%; }
.mod-grupo { display: inline-flex; align-items: center; gap: 8px; }
.mod-rot { font-size: var(--t-2); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--texto-2); }
/* O controle segmentado, um só para todas as telas (B1 da revisão de design: eram 3 cópias com alturas e paddings
   diferentes): as vistas do Calendário, as situações das Referências, os botões de Modelos. Abas (role="tab", com
   aria-selected) ou botões de alternar (aria-pressed). Desenho próprio: o button:hover global pintaria de preto. */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--superficie-3); border-radius: var(--r-3); }
.seg > button, .seg > [role="tab"] { min-height: 36px; padding: 0 16px; border: 0; border-radius: var(--r-2); background: transparent; color: var(--texto-2); font-size: var(--t-3); font-weight: 600; box-shadow: none; }
.seg > button small { margin-left: 4px; font-size: var(--t-2); font-weight: 500; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.seg > :is(button, [role="tab"]):hover:not(:disabled):not([aria-pressed="true"]):not([aria-selected="true"]) { background: var(--branco-60); border-color: transparent; color: var(--texto); }
/* o escolhido com contorno e letra mais forte (só o fundo branco dava 1,15:1 contra a trilha: M2) */
.seg > :is([aria-pressed="true"], [aria-selected="true"]), .seg > :is([aria-pressed="true"], [aria-selected="true"]):hover:not(:disabled) { background: var(--superficie); color: var(--texto); font-weight: 700; box-shadow: 0 0 0 1px var(--borda-campo), var(--sombra-1); }
.mod-contagem { flex-basis: 100%; margin: -4px 0 0; font-size: var(--t-3); color: var(--texto-2); font-variant-numeric: tabular-nums; }

.lista-modelos.lista-modelos { grid-template-columns: 1fr; gap: 6px; }
.lista-modelos > .grupo-titulo { display: flex; flex-wrap: wrap; row-gap: 2px; align-items: baseline; gap: 10px; margin: 18px 0 2px; padding-bottom: 6px; border-bottom: 1px solid var(--linha); }
.lista-modelos > .grupo-titulo:first-child { margin-top: 0; }
.grupo-titulo h3 { margin: 0; font-family: var(--fonte-titulo); font-size: var(--t-5); font-weight: 650; }
.grupo-titulo span { font-size: var(--t-3); color: var(--texto-2); white-space: nowrap; }
.lista-modelos > .pai { min-width: 0; background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--r-3); transition: border-color .15s, box-shadow .15s; }
.lista-modelos > .pai:hover { border-color: var(--borda-forte); box-shadow: var(--sombra-1); }
.lista-modelos > .pai.aberto { border-color: var(--borda-forte); box-shadow: var(--sombra-2); }
/* Q-1 (revisão de 17/10): colunas com a mesma largura em todas as linhas (o "também em" era auto e cada linha calculava a
   sua, então as cores começavam num lugar diferente em cada linha e, com pouco espaço, ficavam uma por linha) */
.pai-topo { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 52px minmax(200px, 1.3fr) minmax(0, 1fr) minmax(0, 1.6fr) 56px; gap: 12px; align-items: center; width: 100%; padding: 8px 14px 8px 8px; border-radius: inherit; cursor: pointer; color: var(--texto); }
@media (min-width: 901px) and (max-width: 1200px) {
  /* janela estreita (notebook, Windows em 125–150%): o "também em" desce para baixo do nome e as cores ganham a largura */
  .pai-topo { grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1.3fr) 56px; grid-template-areas: "foto nome cores n" "foto onde cores n"; row-gap: 2px; }
  .pai-topo img, .pai-topo .sem-foto { grid-area: foto; }
  .pai-topo .pai-nome { grid-area: nome; }
  .pai-topo .onde { grid-area: onde; }
  .pai-topo .cores-resumo { grid-area: cores; }
  .pai-topo .pai-n { grid-area: n; }
}
.pai-topo:hover:not(:disabled) { background: none; }
.pai-topo:focus-visible { outline: 2px solid var(--preto); outline-offset: 2px; }
.pai-topo img, .pai-topo .sem-foto { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; background: var(--superficie-2); }
.pai-nome { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pai-nome strong { font-size: var(--t-4); font-variant-numeric: tabular-nums; }
.pai-nome span { font-size: var(--t-3); font-weight: 600; overflow-wrap: anywhere; }
.pai-nome .sem-nome { font-weight: 500; color: var(--texto-2); }
.pai-nome .selo, .tabela-filhos td.sku .selo { font-size: var(--t-1); font-weight: 600; vertical-align: 1px; overflow-wrap: normal; }
.pai-topo .onde { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; font-size: var(--t-2); color: var(--texto-2); }
.pai-topo .onde .selo { font-size: var(--t-1); }
.tambem { font-size: var(--t-2); color: var(--texto-2); }
/* inline-block: a reticência só vale em bloco (no inline o texto saía cortado ao meio: D-1 da revisão do E-19) */
.col-pilula { display: inline-block; max-width: 100%; padding: 0 7px; border: 1px solid var(--linha); border-radius: var(--r-1); font-size: var(--t-2); color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.col-pilula.lancada { background: var(--superficie-2); }
.col-pilula.col-mais { border-style: dashed; }
/* as cores do resumo quebram linha em vez de sumir cortadas; o nome longo ganha reticência e o nome inteiro no title */
.cores-resumo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; row-gap: 4px; min-width: 0; }
.cores-resumo .cor-chip { flex: 0 1 auto; min-width: 0; max-width: 18ch; }
.cores-resumo .cor-mais { flex: none; }
.pai.aberto .cores-resumo { visibility: hidden; }  /* aberto, a grade logo abaixo já mostra as cores (A1) */
.cor-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 1px 8px 1px 2px; border: 1px solid var(--linha); border-radius: var(--r-pilula); background: var(--superficie-2); font-size: var(--t-2); font-weight: 600; color: var(--texto); white-space: nowrap; overflow: hidden; }
.cor-chip b { flex: none; }
.cor-chip .cor-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cor-chip b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 3px; border: 1px solid var(--borda-forte); border-radius: var(--r-pilula); background: var(--superficie); font-size: 11px; font-weight: 800; }
.cor-mais { padding: 1px 8px; border: 1px dashed var(--borda-forte); border-radius: var(--r-pilula); font-size: var(--t-2); font-weight: 600; color: var(--texto); }
.sem-cor { font-size: var(--t-2); font-weight: 600; color: var(--texto-2); }
.pai-n { display: flex; flex-direction: column; align-items: center; line-height: 1.1; color: var(--texto-2); }
.pai-n b { font-size: 20px; color: var(--texto); font-variant-numeric: tabular-nums; }
.pai-n small { font-size: var(--t-1); font-weight: 600; }
.pai-n .seta { width: 8px; height: 8px; margin-top: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.pai.aberto .pai-n .seta { transform: rotate(-135deg); margin-top: 10px; }
.pai-cores { padding: 2px 14px 14px; border-top: 1px solid var(--linha); }
.pai-acoes { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0 4px; font-size: var(--t-3); }
.pai-acoes-novas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nova-cor-link { min-height: 34px; font-size: var(--t-3); }
.grupo-cores h3 { margin: 12px 0 4px; font-size: var(--t-2); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--texto-2); }
.grupo-cores h3 span { letter-spacing: 0; text-transform: none; font-weight: 500; }
.grade-cores { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 18px; }
.grade-cores > li { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 2px; border-bottom: 1px solid var(--linha-suave); }
.grade-cores .letra { flex: none; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border: 1px solid var(--borda-forte); border-radius: var(--r-pilula); background: var(--superficie); font-size: var(--t-2); font-weight: 800; }
.grade-cores .cor-nome { flex: 1; min-width: 0; font-size: var(--t-3); font-weight: 600; overflow-wrap: anywhere; }
.grade-cores small { flex: none; font-size: var(--t-2); color: var(--texto-2); font-variant-numeric: tabular-nums; }

.tabela-filhos td { padding: 4px 14px; vertical-align: middle; }
.tabela-filhos td.sku a { font-weight: 650; font-variant-numeric: tabular-nums; }
.tabela-filhos td.miniatura { width: 30px; }
.tabela-filhos td.miniatura img, .tabela-filhos td.miniatura .sem-foto { display: block; width: 30px; height: 40px; object-fit: cover; border-radius: 4px; background: var(--superficie-2); }
.letra-pilula { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border: 1px solid var(--borda-forte); border-radius: var(--r-pilula); font-size: 11px; font-weight: 800; }
.lista-modelos .vazio .secondary, .lista-skus-todas .vazio .secondary { margin-top: 8px; }
/* E-19 (F6, D-7): o grupo fechado (as coleções já lançadas) abre pelo título; desenho próprio, sem o hover preto */
.grupo-abrir {
  all: unset; box-sizing: border-box; display: inline-flex; align-items: baseline; gap: 10px; min-height: var(--alvo-link);
  cursor: pointer; color: var(--texto); font: inherit;
}
.grupo-abrir:hover:not(:disabled) { background: none; color: var(--texto); }
.grupo-titulo .grupo-abrir .grupo-nome { font-size: inherit; color: inherit; white-space: normal; }
.grupo-abrir:hover:not(:disabled) .grupo-nome { text-decoration: underline; text-underline-offset: 3px; }
.grupo-abrir:focus-visible { outline: 2px solid var(--preto); outline-offset: 2px; border-radius: var(--r-1); }
.grupo-titulo .grupo-abrir .grupo-acao {
  align-self: center; padding: 1px 10px; border: 1px solid var(--borda-forte); border-radius: var(--r-pilula); background: var(--superficie);
  color: var(--texto); font-family: var(--fonte); font-size: var(--t-2); font-weight: 600;
}
.grupo-abrir:hover:not(:disabled) .grupo-acao { background: var(--superficie-3); border-color: var(--borda-campo); }
/* a origem na vista por cor: texto leve, sem pílula (decisão 40, 16/10: a pílula em 2.105 linhas virava ruído) */
.tabela-filhos .origem-texto { margin-left: 8px; color: var(--planilha-texto); font-size: var(--t-2); font-weight: 600; white-space: nowrap; }
.mostrar-mais { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: var(--e-3) 0 0; }
@media (max-width: 600px) { .grupo-abrir, .mostrar-mais .secondary { min-height: 44px; } }

/* ------------------------------------------------------------------ Calendário: ver calendario.css (E-18 v2) */
.sobre-colecao .conceito { margin: 6px 0 0; color: var(--texto-2); }
.sobre-colecao .na-planilha { margin: 0; font-size: var(--t-2); }
.sobre-colecao .observacoes { margin-top: 4px; font-size: var(--t-3); }
.sobre-colecao .observacoes p { margin: 4px 0 0; white-space: pre-line; color: var(--texto-2); }
.barra { display: flex; gap: var(--e-3) var(--e-4); flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--e-4); }
.barra label { min-width: 220px; }
.barra label.inline { min-width: 0; min-height: var(--alto); }
.barra h2 { margin-right: auto; align-self: center; }
.barra > .muted:last-child {
  display: inline-flex; align-items: center; min-height: var(--alto); margin-left: auto; font-variant-numeric: tabular-nums;
}
label.busca { min-width: 260px; }

.grade-colecoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--e-4); }
.grade-colecoes > :not(.colecao-item, .colecao-caixa) { grid-column: 1 / -1; }
.colecao-item {
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: var(--e-4) 18px;
  color: inherit; text-decoration: none; background: var(--superficie);
  border: 1px solid var(--linha); border-radius: var(--r-3); box-shadow: var(--sombra-1);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.colecao-item::after {
  content: ""; position: absolute; top: 18px; right: 16px; width: 16px; height: 16px; background: var(--texto-2);
  -webkit-mask: var(--icone-seta) center / contain no-repeat; mask: var(--icone-seta) center / contain no-repeat;
  transition: transform .15s, background-color .15s;
}
.colecao-item:hover { border-color: var(--borda-forte); box-shadow: var(--sombra-2); transform: translateY(-1px); }
.colecao-item:hover::after { background: var(--texto); transform: translateX(2px); }
.colecao-item .codigo { padding-right: 24px; font-size: var(--t-2); font-weight: 650; letter-spacing: .04em; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.colecao-item strong { display: block; font-family: var(--fonte-titulo); font-size: var(--t-5); font-weight: 650; line-height: 1.3; letter-spacing: -0.005em; }
.colecao-item .numeros {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: var(--e-3); padding-top: var(--e-3);
  border-top: 1px solid var(--linha-suave); font-size: var(--t-3); color: var(--texto-2); font-variant-numeric: tabular-nums;
}
.colecao-item.lancada { background: var(--superficie-2); box-shadow: none; }
.colecao-caixa { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.colecao-caixa > .colecao-item { flex: 1; }
.colecao-atalho {
  align-self: flex-start; display: inline-flex; align-items: center; min-height: 24px; padding: 0 4px;
  font-size: var(--t-2); font-weight: 600; color: var(--texto-2); text-underline-offset: 3px;
}
.colecao-atalho:hover { color: var(--texto); }
@media (max-width: 900px) { .colecao-atalho { min-height: 44px; } }
/* E-19 (F6): as coleções em grupos (a lançar, sem data, lançadas por ano), o selo e o filtro da origem */
.colecao-item .codigo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.colecao-item .codigo .selo { letter-spacing: 0; }
.grade-colecoes > .grupo-colecoes {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: var(--e-4) 0 calc(-1 * var(--e-1));
  padding-bottom: 6px; border-bottom: 1px solid var(--linha);
}
.grade-colecoes > .grupo-colecoes:first-child { margin-top: 0; }
.grupo-colecoes h3 { margin: 0; font-family: var(--fonte-titulo); font-size: var(--t-5); font-weight: 650; }
.grupo-colecoes span { font-size: var(--t-3); color: var(--texto-2); white-space: nowrap; }
.colecao-item .sem-data { font-style: italic; }
.barra .mod-grupo { align-self: flex-end; min-height: var(--alto); }
.lista-colecoes { margin-top: var(--e-5); }
.acoes-colecao { gap: var(--e-2); }
.page-header p .selo { vertical-align: 1px; }
/* D-6: os anos já lançados num <details> fechado; o título é o resumo (a seta do summary diz que abre) */
.grupo-ano > summary.grupo-colecoes {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; width: 100%; margin: var(--e-4) 0 0;
  padding: 4px 0 6px; border-bottom: 1px solid var(--linha); color: var(--texto);
}
.grupo-ano > summary.grupo-colecoes::before { align-self: center; }
.grupo-ano > summary.grupo-colecoes:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.grupo-ano > summary.grupo-colecoes:focus-visible { outline: 2px solid var(--preto); outline-offset: 2px; border-radius: var(--r-1); }
.grupo-ano > .grade-colecoes { margin-top: var(--e-4); }

/* ------------------------------------------------------------------ cabeçalho da coleção (fica fixo ao rolar) */
.cabecalho-colecao {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: flex-end; gap: var(--e-4); flex-wrap: wrap;
  margin: calc(-1 * var(--pad-topo)) calc(-1 * var(--pad-main)) var(--e-5);
  padding: var(--e-6) var(--pad-main) var(--e-4);
  background: var(--fundo); background: var(--fundo-vidro); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--linha);
}
.cabecalho-colecao h1 { margin-bottom: 6px; }
.editar-colecao { margin-top: 10px; grid-template-columns: 2fr 1fr auto; }
.cabecalho-colecao .numeros {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
  font-size: var(--t-3); color: var(--texto-2); font-variant-numeric: tabular-nums;
}
.cabecalho-colecao .numeros b { color: var(--texto); font-weight: 650; }
/* E-40: "Editar coleção" junto dos dados da coleção (não junto das ações de modelo) */
.numeros-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.numeros-linha .editar-link { font-size: var(--t-3); font-weight: 600; }
/* os números e o "Editar coleção" na mesma linha (senão o link descia e as abas pulavam entre as vistas) */
.cabecalho-colecao .numeros-linha > .numeros { display: contents; }
/* as vistas da coleção (Briefing · Necessidade de MP): links com cara de abas, claras; a atual em cartão branco */
/* as vistas da coleção (Briefing · Necessidade de MP): abas de página, dentro do cabeçalho, presas à linha de baixo dele;
   o mesmo cabeçalho nas duas vistas, para não "pular" ao trocar (revisão de design do E-40, A5 e M8) */
.cabecalho-colecao { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 0 var(--e-4); padding-bottom: 0; }
.cabecalho-colecao > .acoes-linha, .cabecalho-colecao > .acoes-csv { margin-top: 30px; }
.cabecalho-colecao h1 { text-wrap: balance; }
.cabecalho-colecao > .numeros-linha { grid-column: 1 / -1; min-height: 28px; }
.cabecalho-colecao > .acoes-csv a.botao { min-height: var(--alto); }
.cabecalho-colecao > .acoes-csv a.botao .sub { display: none; }
.cabecalho-colecao > .sub-abas { grid-column: 1 / -1; margin: 12px 0 -1px; }
.sub-abas { display: flex; flex-wrap: wrap; gap: 2px; }
.sub-abas a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-bottom: 2px solid transparent; border-radius: var(--r-1) var(--r-1) 0 0; color: var(--texto-2); font-size: var(--t-3); font-weight: 600; text-decoration: none; }
.sub-abas a:hover:not([aria-current="page"]) { background: var(--superficie-3); color: var(--texto); }
.sub-abas a[aria-current="page"] { color: var(--texto); font-weight: 700; border-bottom-color: var(--texto); }
.sub-abas a:focus-visible { outline: 2px solid var(--preto); outline-offset: 2px; }
.intro-mp { max-width: 900px; margin: var(--e-4) 0 var(--e-2); color: var(--texto-2); font-size: var(--t-3); line-height: 1.5; }
.intro-mp b { color: var(--texto); }
.como-mp { margin: 0 0 var(--e-3); font-size: var(--t-3); color: var(--texto-2); }
.como-mp summary { display: inline-flex; align-items: center; min-height: 28px; cursor: pointer; font-weight: 600; color: var(--texto); }
.como-mp p { max-width: 900px; margin: 4px 0 0; line-height: 1.5; }
details.fora-resumo { margin: 0 0 var(--e-3); }
details.fora-resumo > summary { cursor: pointer; font-weight: 650; min-height: 28px; }
details.fora-resumo > div { margin-top: 8px; }
details.fora-resumo .fora-bloco { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--atencao-linha); }
details.fora-resumo .fora-bloco h2 { margin: 0 0 4px; font-size: var(--t-3); }
details.fora-resumo .fora-bloco ul { margin: 0; padding-left: 18px; font-size: var(--t-3); }
#numeros #cadastro.velho { color: var(--atencao-texto); font-weight: 600; }
.barra-mps { display: flex; gap: 2px 10px; align-items: center; flex-wrap: wrap; margin: 0 0 var(--e-3); }
.barra-mps #dica { margin: 0; flex-basis: 100%; }
/* cadastro de MP lido há 1 dia ou mais */
.barra-mps .velho {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--atencao-linha); border-radius: var(--r-2);
  background: var(--atencao-fundo); color: var(--atencao-texto); font-weight: 600;
}
.barra-mps .velho::before {
  content: ""; width: 14px; height: 14px; flex: none; background: currentColor;
  -webkit-mask: var(--icone-alerta) center / contain no-repeat; mask: var(--icone-alerta) center / contain no-repeat;
}
#dica { margin: 0 0 var(--e-5); }

/* ------------------------------------------------------------------ cartões de modelo */
.modelos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: var(--e-5); align-items: start; }
.modelos > .vazio { grid-column: 1 / -1; }
.modelo {
  position: relative; padding: var(--e-5); background: var(--superficie);
  border: 1px solid var(--linha); border-radius: var(--r-3); box-shadow: var(--sombra-1);
  transition: border-color .15s, box-shadow .15s;
}
.modelo:focus { outline: none; }
/* cartão escolhido: é nele que o Ctrl+V cola a foto */
.modelo:focus-within { border-color: var(--preto); box-shadow: 0 0 0 1px var(--preto), var(--sombra-2); }
.modelo:focus-within::after {
  content: "Ctrl+V cola a foto aqui"; position: absolute; top: -11px; right: 16px; z-index: 2; pointer-events: none;
  padding: 2px 10px; border-radius: var(--r-pilula); background: var(--preto); color: var(--no-preto);
  font-size: var(--t-1); font-weight: 600; letter-spacing: .02em; line-height: 18px;
}
.modelo-topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: var(--e-4); }
.modelo-topo .modelo-titulo {
  margin: 0 auto 0 0; font-family: var(--fonte-titulo); font-size: var(--t-5); font-weight: 700;
  letter-spacing: .01em; font-variant-numeric: tabular-nums;
}
.modelo-topo .salvo { font-size: var(--t-2); color: var(--texto-2); }
.modelo-topo .salvo.erro { color: var(--erro-texto); font-weight: 600; }   /* gancho: "Não salvo" */

.fotos { display: grid; grid-template-columns: repeat(2, minmax(0, 180px)); gap: var(--e-3); margin-bottom: var(--e-4); }
.foto {
  position: relative; aspect-ratio: 3 / 4; display: grid; place-items: center; align-content: center; gap: var(--e-2);
  padding: var(--e-3); overflow: hidden; cursor: pointer; text-align: center;
  border: 1.5px dashed var(--borda-forte); border-radius: 10px; background: var(--superficie-2);
  color: var(--texto-2); font-size: var(--t-2); line-height: 1.45;
  transition: border-color .15s, background-color .15s, color .15s;
}
.foto:not(:has(img))::before {
  content: ""; width: 26px; height: 26px; background: currentColor;
  -webkit-mask: var(--icone-imagem) center / contain no-repeat; mask: var(--icone-imagem) center / contain no-repeat;
}
.foto:hover, .foto.arrastando { border-color: var(--preto); background: var(--superficie-3); color: var(--texto); }
.foto.arrastando { border-style: solid; box-shadow: 0 0 0 4px var(--anel-campo); }
.foto:has(img) { border-style: solid; border-color: var(--linha); background: var(--superficie); }
.foto:has(img):hover { border-color: var(--preto); }
.foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--superficie); }
.foto .rotulo {
  position: absolute; left: 8px; top: 8px; z-index: 1; padding: 1px 8px; border-radius: var(--r-pilula);
  background: var(--veu-claro); box-shadow: var(--sombra-1); color: var(--texto);
  font-size: 10px; font-weight: 700; letter-spacing: .06em; line-height: 18px; text-transform: uppercase;
}

.campos { display: grid; grid-template-columns: 2fr 1fr; gap: var(--e-3); }
.campos .largo { grid-column: 1 / -1; }

/* ------------------------------------------------------------------ E-19 (F6): o que veio da planilha, só leitura */
/* a nota: cartão claro azul (nunca bloco preto), o texto com 7,4:1 */
.nota-planilha {
  margin: 0 0 var(--e-3); padding: 8px 12px; border: 1px solid var(--planilha-linha); border-radius: var(--r-2);
  background: var(--planilha-fundo); color: var(--planilha-texto); font-size: var(--t-3); line-height: 1.45;
}
.sobre-colecao .nota-planilha { margin: 0 0 var(--e-2); }
.modelo-topo .selo.planilha { flex: none; }
/* o campo lido: o rótulo igual ao do campo editável; o valor em texto num fundo claro, sem a borda de campo */
.campo-leitura { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo-leitura .rotulo-leitura { font-size: var(--t-3); font-weight: 600; color: var(--texto); }
.campo-leitura .valor-leitura {
  margin: 0; min-height: var(--alto); padding: 8px 11px; border: 1px solid var(--linha-suave); border-radius: var(--r-2);
  background: var(--superficie-2); color: var(--texto); font-size: var(--t-4); line-height: 20px;
  overflow-wrap: anywhere; white-space: pre-line;
}
.campo-leitura .valor-leitura.vazio-leitura { color: var(--texto-2); font-style: italic; }
/* a foto lida: sem a cara de "clique, arraste ou cole" (nada de hover preto, cursor de mão ou ícone de acrescentar) */
.foto.leitura, .foto.leitura:hover { cursor: default; border-style: solid; border-color: var(--linha); background: var(--superficie-2); color: var(--texto-2); }
.foto.leitura:has(img), .foto.leitura:has(img):hover { background: var(--superficie); }
.foto.leitura:not(:has(img))::before { display: none; }
/* sem nenhuma das duas imagens, a faixa fica baixa (eram 240 px de quadro vazio: D-20); com uma delas, as duas iguais */
.fotos:not(:has(img)) .foto.leitura { aspect-ratio: auto; min-height: 72px; padding-top: 30px; }
/* o cartão do modelo da planilha não recebe foto colada: sem o selo "Ctrl+V cola a foto aqui" nem a borda preta */
.modelo.da-planilha:focus-within, .modelo.so-leitura:focus-within { border-color: var(--linha); box-shadow: var(--sombra-1); }
.modelo.da-planilha:focus-within::after, .modelo.so-leitura:focus-within::after { content: none; }
/* as cores do modelo da planilha: o desenho da Visão Geral ao lado da cor e a quantidade em texto */
.lista-skus .cor-foto { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.lista-skus .cor-foto img { flex: none; width: 28px; height: 36px; object-fit: cover; border-radius: 4px; background: var(--superficie-2); }
.lista-skus .qtd-texto { color: var(--texto-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* a ficha lida (uso, consumo, MP por cor, consumo próprio, "não usa") */
.ficha-leitura { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--e-3); }
.ficha-insumo { padding: 10px var(--e-3); border: 1px solid var(--linha); border-radius: var(--r-2); background: var(--superficie-2); }
.ficha-insumo:focus { outline: 2px solid var(--preto); outline-offset: 2px; }
/* (não .ficha-topo: o cores.css, carregado junto no briefing, usa esse nome na ficha da aba Cores) */
.ficha-insumo-topo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 4px; }
.ficha-insumo-topo strong { font-size: var(--t-4); }
.ficha-insumo-topo span { font-size: var(--t-3); color: var(--texto-2); font-variant-numeric: tabular-nums; }
/* as colunas iguais em todas as linhas (subgrid, como a lista de SKUs): a MP não anda quando uma cor tem consumo próprio */
.ficha-cores {
  display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr) minmax(0, 2fr) auto; column-gap: 12px;
  list-style: none; margin: 0; padding: 0;
}
.ficha-cores > li {
  display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; row-gap: 2px;
  align-items: baseline; padding: 5px 0; border-top: 1px solid var(--linha-suave); font-size: var(--t-3);
}
.ficha-cores .sku { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ficha-cores .sku.todas { grid-column: span 2; font-weight: 600; white-space: normal; }  /* "todas as 5 cores" (D-15) */
/* a dica neutra debaixo de um campo (a Linha que falta no Editar: D-4); o vermelho fica para o Salvar recusado */
.dica-campo { margin: calc(-1 * var(--e-1)) 0 0; font-size: var(--t-2); font-weight: 500; color: var(--texto-2); }
@media (min-width: 901px) { #ed-linha-dica { grid-column: 3 / 4; } }  /* debaixo da Linha (N-2 da 2ª rodada de design) */
.ficha-cores .cor { overflow-wrap: anywhere; }
.ficha-cores .mp { overflow-wrap: anywhere; }
.ficha-cores .mp small { color: var(--texto-2); font-size: var(--t-2); }
/* a MP achada pela descrição (decisão 42): marca leve, sem pílula; o porquê no title */
.ficha-cores .pela-descricao { margin-left: 8px; color: var(--texto-2); font-size: var(--t-2); font-style: italic; white-space: nowrap; cursor: help; }
/* sem código de MP: em âmbar só na coleção a lançar (é pendência, P-11); na lançada é história, em cinza */
.ficha-cores .mp.sem { color: var(--texto-2); font-style: italic; }
.ficha-cores .mp.sem.pendente { color: var(--atencao-texto); font-weight: 600; font-style: normal; }
.ficha-cores .proprio { color: var(--texto-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ficha-cores > li.nao-usa .mp { color: var(--texto-2); font-weight: 400; font-style: italic; }
@media (max-width: 600px) {
  .ficha-cores { grid-template-columns: auto minmax(0, 1fr); }
  .ficha-cores .mp, .ficha-cores .proprio { grid-column: 1 / -1; }
  .ficha-cores .proprio:empty { display: none; }
}

/* seções do cartão: cores e insumos */
.cores, .insumos { margin-top: var(--e-5); padding-top: var(--e-4); border-top: 1px solid var(--linha-suave); }
.cores h3, .insumos h3 {
  display: flex; align-items: center; gap: var(--e-2); margin: 0 0 10px;
  font-size: var(--t-3); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--texto);
}
.cores p, .insumos p { margin: 0 0 10px; }

.lista-skus { list-style: none; margin: 0 0 var(--e-3); padding: 0; border: 1px solid var(--linha); border-radius: var(--r-2); overflow: hidden; }
.lista-skus > li {
  display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; padding: 8px 10px 8px 12px;
  font-size: var(--t-3); background: var(--superficie); border-top: 1px solid var(--linha-suave);
}
.lista-skus > li:first-child { border-top: 0; }
.lista-skus > li.cancelado { color: var(--texto-2); background: var(--superficie-2); }
/* o risco só nos textos da cor cancelada: o «Excluir de vez» (BR-7) fica legível como botão */
.lista-skus > li.cancelado > span { text-decoration: line-through; }
.lista-skus > li.erro { box-shadow: inset 3px 0 0 var(--erro-texto); }
.lista-skus .sku { font-weight: 700; letter-spacing: .01em; font-variant-numeric: tabular-nums; white-space: nowrap; }  /* "K5510-W" não quebra no hífen (D-2) */
.lista-skus .linha-vg { margin-left: auto; color: var(--texto-2); font-size: var(--t-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lista-skus .selo { margin-left: auto; }
.lista-skus .detalhe { flex-basis: 100%; color: var(--texto-2); font-size: var(--t-2); }
.lista-skus li.erro .detalhe { color: var(--erro-texto); }
.lista-skus .detalhe.nota { color: var(--atencao-texto); }
/* BR-7: "Cancelar SKU" e "Excluir de vez" juntos, na coluna das ações; a explicação de por que só a última cor tem o botão */
.lista-skus .acoes-sku { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 24px; margin-left: auto; }
.dica-excluir { margin: calc(-1 * var(--e-1)) 0 var(--e-2); }
/* BR-13: a nota do teste encerrado em dois parágrafos curtos */
div.nota-planilha > p { margin: 0; }
div.nota-planilha > p + p { margin-top: var(--e-1); }
@media (min-width: 901px) {
  .lista-skus > li > .acoes-sku { margin-left: 0; justify-self: end; flex-direction: column; align-items: flex-end; }
  /* colunas iguais em todas as linhas (subgrid): o selo e o "Cancelar SKU" ficam sempre no mesmo lugar */
  /* a cor tem no mínimo 10 letras de largura (quebra linha se for maior); quem cede é o selo, que pode quebrar */
  .lista-skus { display: grid; grid-template-columns: max-content minmax(10ch, 1fr) auto auto auto; }
  .lista-skus > li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; }
  .lista-skus > li > .selo { margin-left: 0; justify-self: end; white-space: normal; min-width: 0; }
  .lista-skus > li > .linha-vg { margin-left: 0; justify-self: end; }
  .lista-skus > li > button { justify-self: end; }
  .lista-skus .detalhe { grid-column: 1 / -1; }
}
.qtd-rotulo { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; font-size: var(--t-3); color: var(--texto-2); }
.qtd-sku {
  width: 72px; min-height: var(--alto-p); padding: 4px 8px; text-align: right;
  font-size: var(--t-3); color: var(--texto); font-variant-numeric: tabular-nums;
}
.nova-cor { display: grid; grid-template-columns: 2fr 1fr auto; gap: 10px; align-items: end; }

/* insumos (R-2) */
.lista-insumos { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--e-3); }
.insumo { padding: var(--e-3); border: 1px solid var(--linha); border-radius: var(--r-2); background: var(--superficie-2); }
/* o consumo fixo (valor + selo "estimado" + Editar) precisa da coluna mais larga; a unidade é só texto curto */
.insumo-topo { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(max-content, 1.6fr) minmax(40px, 0.4fr) auto auto; gap: 10px; align-items: end; }
/* a nota da estimativa fica logo abaixo do topo (no celular, logo abaixo do consumo: ver a regra de 375) */
.insumo-topo > .nota-estimativa { grid-column: 1 / -1; margin: 0; }
.insumo > button.link { margin-top: 6px; }
/* campos do topo do insumo: tecido fixo, consumo fixo com Editar, unidade que vem da MP */
.insumo-topo .campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.insumo-topo .rotulo-campo { font-size: var(--t-3); font-weight: 600; color: var(--texto); }
.uso-fixo, .unidade-mp, .consumo-fixo { display: inline-flex; align-items: center; gap: 8px; min-height: var(--alto); }
.consumo-fixo { flex-wrap: wrap; row-gap: 2px; }
.uso-fixo { font-weight: 700; letter-spacing: .02em; }
.unidade-mp { color: var(--texto-2); }
.consumo-fixo .valor { font-weight: 650; font-variant-numeric: tabular-nums; }
.consumo-editando { display: flex; align-items: center; gap: 8px; }
.consumo-editando input { min-width: 0; }
.insumo.tecido { border-left: 3px solid var(--borda-campo); }
.nota-estimativa { margin: 6px 0 0; font-size: var(--t-2); color: var(--texto-2); }
/* E-32: campo obrigatório = asterisco preto, sem a palavra (o leitor de tela ouve pelo aria-required) */
.obrig { color: var(--preto); font-weight: 800; }
.nota-obrig { font-size: var(--t-2); font-weight: 500; color: var(--atencao-texto); }
select[name="responsavel-lista"][aria-invalid="true"] { border-color: var(--atencao-borda); box-shadow: inset 0 0 0 1px var(--atencao-borda); }
/* consumo estimado (mediana da planilha) não pode parecer igual ao confirmado */
.consumo-fixo .valor.estimado { font-weight: 500; font-style: italic; color: var(--texto-2); }
.selo-estimado {
  padding: 0 6px; border: 1px dashed var(--atencao-borda); border-radius: var(--r-pilula);
  font-size: var(--t-1); font-weight: 650; color: var(--atencao-texto); background: var(--atencao-fundo);
}
.campo-com-un { display: flex; align-items: center; gap: 6px; }
.campo-com-un input { min-width: 0; }
.novo-insumo-campos select { min-width: 120px; }
.novo-tecido { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: var(--e-3); }
/* chegou por link (lista de tecidos, Visão geral): destaca por 3 s */
.insumo.destaque, .modelo.destaque { box-shadow: 0 0 0 3px var(--atencao-borda); transition: box-shadow .3s; }
.insumo:focus { outline: none; }
.insumo:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; }
.novo-insumo-campos { display: grid; grid-template-columns: 1.2fr 1fr 0.7fr auto; gap: 10px; align-items: end; }
.insumo-topo > button.link { min-height: var(--alto); }
.insumo-topo > .total { display: inline-flex; align-items: center; min-height: var(--alto); font-size: var(--t-3); font-weight: 600; color: var(--texto); }
.insumo > .aviso { margin: 10px 0 0; }
input.num { text-align: right; font-variant-numeric: tabular-nums; }
.detalhe.erro { color: var(--erro-texto); }
/* novo insumo: quadro tracejado = "acrescentar" */
.novo-insumo fieldset { min-width: 0; margin: 0; padding: 10px var(--e-3) var(--e-3); border: 1px dashed var(--borda-forte); border-radius: var(--r-2); }
.novo-insumo legend {
  padding: 0 6px; margin-left: -6px; font-size: var(--t-1); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-2);
}
.novo-insumo .nota-campo { margin: var(--e-2) 0 0; font-size: var(--t-2); color: var(--atencao-texto); }
.novo-insumo .aviso { margin: var(--e-2) 0 0; }

/* escolha da MP (combobox): lista em duas linhas, descrição inteira e código */
.mp-caixa { position: relative; min-width: 0; }
.mp-lista {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow: auto;
  margin: 0; padding: var(--e-1); list-style: none; background: var(--superficie);
  border: 1px solid var(--linha); border-radius: var(--r-2); box-shadow: var(--sombra-3);
  scrollbar-width: thin; scrollbar-color: var(--borda-forte) transparent;
}
.mp-opcao {
  position: relative; display: flex; flex-direction: column; gap: 1px; padding: 7px 34px 7px 10px;
  border-radius: var(--r-1); cursor: pointer;
}
.mp-opcao:hover { background: var(--superficie-3); }
/* opção marcada: fundo preto + ícone de visto (não depende só de cor) */
.mp-opcao[aria-selected="true"] { background: var(--superficie-3); color: var(--texto); font-weight: 700; box-shadow: inset 3px 0 0 var(--texto-2); }  /* era linha preta inteira (revisão E-40, B5) */
.mp-opcao[aria-selected="true"]::after {
  content: ""; position: absolute; right: 10px; top: 50%; width: 16px; height: 16px; margin-top: -8px; background: currentColor;
  -webkit-mask: var(--icone-ok) center / contain no-repeat; mask: var(--icone-ok) center / contain no-repeat;
}
.mp-desc { font-size: var(--t-3); font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.mp-cod { font-size: var(--t-2); color: var(--texto-2); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.mp-opcao[aria-selected="true"] .mp-cod { color: var(--texto-2); }
.mp-mais { padding: 8px 10px; font-size: var(--t-2); line-height: 1.45; color: var(--texto-2); }
.insumo-cores {
  list-style: none; margin: var(--e-3) 0 var(--e-1); padding: var(--e-3) 0 0; border-top: 1px solid var(--linha);
  display: flex; flex-direction: column; gap: 10px;
}
/* uma linha por cor: rótulo | campo da MP | total; o resto (MP escolhida, notas, erro) embaixo do campo */
.insumo-cores > li { display: grid; grid-template-columns: minmax(110px, 0.8fr) 2fr auto; gap: 4px 12px; align-items: center; font-size: var(--t-3); }
.insumo-cores > li > :not(.cor-rotulo, .mp-caixa, input, .total) { grid-column: 2 / -1; }
.insumo-cores .cor-rotulo { display: block; font-weight: 500; line-height: 1.35; }
.insumo-cores .cor-rotulo b { margin-right: 2px; font-weight: 700; font-variant-numeric: tabular-nums; }
.insumo-cores .detalhe { font-size: var(--t-2); color: var(--texto-2); }
.insumo-cores .detalhe.nota { color: var(--atencao-texto); }
.insumo-cores .detalhe.erro { color: var(--erro-texto); font-weight: 600; }
.insumo-cores .mp-escolhida { font-size: var(--t-2); line-height: 1.4; color: var(--texto-2); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
/* falta escolher / só sugerido: borda tracejada de atenção (4,3:1); pendente ganha também o fundo */
.insumo-cores > li.pendente .mp-caixa input, .insumo-cores > li.sugerido .mp-caixa input { border-style: dashed; border-color: var(--atencao-borda); }
.insumo-cores > li.pendente .mp-caixa input { background-color: var(--atencao-fundo); }
.insumo-cores .total { font-size: var(--t-2); white-space: nowrap; color: var(--texto-2); font-variant-numeric: tabular-nums; }
/* V-3: consumo próprio da cor e "não usa", em letra pequena embaixo da MP */
.insumo-cores .acoes-cor { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: var(--t-2); color: var(--texto-2); }
.insumo-cores .acoes-cor button.link { font-size: var(--t-2); }
.insumo-cores .acoes-cor .proprio-texto { color: var(--texto); font-weight: 600; font-variant-numeric: tabular-nums; }
.insumo-cores .editando-proprio label { font-weight: 600; color: var(--texto); }
.insumo-cores .editando-proprio .campo-com-un input { width: 7em; }
.insumo-cores .editando-proprio .detalhe { flex-basis: 100%; }
.insumo-cores > li.nao-usa .cor-rotulo { color: var(--texto-2); }
.insumo .ajustar-cor { display: block; margin-top: var(--e-2); font-size: var(--t-2); }
.insumo-cores .nao-usa-texto { font-style: italic; }
.aviso-linha { margin: var(--e-2) 0 0; font-size: var(--t-2); color: var(--atencao-texto); }
details.pendencias { margin-top: 10px; font-size: var(--t-3); }
/* summary com seta própria: dá para usar inline-flex (alvo de 44 px no celular) sem perder o triângulo */
summary { display: inline-flex; align-items: center; gap: 6px; min-height: var(--alvo-link); list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::before {
  content: ""; width: 12px; height: 12px; flex: none; background: currentColor; transition: transform .15s;
  -webkit-mask: var(--icone-chevron) center / contain no-repeat; mask: var(--icone-chevron) center / contain no-repeat;
}
details[open] > summary::before { transform: rotate(90deg); }
details.pendencias summary { padding: 2px 0; font-weight: 600; color: var(--atencao-texto); }
details.pendencias ul { margin: 6px 0 0; padding-left: 18px; color: var(--texto); }
details.pendencias li + li { margin-top: 2px; }

.vazio {
  padding: 48px var(--e-6); text-align: center; color: var(--texto-2); font-size: var(--t-4);
  background: var(--superficie); border: 1.5px dashed var(--borda-forte); border-radius: var(--r-3);
}
.vazio strong { display: block; margin-bottom: 6px; color: var(--texto); font-family: var(--fonte-titulo); font-size: var(--t-5); font-weight: 650; }

/* ------------------------------------------------------------------ Lista de tecidos (R-4) */
.page-header .numeros {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: var(--e-3);
  font-size: var(--t-3); color: var(--texto-2); font-variant-numeric: tabular-nums;
}
.page-header .numeros b { color: var(--texto); font-weight: 650; }
.fora-da-soma { display: grid; gap: var(--e-3); margin: var(--e-4) 0; }
.fora-da-soma:empty { display: none; }
.fora-da-soma ul { margin: 6px 0 0; padding-left: 18px; }
.fora-da-soma li + li { margin-top: 3px; }
.fora-da-soma a { color: inherit; font-weight: 650; }
.tabela-tec td.necessidade { font-weight: 650; white-space: nowrap; }
.tabela-tec td.numero, .tabela-tec th.numero { text-align: right; white-space: nowrap; }
.tabela-tec td.acao { width: 1%; white-space: nowrap; text-align: right; }
.tabela-tec td.acao button { white-space: nowrap; }
.tabela-tec td.sku { font-weight: 650; }
.tabela-tec tr.com-aviso td:first-child { box-shadow: inset 3px 0 0 var(--atencao-borda); }
.avisos-mp { margin: 0; padding-left: 16px; color: var(--atencao-texto); font-size: var(--t-2); }
.avisos-mp li + li { margin-top: 2px; }
.tabela-tec tr.rastro > td { padding: 4px 14px 14px 28px; background: var(--superficie-2); }
.tabela-rastro { width: 100%; font-size: var(--t-2); }
.tabela-rastro th { position: static; background: none; padding: 6px 10px; }
.tabela-rastro td { padding: 5px 10px; background: var(--superficie); }
.tabela-rastro td.numero { text-align: right; white-space: nowrap; }
.tabela-rastro .selo { margin-left: 6px; }
.tabela-rastro tfoot td { background: none; border-bottom: 0; padding-top: 8px; font-weight: 650; color: var(--texto); }
.tabela-rastro caption { caption-side: top; }
.acoes-csv { display: flex; gap: var(--e-2); flex-wrap: wrap; }
.acoes-csv a.botao { flex-direction: column; gap: 0; min-height: 52px; line-height: 1.15; }
a.botao .sub { font-size: var(--t-1); font-weight: 500; opacity: .8; }
.aviso.neutro { margin: 0 0 var(--e-3); max-width: 860px; color: var(--texto-2); }
.fora-da-soma h2 { margin: 0; font-size: var(--t-3); font-weight: 700; line-height: 1.4; color: inherit; }
.fora-da-soma .como { margin: 8px 0 0; }
.fora-da-soma > p.como { margin: 0; }
.page-header .numeros .falta b { color: var(--atencao-texto); }
.sem-conta { color: var(--atencao-texto); font-weight: 600; }
.parcial {
  display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--atencao-linha); border-radius: var(--r-pilula);
  background: var(--atencao-fundo); color: var(--atencao-texto); font-size: var(--t-1); font-weight: 650; vertical-align: 1px;
}
.tabela-tec td.ok .muted { font-size: var(--t-2); }
.nota-fora { color: var(--atencao-texto); }
.nota-rodape { margin-top: var(--e-3); max-width: 760px; }

/* ------------------------------------------------------------------ Visão geral */
.status-planilha { display: flex; gap: var(--e-3); align-items: center; flex-wrap: wrap; justify-content: space-between; }
.status-planilha strong { font-size: 15px; font-weight: 650; }
details.avancado summary { padding: 4px 10px; border-radius: var(--r-1); font-size: var(--t-3); font-weight: 600; color: var(--texto-2); }
details.avancado summary:hover { background: var(--superficie-3); color: var(--texto); }
details.avancado[open] summary { margin-bottom: var(--e-2); }

.tabela {
  overflow: auto; max-height: 70vh; background: var(--superficie);
  border: 1px solid var(--linha); border-radius: var(--r-3); box-shadow: var(--sombra-1);
  scrollbar-width: thin; scrollbar-color: var(--borda-forte) transparent;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--t-3); font-variant-numeric: tabular-nums; }
th {
  position: sticky; top: 0; z-index: 1; padding: 10px 14px; text-align: left; white-space: nowrap;
  background: var(--superficie-2); border-bottom: 1px solid var(--linha);
  font-size: var(--t-1); font-weight: 650; letter-spacing: .06em; color: var(--texto-2);
}
td { padding: 6px 14px; border-bottom: 1px solid var(--linha-suave); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--superficie-2); }
.tabela-vg td:nth-child(1) { white-space: nowrap; color: var(--texto-2); }
.tabela-vg td:nth-child(2) { white-space: nowrap; }
.tabela-vg td:nth-child(5) { min-width: 200px; }
.tabela-vg th:nth-child(6) { text-align: right; }
td.sku { white-space: nowrap; }
td.sku a { font-weight: 650; text-decoration-color: var(--borda-forte); }
td.sku a:hover { text-decoration-color: currentColor; }
td.numero { text-align: right; font-variant-numeric: tabular-nums; }
td.miniatura { width: 1%; }
.miniatura-botao {
  display: block; min-height: 0; padding: 0; overflow: hidden;
  background: var(--superficie); border: 1px solid var(--linha); border-radius: 7px; box-shadow: none;
}
.miniatura-botao:hover:not(:disabled) { background: var(--superficie); border-color: var(--preto); }
td.miniatura img { display: block; width: 54px; height: 72px; object-fit: cover; }
td.miniatura .sem { display: block; position: relative; width: 56px; height: 74px; border-radius: 7px; background: var(--superficie-3); }
td.miniatura .sem::after {   /* o mesmo ícone do quadro de foto vazio */
  content: ""; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; background: var(--texto-3);
  -webkit-mask: var(--icone-imagem) center / contain no-repeat; mask: var(--icone-imagem) center / contain no-repeat;
}
.detalhe-erro, .detalhe-nota { max-width: 340px; margin-top: 4px; font-size: var(--t-2); line-height: 1.45; white-space: normal; }
.detalhe-erro { color: var(--erro-texto); }
.detalhe-nota { color: var(--atencao-texto); }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------------ celular e tela estreita */
@media (max-width: 900px) {
  :root { --alto: 44px; --alto-p: 44px; --alvo-link: 44px; --pad-main: 16px; --pad-topo: 20px; }
  body { display: block; background: var(--fundo); }
  .sidebar {
    position: static; height: auto; width: auto; flex-direction: row; align-items: center; flex-wrap: wrap;
    gap: var(--e-2) var(--e-3); padding: 6px 10px 6px var(--e-4);
  }
  .brand { padding: 0; font-size: var(--t-5); }
  .brand small, .sidebar .rodape, .sidebar nav a::before { display: none; }
  .mark { width: 32px; height: 32px; font-size: 17px; }
  .sidebar nav { margin: 0 0 0 auto; flex-direction: row; flex-wrap: wrap; gap: 2px; }  /* 4 itens a 320 px */  .sidebar nav a { min-height: 44px; padding: 0 12px; }
  main { max-width: none; padding: var(--pad-topo) var(--pad-main) 48px; }
  h1 { font-size: var(--t-7); }
  .page-header { margin-bottom: var(--e-5); }
  .card { padding: var(--e-4); }
  .form-linha, .campos, .editar-colecao, .form-colecao, .editar-colecao.form-colecao { grid-template-columns: 1fr; }
  .nova-cor { grid-template-columns: 1fr 1fr; }
  .nova-cor > button { grid-column: 1 / -1; }
  .insumo-topo, .novo-insumo-campos { grid-template-columns: 1fr 1fr; }
  button.selo::after, a.selo::after { inset: -13px -6px; }
  button.link, summary { min-height: 44px; }
  .insumo-topo > button.link { grid-column: 1 / -1; justify-self: end; min-height: 44px; }
  .novo-insumo-campos > label:first-child { grid-column: 1 / -1; }  /* LOGO RELEVO inteiro no select */
  .insumo-topo > * { order: 3; }
  .insumo-topo > .campo:nth-child(-n+2) { order: 1; }
  .insumo-topo > .nota-estimativa { order: 2; }
  .insumo-cores > li { grid-template-columns: minmax(0, 1fr) auto; }
  .insumo-cores > li > * { grid-column: 1 / -1; }
  .insumo-cores > li > :not(.cor-rotulo, .mp-caixa, input, .total) { grid-column: 1 / -1; }
  .insumo-cores > li > .cor-rotulo { grid-column: 1; grid-row: 1; }
  .insumo-cores > li > .total { grid-column: 2; grid-row: 1; }
  .insumo-topo > .total { justify-content: flex-end; }
  .insumo-cores .acoes-cor button.link { min-width: 44px; }  /* "Editar" tinha 40 px de largura (revisão do V-3) */
  .modelo { padding: var(--e-4); }
  .modelo:focus-within::after { display: none; }
  .fotos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lista-skus li { padding: 8px 10px; }
  #dica { display: none; }
  .toast { top: auto; bottom: max(12px, env(safe-area-inset-bottom)); right: 12px; left: 12px; max-width: none; }
  .brand, .eyebrow a { min-height: 44px; display: inline-flex; align-items: center; }
  .dialogo-acoes button { flex: 1 1 auto; }
  .cabecalho-colecao {
    position: static; margin: 0 0 var(--e-4); padding: 0 0 var(--e-4); background: none; backdrop-filter: none;
  }
  .mod-busca { flex: 1 1 100%; max-width: none; }
  .mod-grupo { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .mod-rot { display: none; }  /* o aria-labelledby continua lendo o rótulo */
  .mod-seg { flex: 1 1 auto; }
  .mod-seg button { flex: 1 1 auto; min-height: 44px; padding: 0 6px; }
  .mod-seg button small { display: none; }
  .mod-contagem { margin-left: 0; }
  .pai-topo { grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-areas: "foto nome n" "foto onde n" "foto cores cores"; gap: 4px 10px; }
  .pai-topo img, .pai-topo .sem-foto { grid-area: foto; width: 48px; height: 48px; align-self: start; }
  .pai-nome { grid-area: nome; } .pai-topo .onde { grid-area: onde; } .cores-resumo { grid-area: cores; } .pai-n { grid-area: n; }
  .pai.aberto .cores-resumo { display: none; }
  .grade-cores { grid-template-columns: 1fr 1fr; gap: 0 12px; }
  .grade-cores small { display: none; }  /* o SKU é a letra + o código do pai, que está no topo */
  .pai-acoes-novas { flex-direction: column; align-items: stretch; }
  .pai-acoes { flex-direction: column; align-items: stretch; }
  .pai-acoes .botao { min-height: 44px; }
  .tabela-filhos thead { display: none; }
  .tabela-filhos tr { display: grid; grid-template-columns: 30px auto minmax(0, 1fr); gap: 0 10px; padding: 6px 10px; border-bottom: 1px solid var(--linha-suave); }
  .tabela-filhos td { display: block; padding: 0; border: 0; }
  .tabela-filhos td.miniatura { grid-row: 1 / span 2; }
  .tabela-filhos td:nth-child(n+4) { grid-column: 2 / -1; font-size: var(--t-2); color: var(--texto-2); }
  .cabecalho-colecao { grid-template-columns: 1fr; }
  .cabecalho-colecao > .acoes-linha, .cabecalho-colecao > .acoes-csv { margin-top: 12px; }
  .sub-abas a { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .numeros-linha .editar-link { min-height: 44px; }
  html { scroll-padding-top: 0; }
  .barra > label:not(.inline), label.busca { flex: 1 1 100%; min-width: 0; }
  .barra > .muted:last-child { margin-left: 0; }

  /* Visão geral: cada linha vira um cartão (foto à esquerda, dados à direita) */
  .tabela { max-height: none; overflow: visible; background: none; border: 0; border-radius: 0; box-shadow: none; }
  table.tabela-vg, .tabela-vg tbody { display: block; width: 100%; }
  .tabela-vg thead { display: none; }
  .tabela-vg tr {
    display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px 12px; margin-bottom: 10px; padding: var(--e-3);
    background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--r-3); box-shadow: var(--sombra-1);
  }
  .tabela-vg td { display: block; min-width: 0; padding: 0; border: 0; white-space: normal; }
  tbody tr:hover td { background: none; }
  .tabela-vg td::before {
    content: attr(data-rotulo); display: block; margin-bottom: 1px;
    font-size: 10px; font-weight: 650; letter-spacing: .06em; color: var(--texto-2);
  }
  .tabela-vg td:nth-child(4) { grid-column: 1; grid-row: 1 / span 3; }
  .tabela-vg td:nth-child(4)::before { content: none; }
  .tabela-vg td:nth-child(3) { grid-column: 2; grid-row: 1; }
  .tabela-vg td:nth-child(6) { grid-column: 3; grid-row: 1; text-align: right; }
  .tabela-vg td:nth-child(5) { grid-column: 2 / -1; grid-row: 2; min-width: 0; font-weight: 500; }
  .tabela-vg td:nth-child(1) { grid-column: 2; grid-row: 3; white-space: normal; }
  .tabela-vg td:nth-child(2) { grid-column: 3; grid-row: 3; text-align: right; }
  .tabela-vg td:nth-child(7) { grid-column: 1 / -1; grid-row: 4; padding-top: 10px; border-top: 1px solid var(--linha-suave); }
  .tabela-vg td[colspan] { grid-column: 1 / -1; grid-row: auto; padding: 0; border: 0; }
  .tabela-vg td[colspan]::before { content: none; }
  .tabela-vg td.sku a { display: inline-flex; align-items: center; min-height: 44px; margin-block: -12px; font-size: var(--t-4); }
  td.miniatura img { width: 64px; height: 85px; }
  td.miniatura .sem { width: 64px; height: 85px; }

  /* Lista de tecidos: um cartão por MP; o "Onde é usada" abre embaixo */
  table.tabela-tec, .tabela-tec > tbody { display: block; width: 100%; }
  .tabela-tec > thead { display: none; }
  .tabela-tec > tbody > tr:not(.rastro) {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; margin-top: 10px; padding: var(--e-3);
    background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--r-3); box-shadow: var(--sombra-1);
  }
  .tabela-tec > tbody > tr > td { display: block; min-width: 0; padding: 0; border: 0; white-space: normal; }
  .tabela-tec > tbody > tr > td[data-rotulo]::before {
    content: attr(data-rotulo); display: block; margin-bottom: 1px; font-size: 10px; font-weight: 650; letter-spacing: .06em; color: var(--texto-2);
  }
  .tabela-tec td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .tabela-tec td.necessidade { grid-column: 2; grid-row: 1; text-align: right; font-size: var(--t-4); }
  .tabela-tec td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; font-weight: 500; }
  .tabela-tec td:nth-child(5) { grid-column: 1 / -1; grid-row: 4; }
  .tabela-tec td.acao { width: auto; }
  .tabela-tec tr.com-aviso td:first-child { box-shadow: none; }
  .tabela-tec tr.com-aviso { border-left: 3px solid var(--atencao-borda); }
  .tabela-tec > tbody > tr.rastro { display: block; margin-top: -4px; }
  .tabela-tec tr.rastro > td { display: block; padding: var(--e-3); border-radius: 0 0 var(--r-3) var(--r-3); }
  .tabela-rastro, .tabela-rastro tbody, .tabela-rastro tr, .tabela-rastro td { display: block; width: 100%; }
  .tabela-rastro thead { display: none; }
  .tabela-rastro tr { padding: 8px 0; border-bottom: 1px solid var(--linha-suave); }
  .tabela-rastro td { padding: 1px 0; background: none; border: 0; }
  .tabela-rastro td.numero { text-align: left; white-space: normal; }
  .tabela-rastro tbody td[data-rotulo]::before {
    content: attr(data-rotulo); display: block; font-size: 10px; font-weight: 650; letter-spacing: .06em; color: var(--texto-2);
  }
  .tabela-rastro tfoot tr { border-bottom: 0; }
  /* cartão curto: só a necessidade leva rótulo; o resto se entende pela posição; "conta completa" não ocupa linha */
  .tabela-tec > tbody > tr > td:not(.necessidade)[data-rotulo]::before { content: none; }
  .tabela-tec td.onde { grid-column: 1; grid-row: 3; align-self: center; text-align: left; color: var(--texto-2); font-size: var(--t-2); }
  .tabela-tec td.situacao.ok { display: none; }
  .tabela-tec td.acao { grid-column: 2; grid-row: 3; text-align: right; }
  .fora-da-soma a, .tabela-rastro a { display: inline-flex; align-items: center; min-height: 44px; }
  .acoes-csv { width: 100%; }
  .acoes-csv a.botao { flex: 1 1 140px; }
}

/* ------------------------------------------------------------------ BR-9: a imagem da coleção (topo do briefing) */
.capa-colecao { display: flex; align-items: center; gap: var(--e-4); max-width: 1040px; margin: 0 0 var(--e-4); }
.capa-colecao .capa-quadro { flex: none; width: 280px; aspect-ratio: 16 / 10; }
.capa-colecao .capa-texto { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.capa-colecao .capa-texto h2 { margin: 0; font-family: var(--fonte); font-size: var(--t-1); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--texto-2); }
.capa-colecao .capa-texto p { margin: 0; max-width: 52ch; font-size: var(--t-3); }
@media (max-width: 640px) {
  .capa-colecao { flex-direction: column; align-items: stretch; gap: var(--e-2); }
  .capa-colecao .capa-quadro { width: 100%; }
  .capa-colecao .capa-texto button.link { min-height: 44px; }
}

/* ------------------------------------------------------------------ BR-1: de onde veio o modelo novo */
.nota-copia { margin: -4px 0 var(--e-3); font-size: var(--t-2); }
.acoes-existente { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.acoes-existente button.link { font-size: var(--t-2); color: var(--texto-2); }
.acoes-existente button.link:hover:not(:disabled) { color: var(--texto); }

/* ------------------------------------------------------------------ BR-6: o croqui de cada cor, ao lado do nome */
.croqui-slot { display: inline-flex; flex: none; }
.croqui-cor {
  display: inline-grid; place-items: center; width: 32px; height: 40px; min-height: 0; padding: 0; overflow: hidden;
  border: 1.5px dashed var(--borda-forte); border-radius: 5px; background: var(--superficie-2); box-shadow: none;
  color: var(--texto-2); font-size: 9px; font-weight: 700; line-height: 1.1; text-align: center; cursor: pointer;
}
.croqui-cor:hover:not(:disabled), .croqui-cor.arrastando { border-color: var(--preto); background: var(--superficie-3); color: var(--texto); }
.croqui-cor.com-imagem { border-style: solid; border-color: var(--linha); background: var(--superficie); }
.croqui-cor.com-imagem:hover:not(:disabled) { border-color: var(--preto); background: var(--superficie); }
.croqui-cor img { width: 100%; height: 100%; object-fit: cover; }
.legenda-croqui { margin: -4px 0 8px; font-size: var(--t-2); }
/* BR-4: o tecido de outra base na lista do campo Cor (o servidor recusa): mais claro, ainda legível */
.lista-op [role="option"].fora-da-base b { color: var(--texto-2); font-weight: 600; }
.dica-acoes-existente { margin: 4px 0 0; font-size: var(--t-2); line-height: 1.45; }
@media (max-width: 640px) {
  /* o diálogo «Trazer modelo existente»: as duas ações embaixo do texto, na largura toda */
  .lista-existente li { grid-template-columns: 48px minmax(0, 1fr); }
  .acoes-existente { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .acoes-existente button.link { min-height: 44px; }
  /* a linha da cor no celular: 1ª linha SKU, croqui e nome; 2ª quantidade e situação; 3ª o Cancelar (sempre iguais) */
  .lista-skus > li:has(.croqui-slot) { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 10px; }
  .lista-skus > li:has(.croqui-slot) > .cor-foto { grid-column: 2; }
  .lista-skus > li:has(.croqui-slot) > .qtd-rotulo { grid-column: 1; }
  .lista-skus > li:has(.croqui-slot) > .selo { grid-column: 2; justify-self: end; margin-left: 0; }
  .lista-skus > li:has(.croqui-slot) > button { grid-column: 1 / -1; justify-self: start; }
  /* BR-7: os dois links (Cancelar SKU e Excluir de vez) numa linha própria, sem espremer a coluna da cor (revisão de design) */
  .lista-skus > li:has(.croqui-slot) > .acoes-sku { grid-column: 1 / -1; justify-self: start; margin-left: 0; gap: 2px 24px; }
  .lista-skus > li:has(.croqui-slot) > .detalhe { grid-column: 1 / -1; }
  /* as abas da coleção (agora quatro) numa linha só, com rolagem dentro delas */
  .cabecalho-colecao > .sub-abas { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .cabecalho-colecao > .sub-abas a { flex: none; }
  /* a imagem da coleção vazia não ocupa a tela do celular */
  .capa-colecao .capa-quadro:not(:has(img)) { aspect-ratio: auto; min-height: 96px; }
}
/* sem croqui: o mesmo ícone de imagem dos quadros de referência e croqui (o texto fica no title e no aria-label) */
.croqui-cor:not(.com-imagem)::before {
  content: ""; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--icone-imagem) center / contain no-repeat; mask: var(--icone-imagem) center / contain no-repeat;
}
.lista-skus .cor-croqui { overflow-wrap: break-word; }
@media (min-width: 901px) {
  /* a coluna da cor ganha a largura do quadrinho do croqui: o nome da cor não quebra no meio da palavra */
  .lista-skus:has(.croqui-slot) { grid-template-columns: max-content minmax(calc(10ch + 42px), 1fr) auto auto auto; }
}
@media (max-width: 640px) { .croqui-cor { width: 36px; height: 44px; } }

/* ------------------------------------------------------------------ BR-8: a coleção toda */
.capa-toda { max-width: 1040px; margin: 0 0 var(--e-4); }
.capa-toda.com-imagem img { display: block; max-width: 100%; max-height: 240px; border: 1px solid var(--linha); border-radius: var(--r-3);
  background: var(--superficie); object-fit: contain; }
.capa-toda .capa-vazia { margin: 0; font-size: var(--t-3); }
.barra-toda { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-2) var(--e-4); margin: 0 0 var(--e-4); }
.barra-toda .muted { font-size: var(--t-3); }
.grade-toda { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--e-4); }
.modelo-toda { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--superficie);
  border: 1px solid var(--linha); border-radius: var(--r-3); box-shadow: var(--sombra-1); transition: border-color .15s, box-shadow .15s; }
.modelo-toda:hover { border-color: var(--borda-forte); box-shadow: var(--sombra-2); }
.modelo-toda h2 a:focus-visible { outline: 2px solid var(--preto); outline-offset: 2px; border-radius: 2px; }
.modelo-toda .corpo-toda { flex: 1; }
.modelo-toda .total-toda { margin-top: auto; }
.cores-toda .cor-texto b { display: inline-flex; align-items: center; gap: 6px; }
.cores-toda .cor-texto b .amostra { width: 12px; height: 12px; }
.modelo-toda .foto-toda { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 5; background: var(--superficie-2);
  border-bottom: 1px solid var(--linha-suave); color: var(--texto-2); text-decoration: none; }
.modelo-toda .foto-toda:hover { background: var(--superficie-3); }
.modelo-toda .foto-toda img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--superficie); }
.modelo-toda .foto-toda .sem-foto { font-size: var(--t-2); }
.modelo-toda .foto-toda .rotulo { position: absolute; left: 8px; top: 8px; padding: 1px 8px; border-radius: var(--r-pilula);
  background: var(--veu-claro); box-shadow: var(--sombra-1); color: var(--texto); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; line-height: 18px; text-transform: uppercase; }
.modelo-toda .corpo-toda { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.modelo-toda h2 { margin: 0; font-size: var(--t-2); font-weight: 700; letter-spacing: .06em; color: var(--texto-2); }
.modelo-toda h2 a { color: inherit; text-decoration: none; }
.modelo-toda h2 a:hover { color: var(--texto); text-decoration: underline; }
.modelo-toda .nome { margin: 0; font-size: var(--t-4, 15px); font-weight: 650; color: var(--texto); overflow-wrap: anywhere; }
.modelo-toda .copia { margin: 0; font-size: var(--t-2); }
.cores-toda { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cores-toda li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: var(--t-3); }
.cores-toda .amostra { justify-self: center; width: 26px; height: 26px; }
.cores-toda .croqui-mini { width: 32px; height: 40px; object-fit: cover; border: 1px solid var(--linha); border-radius: 4px; background: var(--superficie); }
.cores-toda .cor-texto { display: flex; flex-direction: column; min-width: 0; }
.cores-toda .cor-texto b { font-weight: 650; overflow-wrap: anywhere; }
.cores-toda .cor-texto small { color: var(--texto-2); font-size: var(--t-2); overflow-wrap: anywhere; }
.cores-toda .qtd { color: var(--texto-2); font-variant-numeric: tabular-nums; }
.total-toda { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0; padding-top: 8px; border-top: 1px solid var(--linha-suave);
  color: var(--texto-2); font-size: var(--t-2); }
@media (max-width: 640px) {
  .grade-toda { grid-template-columns: 1fr; }
  .modelo-toda .foto-toda { aspect-ratio: 16 / 11; }
}
