:root {
  --marinho: #0f2439; /* azul da logomarca */
  --marinho-2: #1d3354;
  --ouro: #c9a227;
  --fundo: #f4f5f7;
  --cartao: #ffffff;
  --borda: #e2e5ea;
  --texto: #1f2937;
  --suave: #6b7280;
  --primaria: #1d4ed8;
  --perigo: #b91c1c;
  --ok: #15803d;
  --raio: 12px;
  --sombra: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; font-size: 14px; color: var(--texto); background: var(--fundo); }
a { color: var(--primaria); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.carregando { padding: 40px; color: var(--suave); }

/* Layout */
.layout { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.lateral { background: var(--marinho); color: #d6dbe4; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.marca { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.marca .logo { font-family: Georgia, "Times New Roman", serif; font-weight: 700; color: var(--ouro); font-size: 18px; letter-spacing: .3px; }
.marca .sub { font-size: 12px; color: #9aa6b8; margin-top: 2px; }
.nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 8px; color: #d6dbe4; margin-bottom: 2px; }
.nav a:hover { background: var(--marinho-2); text-decoration: none; }
.nav a.ativo { background: var(--marinho-2); color: #fff; box-shadow: inset 3px 0 0 var(--ouro); }
.nav .secao { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #7d8aa0; padding: 14px 12px 6px; }
.selo { background: var(--ouro); color: var(--marinho); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center; }
.rodape-lateral { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.rodape-lateral .nome { color: #fff; font-weight: 600; }
.rodape-lateral button { margin-top: 8px; }
.principal { padding: 24px 28px 48px; min-width: 0; }
.topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.topo .acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.migalha { font-size: 13px; color: var(--suave); margin-bottom: 4px; }

/* Componentes */
.cartao { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); padding: 18px; }
.grade { display: grid; gap: 16px; align-content: start; }
.grade.lado { align-items: start; }
.grade.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grade.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grade.lado { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
@media (max-width: 1100px) { .grade.c3, .grade.lado { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .grade.c2 { grid-template-columns: 1fr; } .layout { grid-template-columns: 1fr; } .lateral { position: static; height: auto; } }

.numeros { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.numero { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); padding: 14px 16px; box-shadow: var(--sombra); }
.numero .valor { font-size: 26px; font-weight: 700; color: var(--marinho); }
.numero .rotulo { color: var(--suave); font-size: 12.5px; margin-top: 2px; }
.numero.alerta .valor { color: var(--perigo); }

button, .botao { font: inherit; border: 1px solid var(--borda); background: #fff; color: var(--texto); border-radius: 8px; padding: 7px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
button:hover { background: #f3f4f6; }
button.primario { background: var(--marinho); border-color: var(--marinho); color: #fff; }
button.primario:hover { background: var(--marinho-2); }
button.perigo { color: var(--perigo); border-color: #f3c4c4; }
button.pequeno { padding: 4px 9px; font-size: 12.5px; }
button.link { border: none; background: none; color: var(--primaria); padding: 0; }
button:disabled { opacity: .55; cursor: default; }
.rodape-lateral button { background: transparent; color: #d6dbe4; border-color: rgba(255,255,255,.2); }

input, select, textarea { font: inherit; width: 100%; border: 1px solid #cfd4dc; border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--texto); }
input:focus, select:focus, textarea:focus { outline: 2px solid #bfd0f5; border-color: var(--primaria); }
textarea { resize: vertical; min-height: 70px; }
label { display: block; font-size: 12.5px; color: var(--suave); margin-bottom: 4px; font-weight: 600; }
.campo { margin-bottom: 12px; }
.linha-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filtros input, .filtros select { width: auto; min-width: 160px; }
.filtros input[type=search] { min-width: 240px; }

table.tabela { width: 100%; border-collapse: collapse; background: #fff; }
.tabela th { text-align: left; font-size: 12px; color: var(--suave); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--borda); background: #fafbfc; white-space: nowrap; }
.tabela td { padding: 9px 10px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
.tabela tr.clicavel { cursor: pointer; }
.tabela tr.clicavel:hover td { background: #f8fafc; }
.tabela-envolta { border: 1px solid var(--borda); border-radius: var(--raio); overflow: auto; box-shadow: var(--sombra); background: #fff; }
.vazio { color: var(--suave); padding: 18px; text-align: center; }

.ticket { font-family: Consolas, "Courier New", monospace; font-weight: 700; color: var(--marinho); white-space: nowrap; }
.etiqueta { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef2f7; color: #334155; white-space: nowrap; }
.etiqueta.sub { background: #fff7e6; color: #92400e; border: 1px solid #f6d28b; }
.etiqueta.urgente { background: #fde8e8; color: var(--perigo); }
.etiqueta.alta { background: #fff1e6; color: #c2410c; }
.etiqueta.baixa { background: #eef2f7; color: #64748b; }
.etiqueta.encerrado { background: #e5e7eb; color: #4b5563; }
.etiqueta.ok { background: #e7f6ec; color: var(--ok); }
.ponto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.suave { color: var(--suave); }
.pequeno-txt { font-size: 12.5px; }
.atrasada { color: var(--perigo); font-weight: 600; }

.abas { display: inline-flex; border: 1px solid var(--borda); border-radius: 8px; overflow: hidden; background: #fff; }
.abas button { border: none; border-radius: 0; border-right: 1px solid var(--borda); }
.abas button:last-child { border-right: none; }
.abas button.ativo { background: var(--marinho); color: #fff; }

/* Funil (kanban) */
.funil { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 14px; align-items: flex-start; scroll-snap-type: x proximity; }
.funil::-webkit-scrollbar { height: 10px; }
.funil::-webkit-scrollbar-thumb { background: #cdd3dd; border-radius: 999px; }
.coluna { --cor-etapa: #64748b; flex: 0 0 292px; scroll-snap-align: start; background: #f1f3f7; border: 1px solid #e3e7ee; border-radius: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 200px); overflow: hidden; }
.coluna.final { background: #f6f7f9; }
.coluna-topo { padding: 12px 14px 10px; background: #fff; border-bottom: 1px solid #e3e7ee; border-top: 4px solid var(--cor-etapa); }
.ct-linha { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ct-nome { font-weight: 700; font-size: 14px; display: flex; align-items: center; letter-spacing: .1px; }
.ct-nome .ponto { background: var(--cor-etapa); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cor-etapa) 22%, transparent); }
.coluna-topo .conta { background: color-mix(in srgb, var(--cor-etapa) 14%, #fff); color: var(--cor-etapa); font-weight: 700; font-size: 12px; border-radius: 999px; padding: 2px 9px; min-width: 26px; text-align: center; }
.ct-sub { font-size: 11.5px; color: var(--suave); margin-top: 4px; }
.ct-urg { color: #c2410c; font-weight: 600; }
.ct-barra { height: 4px; background: #eef0f4; border-radius: 999px; margin-top: 8px; overflow: hidden; }
.ct-barra span { display: block; height: 100%; background: var(--cor-etapa); border-radius: 999px; transition: width .4s ease; }
.coluna-corpo { padding: 10px; overflow-y: auto; flex: 1; }
.coluna-vazia { text-align: center; color: #9aa3b2; font-size: 12.5px; padding: 6px 0 10px; }
.zona { min-height: 12px; border-radius: 10px; padding: 2px; margin-bottom: 6px; transition: background .15s, outline-color .15s; outline: 2px dashed transparent; outline-offset: -2px; }
.zona.sub { background: rgba(255,255,255,.55); border: 1px solid #e6e9ef; padding: 4px; }
.zona-titulo { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #8a5a00; padding: 5px 6px 6px; }
.zona-titulo .conta { background: #fff4dc; color: #8a5a00; border-radius: 999px; padding: 0 7px; font-size: 11px; }
.zona-solte { display: none; text-align: center; font-size: 12px; color: #6a7fae; padding: 10px; }
body.arrastando-ticket .zona { min-height: 46px; outline-color: #cfd8ea; }
body.arrastando-ticket .zona-solte { display: block; }
.zona.sobre { background: color-mix(in srgb, var(--cor-etapa) 10%, #fff); outline-color: var(--cor-etapa) !important; }
.cartao-ticket { position: relative; background: #fff; border: 1px solid #e3e7ee; border-radius: 12px; padding: 11px 12px 10px 14px; margin-bottom: 8px; cursor: grab; box-shadow: 0 1px 2px rgba(16,24,40,.05); transition: transform .12s ease, box-shadow .12s ease, border-color .12s; overflow: hidden; }
.cartao-ticket::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: transparent; }
.cartao-ticket.prio-alta::before { background: #f97316; }
.cartao-ticket.prio-urgente::before { background: #dc2626; }
.cartao-ticket.prio-baixa::before { background: #cbd5e1; }
.cartao-ticket:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,24,40,.10); border-color: #cfd6e2; }
.cartao-ticket:focus-visible { outline: 2px solid var(--primaria); outline-offset: 2px; }
.cartao-ticket.arrastando { opacity: .45; transform: rotate(1.5deg); }
.cartao-ticket.fechado { opacity: .8; }
.cartao-ticket .t1 { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.t1-dir { display: inline-flex; align-items: center; gap: 5px; }
.ticket-chip { font-family: Consolas, "Courier New", monospace; font-size: 11px; font-weight: 700; color: #475569; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; padding: 1px 6px; letter-spacing: .2px; white-space: nowrap; }
.ticket-chip.grande { font-size: 13px; padding: 3px 9px; color: var(--marinho); background: #eef2f8; border-color: #d9e1ee; }
.prio { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; border-radius: 999px; padding: 2px 7px; }
.prio.urgente { background: #fee2e2; color: #b91c1c; }
.prio.alta { background: #ffedd5; color: #c2410c; }
.prio.baixa { background: #f1f5f9; color: #64748b; }
.bolinha-msg { background: #16a34a; color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 999px; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; box-shadow: 0 0 0 2px #dcfce7; }
.cartao-ticket .cli { font-weight: 650; font-size: 13.5px; margin: 8px 0 2px; color: #0f172a; }
.cartao-ticket .ass { font-size: 12.5px; color: #526075; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cartao-ticket .chips { margin-top: 8px; display: flex; gap: 5px; flex-wrap: wrap; }
.cartao-ticket .t3 { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 1px dashed #e8ebf0; font-size: 11.5px; color: var(--suave); }
.cartao-ticket .resp { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.cartao-ticket .quando { white-space: nowrap; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; flex: 0 0 auto; letter-spacing: .3px; }
.avatar.mini { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.vazio { background: #e2e8f0; color: #94a3b8; }
.chip-assin { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px 2px 3px; white-space: nowrap; }
.chip-assin .ico { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 9.5px; color: #fff; }
.chip-assin.pendente { background: #eef2ff; color: #4338ca; } .chip-assin.pendente .ico { background: #6366f1; }
.chip-assin.assinado { background: #dcfce7; color: #166534; } .chip-assin.assinado .ico { background: #16a34a; }
.chip-assin.recusado { background: #fee2e2; color: #991b1b; } .chip-assin.recusado .ico { background: #dc2626; }
.chip-assin.excluido { background: #f1f5f9; color: #64748b; } .chip-assin.excluido .ico { background: #94a3b8; }

/* Ticket: cabeçalho e etapas */
.hero { position: relative; padding: 18px 20px 16px; margin-bottom: 16px; overflow: hidden; }
.hero::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--marinho), var(--ouro)); }
.hero.prio-urgente::before { background: linear-gradient(90deg, #dc2626, #f97316); }
.hero.prio-alta::before { background: linear-gradient(90deg, #f97316, var(--ouro)); }
.hero-linha { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-espaco { flex: 1; }
.hero .acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-titulo { font-size: 23px; margin: 12px 0 6px; line-height: 1.25; color: #0f172a; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; color: var(--suave); font-size: 13px; }
.hero-cliente, .hero-resp { display: inline-flex; align-items: center; gap: 7px; }
.hero-cliente { font-weight: 600; color: var(--texto); }
.hero-funil { margin-top: 16px; padding-top: 14px; border-top: 1px solid #eef0f3; }
.hero-sub { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.hero-sub .sel-sub { width: auto; min-width: 220px; padding: 5px 9px; }
.passos { display: flex; gap: 0; overflow-x: auto; padding-bottom: 2px; }
.passo { --cor-etapa: #64748b; flex: 1 1 0; min-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 6px; border: none; background: none; padding: 4px 4px 2px; border-radius: 10px; position: relative; color: var(--suave); font-size: 12.5px; }
.passo:hover { background: #f6f7fa; }
.passo::after { content: ''; position: absolute; top: 18px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; background: #e5e8ee; }
.passo:last-child::after { display: none; }
.passo.feito::after { background: color-mix(in srgb, var(--cor-etapa) 55%, #fff); }
.passo-bola { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; background: #fff; border: 2px solid #dfe3ea; color: #94a3b8; position: relative; z-index: 1; transition: transform .15s; }
.passo:hover .passo-bola { transform: scale(1.08); border-color: var(--cor-etapa); }
.passo.feito .passo-bola { background: color-mix(in srgb, var(--cor-etapa) 14%, #fff); border-color: var(--cor-etapa); color: var(--cor-etapa); }
.passo.atual .passo-bola { background: var(--cor-etapa); border-color: var(--cor-etapa); color: #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--cor-etapa) 20%, transparent); }
.passo.atual { color: #0f172a; font-weight: 700; cursor: default; }
.passo.atual:hover { background: none; }
.passo.final .passo-bola { border-style: dashed; }
.passo.final.atual .passo-bola { border-style: solid; }
.passo-nome { text-align: center; line-height: 1.2; }
.pilula { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.pilula.verde { background: #dcfce7; color: #166534; }
.pilula.cinza { background: #e5e7eb; color: #4b5563; }
.pilula.amarela { background: #fef3c7; color: #92400e; font-size: 10.5px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }

/* Linha do tempo */
.compositor { border: 1px solid #dfe3ea; border-radius: 12px; overflow: hidden; margin-bottom: 14px; background: #fff; }
.compositor textarea { border: none; border-radius: 0; min-height: 64px; }
.compositor textarea:focus { outline: none; }
.compositor-pe { display: flex; justify-content: flex-end; padding: 6px 8px; background: #fafbfc; border-top: 1px solid #eef0f3; }
.linha-tempo { list-style: none; margin: 0; padding: 0; position: relative; }
.linha-tempo::before { content: ''; position: absolute; left: 14px; top: 6px; bottom: 6px; width: 2px; background: #eceff4; }
.linha-tempo li { display: flex; gap: 12px; padding: 7px 0; position: relative; }
.lt-ico { flex: 0 0 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid #e3e7ee; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #64748b; z-index: 1; }
.lt-nota .lt-ico { border-color: #f5d77a; background: #fffbea; color: #a16207; }
.lt-etapa .lt-ico { border-color: #bfd0f5; background: #eef3fd; color: #1d4ed8; }
.lt-assinatura .lt-ico { border-color: #c7d2fe; background: #eef2ff; color: #4338ca; }
.lt-criacao .lt-ico { border-color: var(--ouro); background: #fdf8e7; color: #8a6d0f; }
.lt-corpo { flex: 1; min-width: 0; padding-top: 4px; word-break: break-word; }
.lt-corpo .quem { font-size: 12px; color: var(--suave); margin-bottom: 2px; }
.lt-corpo .quem strong { color: #334155; }
.lt-corpo .nota { background: #fffbea; border: 1px solid #f5e3a3; border-radius: 10px; padding: 8px 11px; margin-top: 4px; white-space: pre-wrap; }

/* Assinaturas */
.lista-assin { list-style: none; margin: 0; padding: 0; }
.assin { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid #eef0f3; }
.assin:last-child { border-bottom: none; }
.assin-ico { flex: 0 0 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; background: #eef2ff; color: #4338ca; }
.assin.assinado .assin-ico { background: #dcfce7; color: #15803d; }
.assin.recusado .assin-ico { background: #fee2e2; color: #b91c1c; }
.assin.excluido .assin-ico { background: #f1f5f9; color: #94a3b8; }
.assin-corpo { flex: 1; min-width: 0; }
.assin-titulo { font-weight: 650; }
.assin-acoes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip-status { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 9px; white-space: nowrap; background: #eef2ff; color: #4338ca; }
.chip-status.assinado { background: #dcfce7; color: #166534; }
.chip-status.recusado { background: #fee2e2; color: #991b1b; }
.chip-status.excluido { background: #f1f5f9; color: #64748b; }
.botao.pequeno { padding: 4px 9px; font-size: 12.5px; }
.botao.destaque { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.vazio-mini { color: var(--suave); font-size: 13px; padding: 10px 2px; }
.secao-modal { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--marinho); margin: 14px 0 8px; padding-bottom: 6px; border-bottom: 1px solid #eef0f3; }
.linha-modelo { display: flex; gap: 8px; align-items: flex-end; }
.linha-modelo .campo { flex: 1; }
.linha-modelo button { margin-bottom: 12px; height: 38px; }
label .obrig { color: var(--perigo); }
label .auto { font-weight: 500; color: #15803d; font-size: 11px; margin-left: 6px; }
input.preenchido { background: #f6fef9; border-color: #bbe5c9; }
.opcoes-envio { display: flex; gap: 18px; flex-wrap: wrap; margin: 2px 0 12px; }
label.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--texto); font-size: 13.5px; margin: 0; cursor: pointer; }
label.check input { width: auto; }
.link-assin { display: flex; gap: 8px; }
.link-assin input { font-family: Consolas, monospace; font-size: 12.5px; }
.passo-a-passo { margin: 0; padding-left: 20px; line-height: 1.55; }
.passo-a-passo li { margin-bottom: 8px; }
code { background: #f1f5f9; border-radius: 5px; padding: 1px 5px; font-size: 12.5px; }

/* Configuração do funil */
.etapa-config { border-left: 4px solid var(--cor-etapa, #64748b); }

/* Detalhe */
.dados dt { font-size: 12px; color: var(--suave); margin-top: 8px; }
.dados dd { margin: 2px 0 0; white-space: pre-wrap; word-break: break-word; }
.historico { list-style: none; padding: 0; margin: 0; }
.historico li { padding: 9px 0; border-bottom: 1px solid #eef0f3; }
.historico li:last-child { border-bottom: none; }
.historico .quem { font-size: 12px; color: var(--suave); }
.historico .nota { background: #fffbea; border: 1px solid #f5e3a3; border-radius: 8px; padding: 8px 10px; margin-top: 4px; white-space: pre-wrap; }
.lista-tarefas { list-style: none; padding: 0; margin: 0; }
.lista-tarefas li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #eef0f3; }
.lista-tarefas li:last-child { border-bottom: none; }
.lista-tarefas input[type=checkbox] { width: auto; margin-top: 3px; }
.lista-tarefas .feita { text-decoration: line-through; color: var(--suave); }

/* Conversas */
.conversas { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 120px); border: 1px solid var(--borda); border-radius: var(--raio); overflow: hidden; background: #fff; box-shadow: var(--sombra); }
.lista-conversas { border-right: 1px solid var(--borda); overflow-y: auto; }
.item-conversa { padding: 11px 14px; border-bottom: 1px solid #eef0f3; cursor: pointer; }
.item-conversa:hover { background: #f8fafc; }
.item-conversa.ativo { background: #eef3fb; }
.item-conversa .l1 { display: flex; justify-content: space-between; gap: 8px; }
.item-conversa .nome { font-weight: 600; }
.item-conversa .previa { font-size: 12.5px; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat { display: flex; flex-direction: column; min-width: 0; }
.chat-topo { padding: 12px 16px; border-bottom: 1px solid var(--borda); display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.chat-mensagens { flex: 1; overflow-y: auto; padding: 16px; background: #efeae2; }
.bolha { max-width: 70%; padding: 8px 11px; border-radius: 10px; margin-bottom: 8px; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.bolha.entrada { background: #fff; }
.bolha.saida { background: #d9fdd3; margin-left: auto; }
.bolha .meta { font-size: 11px; color: #667085; margin-top: 4px; text-align: right; }
.bolha.falhou { border: 1px solid #f3a6a6; }
.bolha .erro { color: var(--perigo); font-size: 11.5px; margin-top: 4px; }
.chat-envio { border-top: 1px solid var(--borda); padding: 10px; display: flex; gap: 8px; align-items: flex-end; }
.chat-envio textarea { min-height: 44px; max-height: 160px; }
.aviso { background: #fff7e6; border: 1px solid #f6d28b; color: #7a4a00; padding: 9px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.aviso.info { background: #eef3fb; border-color: #c4d4f1; color: #1e3a6e; }
@media (max-width: 900px) { .conversas { grid-template-columns: 1fr; height: auto; } .lista-conversas { max-height: 260px; } .chat-mensagens { min-height: 340px; } }

/* Modal e toasts */
.fundo-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal .cab { padding: 16px 18px; border-bottom: 1px solid var(--borda); display: flex; justify-content: space-between; align-items: center; }
.modal .cab h2 { margin: 0; }
.modal .corpo { padding: 16px 18px; }
.modal .pe { padding: 12px 18px; border-top: 1px solid var(--borda); display: flex; justify-content: flex-end; gap: 8px; }
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--marinho); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 380px; }
.toast.erro { background: var(--perigo); }

/* Login */
.tela-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--marinho), #0b1628); padding: 20px; }
.caixa-login { background: #fff; border-radius: 14px; padding: 28px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.caixa-login .logo { font-family: Georgia, serif; color: var(--marinho); font-size: 22px; font-weight: 700; }
.caixa-login .logo span { color: var(--ouro); }
.caixa-login p { color: var(--suave); margin: 6px 0 18px; }
.caixa-login button { width: 100%; justify-content: center; padding: 10px; margin-top: 6px; }
.erro-form { color: var(--perigo); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* ---------- Áreas de atuação ---------- */
:root { --serie-1: #257de0; --serie-2: #f47230; }
.chip-area { --cor-area: #94a3b8; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: #334155; background: #fff; border: 1px solid #e2e8f0; border-radius: 999px; padding: 2px 9px 2px 7px; white-space: nowrap; vertical-align: middle; }
.ponto-area { width: 8px; height: 8px; border-radius: 50%; background: var(--cor-area); flex: 0 0 auto; }
.area-cartao { border-top: 4px solid var(--cor-area, #94a3b8); }
.area-cartao.inativa { opacity: .6; }
.area-nums { display: flex; gap: 18px; font-size: 13px; color: var(--suave); margin-top: 6px; }
.area-nums strong { color: var(--texto); font-size: 18px; margin-right: 2px; }

/* Botão global "Novo ticket" */
.novo-global { padding: 14px 12px 4px; }
.botao-novo { width: 100%; background: var(--ouro); color: #1b1300; border: none; font-weight: 700; border-radius: 10px; padding: 9px 12px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.botao-novo:hover { filter: brightness(1.06); }
.bloco-novo-cliente { border: 1px dashed var(--borda); border-radius: 10px; padding: 10px 10px 0; margin-bottom: 12px; background: #fafbfc; }
.bloco-aviso { border: 1px solid #e3e7ee; border-radius: 10px; padding: 10px 12px; margin-top: 4px; background: #fafbfc; display: grid; gap: 6px; }
.bloco-aviso textarea { margin-top: 4px; }

/* Movimentações do processo */
.lista-mov { list-style: none; margin: 8px 0 0; padding: 0; }
.mov { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid #eef0f3; }
.mov:last-child { border-bottom: none; }
.mov-data { flex: 0 0 52px; height: 56px; border-radius: 10px; background: #eef2f8; color: var(--marinho); display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #d9e1ee; }
.mov.enviada .mov-data { background: #ecfdf3; border-color: #bbf7d0; color: #166534; }
.mov-data .dia { font-size: 20px; font-weight: 800; line-height: 1; }
.mov-data .mes { font-size: 11px; margin-top: 3px; }
.mov-corpo { flex: 1; min-width: 0; }
.mov-desc { font-weight: 600; white-space: pre-wrap; word-break: break-word; }
.mov-enviada { font-size: 12.5px; color: #166534; margin-top: 4px; }
.aviso-mov { color: #b45309; font-weight: 600; margin-top: 3px; }
textarea.msg-previa { min-height: 150px; font-size: 13px; line-height: 1.45; }

/* Relatórios */
.numero .sub { font-size: 12px; color: var(--suave); margin-top: 4px; }
.barras { display: grid; gap: 9px; }
.barra-linha { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 44px; align-items: center; gap: 10px; font-size: 13px; }
.barra-rotulo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #334155; }
.barra-trilho { height: 14px; background: #f1f3f7; border-radius: 4px; overflow: hidden; }
.barra-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; transition: width .4s ease; }
.barra-valor { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: #0f172a; }
.legenda { display: flex; gap: 16px; font-size: 12.5px; color: #334155; margin-bottom: 8px; }
.legenda > span { display: inline-flex; align-items: center; gap: 6px; }
.leg-cor { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.serie-1 { background: var(--serie-1); }
.serie-2 { background: var(--serie-2); }
.colunas { margin-top: 16px; position: relative; display: flex; align-items: flex-end; gap: 2px; height: 200px; padding: 0 0 22px 34px; border-bottom: 1px solid #e3e7ee; }
.col-grades { position: absolute; left: 34px; right: 0; top: 0; bottom: 22px; pointer-events: none; }
.col-grade { position: absolute; left: 0; right: 0; border-top: 1px dashed #e3e7ee; }
.col-grade span { position: absolute; left: -34px; top: -8px; font-size: 10.5px; color: var(--suave); width: 30px; text-align: right; }
.col-grupo { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.col-grupo:hover { background: #f6f8fb; }
.col-par { display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; }
.col { width: 42%; max-width: 16px; min-height: 0; border-radius: 4px 4px 0 0; }
.col-rot { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--suave); white-space: nowrap; }
.tabela.num td:not(:first-child), .tabela.num th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.grade.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grade.c3 { grid-template-columns: 1fr; } }

.tabela.num .hero-resp { white-space: nowrap; }
.cartao-ticket .chip-area { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.bloco-aviso .linha-campos { margin-bottom: 0; }

/* Logomarca */
.marca { display: block; text-decoration: none; }
.marca:hover { text-decoration: none; }
.logo-img { display: block; width: 100%; max-width: 196px; height: auto; }
.marca .sub { margin-top: 8px; letter-spacing: .4px; }
.tela-login { flex-direction: column; gap: 26px; }
.logo-login { width: 100%; max-width: 340px; height: auto; }
.titulo-login { font-size: 20px; margin: 0; color: var(--marinho); }
