/* NeuroFlux Radar — identidade: tinta quase preta, sinal lima (#B6F24A), radar/fluxo. Mobile-first. */
:root {
  --bg: #080B10; --s1: #0F141C; --s2: #151B25; --s3: #1C2431; --line: #232D3B; --line2: #2E3A4C;
  --tx: #E8EDF5; --tx2: #B4BFCF; --mut: #7F8DA3;
  --acc: #B6F24A; --acc-ink: #101A02; --acc-d: #8FC22E; --cy: #5CE1E6; --am: #FFB547; --rd: #FF6B6B; --gr: #5BE3A0; --vi: #A98BFF;
  --raio: 14px; --raio-s: 9px;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 15px/1.5 var(--sans); overflow-x: hidden; min-height: 100vh; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .55;
  background: radial-gradient(900px 500px at 85% -10%, rgba(182,242,74,.07), transparent 60%), radial-gradient(700px 500px at -10% 110%, rgba(92,225,230,.06), transparent 60%); }
a { color: var(--acc); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; } h2 { font-size: 17px; font-weight: 650; } h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 .6em; } small, .peq { font-size: 12.5px; } .mut { color: var(--mut); } .tx2 { color: var(--tx2); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.oculto { display: none !important; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- estrutura */
#raiz { position: relative; z-index: 1; min-height: 100vh; }
.lateral { display: none; }
.topo { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: rgba(8,11,16,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.principal { padding: 18px 16px 96px; max-width: 1240px; margin: 0 auto; min-width: 0; }
.abas-baixo { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: rgba(12,16,23,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.abas-baixo a, .abas-baixo button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; color: var(--mut); font-size: 11px; background: none; border: 0; cursor: pointer; text-decoration: none; }
.abas-baixo svg { width: 22px; height: 22px; } .abas-baixo .ativo { color: var(--acc); }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 750; letter-spacing: -.02em; font-size: 17px; color: var(--tx); text-decoration: none !important; }
.logo svg { width: 28px; height: 28px; flex: none; } .logo small { font-weight: 500; color: var(--mut); letter-spacing: 0; }
.usuario { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #0b0f14; flex: none; }
@media (min-width: 960px) {
  #raiz { display: grid; grid-template-columns: 236px minmax(0, 1fr); }
  .lateral { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line); background: rgba(10,14,20,.7); }
  .topo, .abas-baixo { display: none; }
  .principal { padding: 28px 32px 60px; width: 100%; }
}
.lateral nav { display: flex; flex-direction: column; gap: 3px; }
.lateral nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: var(--tx2); text-decoration: none; font-weight: 550; }
.lateral nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; } .lateral nav a:hover { background: var(--s2); color: var(--tx); }
.lateral nav a.ativo { background: linear-gradient(90deg, rgba(182,242,74,.14), rgba(182,242,74,.03)); color: var(--acc); box-shadow: inset 2px 0 0 var(--acc); }
.lateral .rodape { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.cab { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.cab p { margin: 4px 0 0; color: var(--mut); }
.cab .acoes { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- componentes */
.cartao { background: linear-gradient(180deg, var(--s2), var(--s1)); border: 1px solid var(--line); border-radius: var(--raio); padding: 16px; min-width: 0; }
.cartao.plano { background: var(--s1); }
.cartao > h2, .cartao > .cab-c { margin-bottom: 12px; } .cab-c { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grade { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .g12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.kpi { background: var(--s1); border: 1px solid var(--line); border-radius: var(--raio); padding: 13px 14px; min-width: 0; position: relative; overflow: hidden; }
.kpi .r { font-size: 11.5px; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; }
.kpi .v { font-size: 26px; font-weight: 720; letter-spacing: -.02em; margin-top: 3px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi .n { font-size: 12px; color: var(--mut); } .kpi .barra { height: 5px; background: var(--s3); border-radius: 9px; margin-top: 9px; overflow: hidden; } .kpi .barra i { display: block; height: 100%; background: var(--acc); border-radius: 9px; }
.kpi.ok .v { color: var(--acc); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 15px; border-radius: 10px; border: 1px solid var(--line2); background: var(--s2); color: var(--tx); font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: var(--s3); border-color: #3a4960; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.pri { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); } .btn.pri:hover { background: #c6f967; }
.btn.perigo { color: var(--rd); border-color: rgba(255,107,107,.4); background: rgba(255,107,107,.07); }
.btn.peq { min-height: 32px; padding: 4px 11px; font-size: 13px; border-radius: 8px; } .btn.fantasma { background: transparent; }
.btn svg { width: 17px; height: 17px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid var(--line2); color: var(--tx2); background: var(--s2); white-space: nowrap; }
.chip.lima { color: var(--acc); border-color: rgba(182,242,74,.35); background: rgba(182,242,74,.08); } .chip.verm { color: var(--rd); border-color: rgba(255,107,107,.35); background: rgba(255,107,107,.08); }
.chip.amb { color: var(--am); border-color: rgba(255,181,71,.35); background: rgba(255,181,71,.08); } .chip.verde { color: var(--gr); border-color: rgba(91,227,160,.35); background: rgba(91,227,160,.08); }
.chip.cy { color: var(--cy); border-color: rgba(92,225,230,.35); background: rgba(92,225,230,.08); } .chip.vi { color: var(--vi); border-color: rgba(169,139,255,.35); background: rgba(169,139,255,.08); }
.chip.demo { color: var(--vi); border-style: dashed; }
input, select, textarea { width: 100%; background: var(--s1); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 12px; min-height: 40px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.45; } input::placeholder, textarea::placeholder { color: #5b697e; }
label.campo { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--mut); font-weight: 600; min-width: 0; } label.campo > :not(span) { color: var(--tx); font-weight: 400; }
.linha { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .linha > .cresce { flex: 1; min-width: 0; }
.vazio { padding: 26px 12px; text-align: center; color: var(--mut); border: 1px dashed var(--line2); border-radius: var(--raio); }
.aviso { padding: 11px 13px; border-radius: 10px; font-size: 13.5px; border: 1px solid var(--line2); background: var(--s2); color: var(--tx2); }
.aviso.am { border-color: rgba(255,181,71,.4); background: rgba(255,181,71,.07); color: #ffd9a1; } .aviso.verm { border-color: rgba(255,107,107,.45); background: rgba(255,107,107,.08); color: #ffb8b8; } .aviso.ok { border-color: rgba(182,242,74,.35); background: rgba(182,242,74,.07); color: #d9f79c; }
.sep { height: 1px; background: var(--line); margin: 14px 0; border: 0; }
.lista { display: flex; flex-direction: column; } .lista > * { padding: 11px 0; border-bottom: 1px solid var(--line); } .lista > *:last-child { border-bottom: 0; }

/* ---------- score / gauge */
.anel { position: relative; width: 108px; height: 108px; flex: none; } .anel svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anel .num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 750; font-size: 28px; font-variant-numeric: tabular-nums; line-height: 1; }
.anel .num small { display: block; font-size: 10.5px; font-weight: 500; color: var(--mut); margin-top: 2px; }
.pot { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; } .pot i { display: block; width: 44px; height: 6px; border-radius: 9px; background: var(--s3); overflow: hidden; } .pot i b { display: block; height: 100%; background: linear-gradient(90deg, var(--cy), var(--acc)); }

/* ---------- tabelas e cartões de empresa */
.tabela { display: none; width: 100%; border-collapse: collapse; }
.tabela th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); padding: 8px 10px; border-bottom: 1px solid var(--line2); white-space: nowrap; font-weight: 600; }
.tabela td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; } .tabela tbody tr { cursor: pointer; } .tabela tbody tr:hover { background: var(--s2); }
.tabela .nome { font-weight: 650; max-width: 300px; overflow-wrap: anywhere; } .tabela .sub { color: var(--mut); font-size: 12.5px; }
.cards-emp { display: flex; flex-direction: column; gap: 10px; }
.emp-card { display: block; background: var(--s1); border: 1px solid var(--line); border-radius: var(--raio); padding: 13px; color: var(--tx); text-decoration: none !important; min-width: 0; }
.emp-card:active, .emp-card:hover { border-color: var(--line2); background: var(--s2); } .emp-card .t { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; } .emp-card .nm { font-weight: 680; overflow-wrap: anywhere; }
.emp-card .m { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; align-items: center; } .emp-card .fim { margin-top: 9px; display: flex; justify-content: space-between; align-items: center; color: var(--mut); font-size: 12.5px; gap: 8px; }
@media (min-width: 900px) { .tabela { display: table; } .cards-emp { display: none; } }
.filtros { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); } @media (min-width: 900px) { .filtros { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.filtros .largo { grid-column: 1 / -1; }
.pag { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 10px; flex-wrap: wrap; }

/* ---------- abas internas */
.abas { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin: 0 0 16px; max-width: 100%; }
.abas::-webkit-scrollbar { display: none; }
.abas a { padding: 10px 14px; color: var(--mut); font-weight: 600; white-space: nowrap; text-decoration: none !important; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.abas a.ativo { color: var(--acc); border-color: var(--acc); }
.dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; } .dl > div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); min-width: 0; } .dl dt { color: var(--mut); flex: none; max-width: 46%; } .dl dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; }
@media (min-width: 720px) { .dl.duas { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; } }
.evid { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: flex-start; } .evid .pt { margin-left: auto; font-family: var(--mono); color: var(--acc); flex: none; } .evid span { min-width: 0; overflow-wrap: anywhere; }
.msg { background: var(--s1); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.5; }
.msg-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 12px 0 6px; flex-wrap: wrap; }
.passo { display: flex; gap: 12px; } .passo .bola { width: 30px; height: 30px; border-radius: 50%; background: var(--s3); border: 1px solid var(--line2); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--acc); flex: none; }
.passo + .passo { margin-top: 14px; } .passo > div:last-child { min-width: 0; flex: 1; }
.sol { border: 1px solid var(--line2); border-radius: 12px; padding: 13px; background: var(--s1); border-left: 3px solid var(--acc); min-width: 0; } .sol + .sol { margin-top: 10px; }
.sol .topo-s { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; } .sol .ganho { font-weight: 730; color: var(--acc); font-variant-numeric: tabular-nums; }
.dor { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line2); border-radius: 10px; cursor: pointer; background: var(--s1); min-width: 0; } .dor input { width: 20px; height: 20px; min-height: 0; flex: none; accent-color: var(--acc); padding: 0; }
.dor.on { border-color: rgba(182,242,74,.5); background: rgba(182,242,74,.07); } .dor span { min-width: 0; overflow-wrap: anywhere; }
.obj { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--s1); } .obj + .obj { margin-top: 8px; } .obj b { display: block; margin-bottom: 4px; color: var(--am); }
details.obj summary { cursor: pointer; font-weight: 650; list-style: none; } details.obj summary::-webkit-details-marker { display: none; } details.obj[open] summary { margin-bottom: 8px; color: var(--am); }
.hist { position: relative; padding-left: 18px; } .hist::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--line2); }
.hist > div { position: relative; padding: 6px 0 12px; } .hist > div::before { content: ""; position: absolute; left: -18px; top: 11px; width: 9px; height: 9px; border-radius: 50%; background: var(--s3); border: 2px solid var(--line2); }
.hist > div.etapa::before { background: var(--acc); border-color: var(--acc); } .hist .q { color: var(--mut); font-size: 12px; }

