/* Serigrafia Online — app. Mobile primeiro; tema claro com escuro automático. */
:root {
  --fundo: #f4f5f7;
  --superficie: #ffffff;
  --superficie-2: #f8fafc;
  --borda: #e2e8f0;
  --texto: #0f172a;
  --texto-2: #475569;
  --texto-3: #64748b;
  --marca: #e6007e;
  --marca-forte: #c0006a;
  --marca-texto: #ffffff;
  --marca-suave: #fde7f2;
  --escuro: #111827;
  --ok: #15803d;
  --ok-fundo: #dcfce7;
  --aviso: #a16207;
  --aviso-fundo: #fef3c7;
  --erro: #b91c1c;
  --erro-fundo: #fee2e2;
  --info: #1d4ed8;
  --info-fundo: #dbeafe;
  --raio: 14px;
  --sombra: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --topo-h: 56px;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #0b1120;
    --superficie: #131c2e;
    --superficie-2: #0f172a;
    --borda: #24324a;
    --texto: #e5e7eb;
    --texto-2: #b6c2d4;
    --texto-3: #8796ad;
    --ok: #4ade80; --ok-fundo: #052e1a;
    --aviso: #facc15; --aviso-fundo: #3a2c05;
    --erro: #f87171; --erro-fundo: #3b0d0d;
    --info: #93c5fd; --info-fundo: #0c2347;
    --marca-suave: #3b0a24;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fundo); color: var(--texto);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  min-height: 100vh;
}
body.deslogado { padding-bottom: 0; }
body.deslogado .nav-baixo, body.deslogado .topo { display: none; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
.sutil { color: var(--texto-3); font-size: .9em; }
.pequeno { font-size: .85em; }
.forte { font-weight: 700; }
.direita { text-align: right; }
.centro { text-align: center; }
.oculto { display: none !important; }
hr { border: 0; border-top: 1px solid var(--borda); margin: 16px 0; }

/* Topo e navegação */
.topo {
  position: sticky; top: 0; z-index: 30; height: calc(var(--topo-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0; display: flex; align-items: center; justify-content: space-between;
  background: var(--escuro); color: #fff;
}
.marca { display: flex; align-items: center; gap: 8px; font-weight: 800; text-decoration: none; font-size: 1.05rem; }
.marca-ico { position: relative; display: inline-block; width: 30px; height: 30px; border-radius: 8px; background: #1f2937; flex: none; }
.marca-ico i { position: absolute; width: 14px; height: 14px; border-radius: 50%; mix-blend-mode: screen; opacity: .95; }
.marca-ico i:nth-child(1) { background: #00aeef; left: 5px; top: 6px; }
.marca-ico i:nth-child(2) { background: #e6007e; left: 11px; top: 6px; }
.marca-ico i:nth-child(3) { background: #ffd600; left: 8px; top: 11px; }
.sync { font-size: .78rem; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .1); }
.sync.off { background: #7c2d12; }
.sync.andando { opacity: .8; }
.sync:empty { display: none; }
.nav-baixo {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--superficie); border-top: 1px solid var(--borda);
}
.nav-baixo a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--texto-3); font-size: .75rem; font-weight: 600;
}
.nav-baixo a span { font-size: 1.25rem; line-height: 1; filter: grayscale(1); opacity: .7; }
.nav-baixo a.ativo { color: var(--texto); }
.nav-baixo a.ativo span { filter: none; opacity: 1; }
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .nav-baixo { position: sticky; top: calc(var(--topo-h) + env(safe-area-inset-top)); height: 48px; justify-content: center; gap: 8px; padding: 0; }
  .nav-baixo a { flex: 0 0 auto; flex-direction: row; gap: 8px; padding: 0 18px; font-size: .9rem; }
  .nav-baixo a.ativo { box-shadow: inset 0 -3px 0 var(--marca); }
}

.faixa { padding: 10px 16px; font-size: .9rem; text-align: center; }
.faixa a { font-weight: 700; }
.faixa.aviso { background: var(--aviso-fundo); color: var(--aviso); }
.faixa.erro { background: var(--erro-fundo); color: var(--erro); }
.faixa.ok { background: var(--ok-fundo); color: var(--ok); }

.conteudo { max-width: 980px; margin: 0 auto; padding: 16px; }
.tela { animation: entrar .18s ease-out; }
@keyframes entrar { from { opacity: 0; transform: translateY(4px); } }

/* Cartões e layout */
.cartao { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 16px; box-shadow: var(--sombra); margin-bottom: 14px; }
.cartao > h2:first-child, .cartao > h3:first-child { margin-top: 0; }
.cartao.plano { box-shadow: none; }
.cabecalho { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cabecalho h1 { margin: 0; }
.linha { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.linha.espaco { justify-content: space-between; }
.grade { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grade-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grade-3 { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .grade-3 { grid-template-columns: 1fr 1fr; } }
.pilha > * + * { margin-top: 12px; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  border-radius: 10px; border: 1px solid var(--borda); background: var(--superficie); color: var(--texto);
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--texto-3); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primario { background: var(--marca); border-color: var(--marca); color: var(--marca-texto); }
.btn.primario:hover { background: var(--marca-forte); border-color: var(--marca-forte); }
.btn.escuro { background: var(--escuro); border-color: var(--escuro); color: #fff; }
.btn.perigo { background: var(--erro); border-color: var(--erro); color: #fff; }
.btn.secundario { background: var(--superficie-2); }
.btn.fantasma { background: transparent; border-color: transparent; }
.btn.pequeno { min-height: 34px; padding: 6px 12px; font-size: .88rem; }
.btn.bloco { width: 100%; }
.btn.grande { min-height: 52px; font-size: 1.05rem; }
button.icone { background: none; border: 0; color: inherit; font-size: 1.1rem; cursor: pointer; padding: 6px 8px; border-radius: 8px; min-width: 36px; min-height: 36px; }
button.icone:hover { background: var(--superficie-2); }
.fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 25; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); border-radius: 99px; padding: 0 22px; }
@media (min-width: 900px) { .fab { bottom: 24px; } }

/* Campos */
.campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.campo > span, .campo > label { font-size: .82rem; font-weight: 650; color: var(--texto-2); }
.campo small { color: var(--texto-3); font-size: .78rem; }
input, select, textarea {
  font: inherit; color: var(--texto); background: var(--superficie); border: 1px solid var(--borda);
  border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--marca); outline-offset: 0; border-color: var(--marca); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--marca-forte); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check span { font-size: .92rem; }
.contador { display: flex; align-items: stretch; border: 1px solid var(--borda); border-radius: 10px; overflow: hidden; background: var(--superficie); }
.contador button { width: 44px; border: 0; background: var(--superficie-2); font-size: 1.2rem; cursor: pointer; color: var(--texto); }
.contador input { border: 0; border-radius: 0; text-align: center; min-width: 0; }
.erro-campo { color: var(--erro); font-size: .85rem; min-height: 1em; }
.sufixo { position: relative; }
.sufixo input { padding-right: 44px; }
.sufixo::after { content: attr(data-sufixo); position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--texto-3); font-size: .85rem; pointer-events: none; }

/* Abas */
.abas { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 0 16px; border-bottom: 1px solid var(--borda); position: sticky; top: calc(var(--topo-h) + env(safe-area-inset-top)); background: var(--fundo); z-index: 20; }
@media (min-width: 900px) { .abas { top: calc(var(--topo-h) + 48px + env(safe-area-inset-top)); } }
.abas::-webkit-scrollbar { display: none; }
.abas a { padding: 12px 12px; text-decoration: none; color: var(--texto-3); font-weight: 650; white-space: nowrap; border-bottom: 3px solid transparent; font-size: .92rem; }
.abas a.ativo { color: var(--texto); border-bottom-color: var(--marca); }
.abas a .num { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--superficie-2); font-size: .75rem; margin-left: 4px; border: 1px solid var(--borda); }

/* Selos */
.selo { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: var(--superficie-2); color: var(--texto-2); border: 1px solid var(--borda); white-space: nowrap; }
.selo.ok { background: var(--ok-fundo); color: var(--ok); border-color: transparent; }
.selo.aviso { background: var(--aviso-fundo); color: var(--aviso); border-color: transparent; }
.selo.erro { background: var(--erro-fundo); color: var(--erro); border-color: transparent; }
.selo.info { background: var(--info-fundo); color: var(--info); border-color: transparent; }
.selo.marca { background: var(--marca); color: var(--marca-texto); border-color: transparent; }
.fase { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 5px; border-radius: 6px; color: #fff; font-size: .72rem; font-weight: 800; }
.fase.A { background: var(--fase-a); } .fase.B { background: var(--fase-b); } .fase.C { background: var(--fase-c); }

/* Indicadores */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--superficie); border: 1px solid var(--borda); border-radius: 12px; padding: 12px 14px; }
.kpi b { display: block; font-size: 1.35rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .78rem; color: var(--texto-3); font-weight: 600; }

/* Listas */
.lista { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--superficie); border: 1px solid var(--borda); border-radius: 12px; text-decoration: none; margin-bottom: 8px; }
.item:hover { border-color: var(--texto-3); }
.item .icone-grande { font-size: 1.6rem; width: 44px; height: 44px; display: grid; place-items: center; background: var(--superficie-2); border-radius: 10px; flex: none; }
.item .meio { flex: 1; min-width: 0; }
.item .titulo { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { font-size: .84rem; color: var(--texto-3); }

/* Avisos */
.avisos { list-style: none; padding: 0; margin: 0 0 14px; }
.avisos li { padding: 10px 12px; border-radius: 10px; margin-bottom: 6px; font-size: .9rem; display: flex; gap: 8px; }
.avisos li.erro { background: var(--erro-fundo); color: var(--erro); }
.avisos li.alerta { background: var(--aviso-fundo); color: var(--aviso); }
.avisos li.info { background: var(--info-fundo); color: var(--info); }

/* Tabelas */
.tabela-rolagem { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.tabela { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.tabela th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--texto-3); padding: 8px; border-bottom: 1px solid var(--borda); white-space: nowrap; }
.tabela td { padding: 10px 8px; border-bottom: 1px solid var(--borda); vertical-align: top; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela td.num, .tabela th.num { text-align: right; white-space: nowrap; }
.tabela tfoot td { font-weight: 800; border-top: 2px solid var(--borda); }
.tabela tr.grupo td { background: var(--superficie-2); font-weight: 750; font-size: .8rem; color: var(--texto-2); }
.tabela input { min-height: 36px; padding: 6px 8px; }

/* Estados */
.carregando { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 16px; color: var(--texto-3); }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: gira .7s linear infinite; display: inline-block; }
.spinner.pequeno { width: 14px; height: 14px; }
@keyframes gira { to { transform: rotate(360deg); } }
.vazio { text-align: center; padding: 40px 16px; color: var(--texto-2); }
.vazio .grande { font-size: 3rem; }

/* Toast e modal */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60; background: var(--escuro); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: .92rem; max-width: calc(100% - 32px); transition: .2s; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.toast.mostrar { opacity: 1; transform: translate(-50%, 0); }
.toast.erro { background: #991b1b; }
.toast.aviso { background: #854d0e; }
.modal-fundo { position: fixed; inset: 0; z-index: 50; background: rgba(2, 6, 23, .55); display: flex; align-items: flex-end; justify-content: center; overflow-y: auto; padding: 16px 0 0; }
@media (min-width: 640px) { .modal-fundo { align-items: center; padding: 24px; } }
.modal { background: var(--superficie); width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; animation: subir .2s ease-out; margin: auto auto 0; }
@media (min-width: 640px) { .modal { border-radius: 18px; margin: auto; } }
.modal.largo { max-width: 760px; }
@keyframes subir { from { transform: translateY(24px); opacity: .5; } }
.modal-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-topo h2 { margin: 0; }
.modal-acoes { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.modal-acoes .btn { flex: 1 1 auto; }
@media (min-width: 640px) { .modal-acoes .btn { flex: 0 0 auto; } }

/* Telas de entrada */
.entrada { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.entrada .caixa { width: 100%; max-width: 400px; }
.entrada .logo-grande { display: flex; align-items: center; gap: 10px; justify-content: center; font-weight: 800; font-size: 1.4rem; margin-bottom: 20px; }
.entrada .logo-grande .marca-ico { width: 40px; height: 40px; border-radius: 10px; }
.entrada .logo-grande .marca-ico i { width: 19px; height: 19px; }
.entrada .logo-grande .marca-ico i:nth-child(1) { left: 6px; top: 8px; }
.entrada .logo-grande .marca-ico i:nth-child(2) { left: 15px; top: 8px; }
.entrada .logo-grande .marca-ico i:nth-child(3) { left: 10.5px; top: 15px; }

.preco-grande { font-size: 2.4rem; font-weight: 850; line-height: 1; }
.preco-grande small { font-size: 1rem; font-weight: 600; color: var(--texto-3); }
.beneficios { list-style: none; padding: 0; margin: 12px 0; }
.beneficios li { padding: 6px 0 6px 28px; position: relative; }
.beneficios li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 900; }

.total-linha { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--borda); }
.total-linha.final { border-bottom: 0; font-size: 1.25rem; font-weight: 850; padding-top: 12px; }
.logo-preview { max-width: 160px; max-height: 80px; object-fit: contain; background: #fff; border-radius: 8px; padding: 6px; border: 1px solid var(--borda); }

/* Ajustes depois do teste visual */
body { overflow-x: clip; }
.selo.bloco { white-space: normal; display: flex; border-radius: 10px; padding: 8px 12px; }
.grade > .btn { white-space: normal; text-align: center; line-height: 1.25; }
@media (min-width: 900px) {
  .nav-baixo { position: fixed; top: env(safe-area-inset-top); left: 50%; transform: translateX(-50%); width: auto; height: var(--topo-h); background: transparent; border: 0; z-index: 31; }
  .nav-baixo a { color: #94a3b8; }
  .nav-baixo a.ativo { color: #fff; }
  .abas { top: calc(var(--topo-h) + env(safe-area-inset-top)); }
}
@media (max-width: 480px) { .so-largo { display: none; } }

/* Chips (filtros, grupos do catálogo, tags) */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; flex-wrap: nowrap; }
.chips::-webkit-scrollbar { display: none; }
.pilha .chips:has(input) { flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--borda); background: var(--superficie); color: var(--texto-2); font: inherit; font-size: .85rem; font-weight: 650; cursor: pointer; }
.chip.ativo { background: var(--escuro); color: #fff; border-color: var(--escuro); }
@media (prefers-color-scheme: dark) { .chip.ativo { background: var(--marca); color: var(--marca-texto); border-color: var(--marca); } }
.chip input[type=checkbox] { width: 16px; height: 16px; }
.chip:has(input:checked) { border-color: var(--marca-forte); background: var(--marca-suave); color: var(--texto); }
.lista-escolha { max-height: 52vh; overflow-y: auto; }


/* Tela larga (quadro): usa a largura toda */
body.largo .conteudo { max-width: none; }

/* Tags */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: .72rem; font-weight: 750; color: #fff; background: var(--cor, #64748b); white-space: nowrap; line-height: 1.5; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.bolinha { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--cor, #64748b); flex: none; }
.chip.tag-chip.ativo { background: var(--cor); border-color: var(--cor); color: #fff; }

/* Quadro (kanban) */
.quadro-barra { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.quadro-barra input[type=search] { flex: 1 1 220px; max-width: 360px; }
.quadro { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; scroll-snap-type: x proximity; margin: 0 -16px; padding: 0 16px 16px; }
.kcol { flex: 0 0 300px; scroll-snap-align: start; background: var(--superficie-2); border: 1px solid var(--borda); border-radius: 14px; display: flex; flex-direction: column; max-height: calc(100dvh - var(--topo-h) - var(--nav-h) - 150px); min-height: 160px; }
@media (min-width: 900px) { .kcol { max-height: calc(100dvh - var(--topo-h) - 150px); } }
@media (max-width: 640px) { .kcol { flex-basis: 84vw; } }
.kcol-topo { display: flex; align-items: center; gap: 8px; padding: 12px 12px 4px; border-top: 4px solid var(--cor); border-radius: 14px 14px 0 0; }
.kcol-topo h3 { margin: 0; font-size: .95rem; flex: 1; min-width: 0; }
.kcol-topo .num { font-size: .75rem; font-weight: 800; color: var(--texto-3); background: var(--superficie); border: 1px solid var(--borda); border-radius: 99px; padding: 1px 8px; }
.kcol-soma { padding: 0 12px 8px; font-size: .78rem; color: var(--texto-3); font-weight: 650; }
.kcol-cards { padding: 4px 8px 10px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 60px; border-radius: 0 0 14px 14px; transition: background .15s; }
.kcol.alvo .kcol-cards { background: color-mix(in srgb, var(--cor) 12%, transparent); outline: 2px dashed var(--cor); outline-offset: -4px; }
.kcard { background: var(--superficie); border: 1px solid var(--borda); border-left: 4px solid var(--cor); border-radius: 12px; padding: 10px 12px; box-shadow: var(--sombra); cursor: grab; user-select: none; -webkit-user-select: none; position: relative; flex: none; }
.kcard:hover { border-color: var(--texto-3); border-left-color: var(--cor); }
.kcard .kc-topo { display: flex; gap: 6px; align-items: flex-start; }
.kcard .kc-nome { font-weight: 750; flex: 1; min-width: 0; line-height: 1.3; }
.kcard .kc-num { font-size: .7rem; color: var(--texto-3); font-weight: 700; font-variant-numeric: tabular-nums; display: block; }
.kcard .kc-cliente { font-size: .84rem; color: var(--texto-2); margin: 2px 0 6px; }
.kcard .kc-itens { font-size: .78rem; color: var(--texto-3); margin: 6px 0 0; padding: 0; list-style: none; }
.kcard .kc-itens li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard .kc-rodape { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 8px; font-size: .8rem; }
.kcard .kc-valor { font-weight: 800; font-variant-numeric: tabular-nums; }
.kcard .kc-menu { margin: -6px -8px 0 0; min-width: 32px; min-height: 32px; padding: 2px 6px; }
.prazo { font-size: .74rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--superficie-2); color: var(--texto-2); white-space: nowrap; border: 1px solid var(--borda); }
.prazo.atrasado { background: var(--erro-fundo); color: var(--erro); border-color: transparent; }
.prazo.perto { background: var(--aviso-fundo); color: var(--aviso); border-color: transparent; }
.prazo.ok { background: var(--ok-fundo); color: var(--ok); border-color: transparent; }
.kcard .kc-resp { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--marca); color: #fff; font-size: .68rem; font-weight: 800; }
.kcard.fantasma { position: fixed; z-index: 70; pointer-events: none; transform: rotate(2deg); box-shadow: 0 16px 40px rgba(2, 6, 23, .3); opacity: .96; margin: 0; }
.kcard.origem { opacity: .35; }
.kcard .kc-previa { display: block; width: calc(100% + 24px); height: 110px; object-fit: cover; margin: -10px -12px 8px; border-radius: 10px 10px 0 0; background: var(--superficie-2); pointer-events: none; }
.kcol-vazio { text-align: center; font-size: .8rem; color: var(--texto-3); padding: 18px 6px; border: 1px dashed var(--borda); border-radius: 10px; }
.kcol-add { margin: 0 8px 10px; }
body.arrastando, body.arrastando * { cursor: grabbing !important; user-select: none; }

/* Lista de projetos */
.kpi.destaque { background: var(--escuro); color: #fff; border-color: var(--escuro); }
.kpi.destaque span { color: #cbd5e1; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--texto-2); white-space: nowrap; }

/* Itens do projeto */
.itens { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.item-card { background: var(--superficie); border: 1px solid var(--borda); border-radius: 12px; padding: 14px; text-decoration: none; display: block; color: inherit; }
.item-card:hover { border-color: var(--texto-3); }
.item-card .cab { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.letra { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #fff; font-weight: 850; background: var(--cor, var(--escuro)); flex: none; font-size: .9rem; }
.letra.p { width: 20px; height: 20px; border-radius: 5px; font-size: .7rem; }
.item-card .nome { font-weight: 750; flex: 1; min-width: 0; }
.item-card .fatos { display: flex; flex-wrap: wrap; gap: 6px; }
.item-card .valores { display: flex; justify-content: space-between; margin-top: 10px; font-size: .88rem; }
.modelos { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.modelo { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px; border: 1px solid var(--borda); border-radius: 12px; background: var(--superficie); color: inherit; font: inherit; cursor: pointer; }
.modelo:hover { border-color: var(--marca); box-shadow: 0 0 0 2px var(--marca-suave); }
.modelo .ico { font-size: 1.6rem; line-height: 1; }
.modelo b { display: block; }
.modelo small { color: var(--texto-3); font-size: .78rem; line-height: 1.3; display: block; }

/* Editor de item: linhas de custo */
.linhas { display: flex; flex-direction: column; gap: 8px; }
.lc { border: 1px solid var(--borda); border-radius: 12px; padding: 10px 12px; background: var(--superficie-2); }
.lc-topo { display: flex; align-items: center; gap: 8px; }
.lc-topo .nome { font-weight: 700; flex: 1; min-width: 0; font-size: .92rem; }
.lc-res { font-size: .82rem; color: var(--texto-2); display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.lc-res b { color: var(--texto); font-variant-numeric: tabular-nums; }
.lc-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin-top: 8px; }
.lc-campos .campo > span { font-size: .74rem; }
.lc-campos input, .lc-campos select { min-height: 38px; padding: 6px 9px; }
.lc-campos textarea { min-height: 60px; }
.lc-campos .largo { grid-column: 1 / -1; }
.lc-campos .check { align-self: end; padding-bottom: 8px; }
.barra-total { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); z-index: 15; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--escuro); color: #fff; border-radius: 14px; padding: 10px 16px; box-shadow: 0 10px 30px rgba(2, 6, 23, .3); margin-top: 16px; }
@media (min-width: 900px) { .barra-total { bottom: 12px; } }
.barra-total span { font-size: .74rem; color: #cbd5e1; display: block; }
.barra-total b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* Plano de corte */
.plano-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.plano-cab h3 { margin: 0; }
.folhas { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
.folha { background: #fff; border: 1px solid var(--borda); border-radius: 12px; padding: 8px; color: #334155; }
.folha svg { display: block; width: 100%; height: auto; max-height: 70vh; }
.folha .rot { font-size: .78rem; display: flex; justify-content: space-between; gap: 8px; padding: 2px 4px 6px; }
.legenda-itens { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .84rem; margin: 4px 0 12px; }
.legenda-itens span { display: inline-flex; gap: 6px; align-items: center; }
.medidor { height: 8px; background: var(--superficie-2); border: 1px solid var(--borda); border-radius: 99px; overflow: hidden; width: 120px; display: inline-block; vertical-align: middle; }
.medidor i { display: block; height: 100%; background: var(--ok); }

/* Preço */
.preco-opcoes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 560px) { .preco-opcoes { grid-template-columns: 1fr; } }
.preco-opcao { border: 2px solid var(--borda); border-radius: 12px; padding: 10px 12px; cursor: pointer; background: var(--superficie); text-align: left; font: inherit; color: inherit; }
.preco-opcao.ativo { border-color: var(--marca); box-shadow: 0 0 0 3px var(--marca-suave); }
.preco-opcao span { display: block; font-size: .78rem; color: var(--texto-3); font-weight: 650; }
.preco-opcao b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.composicao { display: flex; height: 14px; border-radius: 99px; overflow: hidden; border: 1px solid var(--borda); margin: 8px 0; }
.composicao i { display: block; height: 100%; }
.legenda-custos { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 4px 12px; font-size: .84rem; }
.legenda-custos > span { display: block; }
.legenda-custos .bolinha { margin-right: 6px; vertical-align: 0; }
.cor-campo { display: flex; gap: 8px; align-items: center; }
.cor-campo input[type=color] { width: 56px; min-height: 40px; padding: 2px; }
.grupo-titulo { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texto-3); font-weight: 800; margin: 14px 0 6px; }

/* Prévias e arquivos do projeto */
.previas { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.previa { border: 1px solid var(--borda); border-radius: 12px; overflow: hidden; background: var(--superficie-2); }
.previa img { display: block; width: 100%; height: 170px; object-fit: cover; background: #fff; }
.previa input, .previa select { min-height: 38px; padding: 6px 9px; }
.previas-faixa { display: flex; gap: 8px; overflow-x: auto; }
.previas-faixa img { height: 120px; width: auto; max-width: 220px; object-fit: cover; border-radius: 10px; border: 1px solid var(--borda); display: block; }
.soltar { border: 2px dashed var(--borda); border-radius: 12px; padding: 18px; text-align: center; color: var(--texto-3); font-size: .9rem; margin-bottom: 10px; transition: .15s; }
.soltar.ativo { border-color: var(--marca); background: var(--marca-suave); color: var(--texto); }
.barra-progresso { height: 8px; border-radius: 99px; background: var(--superficie-2); border: 1px solid var(--borda); overflow: hidden; }
.barra-progresso i { display: block; height: 100%; background: var(--marca); transition: width .2s; }
.arquivo .miniatura { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--borda); flex: none; background: #fff; }
.arquivo .extensao { font-size: .68rem !important; font-weight: 800; color: var(--texto-2); }
.codigo-link { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: var(--marca-suave); }
.codigo-link span { font-size: .8rem; font-weight: 700; color: var(--texto-2); }
.codigo-link b { font-size: 1.6rem; letter-spacing: .12em; font-variant-numeric: tabular-nums; }

/* Quadro: busca no cabeçalho e menu de tags */
.quadro-cab { align-items: center; }
.quadro-cab .quadro-busca { flex: 1 1 260px; max-width: 420px; margin-left: auto; }
@media (max-width: 760px) { .quadro-cab .quadro-busca { order: 3; max-width: none; flex-basis: 100%; margin: 0; } }
.quadro-barra .separador { width: 1px; align-self: stretch; background: var(--borda); margin: 4px 2px; }
@media (max-width: 760px) { .quadro-barra .separador { display: none; } .quadro-barra .atalhos { flex-basis: 100%; } }
.btn .num { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--marca); color: var(--marca-texto); font-size: .72rem; }
.suspenso { position: relative; }
.suspenso-painel { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 280px; max-width: calc(100vw - 32px); background: var(--superficie); border: 1px solid var(--borda); border-radius: 14px; box-shadow: 0 16px 40px rgba(2, 6, 23, .22); padding: 10px; }
.suspenso-titulo { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--texto-3); padding: 2px 4px 8px; }
.suspenso-lista { list-style: none; margin: 8px 0; padding: 0; max-height: 280px; overflow-y: auto; }
.suspenso-lista label { display: flex; align-items: center; gap: 8px; padding: 7px 6px; border-radius: 8px; cursor: pointer; font-size: .9rem; }
.suspenso-lista label:hover { background: var(--superficie-2); }
.suspenso-lista .nome { flex: 1; }
.suspenso-lista input { width: 18px; height: 18px; }
.suspenso-rodape { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--borda); padding-top: 8px; }
.segmentado { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--superficie-2); border: 1px solid var(--borda); border-radius: 10px; padding: 2px; }
.segmentado label { cursor: pointer; }
.segmentado input { position: absolute; opacity: 0; pointer-events: none; }
.segmentado span { display: block; text-align: center; padding: 6px 8px; border-radius: 8px; font-size: .82rem; font-weight: 700; color: var(--texto-3); }
.segmentado input:checked + span { background: var(--superficie); color: var(--texto); box-shadow: var(--sombra); }
.kcard .kc-tarefas { font-size: .74rem; font-weight: 700; color: var(--texto-2); }

/* Navegação com 6 itens: no celular, texto menor */
@media (max-width: 480px) { .nav-baixo a { font-size: .66rem; } .nav-baixo a span { font-size: 1.15rem; } }
@media (min-width: 900px) and (max-width: 1180px) { .nav-baixo a { padding: 0 11px; } }

/* Início (dashboard): minimalista, números tabulares, rótulos pequenos em caixa alta */
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--superficie); border: 1px solid var(--borda); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.tile::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--borda); }
.tile.sobe::before { background: var(--ok); } .tile.desce::before, .tile.alerta::before { background: var(--erro); }
.tile-rotulo { font-size: .7rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-3); }
.tile-valor { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.tile-sub { font-size: .78rem; color: var(--texto-3); }
.tile.sobe .tile-sub { color: var(--ok); } .tile.desce .tile-sub, .tile.alerta .tile-sub { color: var(--erro); }
.dash-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dash-grade .cartao { margin: 0; }
.dash-card.largo { grid-column: 1 / -1; }
@media (min-width: 1100px) { body:not(.largo) .conteudo:has(.dash-grade) { max-width: 1180px; } }
@media (max-width: 760px) { .dash-grade { grid-template-columns: 1fr; } }
.dash-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.dash-cab h2 { margin: 0; font-size: 1rem; }
.dash-cab a { text-decoration: none; }
.vazio-mini { margin: 6px 0; font-size: .88rem; }
.grafico { position: relative; }
.grafico svg { display: block; width: 100%; height: auto; }
.grafico .grade { stroke: var(--borda); stroke-width: 1; stroke-dasharray: 2 4; }
.grafico .base { stroke: var(--texto-3); stroke-width: 1; }
.grafico .eixo { fill: var(--texto-3); font-size: 11px; font-family: inherit; }
.grafico .valor { fill: var(--texto); font-size: 12px; font-weight: 750; font-family: inherit; }
.grafico .barra { fill: color-mix(in srgb, var(--marca) 55%, var(--superficie)); }
.grafico .barra.atual { fill: var(--marca); }
.grafico .alvo { fill: transparent; cursor: default; }
.grafico .alvo.ativo { fill: color-mix(in srgb, var(--texto) 5%, transparent); }
.dica { position: absolute; pointer-events: none; background: var(--escuro); color: #fff; border-radius: 10px; padding: 8px 10px; font-size: .8rem; display: flex; flex-direction: column; min-width: 120px; box-shadow: 0 8px 24px rgba(2, 6, 23, .25); }
.dica span { font-weight: 800; font-variant-numeric: tabular-nums; }
.dica small { color: #cbd5e1; }
.funil { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.funil li { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr auto; gap: 10px; align-items: center; font-size: .85rem; }
.funil-nome { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funil-trilho { display: block; height: 8px; background: var(--superficie-2); border-radius: 99px; overflow: hidden; }
.funil-trilho i { display: block; height: 100%; border-radius: 99px; background: var(--marca); }
.funil-num { font-variant-numeric: tabular-nums; color: var(--texto-3); white-space: nowrap; }
.funil-num b { color: var(--texto); }
.dash-lista { list-style: none; margin: 0; padding: 0; }
.dash-lista a { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--borda); text-decoration: none; color: inherit; }
.dash-lista li:last-child a { border-bottom: 0; }
.dash-lista a:hover { background: var(--superficie-2); }
.dash-lista .prazo { min-width: 58px; text-align: center; }
.dash-lista-meio { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-lista-meio b { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-lista-meio small { color: var(--texto-3); font-size: .78rem; display: flex; align-items: center; gap: 4px; }
.dash-valor { font-weight: 750; font-variant-numeric: tabular-nums; font-size: .88rem; text-align: right; display: flex; flex-direction: column; }
.dash-valor small { font-weight: 500; color: var(--texto-3); font-size: .74rem; }
.ranking { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ranking li { display: flex; align-items: center; gap: 10px; }
.ranking .pos { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--superficie-2); border: 1px solid var(--borda); font-size: .74rem; font-weight: 800; color: var(--texto-2); flex: none; }
.ranking-meio { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ranking-meio b { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linha-tempo { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--borda); }
.linha-tempo li { position: relative; padding: 0 0 12px 4px; font-size: .86rem; display: flex; flex-direction: column; }
.linha-tempo li::before { content: ''; position: absolute; left: -21px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--cor); box-shadow: 0 0 0 3px var(--superficie); }
.linha-tempo a { text-decoration: none; }
.linha-tempo small { color: var(--texto-3); font-size: .76rem; }

/* Tarefas */
.tarefas { list-style: none; margin: 0; padding: 0; }
.tarefas.cartao { padding: 4px 6px; }
.tarefa { display: flex; align-items: flex-start; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--borda); }
.tarefa:last-child { border-bottom: 0; }
.tarefa-check { position: relative; flex: none; width: 22px; height: 22px; margin-top: 1px; cursor: pointer; }
.tarefa-check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 22px; height: 22px; }
.tarefa-check span { display: block; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--texto-3); transition: .15s; }
.tarefa-check input:checked + span { background: var(--ok); border-color: var(--ok); }
.tarefa-check input:checked + span::after { content: '✓'; display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 900; height: 100%; }
.tarefa-check input:focus-visible + span { outline: 2px solid var(--marca); outline-offset: 2px; }
.tarefa-meio { all: unset; flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.tarefa-meio:focus-visible { outline: 2px solid var(--marca); border-radius: 6px; }
.tarefa-titulo { font-size: .92rem; font-weight: 600; overflow-wrap: anywhere; }
.tarefa.feita .tarefa-titulo { text-decoration: line-through; color: var(--texto-3); font-weight: 500; }
.tarefa-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: .76rem; color: var(--texto-3); align-items: center; }
.tarefa-proj { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prioridade { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: var(--erro); color: #fff; font-size: .7rem; font-weight: 900; margin-right: 6px; vertical-align: 1px; }

.grafico-svg { min-height: 220px; }
.dash-card.largo .linha-tempo { columns: 2 280px; column-gap: 32px; border-left: 0; padding-left: 0; }
.dash-card.largo .linha-tempo li { break-inside: avoid; border-left: 2px solid var(--borda); padding-left: 18px; }
.dash-card.largo .linha-tempo li::before { left: -6px; }
