/* ================================================================
   ChatGlobal · Painel — estilo.css
   Sistema de design compartilhado por todas as páginas do painel.
   Paleta alinhada com as cores usadas nos embeds do próprio bot
   (cyan #38BDF8, violeta #A78BFA, verde #22C55E, vermelho #EF4444)
   pra manter o painel e o bot com a mesma identidade visual.
================================================================ */

:root {
  /* superfícies */
  --bg:        #0a0e14;
  --surface:   #10141d;
  --surface-2: #171c27;
  --surface-3: #1e2531;
  --line:      #242b3a;
  --line-2:    #2f3849;

  /* texto */
  --text:      #e7ebf3;
  --text-dim:  #aab3c5;
  --muted:     #6b7690;

  /* acentos — mesma paleta dos embeds do bot */
  --accent:    #38bdf8;  /* cyan   — ações primárias, links, foco   */
  --violet:    #a78bfa;  /* violeta — símbolos, dados secundários   */
  --online:    #22c55e;  /* verde   — status positivo, sucesso      */
  --offline:   #ef4444;  /* vermelho — erro, remoção, bloqueio      */
  --warn:      #f59e0b;  /* âmbar   — avisos                        */
  --gold:      #facc15;  /* dourado — destaques de ranking (#1)     */

  /* tipografia */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* forma */
  --radius:   10px;
  --radius-lg: 14px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
}

