/* ================= tokens ================= */
:root, [data-tema="escuro"] {
  --bg: #090A09;
  --brilho: rgba(117, 244, 55, .07);
  --surface: #111211;
  --surface-2: #171817;
  --surface-3: #1F201F;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --text: #F3F4F1;
  --muted: #9A9C95;
  --dim: #63655F;
  --accent: #75F437;
  --accent-ink: #0B1404;
  --accent-text: #8EF95C;
  --accent-soft: rgba(117, 244, 55, .12);
  --accent-line: rgba(117, 244, 55, .38);
  --danger: #FF6B5E;
  --danger-soft: rgba(255, 107, 94, .12);
  --warn: #F5C451;
  --warn-soft: rgba(245, 196, 81, .12);
  --hachura: repeating-linear-gradient(135deg, rgba(255, 255, 255, .075) 0 2px, transparent 2px 7px);
  --sombra: 0 24px 48px -28px rgba(0, 0, 0, .7);
  --vidro: rgba(17, 18, 17, .72);
  --input: #0D0E0D;
  color-scheme: dark;
}
[data-tema="claro"] {
  --bg: #F3F3EF;
  --brilho: rgba(117, 244, 55, .16);
  --surface: #FFFFFF;
  --surface-2: #F7F7F4;
  --surface-3: #EEEEE9;
  --line: rgba(18, 19, 17, .07);
  --line-2: rgba(18, 19, 17, .13);
  --text: #121311;
  --muted: #62645E;
  --dim: #A3A59E;
  --accent-text: #2E8A0B;
  --accent-soft: rgba(117, 244, 55, .18);
  --accent-line: rgba(46, 138, 11, .32);
  --danger: #D2412F;
  --danger-soft: rgba(210, 65, 47, .08);
  --warn: #A0700A;
  --warn-soft: rgba(245, 196, 81, .2);
  --hachura: repeating-linear-gradient(135deg, rgba(18, 19, 17, .08) 0 2px, transparent 2px 7px);
  --sombra: 0 20px 40px -28px rgba(18, 19, 17, .25);
  --vidro: rgba(255, 255, 255, .8);
  --input: #F7F7F4;
  color-scheme: light;
}
:root {
  --r-lg: 22px;
  --r: 16px;
  --r-sm: 11px;
  --sans: "Geist", "Inter", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}

/* ================= base ================= */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); min-height: 100vh;
  font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(1200px 520px at 70% -180px, var(--brilho), transparent 70%);
  background-attachment: fixed;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
svg { flex: none; }
.mono { font-family: var(--mono); }
.rotulo-mono { font: 500 10.5px/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--dim); }
.kicker { font: 500 10.5px/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--dim); }
.num { font-variant-numeric: tabular-nums; }

/* ================= botões ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line-2); background: transparent;
  font-weight: 500; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s, color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn-primario { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primario:hover { background: #8BFF55; border-color: #8BFF55; }
.btn-fantasma { border-color: transparent; color: var(--muted); }
.btn-fantasma:hover { color: var(--text); }
.btn-icone { width: 36px; height: 36px; padding: 0; }
.btn-perigo:hover { color: var(--danger); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.redondo {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line-2); color: var(--muted); background: transparent; transition: .15s;
}
.redondo svg { width: 15px; height: 15px; }
.redondo:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.pilulas { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.pilulas button {
  border: 0; background: none; height: 32px; padding: 0 14px; border-radius: 999px; color: var(--muted); font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.pilulas button:hover { color: var(--text); }
.pilulas button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ================= login ================= */
#login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 390px; padding: 34px 30px 30px; border-radius: 26px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sombra); position: relative; overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; inset: -40% -20% auto; height: 260px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent); pointer-events: none;
}
.login-card > * { position: relative; }
.login-card h1 { font-weight: 500; font-size: 30px; line-height: 1.1; letter-spacing: -.02em; margin: 28px 0 8px; }
.login-card p { margin: 0 0 24px; color: var(--muted); }
.login-card label { font-size: 13px; font-weight: 500; display: block; margin-bottom: 8px; }

