/* ============================================================================
   ViewFy v3 — war-room de lucro de ads.
   Terminal financeiro industrial: navy profundo, azul elétrico como acento,
   números em mono tabular, atmosfera com glow + grain. Sidebar de operação.
   Tipografia: Archivo (display) + IBM Plex Mono (dados).
   ========================================================================== */

:root {
  --bg0: #070b13;
  --bg1: #0a1120;
  --panel: #0e1626;
  --panel-2: #101b31;
  --line: #1c2a47;
  --line-soft: #152036;
  --ink: #e9eef8;
  --ink-dim: #94a2bd;
  --ink-faint: #5d6c8a;
  --blue: #3d7bff;
  --blue-hi: #6ea1ff;
  --blue-dim: rgba(61, 123, 255, .14);
  --green: #16c784;
  --green-dim: rgba(22, 199, 132, .13);
  --red: #ff5063;
  --red-dim: rgba(255, 80, 99, .13);
  --amber: #ffb648;
  --amber-dim: rgba(255, 182, 72, .14);
  --teal: #14d3c0;
  --grey-dim: rgba(148, 162, 189, .13);

  --radius: 16px;
  --radius-s: 10px;
  /* Fonte neutra (pedido do Pedro): Inter em tudo, numeros com tabular-nums (sem mono chamativo). */
  --display: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --shadow: 0 10px 30px rgba(2, 6, 16, .45);
  --side-w: 236px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg0);
  color: var(--ink);
  font-family: var(--display);
  font-size: 14px;
  line-height: 1.55;
}

/* Atmosfera fixa (glow + grain), fora do fluxo. */
.atmo {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(52rem 30rem at 8% -6%, rgba(61, 123, 255, .15), transparent 60%),
    radial-gradient(44rem 26rem at 105% 12%, rgba(20, 211, 192, .06), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0) 46rem);
}
.atmo::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal { opacity: 0; animation: rise .6s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: var(--d, 0s); }

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ------------------------------ shell ----------------------------------- */
.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ------------------------------ sidebar --------------------------------- */
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(16, 27, 49, .55), rgba(10, 17, 32, .3));
  backdrop-filter: blur(4px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 16px; }
.brand-mark {
  width: 13px; height: 13px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--blue-hi), var(--blue) 55%, #1d4dd8);
  box-shadow: 0 0 18px rgba(61, 123, 255, .8);
  transform: rotate(45deg);
  flex: none;
}
.brand h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.brand h1 em, .login-name em { font-style: normal; color: var(--blue-hi); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  color: var(--ink-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  transition: background .15s ease, color .15s ease;
}
.nav a svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav a:hover { color: var(--ink); background: rgba(61, 123, 255, .07); }
.nav a.on { color: var(--blue-hi); background: var(--blue-dim); }

.side-sec { margin-top: 14px; }
.side-title { margin: 0 0 8px; padding: 0 12px; font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.contas-nav { display: flex; flex-direction: column; gap: 2px; }
.contas-nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--ink-dim);
  font: 600 13px var(--display);
  cursor: pointer;
  text-align: left;
  transition: background .15s ease, color .15s ease;
}
.contas-nav button:hover:not(:disabled) { color: var(--ink); background: rgba(61, 123, 255, .07); }
.contas-nav button.on { color: var(--ink); background: var(--blue-dim); box-shadow: inset 2px 0 0 var(--blue); }
.contas-nav button:disabled { opacity: .45; cursor: not-allowed; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-all { background: var(--blue-hi); }
.dot-br { background: var(--green); }
.dot-pt { background: var(--amber); }
.dot-tt { background: var(--ink-faint); }

.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 4px 0; border-top: 1px solid var(--line-soft); }

/* ------------------------------ main ------------------------------------ */
.main { min-width: 0; padding: 20px 26px 40px; max-width: 1460px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 2px 2px 16px; }
.topbar h2 { margin: 0; font-size: 21px; font-weight: 900; letter-spacing: -.02em; }
.top-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.view { display: block; }
.view[hidden] { display: none; }

/* ------------------------------ base ------------------------------------ */
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel) 70%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.card h3 { margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h3 { margin: 0; }

select, input[type="password"], input[type="text"], textarea {
  background: var(--bg1);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius-s);
  padding: 8px 12px;
  font: 500 13px var(--display);
}
textarea { resize: vertical; line-height: 1.6; }

