/* ALX Negócios · CRM. Paleta: marinho #01233E, dourado #E5AD36. Fontes: Prompt (títulos) + Manrope (texto). */
:root {
  --navy: #01233E; --navy-2: #062B4A; --navy-3: #0D3A60; --gold: #E5AD36; --gold-2: #F5CB6A; --gold-dim: rgba(229,173,54,.14);
  --bg: #04182B; --panel: rgba(9,36,62,.72); --panel-solid: #0A2440; --panel-2: #0F2D4E; --line: rgba(120,160,200,.14); --line-2: rgba(140,180,220,.24);
  --fg: #EAF0F7; --muted: #8FA6BE; --ok: #3FD0A8; --warn: #E5AD36; --bad: #F07272; --info: #6FB6F5;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Prompt", "Manrope", system-ui, sans-serif;
  --r: 3px; --ease: cubic-bezier(.2,.8,.2,1); color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold-2); }
::selection { background: var(--gold); color: var(--navy); }

/* Fundo com luzes lentas */
.fundo { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(1200px 700px at 85% -10%, rgba(229,173,54,.10), transparent 60%), radial-gradient(900px 600px at -10% 110%, rgba(31,110,190,.22), transparent 60%), var(--bg); }
.fundo i { position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(90px); opacity: .22; }
.fundo i:nth-child(1) { background: #1B5E9E; top: 10%; left: 30%; }
.fundo i:nth-child(2) { background: #E5AD36; top: 60%; left: 75%; opacity: .09; }
.fundo i:nth-child(3) { background: #0F4C81; top: 70%; left: 10%; }
@media (prefers-reduced-motion: no-preference) {
  .fundo i:nth-child(1) { animation: flutua 26s ease-in-out infinite alternate; }
  .fundo i:nth-child(2) { animation: flutua 32s ease-in-out infinite alternate-reverse; }
  .fundo i:nth-child(3) { animation: flutua 38s ease-in-out infinite alternate; }
  @keyframes flutua { to { transform: translate(120px, -80px) scale(1.15); } }
}
.app, .entrada { position: relative; z-index: 1; }

/* Botões e campos */
.btn { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 7px 12px; font-weight: 600; transition: background .2s, border-color .2s, box-shadow .2s, transform .15s; }
.btn:hover { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.btn:active { transform: translateY(1px); }
.btn.prim { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--navy); border-color: var(--gold); box-shadow: 0 6px 22px rgba(229,173,54,.25); }
.btn.prim:hover { box-shadow: 0 8px 30px rgba(229,173,54,.42); }
.btn.ghost { background: transparent; }
.btn.grande { padding: 11px 22px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
input[type=text], input[type=search], input[type=number], input[type=email], input[type=date], select, textarea {
  background: rgba(1,23,42,.75); border: 1px solid var(--line-2); border-radius: var(--r); padding: 7px 10px; min-width: 0; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Entrada */
.entrada { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.entrada .box { width: min(440px, 100%); display: grid; gap: 22px; padding: 34px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); backdrop-filter: blur(16px); box-shadow: 0 30px 80px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04); }
.marca { display: flex; align-items: center; gap: 12px; }
.marca .sel { width: 42px; height: 42px; border: 1.5px solid var(--gold); display: grid; place-items: center; font-family: var(--display); font-weight: 600; color: var(--gold); font-size: 14px; letter-spacing: .05em; box-shadow: 0 0 22px rgba(229,173,54,.28), inset 0 0 12px rgba(229,173,54,.12); flex: none; }
.marca b { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: .01em; }
.marca small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.entrada h1 { font-family: var(--display); font-weight: 500; font-size: 30px; line-height: 1.15; margin: 0; }
.entrada p { margin: 0; color: var(--muted); }
.google { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1F1F1F; border: 0; border-radius: var(--r); padding: 12px 16px; font-weight: 700; font-size: 15px; transition: transform .15s, box-shadow .2s; }
.google:hover { box-shadow: 0 10px 30px rgba(255,255,255,.14); transform: translateY(-1px); }
.aviso { border-left: 3px solid var(--warn); background: rgba(229,173,54,.09); padding: 10px 12px; color: var(--fg); }

/* Estrutura com menu lateral */
.app { display: grid; grid-template-columns: 252px 1fr; height: 100vh; }
.lateral { background: linear-gradient(180deg, rgba(1,35,62,.96), rgba(2,24,44,.96)); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px; gap: 18px; overflow-y: auto; z-index: 30; }
.lateral .marca { padding: 0 6px 14px; border-bottom: 1px solid var(--line); }
.lateral nav { display: grid; gap: 2px; }
.lateral .grupo { margin: 14px 10px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); opacity: .85; }
.lateral nav button { position: relative; display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 0; border-radius: var(--r); padding: 9px 10px; color: var(--muted); font-weight: 600; transition: color .2s, background .2s; }
.lateral nav button .ic { width: 20px; text-align: center; font-size: 14px; color: var(--muted); transition: color .2s, text-shadow .2s; }
.lateral nav button:hover { color: var(--fg); background: rgba(255,255,255,.03); }
.lateral nav button[aria-current=page] { color: var(--fg); background: linear-gradient(90deg, rgba(229,173,54,.16), rgba(229,173,54,0)); }
.lateral nav button[aria-current=page]::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.lateral nav button[aria-current=page] .ic { color: var(--gold); text-shadow: 0 0 10px rgba(229,173,54,.7); }
.lateral .quem { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 6px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.principal { display: grid; grid-template-rows: auto auto auto 1fr; min-width: 0; height: 100vh; }
.topo { display: flex; align-items: center; gap: 14px; padding: 16px 22px 10px; }
.topo h1 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 24px; letter-spacing: .005em; }
.migalha { margin: 0; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.topo-acoes { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.contador { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.menu-btn { display: none; }
.filtros { position: relative; z-index: 25; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 22px; margin: 0 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(12px); }
.filtros input[type=search] { width: 220px; }
.filtros .cap { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; }
.filtros .cap input { width: 90px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 22px 0; min-height: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 4px 3px 9px; border: 1px solid rgba(229,173,54,.4); background: var(--gold-dim); color: var(--gold-2); border-radius: 2px; }
.chip button { background: none; border: 0; color: var(--gold-2); padding: 0 4px; font-size: 14px; line-height: 1; }
@media (prefers-reduced-motion: no-preference) { .chip { animation: surge .25s var(--ease); } }
@keyframes surge { from { opacity: 0; transform: translateY(-4px); } }

/* Seleção múltipla */
.multi { position: relative; }
.multi > button { background: rgba(1,23,42,.75); border: 1px solid var(--line-2); border-radius: var(--r); padding: 7px 10px; min-width: 120px; text-align: left; transition: border-color .2s; }
.multi > button.ativo { border-color: var(--gold); color: var(--gold-2); }
.multi > button::after { content: "▾"; float: right; margin-left: 10px; color: var(--muted); }
.multi .pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px; max-height: 360px; overflow: auto; min-width: 260px; box-shadow: 0 18px 48px rgba(0,0,0,.5); }
@media (prefers-reduced-motion: no-preference) { .multi .pop { animation: surge .18s var(--ease); } }
.multi .pop input[type=search] { width: 100%; margin-bottom: 6px; }
.multi .pop label { display: flex; gap: 8px; align-items: center; padding: 5px 6px; cursor: pointer; white-space: nowrap; border-radius: 2px; }
.multi .pop label:hover { background: rgba(255,255,255,.05); }
.multi .pop label small { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; padding-left: 12px; }
.multi .pop .acoes { display: flex; gap: 12px; padding: 4px 6px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.multi .pop .acoes button { background: none; border: 0; color: var(--gold-2); padding: 0; font-size: 12.5px; }
input[type=checkbox] { accent-color: var(--gold); }

main.corpo { position: relative; z-index: 1; overflow: auto; min-height: 0; padding: 14px 22px 26px; }
.chips { position: relative; z-index: 2; }
@media (prefers-reduced-motion: no-preference) { .vista:not([hidden]) { animation: entraVista .35s var(--ease); } }
@keyframes entraVista { from { opacity: 0; transform: translateY(6px); } }

/* Quadro */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(268px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; height: calc(100vh - 230px); }
.kcol { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-height: 0; position: relative; backdrop-filter: blur(10px); }
.kcol::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; background: var(--kc); box-shadow: 0 0 16px var(--kc); }
.kcol header { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); gap: 8px; }
.kcol header b { font-weight: 700; font-size: 13px; }
.kcol header span { color: var(--fg); font-family: var(--display); font-size: 15px; font-variant-numeric: tabular-nums; }
.kcol .lista { padding: 8px; display: grid; gap: 7px; overflow-y: auto; align-content: start; flex: 1; }
.kcol.sobre { box-shadow: inset 0 0 0 2px var(--gold), 0 0 30px rgba(229,173,54,.2); }
.card { background: linear-gradient(180deg, rgba(20,52,86,.85), rgba(13,40,68,.85)); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 11px; display: grid; gap: 4px; cursor: pointer; text-align: left; width: 100%; transition: transform .18s var(--ease), border-color .2s, box-shadow .2s; }
.card:hover { transform: translateY(-2px); border-color: rgba(229,173,54,.45); box-shadow: 0 10px 26px rgba(0,0,0,.35), 0 0 0 1px rgba(229,173,54,.15); }
@media (prefers-reduced-motion: no-preference) { .card { animation: surge .3s var(--ease) both; } }
.card .n { font-weight: 700; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.card .m { color: var(--muted); font-size: 12px; }
.card .t { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.tag { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 2px; color: var(--muted); white-space: nowrap; letter-spacing: .02em; }
.tag.ouro { color: var(--gold-2); border-color: rgba(229,173,54,.4); background: rgba(229,173,54,.07); }
.tag.ok { color: var(--ok); border-color: rgba(63,208,168,.4); }
.tag.atrasado { color: var(--bad); border-color: rgba(240,114,114,.5); }
.vazio { color: var(--muted); font-size: 12.5px; padding: 16px 6px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r); }
.mais { background: none; border: 1px dashed var(--line-2); color: var(--muted); border-radius: var(--r); padding: 7px; font-size: 12.5px; transition: color .2s, border-color .2s; }
.mais:hover { color: var(--gold-2); border-color: var(--gold); }
.skel { height: 64px; border-radius: var(--r); background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.08), rgba(255,255,255,.03)); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) { .skel { animation: brilho 1.3s linear infinite; } @keyframes brilho { to { background-position: -200% 0; } } }

/* Blocos, números e funil */
.painel-bloco { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 14px; backdrop-filter: blur(10px); }
.bloco-cab { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
h2 { font-family: var(--display); font-weight: 500; font-size: 18px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 14px; font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 4px; }
.kpi::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; background: radial-gradient(circle, rgba(229,173,54,.18), transparent 70%); }
.kpi span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.kpi strong { font-family: var(--display); font-weight: 500; font-size: 30px; font-variant-numeric: tabular-nums; }
.funil { display: grid; gap: 8px; }
.funil .lin { display: grid; grid-template-columns: 240px 1fr 100px; gap: 12px; align-items: center; }
.funil .bar, .barra-trilho { height: 14px; background: rgba(1,23,42,.8); border-radius: 0 4px 4px 0; overflow: hidden; }
.funil .bar i, .barra-trilho i { display: block; height: 100%; border-radius: 0 4px 4px 0; width: var(--w); transform-origin: left; }
@media (prefers-reduced-motion: no-preference) { .funil .bar i, .barra-trilho i { animation: cresce .8s var(--ease) both; } @keyframes cresce { from { transform: scaleX(0); } } }
.funil .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* Gráficos de barras (estado e cidade) */
.grafico { display: grid; gap: 4px; }
.gl { display: grid; grid-template-columns: 190px 1fr 110px; gap: 12px; align-items: center; padding: 4px 6px; border-radius: 2px; cursor: pointer; transition: background .15s; }
.gl:hover, .gl:focus-visible { background: rgba(229,173,54,.07); outline: none; }
.gl .rot { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl .rot small { color: var(--muted); margin-left: 6px; }
.gl .barra-trilho { height: 16px; background: transparent; }
.gl .barra-trilho i { background: linear-gradient(90deg, #B8862A, var(--gold) 70%, var(--gold-2)); box-shadow: 0 0 14px rgba(229,173,54,.25); }
.gl:hover .barra-trilho i { box-shadow: 0 0 22px rgba(229,173,54,.5); }
.gl .val { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--fg); }
.dica { position: fixed; z-index: 70; pointer-events: none; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--r); padding: 8px 11px; font-size: 12.5px; box-shadow: 0 12px 30px rgba(0,0,0,.45); font-variant-numeric: tabular-nums; }
.dica b { display: block; font-size: 13px; margin-bottom: 2px; }
.dica span { display: block; color: var(--muted); }

/* Tabelas */
.tbox { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: rgba(1,23,42,.85); color: var(--muted); font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; position: sticky; top: 0; }
tbody tr { cursor: pointer; transition: background .15s; }
tbody tr:hover td { background: rgba(229,173,54,.05); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pag { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 12px 0; color: var(--muted); flex-wrap: wrap; }
form.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; background: var(--panel); border: 1px solid var(--line); padding: 12px; border-radius: var(--r); margin-bottom: 14px; }
form.inline label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }

/* Ficha lateral */
.vela { position: fixed; inset: 0; background: rgba(0,8,18,.6); backdrop-filter: blur(3px); z-index: 50; }
aside.ficha { position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100%); background: linear-gradient(180deg, #0B2745, #071C33); border-left: 1px solid var(--line-2); z-index: 51; display: flex; flex-direction: column; box-shadow: -24px 0 60px rgba(0,0,0,.5); }
@media (prefers-reduced-motion: no-preference) { aside.ficha { animation: entraFicha .28s var(--ease); } @keyframes entraFicha { from { transform: translateX(40px); opacity: 0; } } }
.ficha .cab { padding: 18px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; background: radial-gradient(500px 160px at 100% 0, rgba(229,173,54,.12), transparent 70%); }
.ficha .cab .lin1 { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.ficha .cab h3 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.ficha .cab .rz { color: var(--muted); font-size: 12.5px; }
.ficha .cab .ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.ficha .cab label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.ficha .abas2 { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.ficha .abas2 button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 10px; color: var(--muted); font-weight: 700; white-space: nowrap; transition: color .2s; }
.ficha .abas2 button[aria-selected=true] { color: var(--fg); border-bottom-color: var(--gold); text-shadow: 0 0 12px rgba(229,173,54,.4); }
.ficha .conteudo { padding: 18px; overflow-y: auto; flex: 1; display: grid; gap: 14px; align-content: start; }
dl.dados { display: grid; grid-template-columns: 140px 1fr; gap: 7px 12px; margin: 0; }
dl.dados dt { color: var(--muted); font-size: 12.5px; }
dl.dados dd { margin: 0; overflow-wrap: anywhere; }
.nova { display: grid; gap: 8px; background: rgba(1,23,42,.6); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
.nova textarea { min-height: 84px; resize: vertical; }
.nova .lin { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.item { border-left: 2px solid var(--line-2); padding: 4px 0 4px 12px; display: grid; gap: 3px; }
.item .meta { color: var(--muted); font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.item .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.item .apagar { background: none; border: 0; color: var(--muted); font-size: 12px; padding: 0; text-decoration: underline; }
.soltar { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 20px; text-align: center; color: var(--muted); transition: border-color .2s, background .2s; }
.soltar.sobre { border-color: var(--gold); color: var(--fg); background: var(--gold-dim); }
.doc { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 11px; background: rgba(1,23,42,.6); border: 1px solid var(--line); border-radius: var(--r); }
.doc .nm { overflow-wrap: anywhere; }
.fechar { background: none; border: 1px solid var(--line-2); border-radius: var(--r); width: 32px; height: 32px; font-size: 18px; line-height: 1; flex: none; transition: border-color .2s; }
.fechar:hover { border-color: var(--gold); }

/* Consulta CPF/CNPJ */
.consulta-campos { display: grid; grid-template-columns: 260px 1fr auto; gap: 12px; align-items: end; }
.consulta-campos label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.consulta-campos .lgpd { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; font-size: 12.5px; order: 3; }
.consulta-campos .btn { order: 2; }
.progresso { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.passo { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 3px; position: relative; overflow: hidden; }
.passo b { font-size: 13px; }
.passo span { font-size: 12px; color: var(--muted); }
.passo.rodando::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 40%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
@media (prefers-reduced-motion: no-preference) { .passo.rodando::after { animation: corre 1.1s ease-in-out infinite; } @keyframes corre { from { transform: translateX(-100%); } to { transform: translateX(260%); } } }
.passo.ok { border-color: rgba(63,208,168,.4); } .passo.ok b::before { content: "✓ "; color: var(--ok); }
.passo.erro { border-color: rgba(240,114,114,.45); } .passo.erro b::before { content: "! "; color: var(--bad); }
.relatorio { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); padding: 24px; margin-bottom: 14px; display: grid; gap: 20px; }
.rel-cab { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: start; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.rel-cab h2 { font-size: 22px; }
.rel-sel { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; padding: 3px 9px; border: 1px solid; border-radius: 2px; font-weight: 700; }
.rel-sel.bom { color: var(--ok); border-color: rgba(63,208,168,.5); }
.rel-sel.atencao { color: var(--warn); border-color: rgba(229,173,54,.5); }
.rel-sel.ruim { color: var(--bad); border-color: rgba(240,114,114,.5); }
.rel-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.rel-num { background: rgba(1,23,42,.6); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.rel-num span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.rel-num strong { font-family: var(--display); font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.relatorio h3 { margin: 0 0 8px; font-family: var(--display); font-weight: 500; font-size: 16px; color: var(--gold-2); }
.rel-nota { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--line-2); padding: 11px 15px; border-radius: var(--r); z-index: 80; box-shadow: 0 12px 34px rgba(0,0,0,.5); max-width: calc(100% - 32px); }
@media (prefers-reduced-motion: no-preference) { .toast:not([hidden]) { animation: surge .25s var(--ease); } }
.toast.erro { border-color: var(--bad); }

/* Celular */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; inset: 0 auto 0 0; width: 270px; transform: translateX(-100%); transition: transform .25s var(--ease); }
  .lateral.aberta { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.6); }
  .menu-btn { display: inline-block; }
  .topo { padding: 12px 16px 8px; }
  .filtros { margin: 0 16px; padding: 10px; }
  .chips { padding: 8px 16px 0; }
  main.corpo { padding: 12px 16px 24px; }
  .filtros input[type=search] { width: 100%; }
  .funil .lin, .gl { grid-template-columns: 1fr 80px; }
  .funil .bar, .gl .barra-trilho { grid-column: 1 / -1; grid-row: 2; }
  .consulta-campos { grid-template-columns: 1fr; }
  dl.dados { grid-template-columns: 1fr; }
  .ficha .cab .ctl { grid-template-columns: 1fr; }
  .kanban { height: calc(100vh - 260px); }
}

/* Impressão do relatório */
@media print {
  body { background: #fff; color: #111; }
  .fundo, .lateral, .topo, .filtros, .chips, .consulta-form, .progresso, [data-vista]:not([data-vista=consulta]), #c-hist, .painel-bloco:last-child, .nao-imprime { display: none !important; }
  .app, .principal { display: block; height: auto; }
  main.corpo { overflow: visible; padding: 0; }
  .relatorio { border: 0; background: #fff; color: #111; padding: 0; }
  .relatorio * { color: #111 !important; box-shadow: none !important; }
  .rel-num, .tbox, th { background: #fff !important; border-color: #ccc !important; }
  th, td { border-color: #ddd !important; white-space: normal; }
  .rel-cab { border-color: #01233E; }
  .marca-print { display: flex !important; }
}
.marca-print { display: none; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; color: #01233E; margin-bottom: 8px; }

/* Lista de empresas */
td.nome-col { white-space: normal; min-width: 240px; max-width: 380px; }
td.quebra { white-space: normal; word-break: break-all; max-width: 240px; }
.etq { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.etq::before { content: ""; width: 8px; height: 8px; background: var(--kc); box-shadow: 0 0 8px var(--kc); }
.paginas { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.paginas .btn { padding: 6px 10px; min-width: 38px; }
.reticencias { color: var(--muted); padding: 0 2px; }
@media (prefers-reduced-motion: no-preference) { #tbody tr { animation: surge .3s var(--ease) both; } }

/* Caixinha de carregamento na troca de tela (estilo portal: caixa clara, ícone desenhando, barra e porcentagem) */
.carregando { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(4,18,33,.45); backdrop-filter: blur(6px); }
.carregando-caixa { display: grid; justify-items: center; gap: 12px; width: min(400px, calc(100% - 32px)); padding: 30px 34px 26px; background: #FBFAF6; color: var(--navy); border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.carregando-caixa b { font-family: var(--sans); font-weight: 700; font-size: 16px; color: var(--navy); }
.carregando-caixa .trilho { width: 100%; height: 8px; background: #E9E4D8; border-radius: 6px; overflow: hidden; }
.carregando-caixa .trilho i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #C99325, var(--gold)); border-radius: 6px; transition: width .25s ease-out; }
.carregando-caixa strong { font-family: var(--display); font-weight: 600; font-size: 22px; color: #B98418; font-variant-numeric: tabular-nums; }
.risco { width: 64px; height: 64px; }
.risco path { fill: none; stroke: var(--navy); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 120; stroke-dashoffset: 0; }
.risco path.x { stroke: var(--gold); }
.carregando.pronto .risco path { stroke-dashoffset: 0 !important; animation: none !important; }
@media (prefers-reduced-motion: no-preference) {
  .carregando:not([hidden]) { animation: surge .2s var(--ease); }
  .carregando:not([hidden]) .carregando-caixa { animation: sobe .3s var(--ease); }
  .risco path { animation: desenha 1.6s ease-in-out infinite; }
  .risco path:nth-child(2) { animation-delay: .25s; } .risco path.x { animation-delay: .5s; }
  @keyframes desenha { 0% { stroke-dashoffset: 120; } 55% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -120; } }
  @keyframes sobe { from { transform: translateY(10px) scale(.97); opacity: 0; } }
}
td.quebra { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; word-break: normal; }

/* Relatório: a coluna nunca passa da largura da tela; tabelas largas rolam por dentro */
.relatorio { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.relatorio > * { min-width: 0; }
.rel-grade { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.rel-num { min-width: 0; }
.rel-num span { overflow-wrap: anywhere; }
.relatorio .tbox { max-width: 100%; }

/* Lista: tudo numa tela só, sem rolar para o lado */
[data-vista=lista] table { table-layout: fixed; }
[data-vista=lista] th, [data-vista=lista] td { padding: 9px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-vista=lista] th:nth-child(1) { width: 22%; } [data-vista=lista] th:nth-child(2) { width: 10%; }
[data-vista=lista] th:nth-child(3) { width: 4%; }  [data-vista=lista] th:nth-child(4) { width: 12%; }
[data-vista=lista] th:nth-child(5) { width: 10%; } [data-vista=lista] th:nth-child(6) { width: 14%; }
[data-vista=lista] th:nth-child(7) { width: 8%; }  [data-vista=lista] th:nth-child(8) { width: 11%; }
[data-vista=lista] th:nth-child(9) { width: 9%; }
[data-vista=lista] td.nome-col { white-space: normal; min-width: 0; max-width: none; }
[data-vista=lista] td.quebra { max-width: none; }
[data-vista=lista] .etq { white-space: nowrap; }

/* Processos no relatório: 10 por página, cabendo na largura */
.tab-proc { table-layout: fixed; }
.tab-proc th, .tab-proc td { padding: 8px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-proc th:nth-child(1) { width: 19%; } .tab-proc th:nth-child(2) { width: 8%; } .tab-proc th:nth-child(3) { width: 22%; }
.tab-proc th:nth-child(4) { width: 10%; } .tab-proc th:nth-child(5) { width: 9%; } .tab-proc th:nth-child(6) { width: 20%; } .tab-proc th:nth-child(7) { width: 12%; }
.tab-proc tr.fora-pagina { display: none; }
@media print { .tab-proc tr.fora-pagina { display: table-row; } .tab-proc th, .tab-proc td { white-space: normal; } }