/* ================= marca ================= */
.logo {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px -8px rgba(117, 244, 55, .55);
}
.logo svg { width: 20px; height: 20px; }
.marca { display: flex; align-items: center; gap: 12px; }
.marca b { display: block; font-weight: 500; font-size: 16px; line-height: 1.15; }
.marca small { font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }

/* ================= casca ================= */
.casca { display: grid; grid-template-columns: 88px minmax(0, 1fr); min-height: 100vh; }
.trilho {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 20px 0 18px; border-right: 1px solid var(--line); background: var(--vidro); backdrop-filter: blur(16px); z-index: 20;
}
.trilho .logo { margin-bottom: 22px; }
.trilho nav { display: grid; gap: 6px; }
.trilho-base { margin-top: auto; display: grid; gap: 6px; justify-items: center; }
.rail {
  position: relative; width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center;
  border: 1px solid transparent; background: none; color: var(--dim); transition: background .15s, color .15s, border-color .15s;
}
.rail svg { width: 21px; height: 21px; }
.rail:hover { color: var(--text); background: var(--surface-2); }
.rail[aria-current="page"] { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-line); }
.rail[aria-current="page"]::before {
  content: ""; position: absolute; left: -21px; top: 13px; bottom: 13px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.rail .contador {
  position: absolute; top: 5px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
  background: var(--accent); color: var(--accent-ink); font: 600 9.5px/17px var(--mono); text-align: center;
}
.rail.novo { border: 1px dashed var(--line-2); color: var(--accent-text); margin-top: 6px; }
.rail.novo:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.rail[data-dica]:hover::after {
  content: attr(data-dica); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  background: var(--text); color: var(--bg); font: 500 12.5px var(--sans); padding: 6px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none;
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; position: relative;
  background: var(--surface-3); color: var(--text); font: 500 14px var(--sans); border: 1px solid var(--line-2);
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar .ponto { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.avatar .ponto.off { background: var(--danger); }

.principal { min-width: 0; padding: 26px clamp(18px, 3vw, 40px) 70px; max-width: 1480px; width: 100%; }
.topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.topo .ola { margin: 0 0 8px; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.topo .ola b { color: var(--text); font-weight: 500; }
.topo .ola .vivo { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.topo h1 { margin: 0; font-weight: 500; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.05; letter-spacing: -.025em; }
.topo .sub { margin-top: 8px; color: var(--muted); font-size: 15px; max-width: 60ch; }
.topo-acoes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.selo-simulado {
  font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--warn);
  background: var(--warn-soft); padding: 8px 12px; border-radius: 999px;
}

/* ================= cards ================= */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; }
.c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px;
  min-width: 0; position: relative; box-shadow: var(--sombra);
}
.card-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-cab h2 { margin: 0; font-weight: 500; font-size: 16.5px; letter-spacing: -.01em; }
.card-cab .sub { color: var(--dim); font-size: 12.5px; margin-top: 2px; }

/* números */
.kpi { display: flex; flex-direction: column; gap: 18px; min-height: 152px; }
.kpi-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-rotulo { display: flex; align-items: center; gap: 10px; }
.kpi-icone { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.kpi-icone svg { width: 16px; height: 16px; }
.kpi strong { font-weight: 500; font-size: 42px; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-base { display: flex; align-items: center; gap: 8px; margin-top: auto; font-size: 12.5px; color: var(--dim); flex-wrap: wrap; }
.delta {
  display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: 999px;
  font: 500 11.5px var(--mono); background: var(--accent-soft); color: var(--accent-text); white-space: nowrap;
}
.delta.baixa { background: var(--danger-soft); color: var(--danger); }
.delta.neutro { background: var(--surface-3); color: var(--muted); }
.kpi.destaque {
  background: linear-gradient(150deg, #1C3A0D 0%, #0F1F07 55%, #0B1505 100%); border-color: rgba(117, 244, 55, .25); color: #F3F4F1;
}
.kpi.destaque::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(260px 140px at 85% 0%, rgba(117, 244, 55, .28), transparent 70%);
}
.kpi.destaque > * { position: relative; z-index: 1; }
.kpi.destaque .kpi-icone { background: rgba(117, 244, 55, .16); color: var(--accent); }
.kpi.destaque .rotulo-mono { color: rgba(243, 244, 241, .6); }
.kpi.destaque .kpi-base { color: rgba(243, 244, 241, .55); }
.kpi.destaque .delta { background: rgba(117, 244, 55, .16); color: var(--accent); }
.kpi.destaque .delta.baixa { background: rgba(255, 107, 94, .16); color: #FF8A7E; }
.kpi.destaque .redondo { border-color: rgba(255, 255, 255, .2); color: #F3F4F1; }

/* gráfico de barras */
.grafico { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; height: 250px; }
.eixo-y { display: flex; flex-direction: column; justify-content: space-between; font: 400 11px var(--mono); color: var(--dim); text-align: right; padding-bottom: 26px; }
.eixo-y span { line-height: 0; }
.area { position: relative; display: flex; flex-direction: column; min-width: 0; }
.linhas { position: absolute; inset: 0 0 26px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.linhas i { border-top: 1px dashed var(--line); }
.barras { position: relative; flex: 1; display: flex; align-items: flex-end; gap: clamp(3px, .7vw, 10px); }
.coluna { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; min-width: 0; }
.barra {
  width: 100%; border-radius: 9px 9px 5px 5px; background: var(--hachura), var(--surface-2);
  border: 1px solid var(--line); position: relative; min-height: 3px; transition: background .15s;
}
.barra::before { content: ""; position: absolute; left: 18%; right: 18%; top: -1px; height: 3px; border-radius: 3px; background: var(--accent); }
.barra.vazia::before { display: none; }
.barra.vazia { background: var(--surface-2); }
.barra.maior { background: linear-gradient(180deg, #A4FF72, var(--accent)); border-color: transparent; box-shadow: 0 0 24px -6px rgba(117, 244, 55, .6); }
.barra.maior::before { display: none; }
.coluna:hover .barra:not(.maior) { background: var(--hachura), var(--surface-3); }
.balao-valor {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); white-space: nowrap;
  font: 500 11.5px var(--mono); padding: 4px 8px; border-radius: 999px; background: var(--text); color: var(--bg); opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 2;
}
.coluna:hover .balao-valor, .coluna.fixo .balao-valor { opacity: 1; }
.coluna.fixo .balao-valor { background: var(--accent); color: var(--accent-ink); }
.eixo-x { display: flex; gap: clamp(3px, .7vw, 10px); height: 26px; align-items: flex-end; }
.eixo-x span { flex: 1; text-align: center; font: 400 11px var(--mono); color: var(--dim); white-space: nowrap; min-width: 0; overflow: visible; }
.eixo-x span.forte { color: var(--text); }
.legenda-total { display: flex; align-items: baseline; gap: 10px; }
.legenda-total b { font-weight: 500; font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* funil */
.medidor { position: relative; width: 100%; max-width: 250px; margin: 2px auto 10px; }
.medidor svg { width: 100%; height: auto; display: block; }
.medidor .meio { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; }
.medidor .meio b { display: block; font-weight: 500; font-size: 38px; line-height: 1; letter-spacing: -.03em; }
.medidor .meio small { color: var(--muted); font-size: 12.5px; }
.etapas { display: grid; margin-top: 8px; }
.etapa-f { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.etapa-f:first-child { border-top: 0; }
.etapa-f i { width: 10px; height: 10px; border-radius: 3px; }
.etapa-f b { font-weight: 500; font-variant-numeric: tabular-nums; }
.etapa-f small { font: 400 11.5px var(--mono); color: var(--dim); min-width: 52px; text-align: right; }

/* destaque verde */
.insight {
  background: linear-gradient(140deg, #A4FF72 0%, var(--accent) 45%, #5ED62A 100%); color: var(--accent-ink);
  border: 0; display: flex; flex-direction: column; overflow: hidden; min-height: 290px;
}
.insight::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .45), transparent); pointer-events: none;
}
.insight .chip {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--accent-ink); color: var(--accent); font-size: 12.5px; font-weight: 500; position: relative; z-index: 1;
}
.insight .chip svg { width: 14px; height: 14px; }
.insight p { margin: 18px 0 0; font-weight: 500; font-size: clamp(21px, 1.9vw, 26px); line-height: 1.28; letter-spacing: -.015em; position: relative; z-index: 1; text-wrap: balance; }
.insight p em { font-style: normal; display: inline-block; padding: 0 10px; border: 1.5px solid var(--accent-ink); border-radius: 999px; line-height: 1.3; }
.insight .rodape { margin-top: auto; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: rgba(11, 20, 4, .72); position: relative; z-index: 1; }
.insight .rodape b { color: var(--accent-ink); font-weight: 600; }
.trilha { display: flex; gap: 5px; margin-top: 18px; position: relative; z-index: 1; }
.trilha i { width: 22px; height: 7px; border-radius: 3px; background: rgba(11, 20, 4, .2); }
.trilha i.on { background: var(--accent-ink); }

.insight .partes { display: grid; gap: 9px; margin-top: 20px; position: relative; z-index: 1; }
.insight .parte { display: grid; grid-template-columns: 96px 1fr 40px; gap: 10px; align-items: center; font-size: 12.5px; }
.insight .parte span { font: 500 11px var(--mono); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insight .parte i { height: 8px; border-radius: 99px; background: rgba(11, 20, 4, .16); overflow: hidden; }
.insight .parte i b { display: block; height: 100%; border-radius: 99px; background: var(--accent-ink); }
.insight .parte em { font: 500 12px var(--mono); font-style: normal; text-align: right; }
/* mapa de calor */
.calor { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; align-items: center; }
.calor .dia { font: 400 11px var(--mono); color: var(--dim); }
.calor .dia.forte { color: var(--text); }
.calor .q { aspect-ratio: 1.15; border-radius: 4px; background: var(--surface-3); min-width: 0; }
.calor .q.n1 { background: rgba(117, 244, 55, .22); }
.calor .q.n2 { background: rgba(117, 244, 55, .45); }
.calor .q.n3 { background: rgba(117, 244, 55, .72); }
.calor .q.n4 { background: var(--accent); box-shadow: 0 0 12px rgba(117, 244, 55, .45); }
.calor .hora { font: 400 10px var(--mono); color: var(--dim); text-align: left; height: 14px; }
.escala { display: inline-flex; align-items: center; gap: 4px; font: 400 11px var(--mono); color: var(--dim); }
.escala i { width: 11px; height: 11px; border-radius: 3px; }
.resumo-calor { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.resumo-calor small { display: block; color: var(--dim); font-size: 12px; }
.resumo-calor b { font-weight: 500; font-size: 15px; }

/* listas */
.ranking, .recentes { display: grid; }
.lin { display: grid; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); min-width: 0; }
.lin:first-child { border-top: 0; padding-top: 2px; }
.ranking .lin { grid-template-columns: 22px 42px minmax(0, 1fr) 110px 44px; }
.pos { font: 500 12px var(--mono); color: var(--dim); }
.mini-thumb {
  width: 42px; height: 42px; border-radius: 11px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--dim); flex: none;
}
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-thumb svg { width: 18px; height: 18px; }
.lin .nome { min-width: 0; }
.lin .nome b { display: block; font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lin .nome small { display: block; color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trilho-barra { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.trilho-barra i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.lin .valor { font: 500 14px var(--sans); text-align: right; font-variant-numeric: tabular-nums; }
.recentes .lin { grid-template-columns: 36px minmax(0, 1fr) auto; }
.pessoa { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font: 500 13px var(--sans); color: var(--muted); flex: none; }
.vazio-mini { color: var(--dim); font-size: 14px; padding: 24px 0; text-align: center; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; font: 500 10.5px var(--mono); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
  padding: 5px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); justify-self: start;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.enviado, .badge.simulado { background: var(--accent-soft); color: var(--accent-text); }
.badge.erro { background: var(--danger-soft); color: var(--danger); }
.badge.processando { background: var(--warn-soft); color: var(--warn); }

/* ================= automações ================= */
.barra-filtros { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.auto { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.auto.pausada > :not(.auto-cab) { opacity: .5; }
.auto-cab { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.auto-cab .mini-thumb { width: 52px; height: 52px; border-radius: 14px; }
.auto-cab h3 { margin: 0; font-weight: 500; font-size: 15.5px; line-height: 1.25; letter-spacing: -.005em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.auto-cab small { display: block; color: var(--dim); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palavras { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font: 500 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent-text); background: var(--accent-soft); padding: 4px 8px; border-radius: 7px;
}
.tag.neutra { background: var(--surface-3); color: var(--muted); }
.auto-nums { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.auto-nums div { padding: 10px 12px; min-width: 0; }
.auto-nums div + div { border-left: 1px solid var(--line); }
.auto-nums small { display: block; color: var(--dim); font-size: 11.5px; }
.auto-nums b { font-weight: 500; font-size: 20px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.auto-nums b span { font: 400 11px var(--mono); color: var(--dim); margin-left: 5px; letter-spacing: 0; }
.faisca { width: 100%; height: 46px; display: block; }
.auto-base { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--dim); font-size: 12.5px; margin-top: auto; }
.acoes { display: flex; gap: 2px; }

/* interruptor */
.switch { position: relative; width: 40px; height: 23px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background .2s, border-color .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(17px); background: var(--accent-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--accent-line); outline-offset: 2px; }

.vazio { background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 52px 24px; text-align: center; }
.vazio .bolha { width: 54px; height: 54px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); display: inline-grid; place-items: center; }
.vazio .bolha svg { width: 24px; height: 24px; }
.vazio h3 { font-weight: 500; font-size: 21px; margin: 16px 0 6px; letter-spacing: -.01em; }
.vazio p { color: var(--muted); margin: 0 auto 22px; max-width: 420px; }

/* ================= histórico ================= */
.tabela { padding: 6px 0 4px; }
.tabela .linha { display: grid; grid-template-columns: 210px minmax(0, 1fr) 200px 120px; gap: 16px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.tabela .linha.cab { border-top: 0; padding-top: 12px; padding-bottom: 10px; }
.quem { display: flex; align-items: center; gap: 10px; min-width: 0; }
.quem b { font-weight: 500; font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quem small { display: block; font: 400 11px var(--mono); color: var(--dim); }
.coment { color: var(--muted); font-size: 14px; min-width: 0; }
.coment span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coment .erro { color: var(--danger); font-size: 12.5px; white-space: normal; margin-top: 4px; }
.linha .auto-nome { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.busca {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; min-width: 260px;
  background: var(--surface); border: 1px solid var(--line);
}
.busca:focus-within { border-color: var(--accent-line); }
.busca svg { width: 15px; height: 15px; color: var(--dim); }
.busca input { border: 0; outline: none; background: none; width: 100%; font-size: 14px; }

/* ================= editor ================= */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; align-items: start; }
.etapa { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px 24px; }
.etapa + .etapa { margin-top: 12px; }
.etapa-cab { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.etapa-num { width: 30px; height: 30px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font: 500 12.5px var(--mono); }
.etapa-cab h3 { margin: 0; font-weight: 500; font-size: 16.5px; line-height: 1.2; }
.etapa-cab p { margin: 2px 0 0; color: var(--dim); font-size: 13px; }
.campo { display: grid; gap: 8px; }
.campo + .campo { margin-top: 18px; }
.campo label, .rotulo { font-size: 13px; font-weight: 500; }
.campo small { color: var(--dim); font-size: 12.5px; }
.input, .textarea {
  width: 100%; background: var(--input); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239A9C95' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 38px; }
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.contador { font: 400 11px var(--mono); color: var(--dim); justify-self: end; margin-top: -4px; }
.dica code { font: 500 12px var(--mono); color: var(--accent-text); background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; }
.gatilhos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.gatilho {
  display: grid; gap: 4px; text-align: left; padding: 14px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line); transition: border-color .15s, background .15s;
}
.gatilho:hover { border-color: var(--line-2); }
.gatilho svg { width: 20px; height: 20px; color: var(--dim); margin-bottom: 6px; }
.gatilho b { font-weight: 500; font-size: 14px; }
.gatilho small { color: var(--dim); font-size: 12px; line-height: 1.35; }
.gatilho[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); }
.gatilho[aria-pressed="true"] svg { color: var(--accent-text); }
.posts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.post { position: relative; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; padding: 0; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.post img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.post:hover img { transform: scale(1.04); }
.post[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.post[aria-pressed="true"]::after {
  content: ""; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B1404' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.post.qualquer { display: grid; place-content: center; gap: 8px; justify-items: center; font-size: 12px; font-weight: 500; padding: 8px; text-align: center; border-style: dashed; border-color: var(--line-2); }
.post.qualquer svg { width: 20px; height: 20px; color: var(--accent-text); }
.post.esqueleto { animation: pulsar 1.2s ease-in-out infinite; }
@keyframes pulsar { 50% { opacity: .5; } }
.post .tipo { position: absolute; left: 6px; bottom: 6px; font: 500 9px var(--mono); text-transform: uppercase; letter-spacing: .06em; background: rgba(9, 10, 9, .75); color: #fff; padding: 3px 6px; border-radius: 5px; }
.segmentado { display: inline-grid; grid-auto-flow: column; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.segmentado button { border: 0; background: none; height: 34px; padding: 0 14px; border-radius: 999px; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.segmentado button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.marcar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.marcar + .marcar { margin-top: 16px; }
.marcar small { display: block; color: var(--dim); font-size: 12.5px; margin-top: 2px; }
.rodape-editor {
  position: sticky; bottom: 16px; margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 20px; border-radius: 999px; background: var(--vidro); backdrop-filter: blur(16px);
  border: 1px solid var(--line-2); box-shadow: var(--sombra); z-index: 5;
}
.rodape-editor .erro-form { color: var(--danger); font-size: 13.5px; }
.rodape-editor .info { color: var(--muted); font-size: 13px; }

/* prévia no celular */
.previa-col { position: sticky; top: 24px; }
.celular { background: #050505; border-radius: 34px; padding: 8px; border: 1px solid rgba(255, 255, 255, .1); box-shadow: var(--sombra); }
.cel-tela { background: #000; border-radius: 27px; overflow: hidden; }
.cel-topo { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #161616; color: #fff; }
.cel-topo .avatar { width: 30px; height: 30px; font-size: 13px; background: #262626; border: 0; color: #fff; }
.cel-topo b { font-weight: 500; font-size: 14px; display: block; line-height: 1.2; }
.cel-topo small { color: #6b6b6b; font-size: 11.5px; }
.cel-corpo { padding: 18px 14px 22px; min-height: 280px; display: flex; flex-direction: column; gap: 6px; }
.cel-hora { align-self: center; font-size: 11px; color: #5c5c5c; margin-bottom: 8px; }
.contexto { font-size: 11.5px; color: #6b6b6b; margin-left: 4px; }
.balao { max-width: 88%; background: #262626; color: #fafafa; padding: 10px 13px; border-radius: 20px 20px 20px 6px; font-size: 14px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }
.balao a { color: #A9C7FF; text-decoration: underline; text-underline-offset: 2px; }
.balao.vazio-b { color: #6b6b6b; font-style: italic; }
.balao.com-botao { border-radius: 20px 20px 6px 6px; }
.botao-direct { max-width: 88%; margin-top: -2px; background: #262626; color: #fafafa; border-top: 1px solid #363636; border-radius: 6px 6px 20px 20px; padding: 10px 13px; text-align: center; font-size: 14px; font-weight: 600; }
.comentario-prev { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.comentario-prev .kicker { display: block; margin-bottom: 12px; }
.comentario-prev .cl { display: flex; gap: 10px; font-size: 13.5px; }
.comentario-prev .cl + .cl { margin-top: 10px; padding-left: 26px; }
.comentario-prev .mini { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); flex: none; }
.comentario-prev .mini.eu { background: var(--accent-ink); box-shadow: inset 0 0 0 5px var(--accent); width: 18px; height: 18px; }
.comentario-prev b { font-weight: 500; margin-right: 6px; }

/* conta */
.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.painel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.painel h2 { margin: 10px 0 6px; font-weight: 500; font-size: 19px; letter-spacing: -.01em; }
.painel > p { margin: 0 0 20px; color: var(--muted); }
.conta-linha { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.conta-linha .info { flex: 1; min-width: 0; }
.conta-linha .info b { font-weight: 500; }
.conta-linha .info small { display: block; color: var(--dim); font: 400 11.5px var(--mono); margin-top: 2px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; z-index: 60;
  background: var(--text); color: var(--bg); font-weight: 500; font-size: 14px; padding: 11px 18px; border-radius: 999px;
  transition: .25s; pointer-events: none; display: flex; align-items: center; gap: 8px; box-shadow: var(--sombra);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.toast.ver { opacity: 1; transform: translate(-50%, 0); }
.toast.erro::before { background: var(--danger); }

/* ================= responsivo ================= */
@media (max-width: 1280px) {
  .c3 { grid-column: span 6; }
  .c4, .c5, .c6, .c7, .c8 { grid-column: span 12; }
  .editor { grid-template-columns: 1fr; }
  .previa-col { position: static; }
}
@media (min-width: 1000px) and (max-width: 1280px) {
  .c4.lado { grid-column: span 5; } .c8.lado { grid-column: span 7; }
}
@media (max-width: 860px) {
  .casca { grid-template-columns: 1fr; }
  .trilho {
    position: fixed; top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); left: 10px; right: 10px; height: auto;
    flex-direction: row; justify-content: space-around; padding: 6px; border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--sombra);
  }
  .trilho .logo, .trilho-base { display: none; }
  .trilho nav { display: flex; width: 100%; justify-content: space-around; }
  .rail[aria-current="page"]::before, .rail[data-dica]:hover::after { display: none; }
  .rail.novo { margin-top: 0; }
  .principal { padding: 22px 16px 110px; }
  .topo .ola { display: block; font-size: 13px; }
  .topo .ola .vivo { display: inline-block; margin-right: 6px; vertical-align: middle; }
  .kpi { min-height: 0; gap: 12px; }
  .kpi strong { font-size: 32px; }
  .duas { grid-template-columns: 1fr; }
  .tabela .linha { grid-template-columns: 1fr auto; }
  .tabela .linha .auto-nome, .tabela .linha.cab { display: none; }
  .tabela .linha .coment { grid-column: 1 / -1; grid-row: 2; }
  .gatilhos { grid-template-columns: 1fr; }
  .posts { grid-template-columns: repeat(3, 1fr); }
  .rodape-editor { bottom: 86px; }
  .ranking .lin { grid-template-columns: 18px 42px minmax(0, 1fr) 40px; }
  .ranking .lin .trilho-barra { display: none; }
  .calor { grid-template-columns: 28px repeat(24, minmax(0, 1fr)); gap: 2px; }
  .busca { min-width: 0; flex: 1; }
  .grafico { height: 210px; }
}
@media (max-width: 520px) {
  .grade { grid-template-columns: 1fr; }
  .etapa { padding: 18px; }
  .topo-acoes .btn-primario span { display: none; }
  .kpi strong { font-size: 28px; }
  .kpi { padding: 16px; }
  .kpi-rotulo .kpi-icone { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
