/* Base visual dos painéis interativos da BI Concept.
   Mesma identidade do site: fundo frio quase preto, cards com borda fina,
   um acento só (o verde da logo) e números em fonte mono. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@500;600&display=swap");

:root {
  --bg: #070a0e;
  --surface: #0d1117;
  --surface-2: #151b23;
  --surface-3: #1f2730;
  --text: #e6edf3;
  --muted: #8b98a5;
  --faint: #5f6b78;
  --line: #1b2531;
  --line-strong: #333c48;
  --accent: #01ffa5;
  --accent-dim: #1eb880;
  --accent-deep: #0c6b4f;
  --negative: #f25a50;
  --warning: #f7b23b;
  --sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --display: "Space Grotesk", "Inter", ui-sans-serif, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); }
body { font-family: var(--sans); color: var(--text); -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }

/* Página de tamanho fixo, escalada para caber na janela */
#canvas {
  position: absolute; left: 0; top: 0; width: 1280px; height: 720px; overflow: hidden; transform-origin: 0 0;
  background:
    radial-gradient(900px 260px at 55% -80px, rgba(1, 255, 165, .07), transparent 70%),
    var(--bg);
}
#canvas::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(27, 37, 49, .5) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(27, 37, 49, .5) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, #000 30%, transparent 100%);
}

/* Trilho lateral: navega entre os módulos */
.rail {
  position: absolute; left: 0; top: 0; bottom: 0; width: 60px; z-index: 3;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; padding-top: 16px; gap: 6px;
}
.rail .marca { width: 30px; height: 30px; margin-bottom: 18px; }
.rail a {
  position: relative; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  color: var(--muted); text-decoration: none; transition: color .2s, background .2s;
}
.rail a:hover { color: var(--text); background: var(--surface-2); }
.rail a.ativo { color: var(--accent); background: rgba(1, 255, 165, .08); }
.rail a.ativo::before { content: ""; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--accent); }
.rail a span {
  position: absolute; left: 48px; padding: 4px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text);
  opacity: 0; pointer-events: none; transform: translateX(-4px); transition: opacity .15s, transform .15s;
}
.rail a:hover span { opacity: 1; transform: none; }
.rail svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Cabeçalho */
.topo { position: absolute; left: 84px; right: 24px; top: 16px; height: 44px; display: flex; align-items: center; gap: 14px; z-index: 2; }
.titulo { flex: none; }
.eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.titulo h1 { margin: 3px 0 0; font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.chips { display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; margin-left: 6px; align-self: flex-end; padding-bottom: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 6px 0 10px; border-radius: 999px; cursor: pointer;
  font-size: 11px; color: var(--accent); background: rgba(1, 255, 165, .08); border: 1px solid rgba(1, 255, 165, .3); white-space: nowrap;
  animation: entra .2s ease-out;
}
.chip b { font-weight: 500; color: var(--text); }
.chip i { font-style: normal; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: rgba(1, 255, 165, .12); }
.chip:hover i { background: var(--accent); color: var(--bg); }
.controles { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sel { position: relative; }
.sel select {
  appearance: none; height: 32px; padding: 0 30px 0 12px; border-radius: 8px; cursor: pointer; font-size: 12px;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); outline: none;
}
.sel select:hover, .sel select:focus { border-color: var(--accent-dim); }
.sel:has(> select)::after { content: ""; position: absolute; right: 12px; top: 13px; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.sel select option { background: var(--surface-2); }
.vivo { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.vivo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulsa 2s ease-in-out infinite; }

/* Botões segmentados */
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.seg button { border: 0; background: none; cursor: pointer; height: 22px; padding: 0 10px; border-radius: 6px; font-size: 11px; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button.ativo { background: var(--surface-3); color: var(--text); }

/* Cards */
.card {
  position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  transition: border-color .25s;
}
.card:hover { border-color: var(--line-strong); }
.card-cab { position: absolute; left: 16px; right: 14px; top: 12px; display: flex; align-items: center; gap: 10px; z-index: 2; }
.card-cab h2 { margin: 0; font-family: var(--display); font-size: 13.5px; font-weight: 500; }
.card-cab .sub { font-size: 11px; color: var(--muted); }
.card-cab .dir { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* KPIs */
.kpi { padding: 13px 16px; }
.kpi .rot { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.kpi .rot svg { width: 14px; height: 14px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kpi .val { font-family: var(--display); font-size: 25px; font-weight: 600; letter-spacing: -.02em; margin: 8px 0 7px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.kpi .linhas { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.kpi .linhas div { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.kpi .meta { position: absolute; left: 16px; right: 16px; bottom: 12px; }
.kpi .meta .trilho { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.kpi .meta .trilho i { display: block; height: 100%; border-radius: 4px; background: var(--accent); box-shadow: 0 0 10px rgba(1, 255, 165, .5); transition: width .5s cubic-bezier(.16, 1, .3, 1); }
.kpi .meta .trilho i.abaixo { background: var(--warning); box-shadow: none; }
.kpi .meta .leg { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-bottom: 5px; font-family: var(--mono); }
.kpi .meta .leg b { color: var(--text); font-weight: 500; }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sobe { color: var(--accent); }
.desce { color: var(--negative); }
.delta { font-family: var(--mono); font-size: 10.5px; }

/* Rankings em lista */
.ranking { position: absolute; left: 8px; right: 6px; top: 46px; bottom: 8px; overflow-y: auto; padding: 0 8px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.ranking::-webkit-scrollbar { width: 5px; }
.ranking::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.lin { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; column-gap: 8px; padding: 5px 6px; border-radius: 8px; cursor: pointer; transition: background .15s, opacity .25s; }
.lin:hover { background: var(--surface-2); }
.lin .pos { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.lin .nome { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lin .v { font-family: var(--mono); font-size: 11px; text-align: right; white-space: nowrap; }
.lin .barra { grid-column: 2 / 4; height: 3px; border-radius: 3px; background: var(--surface-3); margin-top: 5px; overflow: hidden; }
.lin .barra i { display: block; height: 100%; border-radius: 3px; background: var(--accent-dim); transition: width .45s cubic-bezier(.16, 1, .3, 1); }
.lin:first-child .barra i { background: var(--accent); }
.lin.sel { background: rgba(1, 255, 165, .07); box-shadow: inset 0 0 0 1px rgba(1, 255, 165, .3); }
.apagado { opacity: .32; }

/* Tabelas */
.tabela { position: absolute; left: 8px; right: 6px; top: 46px; bottom: 8px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.tabela table { width: 100%; border-collapse: collapse; font-size: 11px; }
.tabela th { position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: left; padding: 7px 8px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 400; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.tabela td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabela td.n, .tabela th.n { text-align: right; font-family: var(--mono); }
.tabela tbody tr { cursor: pointer; transition: background .15s; }
.tabela tbody tr:hover { background: var(--surface-2); }
.tabela tr.sel { background: rgba(1, 255, 165, .07); }

.grafico { position: absolute; }

/* Dica (tooltip) */
.dica {
  position: absolute; z-index: 30; pointer-events: none; display: none; min-width: 140px;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 11px;
  font-size: 11.5px; line-height: 1.55; color: var(--text); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .8);
}
.dt-t { font-family: var(--display); font-weight: 600; font-size: 12.5px; margin-bottom: 3px; }
.dt-l { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); }
.dt-l b { font-family: var(--mono); font-weight: 400; color: var(--text); }

.rodape { position: absolute; right: 24px; bottom: 4px; font-family: var(--mono); font-size: 9px; letter-spacing: .08em; color: var(--faint); }

@keyframes pulsa { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.85); } }
@keyframes entra { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