@media (prefers-color-scheme: light) {
  /* o painel é intencionalmente escuro sempre — console de operação,
     não um site de marketing — mas isso evita "flash" branco no load */
  :root { color-scheme: dark; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(circle at 12% -10%, rgba(56,189,248,.06), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(167,139,250,.05), transparent 35%);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: .92em;
  color: var(--text-dim);
}

::selection { background: rgba(56,189,248,.25); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ── PORTÃO DE SENHA ──────────────────────────────────────────── */
.gate {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
}
.gate__icone {
  font-size: 34px;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.gate__titulo {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.gate__sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.gate__campo { margin-top: 6px; }
.field input {
  width: 260px;
  max-width: 80vw;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 14px;
  text-align: center;
  transition: border-color .15s, transform .15s;
}
.field input:focus { outline: none; border-color: var(--accent); }
.gate__campo.is-errado input {
  border-color: var(--offline);
  animation: sacudir .35s;
}
@keyframes sacudir {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.is-oculto { display: none !important; }

/* ── MODAL DE CONFIRMAÇÃO COM SEGUNDA SENHA (servidores.html) ──── */
.modal-fundo {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 11, .72);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-caixa {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.modal-caixa__icone {
  font-size: 26px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: 4px;
}
.modal-caixa__titulo {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
}
.modal-caixa__sub {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 4px;
}
.modal-caixa .field input {
  width: 100%;
  max-width: none;
}
.modal-caixa__botoes {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
}
.modal-caixa__botoes .btn { flex: 1; }
.modal-caixa__botoes--coluna { flex-direction: column; }

/* ── CABEÇALHO ────────────────────────────────────────────────── */
.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  margin-bottom: 6px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.brand__dot.is-online {
  background: var(--online);
  box-shadow: 0 0 0 0 rgba(34,197,94,.6);
  animation: pulso 2s infinite;
}
@keyframes pulso {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.brand__title {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.brand__title small {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0;
  margin-top: 1px;
}

/* ── NAVEGAÇÃO ────────────────────────────────────────────────── */
.nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 0;
}
.nav a {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  transform: translateY(1px);
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--surface-2);
}

/* ── CARTÕES ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--card-acento, var(--line));
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--text);
}
.card h2 .sub {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}
.card p.hint {
  font-size: 11.5px;
  color: var(--muted);
  margin: -8px 0 14px;
}
.sub-titulo {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0 0 10px;
}

.badge {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2px 9px;
  margin-left: auto;
}
.badge.badge-accent { color: var(--accent); border-color: rgba(56,189,248,.35); }
.badge.badge-violet { color: var(--violet); border-color: rgba(167,139,250,.35); }
.badge.badge-online { color: var(--online); border-color: rgba(34,197,94,.35); }

.empty-note {
  color: var(--muted);
  font-size: 12.5px;
  font-family: var(--mono);
  padding: 10px 2px;
}

/* ── GRID DE ESTATÍSTICAS ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 12px 14px; }
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--stat-cor, var(--accent));
}
.stat-card .stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.stat-card .stat-valor {
  font-family: var(--mono);
  font-size: clamp(15px, 4.2vw, 25px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  overflow-wrap: break-word;
}
.stat-card .stat-valor .unidade {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}
.stat-card .stat-nota {
  font-size: 11px;
  color: var(--muted);
  margin-top: 7px;
}
.stat-card .stat-nota.up   { color: var(--online); }
.stat-card .stat-nota.down { color: var(--offline); }

/* ── BARRAS ESTILO TERMINAL (█░) ──────────────────────────────── */
.barra-linha {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.barra-linha:last-child { border-bottom: none; }
.barra-linha .rotulo {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.barra-linha .trilha {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.barra-linha .preenchido {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  border-radius: 4px 0 0 4px;
  transition: width .5s ease;
}
.barra-linha .valor {
  font-family: var(--mono);
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
}
.medalha { font-size: 13px; }

/* ── TABELAS ──────────────────────────────────────────────────── */
table.tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.tabela th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--line);
}
table.tabela td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
}
table.tabela tr:last-child td { border-bottom: none; }
table.tabela td.mono { font-family: var(--mono); color: var(--text); }
table.tabela tbody tr { transition: background .12s ease; }
table.tabela tbody tr:hover td { background: var(--surface-2); }

.tabela-servidor { display:flex; align-items:center; gap:9px; }
.ico-servidor {
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  object-fit: cover; background: var(--surface-2); border: 1px solid var(--line);
}
.ico-servidor--vazio {
  display:flex; align-items:center; justify-content:center;
  font-size: 11px; font-weight: 700; color: var(--muted);
  font-family: var(--disp, var(--sans));
}

/* ── FORMULÁRIOS ──────────────────────────────────────────────── */
.filtro-input,
input[type="text"].campo,
input[type="number"].campo {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 13px;
  width: 100%;
}
.filtro-input:focus,
input.campo:focus { outline: none; border-color: var(--accent); }
.filtro-input::placeholder,
input.campo::placeholder { color: var(--muted); }

.filtro-erro {
  font-size: 11.5px;
  color: var(--offline);
  min-height: 18px;
  margin-bottom: 8px;
  font-family: var(--mono);
}
.filtro-ok {
  font-size: 11.5px;
  color: var(--online);
  min-height: 18px;
  margin-bottom: 8px;
  font-family: var(--mono);
}

/* ── BOTÕES ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, transform .1s, background .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-add {
  border-color: rgba(56,189,248,.4);
  color: var(--accent);
  white-space: nowrap;
  padding: 10px 14px;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #04141c;
  font-weight: 600;
}
.btn-primary:hover { background: #56c8fb; border-color: #56c8fb; }
.btn-danger {
  border-color: rgba(239,68,68,.4);
  color: var(--offline);
}
.btn-danger:hover { background: rgba(239,68,68,.08); border-color: var(--offline); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.linha-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.badge-bloqueado { color: var(--offline); border-color: rgba(239,68,68,.35); }

/* ── EDIÇÃO DE PREÇO (analitico.html — mercado cripto/ações) ──── */
.preco-edit { display: flex; align-items: center; gap: 6px; }
.preco-edit input.campo-preco {
  width: 100px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 9px;
  font-family: var(--mono);
  font-size: 12.5px;
}
.preco-edit input.campo-preco:focus { outline: none; border-color: var(--accent); }

/* ── AÇÕES (botoes.html) ──────────────────────────────────────── */
.acao-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.acao-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.acao-card .acao-icone {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.acao-card h3 {
  font-size: 13.5px;
  margin: 0;
  font-weight: 600;
}
.acao-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  flex: 1;
}
.acao-card .btn { justify-content: center; width: 100%; }
.acao-card.pendente { opacity: .55; }
.acao-status {
  font-family: var(--mono);
  font-size: 11px;
  min-height: 14px;
  color: var(--muted);
}
.acao-status.ok { color: var(--online); }
.acao-status.erro { color: var(--offline); }

/* ── CHIPS (usado no filtro) ──────────────────────────────────── */
.chip-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 32px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text);
}
.chip.chip-simbolo {
  color: var(--violet);
  border-color: rgba(167,139,250,.35);
  background: rgba(167,139,250,.07);
  font-size: 15px;
  letter-spacing: .05em;
}
.chip-del {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  font-family: var(--mono);
}
.chip-del:hover { color: var(--offline); }

/* ── TOAST ────────────────────────────────────────────────────── */
.toast-area {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}
.toast {
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 12.5px;
  box-shadow: var(--shadow);
  animation: entrar-toast .2s ease;
  max-width: 300px;
}
.toast.ok  { border-left-color: var(--online); }
.toast.erro{ border-left-color: var(--offline); }
@keyframes entrar-toast {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── CARDS COM ÍCONE POR MÉTRICA (Economia / Divulgação / Insígnias) ──
   os 3 únicos tópicos que envolvem dinheiro/recompensa no painel,
   cada um com sua cor (--stat-cor) e um ícone específico por linha. */
.card-dinheiro h2 { margin-bottom: 18px; }
.card-dinheiro .card__subtitulo {
  font-size: 12px;
  color: var(--muted);
  margin: -10px 0 16px;
}
.stats-grid--icones {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.stat-card--icone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
}
.stat-card--icone .stat-card__icone {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: color-mix(in srgb, var(--stat-cor, var(--accent)) 16%, var(--surface-3));
  border: 1px solid color-mix(in srgb, var(--stat-cor, var(--accent)) 35%, var(--line));
}
.stat-card--icone .stat-card__texto { min-width: 0; flex: 1; }
.stat-card--icone .stat-label {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
  white-space: normal;
}
.stat-card--icone .stat-valor {
  font-size: clamp(14px, 3.6vw, 19px);
  overflow-wrap: break-word;
}
@media (max-width: 480px) {
  .stats-grid--icones { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card--icone { padding: 11px 12px; gap: 10px; }
  .stat-card--icone .stat-card__icone { width: 32px; height: 32px; font-size: 15px; }
}

/* ── LAYOUT DE DUAS COLUNAS ───────────────────────────────────── */
.duas-col {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 760px) {
  .duas-col { grid-template-columns: 1fr; }
  .head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .barra-linha { grid-template-columns: 100px 1fr auto; font-size: 11.5px; }
}

.footer-nota {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  margin-top: 30px;
}
