/* =====================================================================
   Telas do sistema — padrão visual Metalprint (Inter, tinta escura, C/M/Y)
   Leitura confortável, alto contraste e visual delicado.
   ===================================================================== */
:root {
  /* Chumbo no lugar do preto; cores da impressão só como toque */
  --ink: #3B3E44; --ink2: #4A4E55; --ink3: #5A5F67;
  --paper: #F6F6F4; --white: #fff;
  --text: #3B3E44; --muted: #80858E; --line: #E4E5E8;
  --cyan: #00A9C9; --cyan-esc: #007C93; --magenta: #D6337F; --magenta-esc: #B0246A;
  --yellow: #F2B825; --green: #2E9E6E; --green-esc: #23805A; --red: #C8463D;
  --raio: 10px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--paper); color: var(--text); font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; font-weight: 400; font-feature-settings: 'ss01', 'cv11';
       line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--cyan-esc); font-weight: 500; }
a:hover { color: var(--magenta-esc); }
h1 { font-size: 1.55rem; line-height: 1.2; letter-spacing: -.025em; margin: 0 0 .4em; font-weight: 400; }
h2 { font-size: 1.08rem; margin: 0 0 .7em; font-weight: 500; letter-spacing: -.01em; }
h3 { font-size: 1rem; margin: 0 0 .5em; font-weight: 500; }
p { margin: 0 0 .8em; }
.mudo { color: var(--muted); }
.pequeno { font-size: .85rem; }

.faixa-cmy { height: 2px; background: linear-gradient(90deg, var(--cyan) 0 33.3%, var(--magenta) 33.3% 66.6%, var(--yellow) 66.6%); }
.cmy { display: inline-flex; gap: 5px; margin-right: 10px; vertical-align: middle; }
.cmy i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.cmy i:nth-child(1) { background: var(--cyan); } .cmy i:nth-child(2) { background: var(--magenta); } .cmy i:nth-child(3) { background: var(--yellow); }

