:root {
    --bg-dark: #0d1117;
    --bg-card: #161b22;
    --text: #c9d1d9;
    --accent: #fcd535;
    --danger: #da3633;
    --blue: #2b6cb0;
    --btn-hover: #f0b90b;
    --btn-danger-hover: #b92522;
    --btn-blue-hover: #1e4f91;
  }

  /* ---------------- RESET ---------------- */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text);
  }

  /* ---------------- LOADER ---------------- */
  #loader {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: var(--bg-dark);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999;
  }
  #loader img {
    width: 80px; height: 80px;
    animation: spin 1.2s linear infinite;
  }
  @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

  /* ---------------- ALERTA DE ERRO ---------------- */
  .erro-alert {
    display: flex; align-items: center; gap: 10px;
    background: #1a1818; border: 1px solid var(--danger); color: var(--danger);
    padding: 8px 16px; margin-top: 8px; border-radius: 6px;
    font-size: 15px; position: relative;
  }
  .fechar-erro {
    margin-left: auto; color: var(--danger); font-size: 22px; font-weight: bold;
    cursor: pointer; background: none; border: none; line-height: 1;
    transition: color 0.2s;
  }
  .fechar-erro:hover { color: #fff; }

  /* ---------------- MENU DO USUÁRIO ---------------- */
  .menu-usuario { position: fixed; top: 20px; right: 20px; z-index: 999; display: none; }
  .perfil-icone { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; cursor: pointer; border: 2px solid #30363d; }
  .perfil-icone img { width: 100%; height: 100%; object-fit: cover; }

  .dropdown-menu {
    display: none; position: absolute; right: 0; margin-top: 10px;
    background-color: #21262d; border: 1px solid #30363d;
    border-radius: 8px; box-shadow: 0 0 10px rgba(0,0,0,0.5);
    min-width: 200px; padding: 10px 0;
  }
  .dropdown-menu.show { display: block; }
  .dropdown-menu p.email { margin: 0; padding: 10px 20px; font-weight: bold; color: #58a6ff; }
  .dropdown-menu a {
    display: block; padding: 10px 20px; color: var(--text); text-decoration: none; font-size: 14px; cursor: pointer;
  }
  .dropdown-menu a:hover { background-color: #30363d; }

  /* ---------------- LOGIN ---------------- */
  .login-container {
    height: 90vh; display: flex; justify-content: center; align-items: center; flex-direction: column;
  }
  .cardlogin {
    background: var(--bg-card); padding: 20px; margin: 20px;
    border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    max-width: 450px; width: 90%;
  }
  input, button, select {
    padding: 10px; margin: 8px 0 12px 0; width: 100%;
    border-radius: 6px; border: none; font-size: 1em; box-sizing: border-box;
  }
  input, select { background: #21262d; color: var(--text); }
  button {
    font-weight: bold; cursor: pointer; transition: background 0.3s;
    background-color: var(--accent); color: #000000;
  }
  button:hover { background-color: var(--btn-hover); }

  /* Botões especiais */
  #bot-button.iniciar { background-color: var(--blue); color: white; }
  #bot-button.iniciar:hover { background-color: var(--btn-blue-hover); }
  #bot-button.parar, .parar-instancia { background-color: var(--danger); color: white; }
  #bot-button.parar:hover, .parar-instancia:hover { background-color: var(--btn-danger-hover); }

  /* Links do login */
.cardlogin a {
  color: #3b82f6; /* Azul padrão estilo corretora */
  text-decoration: none;
  font-size: 0.9rem;
  transition: 0.2s;
}

.cardlogin a:hover {
  color: #60a5fa; /* Azul mais claro no hover */
  text-decoration: underline;
}


  /* ---------------- PAINEL ---------------- */
  #painel, #cadastro, #login, #verificacao { display: none; }
  .painel-wrapper { display: flex; min-height: 100vh; }
  .menu-lateral {
    width: 250px; background-color: var(--bg-card); padding: 20px; box-sizing: border-box;
  }
  .menu-lateral ul { list-style: none; }
  .menu-lateral li { margin-bottom: 10px; }
  .menu-lateral a {
    color: var(--text); text-decoration: none; display: block; padding: 10px; border-radius: 4px;
  }
  .menu-lateral a.active, .menu-lateral a:hover { background-color: #f0b90b; }
  .conteudo { flex: 1; padding: 10px; }
  .aba { display: none; background-color: var(--bg-card); padding: 5% 5% 28%; min-height: 98vh; border-radius: 6px; }
  .aba.active { display: block; }

  /* ---------------- DASHBOARD ---------------- */
  .dashboard-container {
    display: none; padding: 20px; color: #fff; background-color: var(--bg-dark);
    font-family: Arial, sans-serif;
  }

  /* Cards */
  .cards {
    display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px;
  }
  .card {
    flex: 1 1 200px; background: var(--bg-card); padding: 20px;
    border-radius: 10px; text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
  }
  .card p { font-size: 1.5em; margin-top: 10px; }
  .card:hover { transform: translateY(-4px); box-shadow: 0 0 20px rgba(0, 255, 100, 0.2); }

  /* Tooltip em cards */
  .card::after {
    content: attr(data-tooltip);
    position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.85); color: white;
    padding: 8px 12px; border-radius: 5px; white-space: normal;
    text-align: center; font-size: 12px; line-height: 1.3;
    width: max-content; max-width: 220px;
    opacity: 0; visibility: hidden; transition: 0.3s;
    pointer-events: none; z-index: 999;
  }
  .card:hover::after { opacity: 1; visibility: visible; }

  /* Lucro/Perda */
  .positivo { color: #07d374; }
  .negativo { color: #da3633; }

  /* Charts */
  .charts {
    display: flex; flex-wrap: wrap; justify-content: space-between;
    gap: 20px; margin: 20px 0;
  }
  .charts canvas {
    background: var(--bg-card); padding: 20px; border-radius: 8px; flex: 1;
    max-width: 49%; height: 500px !important;
  }

  /* Tabela */
  .recent-trades table {
    width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px;
    text-align: center;
  }
  .recent-trades th, .recent-trades td {
    padding: 12px 8px; border-bottom: 1px solid #2a2f38;
  }
  .recent-trades th {
    background-color: var(--bg-card); color: #f0f0f0;
    font-weight: bold; text-transform: uppercase; font-size: 13px;
  }
  .recent-trades td { color: var(--text); }
  .recent-trades td.lucro-positivo { color: #07d374; font-weight: bold; }
  .recent-trades td.prejuizo { color: #da3633; font-weight: bold; }
  .recent-trades td.lucro-neutro { color: #cfda33; font-weight: bold; }
  .recent-trades tbody tr:hover { background-color: #1c2129; transition: 0.2s; }

  /* Grid charts avançados */
  .dashboard-charts {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px; margin-top: 30px;
  }
  .chart-card {
    background: var(--bg-card); padding: 20px;
    border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  .chart-card h3 { text-align: center; margin-bottom: 10px; color: var(--text); }
  .chart-card canvas { max-width: 100%; height: 280px !important; }
  .chart-card.wide { grid-column: span 2; }


   /* ---------------- INSTÂNCIAS ---------------- */
  #aba-bot {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
  }

  #minhas-instancias {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px; margin-top: 20px; list-style: none; padding: 0;
  }

  #minhas-instancias li {
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid rgba(31, 36, 44, 0.6);
    border-radius: 10px;
    padding: 18px 20px;
    display: flex; flex-direction: column; justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  #minhas-instancias li:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,0.4); }

  .info .par { font-weight: bold; font-size: 1.1rem; color: #fff; }
  .info .detalhes { font-size: 0.85rem; color: #9ca3af; }

  .status {
    font-weight: bold; padding: 4px 10px; border-radius: 5px; font-size: 0.85rem;
    display: inline-block; margin-top: 6px; text-transform: capitalize;
  }
  .status.ativa { color: var(--status-green); background: rgba(0, 200, 83, 0.12); }
  .status.pausada { color: var(--status-red); background: rgba(255, 82, 82, 0.12); }
  .status.encerrada { color: var(--status-gray); background: rgba(156, 163, 175, 0.12); }

  .acoes { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
  .acoes button {
    flex: 1; padding: 8px 0; border-radius: 4px; border: none; font-size: 0.85rem; cursor: pointer; font-weight: bold;
    transition: 0.2s;
  }
  .acoes .btn-start { background: var(--accent); color: white; }
  .acoes .btn-start:hover { background: #3fcf5a; }
  .acoes .btn-stop { background: var(--danger); color: white; }
  .acoes .btn-stop:hover { background: #ff5555; }
  
.text-lucro {
  color: #f0b90b; /* Verde */
  font-weight: bold;
}

.text-prejuizo {
  color: #da3633; /* Vermelho */
  font-weight: bold;
}

.text-em-aberto {
  color: #cfda33; /* Amarelo */
  font-weight: bold;
}

  a {
    color: inherit;
    text-decoration: none;
  }
  a:visited {
    color: inherit;
  }
  a:hover {
    color: #F0B90B;
  }

.spinner {
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-left-color: #09f;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === BARRA DE FILTROS === */
.linha-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin: 0.5rem 0 1rem 0;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  backdrop-filter: blur(8px);
  transition: background 0.3s ease, border 0.3s ease;
}

.linha-filtros:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.linha-filtros .campo {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 220px;
}

.linha-filtros label {
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #bdbdbd;
}

/* === SELECTS COM ÍCONE SVG MODERNO === */
.linha-filtros select {
  background-color: #1a1a1a;
  border: 1px solid #333;
  color: #e0e0e0;
  border-radius: 6px;
  padding: 0.5rem 2.2rem 0.5rem 0.75rem;
  font-size: 0.9rem;
  transition: all 0.25s ease;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bbb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.linha-filtros select:hover {
  border-color: #3a6df0;
  background-color: #202020;
}

.linha-filtros select:focus {
  outline: none;
  border-color: #3a6df0;
  box-shadow: 0 0 0 3px rgba(58, 109, 240, 0.25);
}

/* Scrollbar */
.linha-filtros select::-webkit-scrollbar {
  width: 8px;
}
.linha-filtros select::-webkit-scrollbar-thumb {
  background-color: #333;
  border-radius: 4px;
}
.linha-filtros select::-webkit-scrollbar-thumb:hover {
  background-color: #3a6df0;
}

/* === RESPONSIVO === */
@media (max-width: 768px) {
  .linha-filtros {
    flex-direction: column;
  }
  .linha-filtros .campo {
    width: 100%;
  }
}

 /* ===== Alertas de Execução – visual refinado e centralizado ===== */
  .card-alertas.is-centered{
    max-width: 980px;      /* ajuste se quiser mais/menos largo */
    margin: 0 auto;
    text-align: center;
  }
  .card-alertas .card-alertas__head{
    display:flex; align-items:center; justify-content:center; gap:12px; margin-bottom:8px;
  }
  .card-alertas h3{ margin:0; font-size:1.05rem; }
  .card-alertas__hint{ margin:0 0 12px; opacity:.75; font-size:.9rem; text-align:center; }

  .card-alertas__grid{
    display:flex; flex-wrap:wrap; gap:12px 24px; justify-content:center; margin-bottom:14px;
  }

  /* switches */
  .switch{ display:flex; align-items:center; gap:12px; }
  .switch input{ display:none; }
  .switch .slider{
    position:relative; width:44px; height:24px; border-radius:999px;
    background:#2b2f3a; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
    transition:.2s ease;
  }
  .switch .slider::after{
    content:""; position:absolute; top:2px; left:2px; width:20px; height:20px;
    border-radius:50%; background:#9aa0a6; transition:.2s ease;
  }
  .switch input:checked + .slider{ background:#f0b90b; }
  .switch input:checked + .slider::after{ transform: translateX(20px); background:#fff; }
  .switch .label{ user-select:none; font-size:.95rem; }

  .card-alertas__actions{ display:flex; justify-content:center; gap:10px; }
  .card-alertas .btn-primary{ min-width:220px; width:clamp(220px, 50%, 720px); }
  .btn.btn-secondary{
    background:transparent; border:1px solid rgba(255,255,255,.14);
    padding:.6rem .9rem; border-radius:.75rem; cursor:pointer;
  }
  .btn.btn-secondary:hover{ background:rgba(255,255,255,.06); }

  /* pill de status (Ativo/Desativado) */
  .status-pill{
    display:inline-flex; align-items:center; gap:8px; padding:4px 10px; border-radius:999px;
    font-size:.8rem; background:rgba(255,255,255,.06);
  }
  .status-pill .dot{ width:8px; height:8px; border-radius:50%; background:#9ca3af; }
  .status-pill.is-on{ background:rgba(22,163,74,.18); }
  .status-pill.is-on .dot{ background:#16a34a; }
  .status-pill.is-off{ background:rgba(239,68,68,.15); }
  .status-pill.is-off .dot{ background:#ef4444; }

  .card-alertas__status-note{ display:block; margin-top:8px;  opacity:.7; text-align:center; }


/* --- GRID DOS CARDS (3 colunas) --- */

/* liberar largura do overlay */
#aba-overlayAssinatura .overlay-container {
  width: min(1200px, 96vw);
  margin: 0 auto;
}

/* grid de 3 colunas dentro do container de planos */
#aba-overlayAssinatura #planosContainer {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 24px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1200px) {
  #aba-overlayAssinatura #planosContainer {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }
}

@media (max-width: 760px) {
  #aba-overlayAssinatura #planosContainer {
    grid-template-columns: 1fr;
  }
}

/* ====== ESTILO BASE (somente no overlay de assinatura) ====== */
#aba-overlayAssinatura .card {
  pointer-events: none;
  border: 2px solid transparent;
  border-radius: 20px;
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  min-height: 640px;
  background-size: 200% 200%;
  opacity: 0;
  transform: translateY(25px);
  animation: fadeInUp 0.6s ease forwards;
}

/* Desativa tooltip apenas nos cards do overlay de assinaturas */
#aba-overlayAssinatura .card::after {
  content: none !important;
  display: none !important;
}

/* Após 2 segundos, reativa o hover */
body.loaded #aba-overlayAssinatura .card {
  pointer-events: auto;
}

#outrosPlanos {
  opacity: 0;
  transform: translateY(2000px);
}

#outrosPlanos.mostrar {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .8s ease, transform .8s ease;
}


/* ====== GRADIENTES ====== */
#aba-overlayAssinatura .starter {
  border-color: #00a3ff;
  background: linear-gradient(180deg, rgba(0, 163, 255, 0.12) 0%, rgba(24, 26, 32, 1) 100%);
}
#aba-overlayAssinatura .pro {
  border-color: #f0b90b;
  background: linear-gradient(180deg, rgba(240, 185, 11, 0.15) 0%, rgba(24, 26, 32, 1) 100%);
}
#aba-overlayAssinatura .premium {
  border-color: #9e86ff;
  background: linear-gradient(180deg, rgba(158, 134, 255, 0.15) 0%, rgba(24, 26, 32, 1) 100%);
}


/* ====== EFEITO HOVER ====== */
#aba-overlayAssinatura .card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 0 35px rgba(240, 185, 11, 0.4);
  filter: brightness(1.42);
  border-color: #f0b90b;
}


/* ====== HOVER ESPECÍFICO POR PLANO ====== */
#aba-overlayAssinatura .starter:hover {
  border-color: #00a3ff;
  box-shadow: 0 0 250px rgba(0, 163, 255, 0.4);
}
#aba-overlayAssinatura .pro:hover {
  border-color: #f0b90b;
  box-shadow: 0 0 3000px rgba(240, 185, 11, 0.75);
}
#aba-overlayAssinatura .premium:hover {
  border-color: #9e86ff;
  box-shadow: 0 0 200px rgba(158, 134, 255, 0.4);
}

/* ====== ESCURECER OUTROS CARDS ====== */
#aba-overlayAssinatura #planosContainer.hovering .card {
  opacity: 0.4;
  filter: blur(10px);
  transition: all 0.3s ease;
}

/* O card sob o mouse fica normal */
#aba-overlayAssinatura #planosContainer.hovering .card:hover {
  
  filter: brightness(1.25) !important;
  z-index: 10;
  transform: scale(1.05);
}

/* ====== BADGE E PREÇO ====== */
#aba-overlayAssinatura .badge-popular {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #f0b90b;
  color: #000;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
}

#aba-overlayAssinatura .price {
  font-size: 2rem;
  font-weight: 700;
  color: #f0b90b;
}

/* ====== BOTÃO ====== */
#aba-overlayAssinatura .btn-comprar {
  background-color: #f0b90b;
  color: #000;
  font-weight: 700;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  transition: all 0.2s;
  text-align: center;
}
#aba-overlayAssinatura .btn-comprar:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

/* ====== LISTA ====== */
#aba-overlayAssinatura .feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.6rem;
}
#aba-overlayAssinatura .check-icon {
  color: #9e86ff;
  font-weight: bold;
  font-size: 1.1rem;
}

#planosExtraContainer {
  display: grid;
  grid-template-columns: repeat(3, minmax(380px, 1fr));
  gap: 34px;
}

/* ====== ANIMAÇÃO ====== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(3000px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ====== DELAYS SEQUENCIAIS ====== */
#aba-overlayAssinatura .card:nth-child(1) { animation-delay: 0.1s; }
#aba-overlayAssinatura .card:nth-child(2) { animation-delay: 0.1s; }
#aba-overlayAssinatura .card:nth-child(3) { animation-delay: 0.1s; }


    /* ---------------- RESPONSIVIDADE ---------------- */
  @media (max-width: 768px) {
    .cards, .charts { flex-direction: column; }
    .card p { font-size: 1.2em; }
  }
  @media (max-width: 480px) {
    .chart-card.wide { grid-column: span 1; }
    .charts canvas { height: 300px !important; }
  }