/* ---------- kanban */
.chips-etapa { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; max-width: 100%; } .chips-etapa::-webkit-scrollbar { display: none; }
.chips-etapa button { flex: none; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line2); background: var(--s1); color: var(--tx2); font-weight: 600; cursor: pointer; }
.chips-etapa button.ativo { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); } .chips-etapa button b { opacity: .7; margin-left: 4px; }
.kanban { display: none; } .kcol-m { display: flex; flex-direction: column; gap: 9px; }
.kcard { background: var(--s1); border: 1px solid var(--line); border-radius: 12px; padding: 11px; min-width: 0; } .kcard .nm { font-weight: 650; display: block; color: var(--tx); text-decoration: none !important; overflow-wrap: anywhere; }
.kcard .m { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; align-items: center; } .kcard select { margin-top: 9px; min-height: 34px; padding: 5px 9px; font-size: 13px; }
@media (min-width: 960px) {
  .chips-etapa, .kcol-m { display: none; }
  .kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 244px; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; max-width: 100%; }
  .kcol { background: var(--s1); border: 1px solid var(--line); border-radius: var(--raio); padding: 10px; min-height: 160px; display: flex; flex-direction: column; gap: 8px; }
  .kcol.sobre { border-color: var(--acc); background: rgba(182,242,74,.05); } .kcol h3 { display: flex; justify-content: space-between; padding: 2px 4px 6px; } .kcol h3 b { color: var(--mut); font-weight: 600; }
  .kcard { cursor: grab; } .kcard.arrastando { opacity: .4; }
}