/* ---------- Topo e menu (claro, numa linha só) ---------- */
.topo { background: #fff; border-bottom: 1px solid var(--line); }
.topo-in { max-width: 1680px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 28px; }
.marca { display: flex; align-items: center; flex: none; }
.marca img { height: 26px; }
.menu { display: flex; gap: 2px; align-items: center; flex: 1; min-width: 0; }
.menu a { color: var(--muted); text-decoration: none; padding: 7px 12px; border-radius: 6px; font-weight: 400; font-size: .9rem; white-space: nowrap; }
.menu a:hover { color: var(--ink); background: var(--paper); }
.menu a.ativo { color: var(--ink); box-shadow: inset 0 -1px 0 var(--magenta); border-radius: 0; }
.menu a.destaque { color: var(--magenta-esc); }
.quem { display: flex; gap: 14px; align-items: center; font-size: .85rem; flex: none; }
.quem a { color: var(--muted); font-weight: 400; text-decoration: none; }
.quem a:hover { color: var(--ink); }
@media (max-width: 900px) {
  .topo-in { flex-wrap: wrap; gap: 6px 16px; }
  .quem { margin-left: auto; }
  .menu { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -8px; }
  .menu::-webkit-scrollbar { display: none; }
}

.conteudo { max-width: 1280px; margin: 0 auto; padding: 24px 24px 72px; }
.conteudo.estreito { max-width: 860px; }
.conteudo.largo { max-width: 1680px; }

/* ---------- Avisos ---------- */
.aviso { padding: 10px 14px; border-radius: 6px; margin: 0 0 16px; font-weight: 400; font-size: .92rem; background: #fff;
  border: 1px solid var(--line); border-left: 2px solid var(--muted); color: var(--text); }
.aviso b { font-weight: 500; }
.aviso-ok { border-left-color: var(--green); }
.aviso-erro { border-left-color: var(--red); color: #8E2E27; }
.aviso-info { border-left-color: var(--cyan); }
.aviso-atencao { border-left-color: var(--yellow); }

/* ---------- Cartões e grades ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 24px; box-shadow: none; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-escuro { background: var(--ink); color: #fff; border: 0; }
.grade { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } html { font-size: 18px; } }

.cabecalho-pagina { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.cabecalho-pagina h1 { margin: 0; }
.olho { font-size: .7rem; font-weight: 400; letter-spacing: .18em; text-transform: uppercase; color: var(--magenta); margin-bottom: 6px; }

/* ---------- Botões ---------- */
.botao { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 18px;
  border-radius: 6px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font: inherit; font-weight: 400; font-size: .92rem; letter-spacing: .01em;
  text-decoration: none; cursor: pointer; line-height: 1.2; text-align: center; }
.botao:hover { background: var(--ink3); border-color: var(--ink3); color: #fff; }
.botao-primario { background: var(--ink); border-color: var(--ink); box-shadow: inset 0 -2px 0 var(--magenta); }
.botao-primario:hover { background: var(--ink2); border-color: var(--ink2); }
.botao-verde { background: var(--green-esc); border-color: var(--green-esc); }
.botao-verde:hover { background: #075C35; border-color: #075C35; }
.botao-claro { background: transparent; color: var(--ink); border-color: #D3D5DA; }
.botao-claro:hover { background: #fff; color: var(--ink); border-color: var(--ink3); }
.botao-perigo { background: transparent; color: var(--red); border-color: transparent; }
.botao-perigo:hover { background: #FDECEB; color: var(--red); border-color: var(--red); }
.botao-grande { min-height: 44px; font-size: .95rem; padding: 10px 22px; border-radius: 6px; font-weight: 400; }
.botao-pequeno { min-height: 30px; padding: 4px 10px; font-size: .82rem; border-radius: 5px; }
.botoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.botoes-fixos { position: sticky; bottom: 0; z-index: 20; background: rgba(245,247,251,.96); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line); padding: 10px 0; margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.botoes-fixos .total-rapido { margin-right: auto; font-weight: 500; font-size: 1.05rem; }

/* ---------- Formulários ---------- */
label { display: block; font-weight: 400; font-size: .85rem; margin: 0 0 5px; color: var(--muted); letter-spacing: .01em; }
.campo { margin-bottom: 14px; }
.dica { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=tel], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text); padding: 9px 12px; min-height: 42px; border: 1px solid #D9DBE0;
  border-radius: 6px; background: #fff; }
textarea { min-height: 100px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,184,217,.18); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--magenta); vertical-align: middle; margin: 0 8px 0 0; }
.check { display: inline-flex; align-items: center; font-weight: 400; font-size: .95rem; cursor: pointer; color: var(--text); }
input[type=color] { width: 64px; height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; }
input[type=file] { font: inherit; font-size: .95rem; }

/* Campo alterado em relação ao modelo */
.alterado-campo, input.alterado-campo, textarea.alterado-campo { border-color: #D9B44A !important; }
.selo { display: inline-block; font-size: .68rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; vertical-align: middle; }
.selo-alterado { background: transparent; color: #9A6F00; padding: 0 4px; letter-spacing: .04em; }
.selo-conferir { background: #FFE2EE; color: var(--magenta-esc); }
.selo-ok { background: #DDF5EA; color: var(--green-esc); }
.so-se-alterado { display: none; margin-left: 8px; }
.alterado .so-se-alterado { display: inline-block; }

/* ---------- Passos ---------- */
.passos { list-style: none; display: flex; padding: 0; margin: 0 0 20px; gap: 0; counter-reset: p; }
.passos li { flex: 1; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: transparent; border: 0; border-bottom: 1px solid var(--line); font-weight: 400; font-size: .88rem; color: var(--muted); }

.passos i { font-style: normal; width: 22px; height: 22px; font-size: .75rem; font-weight: 400; border-radius: 50%; display: grid; place-items: center; background: transparent; border: 1px solid #D3D5DA; flex: none; }
.passos .feito i { background: transparent; border-color: var(--cyan); color: var(--cyan-esc); }
.passos .feito { color: var(--text); }
.passos .agora { color: var(--ink); border-bottom: 1px solid var(--magenta); }
.passos .agora i { background: transparent; border-color: var(--magenta); color: var(--magenta); }
@media (max-width: 760px) { .passos span { font-size: .85rem; } .passos li { padding: 10px; } }

/* ---------- Opções grandes (escolher empresa, modelo, máquina) ---------- */
.opcoes { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.opcao { position: relative; display: block; cursor: pointer; margin: 0; }
.opcao input { position: absolute; opacity: 0; pointer-events: none; }
.opcao .caixa { display: flex; gap: 12px; align-items: center; height: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-weight: 400; }
.opcao .caixa img { width: 64px; height: 52px; object-fit: contain; flex: none; background: var(--paper); border-radius: 10px; }
.opcao .caixa b { display: block; font-size: .95rem; font-weight: 500; color: var(--text); }
.opcao .caixa small { display: block; color: var(--muted); font-weight: 400; font-size: .82rem; margin-top: 2px; }
.opcao:hover .caixa { border-color: #C6C9CF; }
.opcao input:checked + .caixa { border-color: var(--ink3); box-shadow: inset 3px 0 0 var(--magenta); background: #fff; }
.opcao input:focus-visible + .caixa { outline: 3px solid var(--cyan); outline-offset: 2px; }
.opcao .caixa .logo-emp { width: 96px; height: 36px; object-fit: contain; background: #fff; }

/* ---------- Tabelas de listagem ---------- */
.tabela-wrap { overflow-x: auto; }
table.lista { width: 100%; border-collapse: collapse; background: #fff; }
table.lista th { text-align: left; font-size: .7rem; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.lista td { padding: 11px 12px; border-bottom: 1px solid #E8ECF4; vertical-align: middle; font-size: .95rem; }
table.lista tr:hover td { background: #FAFBFE; }
table.lista .n { text-align: right; white-space: nowrap; }
.num-orc { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; font-size: .85rem; white-space: nowrap; color: var(--text); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #B9BDC4; }
.status-gerado::before { background: var(--cyan); }
.status-enviado::before { background: var(--yellow); }
.status-aprovado::before { background: var(--green); }
.status-perdido::before { background: var(--red); }
select.mudar-status { min-height: 32px; padding: 3px 8px; font-weight: 400; font-size: .85rem; width: auto; border-radius: 5px; }

/* ---------- Filtros ---------- */
.filtros { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filtros .campo { margin: 0; flex: 1 1 200px; }
.filtros .campo-busca { flex: 3 1 320px; }

/* ---------- Página inicial ---------- */
.atalhos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.atalho { display: block; padding: 20px 22px; border-radius: 14px; text-decoration: none; background: #fff; border: 1px solid var(--line); color: var(--text); box-shadow: none; }
.atalho b { display: block; font-size: 1.02rem; font-weight: 500; letter-spacing: -.01em; margin: 10px 0 2px; }
.atalho span { color: var(--muted); font-weight: 400; font-size: .9rem; }
.atalho .ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 400; background: transparent; border: 1px solid #BFE6EE; color: var(--cyan-esc); }
.atalho.novo { background: #fff; border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--magenta), 0 4px 16px rgba(15,23,60,.04); }

.atalho.novo .ic { border-color: #EDBBD2; color: var(--magenta); }
.atalho:hover { border-color: #C3CBDD; color: inherit; }

@media (max-width: 860px) { .atalhos { grid-template-columns: 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 22px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi b { display: block; font-size: 1.55rem; line-height: 1.1; font-weight: 300; letter-spacing: -.03em; margin-bottom: 6px; }
.kpi span { color: var(--muted); font-weight: 400; font-size: .85rem; }
.kpi { border-top: 2px solid var(--line); } .kpi.c { border-top-color: var(--cyan); } .kpi.m { border-top-color: var(--magenta); } .kpi.y { border-top-color: var(--yellow); } .kpi.g { border-top-color: var(--green); }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* ---------- Editor do orçamento ---------- */
.bloco-titulo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.bloco-titulo .n { width: 24px; height: 24px; border-radius: 50%; background: transparent; color: var(--magenta); border: 1px solid var(--magenta); display: grid; place-items: center; font-weight: 500; font-size: .85rem; flex: none; }
.bloco-titulo h2 { margin: 0; }

.busca-cliente { position: relative; }
.sugestoes { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: #fff; border: 1px solid var(--cyan); border-radius: 10px; margin-top: 4px;
  box-shadow: 0 16px 40px rgba(15,23,60,.18); max-height: 420px; overflow: auto; display: none; }
.sugestoes.aberta { display: block; }
.sugestoes button { display: block; width: 100%; text-align: left; font: inherit; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; }
.sugestoes button:hover, .sugestoes button:focus { background: var(--paper); outline: none; }
.sugestoes button b { display: block; font-weight: 500; }
.sugestoes button small { color: var(--muted); }
.cliente-escolhido { padding: 8px 12px; border-radius: 6px; background: #fff; border: 1px solid var(--line); border-left: 2px solid var(--cyan); margin-bottom: 14px; font-weight: 400; display: none; }
.cliente-escolhido.visivel { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

.item-ed { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #fff; }
.item-ed.opcional { border-style: dashed; background: #FCFCFE; }
.item-ed .linha { display: grid; grid-template-columns: minmax(0, 1fr) 100px 170px 160px; gap: 12px; align-items: end; }
.item-ed .total-item { font-weight: 500; font-size: 1rem; padding: 8px 0; text-align: right; }
.item-ed .inferior { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 14px; margin-top: 10px; }
.item-ed .foto-item { text-align: center; }
.item-ed .foto-item img { max-height: 120px; border-radius: 10px; background: var(--paper); }
.item-ed .acoes-item { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.item-ed textarea { min-height: 140px; font-size: .92rem; }
@media (max-width: 900px) { .item-ed .linha, .item-ed .inferior { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } .item-ed .linha > :first-child { grid-column: 1 / -1; } }

.resumo-totais { margin-left: auto; max-width: 460px; }
.resumo-totais table { width: 100%; border-collapse: collapse; }
.resumo-totais td { padding: 7px 6px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.resumo-totais .n { text-align: right; font-weight: 500; white-space: nowrap; }
.resumo-totais tr.total td { font-size: 1.15rem; font-weight: 400; border-bottom: 0; }
.resumo-totais input { max-width: 200px; margin-left: auto; text-align: right; }

.secao-ed { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.secao-ed.alterado { border-color: #E6CF8A; }
.secao-ed.desligada { opacity: .55; background: var(--paper); }
.secao-ed .topo-secao { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.secao-ed .topo-secao .num-sec { width: 24px; height: 24px; border-radius: 50%; background: transparent; color: var(--magenta); border: 1px solid #E9B7CF; display: grid; place-items: center; font-weight: 500; font-size: .8rem; flex: none; }
.secao-ed .topo-secao input[type=text] { flex: 1 1 260px; font-weight: 500; }
.secao-ed .auto { color: var(--muted); font-size: .85rem; background: var(--paper); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.secao-ed textarea { min-height: 90px; }

.soltar { position: relative; display: block; border: 1.5px dashed #C9CDD4; border-radius: 12px; padding: 22px; text-align: center; cursor: pointer;
  background: #FAFAF8; margin: 0 0 16px; transition: border-color .15s, background .15s; }
.soltar:hover, .soltar.sobre { border-color: var(--cyan); background: #F1FAFC; }
.soltar.enviando { opacity: .7; }
.soltar input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.soltar-t { display: block; font-weight: 500; color: var(--ink); }
.soltar-s { display: block; font-size: .85rem; color: var(--muted); margin-top: 2px; }
.soltar-status { display: block; font-size: .85rem; color: var(--cyan-esc); margin-top: 6px; }
.galeria-ed { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.img-ed { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.img-ed.eh-capa { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(0,169,201,.15); }
.img-ed-foto { position: relative; }
.img-ed-foto img { width: 100%; height: 120px; object-fit: contain; background: var(--paper); border-radius: 8px; display: block; }
.img-ed-selo { display: none; position: absolute; top: 6px; left: 6px; background: var(--cyan-esc); color: #fff; font-size: .7rem; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.img-ed.eh-capa .img-ed-selo { display: inline-block; }
.img-ed-pos { display: flex; background: var(--paper); border-radius: 8px; padding: 3px; gap: 3px; }
.img-ed-pos label { flex: 1; margin: 0; text-align: center; font-size: .85rem; padding: 5px 0; border-radius: 6px; cursor: pointer; color: var(--muted); }
.img-ed-pos input { position: absolute; opacity: 0; width: 0; height: 0; }
.img-ed-pos label:has(input:checked) { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.img-ed input[type=text], .img-ed select { min-height: 36px; padding: 6px 10px; font-size: .88rem; }
.img-ed-rot { font-size: .78rem; margin: 0 0 -4px; }
.img-ed-acoes { display: flex; gap: 4px; align-items: center; }

.ajuda { background: transparent; border-left: 1px solid var(--cyan); padding: 4px 14px; margin-bottom: 16px; color: var(--muted); font-size: .88rem; }
.ajuda code { background: #fff; padding: 2px 6px; border-radius: 6px; font-size: .9em; }

/* ---------- Revisão ---------- */
.revisao-barra { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.legenda-alt { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; font-size: .9rem; color: var(--muted); }
.legenda-alt i { width: 22px; height: 14px; background: #FFF3B0; outline: 2px solid var(--yellow); border-radius: 3px; display: inline-block; }
.fundo-folha { background: #E4E8F1; padding: 24px 12px; border-radius: 14px; }
@media (max-width: 860px) { .fundo-folha { padding: 0; background: none; } }

/* ---------- Login ---------- */
.tela-login { min-height: 100vh; display: grid; place-items: center; background: var(--paper); position: relative; overflow: hidden; padding: 24px; }
.tela-login::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 92% 6%, rgba(0,169,201,.10), transparent 30%),
  radial-gradient(circle at 6% 96%, rgba(214,51,127,.08), transparent 30%); }
.tela-login .card { position: relative; width: 100%; max-width: 420px; padding: 30px; }
.tela-login .logo-login { display: block; max-height: 48px; margin: 0 auto 18px; }
.tela-login + .faixa-cmy { display: none; }
body.login .faixa-cmy { position: fixed; top: 0; left: 0; right: 0; z-index: 2; }
body.login .conteudo { padding: 0; max-width: none; }

/* ---------- Catálogo ---------- */
.produto-linha img { width: 70px; height: 56px; object-fit: contain; background: var(--paper); border-radius: 8px; }
.vazio { text-align: center; padding: 40px; color: var(--muted); }

/* ---------- Importação ---------- */
.import-secao { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #fff; }
.import-secao.marcada { border-color: var(--cyan); }
.import-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.import-imgs label { border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; font-weight: 400; cursor: pointer; }
.import-imgs img { height: 110px; object-fit: contain; width: 100%; }
.import-imgs input:checked + span { color: var(--magenta-esc); }

.oculto { display: none !important; }
@media print { .topo, .menu, .botoes-fixos, .faixa-cmy, .revisao-barra, .aviso { display: none !important; } .fundo-folha { background: none; padding: 0; } }

/* ---------- Celular ---------- */
@media (max-width: 640px) {
  html { font-size: 15px; }
  .conteudo { padding: 16px 14px 56px; }
  .topo-in { padding: 8px 14px; }
  .marca img { height: 22px; }
  .menu a { padding: 6px 10px; font-size: .86rem; }
  h1 { font-size: 1.35rem; }
  .passos li { min-width: 0; padding: 7px 8px; gap: 6px; font-size: .78rem; }
  .passos span { line-height: 1.2; overflow-wrap: anywhere; }
  .passos i { width: 22px; height: 22px; font-size: .72rem; }
  .item-ed .linha, .item-ed .inferior { grid-template-columns: minmax(0, 1fr); }
  .botoes-fixos { justify-content: flex-end; }
  .botoes-fixos .total-rapido { flex-basis: 100%; font-size: .95rem; }
  .card { padding: 16px; border-radius: 12px; }
  .grade[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  table.lista th, table.lista td { padding: 8px 6px; }
  .atalho { padding: 16px; }
  .cabecalho-pagina { margin-bottom: 16px; }
}
input[type=file] { max-width: 100%; }

/* ---------- Editor com prévia ao lado ---------- */
.editor-duplo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 24px; align-items: start; }
.editor-previa { position: sticky; top: 12px; height: calc(100vh - 24px); display: flex; flex-direction: column;
  background: #E9ECF3; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.previa-barra { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; font-size: .82rem; font-weight: 500;
  color: var(--muted); letter-spacing: .02em; border-bottom: 1px solid var(--line); background: #F3F5F9; }
.previa-area { flex: 1; overflow: auto; padding: 12px; }
.previa-area .doc-tela { box-shadow: 0 6px 24px rgba(15,23,60,.10); margin: 0 auto; }
.so-estreito { display: none !important; }
@media (max-width: 1100px) {
  .editor-duplo { grid-template-columns: minmax(0, 1fr); }
  .editor-previa { display: none; }
  .so-estreito { display: inline-flex !important; }
  body.previa-aberta .editor-previa { display: flex; position: fixed; inset: 0; top: 0; height: 100vh; z-index: 100; border-radius: 0; }
}

/* ---------- Biblioteca de imagens ---------- */
.biblio-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.biblio-item { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.biblio-foto { height: 130px; display: flex; align-items: center; justify-content: center; border: 1px solid #ECE9E3; border-radius: 8px; background: #fff; }
.biblio-foto img { max-height: 118px; max-width: 92%; object-fit: contain; }
.biblio-item input, .biblio-item select { min-height: 36px; padding: 6px 10px; font-size: .88rem; }

.modal { border: 0; border-radius: 16px; padding: 22px; width: min(960px, 94vw); max-height: 88vh; box-shadow: 0 30px 80px rgba(20,22,30,.25); }
.modal::backdrop { background: rgba(40,42,48,.45); }
.modal-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-cab h2 { margin: 0; font-size: 1.4rem; font-weight: 400; }
.it-tela { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; color: var(--cyan-esc); font-size: 1.15em; }
.bib-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; max-height: 52vh; overflow: auto; padding: 2px; }
.bib-item { display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer; }
.bib-item:hover { border-color: #C6C9CF; }
.bib-item.marcada { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,169,201,.18); }
.bib-foto { height: 104px; display: flex; align-items: center; justify-content: center; border: 1px solid #ECE9E3; border-radius: 8px; background: #fff; }
.bib-foto img { max-height: 94px; max-width: 92%; object-fit: contain; }
.bib-nome { font-size: .88rem; color: var(--ink); }
.bib-cat { font-size: .75rem; color: var(--muted); }
.modal-rod { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 16px; }
.modal-rod .mudo { margin-right: auto; }

.opcao-botao { font: inherit; border: 0; padding: 0; background: none; text-align: left; }
.opcao-botao:hover .caixa { border-color: var(--cyan); }

/* Versão atualizada (revisão) */
.selo-versao { background: #FDF4DA; color: #8A6400; }
.selo-substituida { white-space: nowrap; background: #F1F0EC; color: #8A8F98; }
.card-versao { border-color: #F1E3B8; }
.mud-auto { background: #FBFAF7; border: 1px solid var(--linha, #ECE9E3); border-radius: 10px; padding: 12px 14px; }
.mud-auto ul { list-style: none; margin: 8px 0 10px; padding: 0; }
.mud-auto li { position: relative; padding: 3px 0 3px 22px; font-size: .92rem; }
.mud-auto li::before { position: absolute; left: 0; top: 4px; width: 15px; height: 15px; border-radius: 50%; font-size: 11px; line-height: 15px; text-align: center; }
.mud-auto li.mud-mais::before { content: "+"; background: #E3F5F9; color: #00748C; }
.mud-auto li.mud-menos::before { content: "−"; background: #FBE9F1; color: #A8235F; }
.mud-auto li.mud-alt::before { content: "↻"; background: #FDF4DA; color: #8A6400; }

/* ---------- Painel do início ---------- */
.painel-numeros { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.pn { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 15px; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; color: var(--text); text-decoration: none; font-weight: 400; }
.pn-ico { grid-row: span 1; line-height: 0; }
.pn-ico .ico { width: 34px !important; height: 34px !important; }
.pn-rot { color: var(--muted); font-size: .85rem; }
.pn b { grid-column: 1 / -1; display: block; font-size: 1.75rem; font-weight: 300; letter-spacing: -.03em; line-height: 1.1; margin: 14px 0 4px; font-variant-numeric: tabular-nums; }
.pn small { grid-column: 1 / -1; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.pn-link:hover { border-color: #C3CBDD; color: var(--text); }
.painel-grade { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 14px; }
.painel-grade > .card { margin-bottom: 14px; }
.pg-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pg-cab h2 { margin-bottom: .15em; }
.legenda { display: flex; gap: 16px; font-size: .82rem; color: var(--ink2); padding-top: 3px; }
.legenda i, .g-dica i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.grafico { position: relative; margin-top: 10px; }
.grafico svg { display: block; width: 100%; height: auto; overflow: visible; }
.grafico .eixo { font: 400 11px Inter, system-ui, sans-serif; fill: var(--muted); font-variant-numeric: tabular-nums; }
.grafico .eixo.atual { fill: var(--ink); font-weight: 500; }
.grafico .mes { cursor: default; }
.grafico .mes .alvo { transition: fill .12s; }
.grafico .mes.ativo .alvo { fill: rgba(59,62,68,.045); }
.g-dica { position: absolute; top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(30,32,36,.08); padding: 8px 11px; font-size: .8rem; color: var(--ink2); white-space: nowrap; pointer-events: none; z-index: 2; }
.g-dica b { display: block; font-weight: 500; color: var(--ink); margin-bottom: 3px; text-transform: capitalize; }
.g-dica span { display: block; }
.g-dica em { font-style: normal; font-weight: 500; color: var(--ink); margin-left: 6px; font-variant-numeric: tabular-nums; }
.g-dica .v { color: var(--muted); margin-top: 2px; }
.barras-h { list-style: none; margin: 14px 0 0; padding: 0; }
.barras-h li > a, .barras-h li { color: var(--text); text-decoration: none; font-weight: 400; }
.barras-h li > a, .barras-h.maquinas li { display: grid; grid-template-columns: 7.2rem 1fr 4.6rem; gap: 12px; align-items: center; padding: 7px 0; }
.barras-h.maquinas li { grid-template-columns: minmax(0, 9rem) 1fr 4.6rem; }
.barras-h li + li { border-top: 1px solid #F1F0ED; }
.barras-h li > a:hover .bh-barra { background: var(--ink); }
.bh-rot { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-trilho { height: 6px; border-radius: 3px; background: #F1F0ED; overflow: hidden; }
.bh-barra { display: block; height: 100%; border-radius: 3px; background: var(--ink3); }
.bh-num { text-align: right; line-height: 1.15; font-variant-numeric: tabular-nums; }
.bh-num b { font-weight: 500; font-size: .95rem; }
.bh-num small { display: block; color: var(--muted); font-size: .74rem; }
.seguir { list-style: none; margin: 12px 0 8px; padding: 0; }
.seguir li { display: grid; grid-template-columns: 3.2rem 1fr auto auto; gap: 14px; align-items: center; padding: 10px 0; }
.seguir li + li { border-top: 1px solid #F1F0ED; }
.sg-dias { width: 3.2rem; height: 3.2rem; border-radius: 50%; border: 1px solid #F3DDA0; display: grid; place-content: center; text-align: center; line-height: 1; }
.sg-dias b { font-weight: 400; font-size: 1.05rem; color: #8A6400; }
.sg-dias small { font-size: .66rem; color: var(--muted); }
.sg-dias.forte { border-color: #EDBBD2; } .sg-dias.forte b { color: #A8235F; }
.sg-quem { min-width: 0; line-height: 1.35; }
.sg-quem b { font-weight: 500; display: block; }
.sg-quem small { display: block; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-valor { font-variant-numeric: tabular-nums; font-size: .9rem; white-space: nowrap; }
@media (max-width: 1000px) { .painel-grade { grid-template-columns: 1fr; } .painel-numeros { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) {
  .painel-numeros { grid-template-columns: 1fr; }
  .seguir li { grid-template-columns: 3.2rem 1fr; }
  .sg-valor { grid-column: 2; } .seguir li .botao { grid-column: 2; justify-self: start; }
}
.numero-editavel { display: flex; align-items: center; gap: 8px; }
.numero-editavel input { width: 7.5rem; font-variant-numeric: tabular-nums; }
.numero-editavel input[readonly] { background: var(--paper); color: var(--ink2); }
.grafico-vazio { position: absolute; inset: 0 0 30px 30px; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: .92rem; pointer-events: none; }
.amostra-titulo { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.amostra-titulo small { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 2px; }
.amostra-titulo span { font-family: 'Instrument Serif', Georgia, serif; font-size: 1.6rem; line-height: 1.15; color: var(--ink); }
.amostra-titulo .it { font-style: italic; }
.dica.dica-alerta { color: var(--magenta-esc); }
.card-notas { background: #FFFDF6; border-color: #F1E6C4; }
.n-cadeado { display: inline-grid; place-items: center; border-color: #F3DDA0 !important; background: #FDF4DA; }
.n-cadeado .ico { width: 15px !important; height: 15px !important; }
.nota-chip { display: inline-block; margin-top: 4px; font-size: .75rem; color: #8A6400; background: #FDF4DA; border-radius: 4px; padding: 1px 7px; cursor: help; }
.ola-login { font-size: 1.05rem; margin: 4px 0 14px; }
.ola-login b { font-weight: 500; }
.senha-grande { font-size: 1.6rem !important; letter-spacing: .35em; text-align: center; padding: 12px !important; }
.outro-login { text-align: center; margin: 16px 0 0; font-size: .9rem; }
.outro-login a { color: var(--muted); font-weight: 400; }
.desconto-campo { display: inline-flex; gap: 6px; align-items: center; }
.desconto-campo input { width: 9rem; text-align: right; }
.desconto-campo select { width: auto; padding-right: 26px; }
.linha-desc-texto td { padding-top: 4px; }
.fotos-extras { margin-top: 12px; text-align: left; }
.extras-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin-bottom: 6px; }
.extras-lista .extra { display: block; margin: 0; text-align: center; font-size: .72rem; color: var(--muted); }
.extras-lista img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.extras-lista .extra span { display: inline-flex; gap: 3px; align-items: center; }
.resumo-totais #desconto_texto { width: 100%; max-width: none; text-align: left; }