.btn {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius-s);
  padding: 8px 16px;
  font: 700 13px var(--display);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); background: #142140; }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--blue-hi), var(--blue) 60%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 20px rgba(61, 123, 255, .35);
}
.btn-primary:hover { background: linear-gradient(135deg, #7fadff, #4b85ff 60%); box-shadow: 0 8px 26px rgba(61, 123, 255, .45); }
.btn-mini { padding: 5px 12px; font-size: 12px; border-radius: 8px; }
.btn-danger:hover { background: var(--red-dim); border-color: rgba(255, 80, 99, .4); }

:focus-visible { outline: 2px solid var(--blue-hi); outline-offset: 2px; border-radius: 6px; }

.switch { display: inline-flex; flex-direction: row; align-items: center; gap: 10px; cursor: pointer; }
.switch-label { font-size: 12px; color: var(--ink-dim); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 38px; height: 21px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s ease; flex: none; }
.switch .track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--ink-dim);
  transition: transform .2s ease, background .2s ease;
}
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track::after { transform: translateX(17px); background: #fff; }

/* Interruptor de status do anuncio na tabela: verde=ativo, cinza=pausado. */
.acao-cell { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.switch.switch-ad { cursor: pointer; }
.switch.switch-ad input:checked + .track { background: var(--green); }
.lock-mini { display: inline-flex; color: var(--amber); }
.lock-mini .lock-icon { margin: 0; }
.switch input:focus-visible + .track { outline: 2px solid var(--blue-hi); outline-offset: 2px; }

.banner {
  background: var(--amber-dim);
  border: 1px solid rgba(255, 182, 72, .4);
  border-left-width: 4px;
  color: var(--ink);
  border-radius: var(--radius-s);
  padding: 10px 14px;
  margin: 0 0 16px;
}

.b { display: inline-block; font: 600 11px var(--mono); padding: 3px 10px; border-radius: 999px; border: 1px solid transparent; }
.b-green { background: var(--green-dim); color: var(--green); border-color: rgba(22,199,132,.35); }
.b-red { background: var(--red-dim); color: var(--red); border-color: rgba(255,80,99,.35); }
.b-amber { background: var(--amber-dim); color: var(--amber); border-color: rgba(255,182,72,.35); }
.b-blue { background: var(--blue-dim); color: var(--blue-hi); border-color: rgba(61,123,255,.35); }
.b-grey { background: var(--grey-dim); color: var(--ink-dim); border-color: rgba(148,162,189,.3); }

.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pos-txt { color: var(--green); }
.neg-txt { color: var(--red); }
.mid-txt { color: var(--amber); }
.muted { color: var(--ink-faint); font-size: 12px; }
.empty { padding: 18px 12px; color: var(--ink-faint); }

/* ------------------------------ KPIs ------------------------------------ */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi-lucro { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.kpi-lucro::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto;
  height: 130%;
  background: radial-gradient(36rem 16rem at 26% 0%, var(--glow, rgba(61,123,255,.14)), transparent 65%);
  pointer-events: none;
}
.kpi-lucro.pos { --glow: rgba(22, 199, 132, .16); }
.kpi-lucro.neg { --glow: rgba(255, 80, 99, .15); }
.kpi-num { margin: 2px 0 4px; font-size: clamp(34px, 4.2vw, 54px); font-weight: 700; line-height: 1.05; }
.kpi-num.sm { font-size: clamp(20px, 1.9vw, 25px); }
.kpi-sub { margin: 0; color: var(--ink-faint); font-size: 12px; }
.kpi-note { margin: 6px 0 0; font-size: 11px; }
.kpi-atrib { grid-column: span 2; display: flex; flex-direction: column; justify-content: center; }
.kpi-atrib .b { align-self: flex-start; font-size: 13px; padding: 5px 14px; margin: 2px 0 8px; }

/* ------------------------------ gráficos -------------------------------- */
.charts { display: grid; grid-template-columns: 1.02fr 1.8fr 1.02fr; gap: 14px; margin-bottom: 16px; }
.chart { display: flex; flex-direction: column; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-dim); }
.chart-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-rec { background: var(--green); }
.lg-gasto { background: #46557a; }
.lg-lucro { background: var(--blue-hi); }

.donut-wrap { position: relative; width: 168px; margin: 8px auto 4px; }
.donut-wrap svg { display: block; width: 100%; height: auto; }
.donut-wrap circle { fill: none; stroke-width: 15; transition: stroke-dasharray .9s cubic-bezier(.2,.7,.2,1); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center .num { font-size: 30px; font-weight: 700; }
.legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend .dot { width: 9px; height: 9px; border-radius: 3px; }
.legend .lv { margin-left: auto; font-family: var(--mono); color: var(--ink-dim); font-size: 12px; }

.chart-dias { flex: 1; min-height: 210px; }
.chart-dias svg { display: block; width: 100%; height: 100%; }
.chart-dias .grid-line { stroke: var(--line-soft); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-dias .eixo-txt { fill: var(--ink-faint); font: 500 10px var(--mono); }
.chart-dias .bar-rec { fill: url(#gRec); }
.chart-dias .bar-gasto { fill: #46557a; opacity: .8; }
.chart-dias .lucro-line { fill: none; stroke: var(--blue-hi); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(110,161,255,.5)); }
.chart-dias .lucro-dot { fill: var(--blue-hi); stroke: var(--bg0); stroke-width: 2; }
.chart-dias .lucro-lbl { font: 700 10.5px var(--mono); }

.funil { display: flex; gap: 10px; flex: 1; min-height: 190px; padding-top: 8px; }
.fcol { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fbarea { flex: 1; display: flex; align-items: flex-end; }
.fbar {
  width: 100%;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, rgba(110,161,255,.95), rgba(61,123,255,.30));
  box-shadow: 0 0 16px rgba(61,123,255,.2);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform .7s cubic-bezier(.2,.7,.2,1);
}
.fbar.in { transform: scaleY(1); }
.fval { font: 700 14px var(--mono); margin-top: 8px; }
.flabel { font-size: 11px; color: var(--ink-dim); }
.fconv { font: 600 11px var(--mono); color: var(--teal); min-height: 16px; }

/* ------------------------------ contas cards ---------------------------- */
.contas-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.conta-card { cursor: pointer; transition: transform .15s ease, border-color .15s ease; }
.conta-card:hover { transform: translateY(-2px); border-color: var(--line); }
.conta-card.on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), var(--shadow); }
.conta-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.conta-head strong { font-size: 15px; font-weight: 700; }
.conta-grid { display: grid; grid-template-columns: repeat(4, auto); gap: 6px 28px; }
.conta-grid .lbl { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.conta-grid .val { font: 600 15px var(--mono); }
.conta-foot { margin-top: 10px; font-size: 11px; color: var(--ink-faint); }
.pill { display: inline-block; font: 700 10px var(--mono); letter-spacing: .06em; padding: 2px 8px; border-radius: 6px; background: var(--blue-dim); color: var(--blue-hi); }
.pill.pt { background: var(--amber-dim); color: var(--amber); }
.pill.demo { background: var(--grey-dim); color: var(--ink-dim); }

/* ------------------------------ tabelas --------------------------------- */
.table-card { margin-bottom: 16px; padding-bottom: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font: 700 10.5px var(--display);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.r, td.r { text-align: right; }
th.sorted { color: var(--blue-hi); }
td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; white-space: nowrap; vertical-align: middle; }
td.num-cell { font: 600 13px var(--mono); }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: rgba(61, 123, 255, .05); }
tbody tr:last-child td { border-bottom: none; }

.cell-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-nome { font-weight: 600; max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.cell-sub { font-size: 11px; color: var(--ink-faint); display: flex; align-items: center; gap: 8px; }
.tag-pausado { color: var(--amber); font-weight: 600; }
.lock-icon { vertical-align: -1px; margin-right: 6px; color: var(--amber); }

/* Orcamento: botao inline que vira input ao clicar */
.budget-cell { min-width: 96px; }
.budget-btn {
  font: 600 13px var(--mono); color: var(--ink); background: transparent;
  border: 1px solid transparent; border-radius: 7px; padding: 4px 8px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: border-color .12s ease, background .12s ease;
}
.budget-btn:hover { border-color: var(--line-soft); background: rgba(61, 123, 255, .08); }
.budget-pen { font-size: 11px; color: var(--blue-hi); opacity: .7; }
.budget-btn:hover .budget-pen { opacity: 1; }
.budget-input {
  width: 92px; font: 600 13px var(--mono); text-align: right; color: var(--ink);
  background: var(--bg1); border: 1px solid var(--blue-hi); border-radius: 7px; padding: 4px 8px;
}
.budget-input:focus { outline: none; box-shadow: 0 0 0 2px rgba(61, 123, 255, .3); }

.segmented { display: inline-flex; background: var(--bg1); border: 1px solid var(--line-soft); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button {
  background: transparent;
  border: 0;
  color: var(--ink-dim);
  font: 700 12.5px var(--display);
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.segmented button:hover { color: var(--ink); }
.segmented button.on { background: var(--blue-dim); color: var(--blue-hi); }

select.modo-sel { min-width: 128px; padding: 6px 10px; }

/* ------------------------------ recomendações --------------------------- */
.recs { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 8px; }
.rec-row { background: var(--bg1); border: 1px solid var(--line-soft); border-left: 3px solid var(--blue); border-radius: var(--radius-s); padding: 13px 16px; }
.rec-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.rec-head strong { font-size: 14px; }
.rec-txt { margin: 4px 0 10px; color: var(--ink-dim); font-size: 13px; line-height: 1.55; }
.rec-actions { display: flex; gap: 8px; }
.rec-row.resolvida { opacity: .55; border-left-color: var(--line); }

.pending { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 8px; }
.pend-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--bg1); border: 1px solid var(--line-soft); border-radius: var(--radius-s); padding: 11px 14px; }
.pend-row .grow { flex: 1; min-width: 200px; }
.pend-acao { font: 700 12px var(--mono); color: var(--amber); text-transform: uppercase; letter-spacing: .08em; }

/* ------------------------------ mineração ------------------------------- */
.miner-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-form input[type="text"] { min-width: 220px; }
.terms { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 8px; }

/* galeria de criativos garimpados */
.miner-galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 14px; padding: 4px 0 10px; }
.cria-card { background: var(--bg1); border: 1px solid var(--line-soft); border-radius: var(--radius-s); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease, border-color .15s ease; }
.cria-card:hover { transform: translateY(-2px); border-color: var(--line); }
.cria-thumb { aspect-ratio: 4 / 5; background-size: cover; background-position: center; background-color: var(--panel-2); position: relative; }
.cria-noimg { display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-size: 12px; }
.cria-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 32px; color: rgba(255,255,255,.92); text-shadow: 0 2px 14px rgba(0,0,0,.7); }
.cria-body { padding: 11px 13px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.cria-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cria-top strong { font-size: 13px; }
.cria-copy { margin: 0; font-size: 12px; color: var(--ink-dim); line-height: 1.45; flex: 1; overflow: hidden; }
.cria-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.cria-link { margin-left: auto; font-size: 12px; color: var(--blue-hi); text-decoration: none; font-weight: 600; }
.cria-link:hover { text-decoration: underline; }
.term-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--bg1); border: 1px solid var(--line-soft); border-radius: 999px; padding: 5px 7px 5px 13px; font-size: 12.5px; }
.term-chip .x { border: 0; background: transparent; color: var(--ink-faint); cursor: pointer; font: 700 12px var(--display); padding: 2px 7px; border-radius: 999px; }
.term-chip .x:hover { color: var(--red); background: var(--red-dim); }
.score-wrap { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.score-num { font: 700 14px var(--mono); width: 40px; }
.score-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.score-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--teal)); }