/* ---------- gráficos */
.bar-h { display: grid; grid-template-columns: 92px minmax(0, 1fr) 64px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13.5px; }
.bar-h .trilho { height: 14px; background: var(--s3); border-radius: 7px; overflow: hidden; } .bar-h .trilho i { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--cy), var(--acc)); min-width: 2px; }
.bar-h .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.serie { width: 100%; height: auto; display: block; } .serie text { fill: var(--mut); font-size: 11px; font-family: var(--sans); }
.legenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--mut); margin-top: 6px; } .legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.conv { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; } .conv .seta { color: var(--mut); } .conv b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- modal, toast */
.fundo { position: fixed; inset: 0; background: rgba(3,5,8,.72); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--s1); border: 1px solid var(--line2); border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 720px) { .fundo { align-items: center; } .modal { border-radius: 18px; padding: 22px; } }
.modal h2 { margin-bottom: 12px; } .modal .acoes { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 82px; z-index: 80; background: var(--s3); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 16px; max-width: min(92vw, 520px); box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.toast.erro { border-color: rgba(255,107,107,.6); } .toast.ok { border-color: rgba(182,242,74,.6); } @media (min-width: 960px) { .toast { bottom: 28px; } }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--line2); border-top-color: var(--acc); border-radius: 50%; animation: gira .8s linear infinite; vertical-align: -3px; } @keyframes gira { to { transform: rotate(360deg); } }
.pulso { animation: pulsa 1.6s ease-in-out infinite; } @keyframes pulsa { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .spin, .pulso { animation: none; } }
.token-novo { font-family: var(--mono); font-size: 13px; word-break: break-all; padding: 12px; background: #0b1218; border: 1px dashed var(--acc); border-radius: 10px; color: var(--acc); }
pre.codigo { background: #0A0F15; border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; overflow-x: auto; font: 12.5px/1.55 var(--mono); color: #cfe3ff; margin: 8px 0 14px; max-width: 100%; white-space: pre; }
.radar-bg { position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; opacity: .5; pointer-events: none; }
@media print { .lateral, .topo, .abas-baixo { display: none; } }

.sol-kpis .kpi .v { font-size: 20px; white-space: nowrap; }
/* barra lateral: a coluna continua até o fim da página, mesmo em página longa */
@media (min-width: 960px) { #raiz { background: linear-gradient(90deg, rgba(10,14,20,.7) 235px, var(--line) 235px 236px, transparent 236px); } }
/* campo de data em pt-BR (ver app.js) */
.data-br { position: relative; display: inline-block; width: 100%; max-width: 100%; }
.data-br-txt { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-br-txt::after { content: "📅"; font-size: 13px; opacity: .7; }
.data-br-txt.vazio { opacity: .6; }
.data-br input[type="date"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; min-height: 0; }
.data-br:focus-within .data-br-txt { outline: 2px solid var(--acc, #c6ff3d); outline-offset: 1px; }
