/* InstaFlow · Início: números e gráficos (estilo painel de BI) */
.dash-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-sec { font: 800 .8rem var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: -8px; }

/* cartões de números */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.kpi { min-width: 0; display: grid; gap: 7px; align-content: start; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease, border-color .15s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.kpi h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 800 .76rem var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.kpi h3 svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.kpi .ln { color: var(--muted); font-size: .88rem; line-height: 1.35; }
.kpi .ln b { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi .big { font: 800 1.85rem/1.05 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi .big small { font: 600 .9rem var(--body); color: var(--muted); }
.kpi .bar { margin-top: 2px; }
.trend { display: inline-flex; align-items: center; gap: 4px; justify-self: start; padding: 2px 8px; border-radius: 999px; font: 700 .75rem var(--body); }
.trend.up { background: var(--ok-soft); color: var(--ok); }
.trend.down { background: var(--bad-soft); color: var(--bad); }
.trend.flat { background: var(--surface-2); color: var(--muted); }

/* cartão de gráfico */
.chart-card { min-width: 0; display: grid; gap: 16px; align-content: start; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chart-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chart-title .ib { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.chart-title .ib svg { width: 20px; height: 20px; }
.chart-title h2 { font-size: 1.05rem; }
.chart-title h2 small { font: 600 .84rem var(--body); color: var(--muted); }
.chart-title p { color: var(--muted); font-size: .84rem; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--muted); font-size: .82rem; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; vertical-align: -1px; }
.legend i.dash { width: 16px; height: 0; border-radius: 0; border-top: 2px dashed; background: none !important; vertical-align: 3px; }
.badge-ok { padding: 6px 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font: 700 .82rem var(--body); white-space: nowrap; }
.dash-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

/* gráficos (charts.js) */
.ch-wrap { position: relative; min-width: 0; }
svg.ch { display: block; width: 100%; height: auto; overflow: visible; }
.ch-grid { stroke: var(--line); stroke-dasharray: 3 5; }
.ch-ax { fill: var(--muted); font: 500 11.5px var(--body); }
.ch-x { fill: var(--ink-2); font-weight: 700; }
.ch-line { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ch-line.dashed { stroke-width: 2; stroke-dasharray: 6 6; }
.ch-dot, .ch-dot-hl { stroke: var(--surface); stroke-width: 2; }
.ch-mark { stroke: var(--muted); stroke-dasharray: 2 4; }
.ch-mark-t { fill: var(--muted); font-weight: 700; }
.ch-guide { stroke: var(--ink-2); stroke-opacity: .35; }
.ch-hit { fill: transparent; cursor: crosshair; }
.ch-band { fill: transparent; }
.ch-grp:hover .ch-band { fill: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.ch-tip { position: absolute; z-index: 5; display: grid; gap: 5px; min-width: 160px; padding: 10px 12px; border-radius: 12px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-size: .8rem; pointer-events: none; }
.ch-tip b { font-size: .84rem; }
.ch-tip span { display: flex; align-items: center; gap: 7px; }
.ch-tip i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ch-tip em { margin-left: auto; padding-left: 14px; font-style: normal; font-weight: 800; }
.ch-empty { padding: 44px 12px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }

/* rosca */
.ch-donut { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 22px; align-items: center; }
.ch-donut-g { position: relative; }
.ch-donut-g svg { display: block; width: 100%; height: auto; }
.ch-ring { fill: none; stroke: var(--surface-2); stroke-width: 26; }
.ch-seg { fill: none; stroke-width: 26; cursor: pointer; transition: opacity .15s; }
.ch-seg.dim, .ch-legend li.dim { opacity: .28; }
.ch-donut-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.ch-donut-c b { font: 800 1.7rem/1 var(--display); }
.ch-donut-c span { max-width: 120px; margin: 5px auto 0; overflow: hidden; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.ch-legend { display: grid; gap: 9px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.ch-legend li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; align-items: center; gap: 9px; font-size: .84rem; transition: opacity .15s; }
.ch-legend i { width: 14px; height: 14px; border-radius: 4px; }
.ch-legend .lbl { overflow: hidden; color: var(--ink-2); font-weight: 700; letter-spacing: .02em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.ch-legend b { font-variant-numeric: tabular-nums; }
.ch-legend em { min-width: 38px; color: var(--muted); font-style: normal; text-align: right; }

/* funil */
.ch-funnel { --fun-a: #FF5A12; --fun-b: #FFB52E; position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); height: 250px; }
.ch-funnel svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ch-sep { stroke: var(--line); }
.ch-fun-halo { fill: var(--fun-a); opacity: .16; }
.ch-fun-col { position: relative; display: grid; grid-template-rows: auto 1fr auto; align-items: center; justify-items: center; padding: 10px 6px 12px; text-align: center; }
.ch-fun-col b { font: 800 1.2rem var(--display); font-variant-numeric: tabular-nums; }
.ch-pill { padding: 5px 13px; border-radius: 999px; background: #14161B; color: #fff; font: 800 .84rem var(--body); box-shadow: 0 3px 10px rgba(0, 0, 0, .28); }
.ch-fun-col em { color: var(--ink-2); font-size: .86rem; font-style: normal; }

/* mapa de calor */
.ch-scrollx { overflow-x: auto; padding-bottom: 4px; }
.ch-heat { display: grid; grid-template-columns: 34px repeat(24, minmax(12px, 1fr)); gap: 3px; min-width: 540px; }
.ch-hh { color: var(--muted); font: 500 .72rem var(--mono); }
.ch-hd { align-self: center; color: var(--muted); font: 600 .75rem var(--body); }
.ch-heat i { aspect-ratio: 1; border-radius: 4px; background: color-mix(in srgb, var(--accent) var(--a), var(--surface-2)); }
.heat-scale { display: flex; align-items: center; justify-content: flex-end; gap: 4px; color: var(--muted); font-size: .76rem; }
.heat-scale i { width: 14px; height: 14px; border-radius: 4px; background: color-mix(in srgb, var(--accent) var(--a), var(--surface-2)); }

/* contas que mais publicam */
.top-list { display: grid; gap: 12px; }
.top-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.top-name { overflow: hidden; font-size: .9rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.top-bar { height: 8px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: var(--surface-2); }
.top-bar i { display: block; height: 100%; border-radius: inherit; background: var(--brand-grad); }
.top-num { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.top-num small { display: block; color: var(--muted); font-size: .75rem; font-weight: 500; }

@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) { .dash-grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .big { font-size: 1.6rem; }
  .chart-card { gap: 14px; padding: 16px; }
  .ch-donut { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 16px; }
  .ch-donut-g { width: min(220px, 72%); }
  .ch-legend { width: 100%; }
  .ch-funnel { height: 220px; }
  .ch-fun-col b { font-size: 1rem; }
  .ch-pill { padding: 4px 9px; font-size: .76rem; }
  .ch-fun-col em { font-size: .76rem; }
}
@media (max-width: 380px) { .kpis { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .kpi, .kpi:hover { transition: none; transform: none; } }