/* leaderboard de ofertas escaladas (infoproduto) */
.miner-board { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 6px; }
.board-card { display: grid; grid-template-columns: 58px minmax(0, 1fr) 220px; gap: 16px; align-items: stretch;
  background: var(--bg1); border: 1px solid var(--line-soft); border-radius: var(--radius-s); padding: 14px 16px;
  transition: border-color .15s ease, transform .12s ease; }
.board-card:hover { border-color: var(--line); transform: translateY(-1px); }
.bc-rank { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-right: 1px solid var(--line-soft); padding-right: 6px; }
.bc-pos { font: 700 13px var(--display); color: var(--ink-faint); }
.bc-score { font: 800 22px var(--mono); background: linear-gradient(90deg, var(--blue-hi), var(--teal));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.bc-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bc-nome { font: 700 15px var(--display); }
.bc-sub { font-size: 12px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-sub b { color: var(--teal); font-weight: 600; }
.bc-metrics { display: flex; gap: 22px; margin-top: 2px; }
.bc-metrics > div { display: flex; flex-direction: column; }
.bc-metrics b { font: 700 17px var(--mono); }
.bc-metrics span { font-size: 10.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }
.bc-spark { height: 26px; margin-top: 2px; }
.spark { width: 130px; height: 26px; }
.spark polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark.up polyline { stroke: var(--green); }
.spark.down polyline { stroke: var(--red); }
.spark-flat { font-size: 11px; color: var(--ink-faint); font-style: italic; }
.bc-cria { display: flex; flex-direction: column; gap: 7px; border-left: 1px solid var(--line-soft); padding-left: 16px; }
.bc-thumb { aspect-ratio: 16 / 9; border-radius: 8px; background: var(--panel-2) center/cover no-repeat; }
.bc-thumb.vazio { display: flex; }
.bc-thumb.vazio::after { content: 'sem imagem'; margin: auto; color: var(--ink-faint); font-size: 11px; }
.bc-hook { font-size: 12px; color: var(--ink-dim); line-height: 1.4; max-height: 51px; overflow: hidden; }
.bc-link { font-size: 12px; color: var(--blue-hi); font-weight: 600; text-decoration: none; }
.bc-link:hover { text-decoration: underline; }
.bc-foot { margin-top: auto; }
.bc-status { width: 100%; }
/* badges do leaderboard */
.badge { display: inline-flex; align-items: center; gap: 3px; font: 600 10.5px var(--display); padding: 2px 8px;
  border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.badge-info { background: rgba(61,123,255,.16); color: var(--blue-hi); border-color: rgba(61,123,255,.4); }
.badge-info.soft { background: transparent; color: var(--ink-dim); border-color: var(--line); }
.badge-fire { background: rgba(255,120,40,.16); color: #ff9a4d; border-color: rgba(255,120,40,.4); }
.badge-king { background: rgba(255,196,0,.14); color: var(--amber); border-color: rgba(255,196,0,.38); }
.badge-new { background: var(--green-dim); color: var(--green); border-color: rgba(22,199,132,.35); }
.badge-soft { background: transparent; color: var(--ink-faint); border-color: var(--line-soft); }
@media (max-width: 860px) {
  .board-card { grid-template-columns: 44px minmax(0,1fr); }
  .bc-cria { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--line-soft); padding-top: 10px; }
  .bc-metrics { gap: 16px; flex-wrap: wrap; }
}

/* ------------------------------ anotações ------------------------------- */
.notes-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; align-items: start; }
.notes-busca { width: 100%; margin-bottom: 10px; }
.notes-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.note-item { text-align: left; border: 1px solid transparent; background: transparent; border-radius: var(--radius-s); padding: 10px 12px; cursor: pointer; color: var(--ink-dim); transition: background .12s ease; }
.note-item:hover { background: rgba(61, 123, 255, .06); }
.note-item.on { background: var(--blue-dim); border-color: rgba(61,123,255,.3); color: var(--ink); }
.note-item strong { display: block; font-size: 13.5px; color: var(--ink); margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item span { font-size: 11px; }
.notes-editor-card { display: flex; flex-direction: column; gap: 12px; min-height: 60vh; }
.note-titulo { font: 700 17px var(--display); padding: 10px 14px; }
#note-corpo { flex: 1; min-height: 40vh; font: 500 14px/1.7 var(--display); }
.note-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.note-actions { display: flex; gap: 8px; }

/* ------------------------------ login ----------------------------------- */
.login-overlay[hidden] { display: none; }
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(50rem 30rem at 14% -8%, rgba(61, 123, 255, .14), transparent 60%),
    radial-gradient(40rem 24rem at 104% 108%, rgba(20, 211, 192, .06), transparent 60%),
    var(--bg0);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel) 75%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 60px rgba(61, 123, 255, .08);
  padding: 34px 30px 30px;
  display: flex;
  flex-direction: column;
  animation: rise .55s cubic-bezier(.2, .7, .2, 1) both;
}
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.login-name { font-size: 26px; font-weight: 900; letter-spacing: -.03em; }
.login-sub { margin: 0 0 24px; text-align: center; color: var(--ink-dim); font-size: 13px; }
.login-label { font-size: 11px; color: var(--ink-faint); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.login-card input { width: 100%; min-width: 0; padding: 11px 13px; font-size: 14px; margin-bottom: 16px; }
.login-btn { width: 100%; padding: 11px 16px; font-size: 14px; }
.login-err { margin: 14px 0 0; text-align: center; color: var(--red); font-size: 13px; }

.foot { text-align: center; color: var(--ink-faint); font-size: 12px; margin-top: 26px; letter-spacing: .06em; }

::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------ responsivo ------------------------------ */
@media (max-width: 1150px) {
  .charts { grid-template-columns: 1fr 1fr; }
  .chart-wide { grid-column: span 2; order: -1; }
  .notes-grid { grid-template-columns: 1fr; }
}
@media (max-width: 940px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .side-sec { margin: 0 0 0 auto; }
  .contas-nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin: 0; border: 0; padding: 0; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-lucro, .kpi-atrib { grid-column: span 2; grid-row: auto; }
  .contas-cards, .miner-top { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .main { padding: 14px 12px 40px; }
  .kpis { grid-template-columns: 1fr; }
  .kpi-lucro, .kpi-atrib { grid-column: auto; }
  .charts { grid-template-columns: 1fr; }
  .chart-wide { grid-column: auto; order: 0; }
  .conta-grid { grid-template-columns: repeat(2, auto); }
}
