
/* ===== LOGIN STYLES ===== */
body {
  margin: 0;
  padding: 0;
  background: #0A0E11;
  color: #EAECEF;
  text-align: center;
  -webkit-font-smoothing: antialiased;
  font-family: "Urbanist", sans-serif;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #111418;
  border-radius: 16px;
  padding: 24px 24px 28px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  border: 1px solid #1f2327;
}

.login-card h2 {
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.login-card p {
  margin: 0 0 16px;
  color: #9ca3af;
  font-size: 14px;
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid #2a2f35;
  outline: none;
  background: #0b0f14;
  color: #EAECEF;
  font-size: 14px;
}

.login-card input:focus {
  border-color: #FFE600;
  box-shadow: 0 0 12px rgba(255,230,0,0.35);
}

.login-card button {
  width: 100%;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(120deg,#facc15,#f97316);
  color: #111827;
  box-shadow: 0 6px 18px rgba(0,0,0,0.7);
}

.login-card button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.9);
}

.login-error {
  margin-top: 10px;
  font-size: 13px;
  color: #f97373;
  min-height: 18px;
}

/* Cuando la app está visible, ocultamos el wrapper de login visualmente */
body.app-visible .login-wrapper {
  display: none;
}


/* ===== APP ORIGINAL CSS ===== */

/* ------------------------------------------------------------
     ESTILOS BASE - TIPO JOHN5CRIPTO + TOQUES BINANCE
  -------------------------------------------------------------*/

  * {
    font-family: "Urbanist", sans-serif;
    letter-spacing: 0.4px;
    box-sizing: border-box;
  }

  body {
    margin: 0;
    padding: 0;
    background: #0A0E11;
    color: #EAECEF;
    text-align: center;
    -webkit-font-smoothing: antialiased;
  }

  h1 {
    font-size: 2.8em;
    margin: 10px 0 8px;
    font-weight: 800;
    background: linear-gradient(90deg, #FFE600, #F8D400);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  p {
    color: #9ca3af;
    font-size: 17px;
    margin-top: 0;
  }

  /* ------------------------------------------------------------
     CONTENEDOR GENERATEPRESS
  -------------------------------------------------------------*/

  .site {
    width: 100%;
    display: block;
  }

  .site-content {
    max-width: 1200px;
    margin: auto;
    padding-top: 10px;
    padding-bottom: 40px;
  }

  .inside-article {
    width: 100%;
    padding: 20px;
  }

  /* ------------------------------------------------------------
     TOP CONTROLS (Tema / Idioma)
  -------------------------------------------------------------*/

  .top-controls {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 10px;
    margin-bottom: 12px;
  }

  .switch-group {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .switch-group span {
    font-size: 13px;
    color: #9ca3af;
    text-transform: uppercase;
  }

  .toggle-btn {
    padding: 8px 18px !important;
    font-size: 13px !important;
    text-transform: none !important;
    letter-spacing: 0.4px !important;
  }

  /* ------------------------------------------------------------
     BUSCADOR + TIMEFRAMES
  -------------------------------------------------------------*/

  .search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
  }

  input {
    padding: 16px;
    width: 260px;
    font-size: 18px;
    background: #111418;
    border: 2px solid #2A2F35;
    color: #EAECEF;
    border-radius: 14px;
    outline: none;
    transition: all 0.25s ease;
    box-shadow: inset 0 0 12px #00000040;
  }

  input:focus {
    border-color: #FFE600;
    box-shadow: 0 0 12px #FFE60040;
  }

  button {
    padding: 15px 32px;
    font-size: 17px;
    font-weight: 700;
    background: linear-gradient(120deg, #1f2024, #2c2e33);
    color: #FFE600;
    border: 1px solid #2d2f33;
    border-radius: 14px;
    cursor: pointer;
    transition: 0.25s ease;
    box-shadow: 0 4px 10px #00000050;
    text-transform: uppercase;
    letter-spacing: 0.6px;
  }

  button:hover {
    background: linear-gradient(120deg, #2b2d31, #3a3d44);
    transform: translateY(-3px);
    box-shadow: 0 8px 16px #00000080;
  }

  button:disabled {
    background: #2c2f33;
    color: #777;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
  }

  /* Timeframe buttons estilo Binance */

  .tf-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .tf-btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    background: #1f2024;
    color: #e5e7eb;
    border-radius: 10px;
    border: 1px solid #2d3035;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    box-shadow: 0 2px 5px #00000060;
  }

  .tf-btn:hover {
    background: #272932;
  }

  .tf-btn.active {
    border-color: #FFE600;
    color: #FFE600;
    background: #25262b;
    box-shadow: 0 0 10px #FFE60033;
  }
  .tf-btn-ranking.active {
    border-color: #FFE600;
    color: #FFE600;
    background: #25262b;
    box-shadow: 0 0 10px #FFE60033;
  }


  /* ------------------------------------------------------------
     BOTÓN COMPRAR AHORA
  -------------------------------------------------------------*/

  #btnCompra {
    background: linear-gradient(120deg, #39FF14, #2DE80F);
    color: #000;
    border: none;
    font-size: 22px;
    padding: 20px 42px;
    border-radius: 18px;
    font-weight: 900;
    text-transform: uppercase;
    box-shadow: 0 0 25px #39FF1444;
    animation: buyPulse 2.2s infinite ease-in-out;
    display: none;
    margin-top: 20px;
  }

  #btnCompra:hover {
    transform: scale(1.06);
    box-shadow: 0 0 32px #39FF1480;
  }

  @keyframes buyPulse {
    0% { box-shadow: 0 0 20px #39FF1444; }
    50% { box-shadow: 0 0 40px #39FF1480; }
    100% { box-shadow: 0 0 20px #39FF1444; }
  }

  #promoText {
    margin-top: 16px;
    margin-bottom: 22px;
    font-size: 16px;
    color: #39FF14;
    font-weight: 600;
  }

  /* ------------------------------------------------------------
     RESULTADO / RSI
  -------------------------------------------------------------*/

  #resultado {
    font-size: 44px;
    font-weight: 800;
    padding: 18px;
    min-height: 80px;
    line-height: 1.3;
  }

  .sobreventa { color: #00ff95; font-weight: 800; }
  .sobrecompra { color: #ff4242; font-weight: 800; }
  .normal { color: #ffd54f; font-weight: 800; }

  /* ------------------------------------------------------------
     CARTA DE RESULTADOS
  -------------------------------------------------------------*/

  #precioInfo {
    background: #111418;
    padding: 26px;
    border-radius: 18px;
    font-size: 22px;
    line-height: 1.65em;
    max-width: 900px;
    margin: 25px auto;
    box-shadow: 0 6px 20px #00000080;
    border: 1px solid #1f2327;
  }

  .entrada { color: #76ff03; font-weight: 800; }
  .dca1 { color: #c6ff00; font-weight: 800; }
  .dca2 { color: #eeff41; font-weight: 800; }
  .dca3 { color: #f6ff7a; font-weight: 800; }
  .tp { color: #42a5f5; font-weight: 800; }
  .sl { color: #ff1744; font-weight: 800; }

  .riskBarContainer {
    width: 240px;
    height: 24px;
    background: #1b1f24;
    border-radius: 14px;
    margin: 18px auto 6px auto;
    overflow: hidden;
    box-shadow: inset 0 0 10px #00000080;
    border: 1px solid #2d3238;
  }

  .riskBarFill {
    height: 100%;
    transition: 0.35s ease;
  }

  .riskText {
    font-size: 16px;
    margin-top: 6px;
    color: #d1d4d8;
    font-weight: 600;
  }

  /* ------------------------------------------------------------
     BARRA DE CARGA
  -------------------------------------------------------------*/

  #barraCarga {
    width: 90%;
    max-width: 600px;
    height: 20px;
    background: #1a1f25;
    border-radius: 12px;
    margin: 10px auto;
    overflow: hidden;
    display: none;
    border: 1px solid #2d3238;
  }

  #barraInterna {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #FFE600, #ffae00, #F8D400);
    transition: width 0.2s ease;
  }

  /* ------------------------------------------------------------
     LEYENDA INDICADORES
  -------------------------------------------------------------*/

  #leyendaIndicadores {
    background: #111418;
    border-radius: 14px;
    max-width: 850px;
    margin: 26px auto;
    padding: 16px 20px;
    color: #b5bac1;
    box-shadow: 0 4px 14px #00000040;
    border: 1px solid #1f2327;
    font-size: 14px;
    line-height: 1.4em;
  }

  #progresoIndividual,
  #progresoRanking {
    font-size: 16px;
    color: #9ca3af;
    margin-top: 10px;
  }

  /* ------------------------------------------------------------
     TABLA TOP 10
  -------------------------------------------------------------*/

  table {
    width: 90%;
    max-width: 900px;
    margin: 40px auto;
    background: #111418;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #1f2327;
    box-shadow: 0 6px 20px #00000080;
    border-collapse: collapse;
    font-size: 18px;
  }

  th {
    background: #1d2024;
    color: #FFE600;
    padding: 20px;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  td {
    padding: 16px;
    color: #EAECEF;
    border-bottom: 1px solid #2a2d31;
    text-align: center;
  }

  tr:nth-child(even) {
    background: #161a1f;
  }

  #explicacionTop10 {
    margin-top: 8px;
    font-size: 14px;
    color: #9ca3af;
  }

  #btnTop {
    margin-top: 26px;
  }

  /* ------------------------------------------------------------
      TEMA CLARO
  -------------------------------------------------------------*/

  body.light-theme {
    background: #F5F5F7;
    color: #111827;
  }

  body.light-theme p {
    color: #4b5563;
  }

  body.light-theme #precioInfo {
    background: #ffffff;
    color: #111827;
    border-color: #e5e7eb;
    box-shadow: 0 4px 16px #00000020;
  }

  body.light-theme #leyendaIndicadores {
    background: #ffffff;
    color: #4b5563;
    border-color: #e5e7eb;
    box-shadow: 0 4px 12px #00000010;
  }

  body.light-theme table {
    background: #ffffff;
    color: #111827;
    border-color: #e5e7eb;
    box-shadow: 0 4px 16px #00000020;
  }

  body.light-theme table td,
  body.light-theme table th {
    color: #111;
  }

  body.light-theme tr:nth-child(even) {
    background: #f3f4f6;
  }

  body.light-theme #btnCompra {
    background: linear-gradient(120deg, #39FF14, #2DE80F);
    color: #000;
    box-shadow: 0 0 18px #39FF1450;
  }

  body.light-theme #resultado {
    color: #111827;
  }

  body.light-theme #promoText {
    color: #1CB300;
  }

  body.light-theme .sobreventa { color:#0e7a43; }
  body.light-theme .sobrecompra { color:#c63a3a; }
  body.light-theme .normal { color:#caa700; }

  body.light-theme .tf-btn {
    background: #e5e7eb;
    color: #111827;
    border-color: #d1d5db;
  }

  body.light-theme .tf-btn.active {
    background: #facc15;
    color: #111827;
    border-color: #eab308;
    box-shadow: 0 0 10px #facc1533;
  }

  
body.light-theme th {
  background: #e5e7eb !important;
  color: #111827 !important;
}


/* === STYLE C: PRO Binance + John5 === */
table {
  border-radius: 12px;
  overflow: hidden;
}
table tr:hover {
  background: rgba(255,230,0,0.07);
}
th {
  background: linear-gradient(90deg,#f7d400,#ffe600);
  color:#000!important;
}
body.light-theme th {
  background: linear-gradient(90deg,#ffe600,#facc15)!important;
  color:#000!important;
}


/* Header row (# Crypto RSI) custom background compatible with Style C */
table tr:nth-child(2) th {
  background: #2b2e35 !important;
  color: #FFE600 !important;
}
body.light-theme table tr:nth-child(2) th {
  background: #ececf1 !important;
  color: #111 !important;
}


.ranking-title{
  text-align:center;
  margin-top:20px;
  font-size:28px;
  font-weight:800;
  background: linear-gradient(90deg,#FFE600,#FFCC00);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
}
#rankingSection{width:100%;text-align:center;margin-top:20px;}
#rankingTFButtons{display:flex;justify-content:center;gap:8px;margin-top:10px;}


#rankingTooltip{
  box-shadow:0 10px 30px rgba(0,0,0,0.45);
}
tr.rank-row:hover{
  background:#1f2933;
}


  #panelCaidas {
    max-width: 900px;
    margin: 10px auto 0 auto;
    padding: 14px 18px;
    background: #111418;
    border-radius: 14px;
    border: 1px solid #1f2327;
    box-shadow: 0 4px 12px #00000050;
    font-size: 14px;
    color: #d1d5db;
    text-align: left;
    display: none;
  }
  #panelCaidas .pc-title {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 14px;
  }
  #panelCaidas .pc-line {
    margin: 2px 0;
    font-size: 13px;
  }
  #panelCaidas .pc-tf {
    font-weight: 700;
    margin-right: 4px;
  }
  body.light-theme #panelCaidas {
    background: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 4px 10px #00000015;
    color: #374151;
  }


  /* ------------------------------------------------------------
     RESPONSIVE AJUSTES
  -------------------------------------------------------------*/
  @media (max-width: 900px) {
    .site-content {
      padding: 10px 12px 40px 12px;
    }
    #precioInfo {
      font-size: 18px;
      padding: 18px;
    }
    table {
      font-size: 16px;
    }
  }

  @media (max-width: 700px) {
    .search-row {
      flex-direction: column;
      align-items: stretch;
    }
    .search-row input {
      width: 100%;
    }
    .search-row button {
      width: 100%;
    }
    .tf-buttons {
      justify-content: center;
    }
    #sparkContainer, #sparkline, #sparkVolume {
      width: 100% !important;
      max-width: 100% !important;
    }
    canvas#sparkline, canvas#sparkVolume {
      width: 100% !important;
    }
    table {
      width: 100%;
    }
    td, th {
      padding: 10px;
    }
  }

  @media (max-width: 480px) {
    h1 {
      font-size: 2.1em;
    }
    #resultado {
      font-size: 32px;
    }
    #precioInfo {
      font-size: 16px;
    }
    .ranking-title {
      font-size: 22px;
    }
  }


/* ================================================
   RESPONSIVE PREMIUM V2 — JOHN5 CRIPTO
================================================ */
@media (max-width: 600px) {
  .top-controls { flex-wrap: wrap; row-gap: 6px; column-gap: 6px; padding: 0 8px; }
  .switch-group { gap: 4px; }
  .toggle-btn { padding: 6px 10px !important; font-size: 11px !important; line-height: 1 !important; border-radius: 8px !important; }
  .tf-buttons { gap:5px !important; justify-content:center !important; flex-wrap:wrap !important; }
  .tf-btn, .tf-btn-ranking { padding:6px 9px !important; font-size:11px !important; border-radius:7px !important; line-height:1.1 !important; }
  .search-row { flex-direction:column; gap:8px; }
  .search-row input { width:100%; font-size:15px; padding:12px; }
  .search-row button { width:100%; padding:12px; font-size:14px; }
  #sparkContainer,#sparkline,#sparkVolume { width:100% !important; max-width:100% !important; }
  canvas#sparkline,canvas#sparkVolume { width:100% !important; }
  #precioInfo { font-size:15px !important; padding:16px !important; }
  #resultado { font-size:30px !important; margin-top:10px; }
  .ranking-title{ font-size:20px !important; }
  table{ font-size:14px !important; }
  td,th{ padding:8px !important; }
}
@media (max-width:380px){
  .toggle-btn{ padding:5px 8px !important; font-size:10px !important; }
  .tf-btn,.tf-btn-ranking{ padding:5px 7px !important; font-size:10px !important; }
  h1{ font-size:1.8em !important; }
  #resultado{ font-size:26px !important; }
}
.logout-button {
    position: fixed;
    top: 15px;
    right: 15px;
    padding: 8px 14px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    z-index: 9999;
}

/* ==============================
   Modal de gráfica ampliada
   (independiente del sparkline)
   ============================== */
.spark-modal{position:fixed;inset:0;z-index:99999;display:none;}
.spark-modal.is-open{display:block;}
.spark-modal__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.65);backdrop-filter:blur(6px);}
.spark-modal__panel{position:relative;width:min(1150px,calc(100vw - 24px));height:min(760px,calc(100vh - 24px));margin:12px auto;border-radius:14px;border:1px solid rgba(148,163,184,.25);background:rgba(15,23,42,.92);box-shadow:0 18px 60px rgba(0,0,0,.55);display:flex;flex-direction:column;overflow:hidden;}
.spark-modal__header{padding:14px 18px 6px 18px;display:flex;align-items:flex-start;justify-content:flex-start;}
.spark-modal__close{position:absolute;top:10px;right:12px;border:1px solid rgba(148,163,184,.25);background:rgba(2,6,23,.35);color:#e2e8f0;border-radius:10px;width:40px;height:40px;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;}
.spark-modal__close:hover{background:rgba(2,6,23,.55);}
.spark-modal__body{flex:1;display:flex;gap:14px;padding:10px 14px 14px 14px;min-height:0;}
.spark-modal__chart{flex:1;display:flex;flex-direction:column;gap:10px;min-width:0;}
.spark-modal__lineRow{flex:1;min-height:0;display:flex;gap:10px;align-items:stretch;}
.spark-modal__canvasWrap{position:relative;flex:1;min-width:0;min-height:0;border-radius:12px;border:1px solid rgba(148,163,184,.20);background:rgba(2,6,23,.20);overflow:hidden;}
#sparkModalLine{width:100%;height:100%;display:block;}
#sparkModalVolume{width:100%;height:clamp(90px,18vh,140px);display:block;border-radius:12px;border:1px solid rgba(148,163,184,.20);background:rgba(2,6,23,.20);}
.spark-modal__axis{position:relative;height:100%;width:92px;flex:0 0 92px;pointer-events:none;}
.spark-modal__axis .tick{position:absolute;right:8px;transform:translateY(-50%);display:flex;align-items:center;gap:8px;}
.spark-modal__axis .line{width:14px;height:1px;background:rgba(148,163,184,.55);}
.spark-modal__axis .label{font-size:12px;color:rgba(241,245,249,.96);text-shadow:0 1px 2px rgba(0,0,0,.65);}

/* Modal header (symbol + timeframe + indicadores) */
.spark-modal__meta{display:flex;flex-direction:column;gap:6px;min-width:0;}
.spark-modal__pair{display:flex;align-items:center;gap:10px;min-width:0;}
.spark-modal__symbol{font-weight:800;letter-spacing:.2px;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:68vw;}
.spark-modal__tf{font-weight:700;font-size:14px;opacity:.95;}
.spark-modal__price{font-weight:800;font-size:14px;opacity:1;}
.spark-modal__dot{opacity:.55;}
.spark-modal__indicators{font-size:12px;opacity:.9;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:78vw;}

/* Barra superior (Leyenda + señales Bottom/Top) */
.spark-modal__topbar{margin-top:2px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0;}
.spark-modal__topbarTitle{font-size:12px;font-weight:800;opacity:.95;white-space:nowrap;}
.spark-modal__signals{font-size:12px;opacity:.95;display:flex;align-items:center;gap:10px;white-space:nowrap;}
.spark-modal__signals .sig{display:inline-flex;align-items:center;gap:6px;padding:3px 8px;border-radius:999px;border:1px solid rgba(148,163,184,.22);background:rgba(2,6,23,.22);}
.spark-modal__signals .sig .tri{font-weight:900;}
.spark-modal__signals .sig.bottom .tri{color:#ff5252;}
.spark-modal__signals .sig.top .tri{color:#4caf50;}
.spark-modal__signals .sig .txt{opacity:.92;}

/* Indicadores en formato "línea" */
.spark-modal__indicators{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0;max-width:100%;}
.spark-modal__indicators .ind{display:inline-flex;align-items:center;gap:8px;padding:3px 8px;border-radius:999px;border:1px solid rgba(148,163,184,.22);background:rgba(2,6,23,.18);}
.spark-modal__indicators .sw{width:18px;height:3px;border-radius:999px;background:rgba(226,232,240,.75);}
.spark-modal__indicators .lab{font-size:12px;opacity:.92;white-space:nowrap;}

/* Tooltip inside modal chart */
.spark-modal__tooltip{position:absolute;z-index:3;pointer-events:none;display:none;max-width:260px;padding:8px 10px;border-radius:10px;
  background:rgba(2,6,23,.88);border:1px solid rgba(148,163,184,.22);
  box-shadow:0 12px 30px rgba(0,0,0,.45);backdrop-filter:blur(6px);
  font-size:12px;color:rgba(241,245,249,.96);
}
.spark-modal__tooltip strong{font-weight:800;}

/* (Leyenda lateral eliminada: ahora todo va en la barra superior) */

@media (max-width: 820px){
  .spark-modal__panel{width:calc(100vw - 18px);height:calc(100vh - 18px);margin:9px auto;}
  .spark-modal__body{flex-direction:column;}
  .spark-modal__axis{width:78px;flex:0 0 78px;}
}
.logout-button:hover {
    background: #dd3333;
}

.admin-panel-button {
    position: fixed;
    top: 15px;
    right: 130px;
    padding: 8px 14px;
    background: #0080ff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    z-index: 9999;
}
.admin-panel-button:hover {
    background: #0066cc;
}

.top-buttons {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    z-index: 9999;
    background: rgba(11, 15, 26, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.top-buttons.hidden {
    transform: translateY(-110%);
    opacity: 0;
}

body.with-top-buttons {
    padding-top: 72px; /* espacio para que el contenido no quede debajo del header */
}

.top-buttons button {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    font-size: 14px;
}
#logoutBtn { background:#ff4444; }
#logoutBtn:hover { background:#dd3333; }
#adminPanelBtn { background:#0080ff; }
#adminPanelBtn:hover { background:#0066cc; }
#changePwBtn { background:#00aa88; }
#changePwBtn:hover { background:#008866; }


/* === ADMIN PANEL STYLES === */
.admin-card {
  background: #111418;
  border-radius: 16px;
  padding: 16px 20px 20px;
  max-width: 1100px;
  margin: 20px auto 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  border: 1px solid #1f2327;
}
.admin-card input,
.admin-card select {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #2a2f35;
  outline: none;
  background: #0b0f14;
  color: #EAECEF;
  font-size: 14px;
}
.admin-card input:focus,
.admin-card select:focus {
  border-color: #FFE600;
  box-shadow: 0 0 12px rgba(255,230,0,0.35);
}
.admin-card button {
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(120deg,#facc15,#f97316);
  color: #111827;
  box-shadow: 0 6px 18px rgba(0,0,0,0.7);
}
.admin-card button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.9);
}


/* Admin: botón + contador */
.admin-create-wrap{
  display:flex;
  align-items:center;
  gap:12px;
}
.admin-user-count{
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  font-weight:800;
  font-size:12px;
  letter-spacing:.4px;
  text-transform:uppercase;
  color:#111827;
  background:linear-gradient(120deg,#facc15,#f97316);
  box-shadow:0 6px 18px rgba(0,0,0,0.35);
}
#adminMsg {
  margin-top: 4px;
  font-size: 14px;
  color: #9ca3af;
}

.admin-users-title {
  margin-top: 26px;
  font-size: 20px;
  font-weight: 700;
}

.admin-users-wrapper {
  max-width: 1100px;
  margin: 10px auto 40px;
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  background: #111418;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #1f2327;
  box-shadow: 0 6px 20px #00000080;
  font-size: 14px;
}
.admin-users-table th,
.admin-users-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #2a2d31;
}
.admin-users-table th {
  background: #1d2024;
  color: #FFE600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 12px;
}
.admin-users-table tr:nth-child(even) {
  background: #161a1f;
}

/* Admin: input de expiración dentro de tabla */
.admin-exp-input {
  background: #0f1317;
  border: 1px solid #2a2d31;
  color: #e5e7eb;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 13px;
}

.admin-exp-input:focus {
  outline: none;
  border-color: #FFE600;
}

/* Back & logout colors for secondary pages */
#backBtn {
  background:#4b5563;
}

/* === ADMIN: compactación tabla + acciones === */
.admin-users-table{
  width:100%;
  max-width:1100px;
  margin: 14px auto 30px;
  border-collapse: collapse;
  border-radius: 14px;
  overflow: hidden;
}
.admin-users-table th,
.admin-users-table td{
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.2;
}
.admin-users-table td{
  vertical-align: middle;
}
.admin-users-table th{
  font-size: 11px;
  padding: 8px 10px;
}

.admin-exp-input{
  padding: 6px 10px;
  height: 34px;
}

.admin-actions{
  display:flex;
  flex-direction:column;
  gap: 10px;
  align-items: stretch;
}

.admin-action-btn{
  width: 120px;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid #2a2d31;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  cursor:pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.65);
  background: #1d2024;
  color: #FFE600;
}

.admin-action-btn:hover{
  transform: translateY(-1px);
}

/* botones por tipo */
.admin-save-exp{ background: #1d2024; }
.admin-del-user{ background: #1a1111; border-color:#3a1f1f; }

@media (max-width: 900px){
  .admin-action-btn{ width: 100%; }
  .admin-users-table th:nth-child(4), .admin-users-table td:nth-child(4){ display:none; } /* oculta UID en móvil/tablet si molesta */
}


#backBtn:hover {
  background:#374151;
}
#logoutAdminBtn,
#logoutBtnCP {
  background:#ff4444;
}
#logoutAdminBtn:hover,
#logoutBtnCP:hover {
  background:#dd3333;
}

@media (max-width: 900px) {
  .admin-card {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-card input,
  .admin-card select,
  .admin-card button {
    width: 100%;
  }
}


/* modal sparkline fixes */
.spark-modal__canvasWrap canvas{position:relative;z-index:1;}
.spark-modal__axis{z-index:2;}


/* ===== Mobile-only ajustes modal gráfica ampliada ===== */
@media (max-width: 768px){
  .spark-modal__panel{width:calc(100vw - 16px);height:calc(100vh - 16px);margin:8px;border-radius:16px;}
  .spark-modal__header{padding-right:64px;}
  .spark-modal__topbar{gap:6px;}
  .spark-modal__indicators{gap:6px;}
  .spark-modal__signals{gap:6px;}
  .spark-modal__body{flex-direction:column;overflow-y:auto;gap:10px;}
  .spark-modal__lineRow{min-height:260px;}
  .spark-modal__axis{width:74px;flex:0 0 74px;}
  #sparkModalVolume{height:clamp(80px,22vh,120px);}
  /* scroll horizontal en vertical */
  .spark-modal__canvasWrap.is-mobile-scroll{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;}
}
@media (max-width: 768px) and (orientation: landscape){
  .spark-modal__panel{height:calc(100vh - 12px);margin:6px;}
  .spark-modal__header{padding:10px 14px 6px 14px;padding-right:64px;}
  .spark-modal__body{overflow-y:auto;}
  .spark-modal__lineRow{min-height:200px;}
  #sparkModalVolume{height:clamp(70px,28vh,110px);}
}



/* ==============================
   Mobile-only fixes (scroll modal body)
   ============================== */
@media (max-width: 820px){
  .spark-modal__panel{
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }
  .spark-modal__header{
    position: sticky;
    top: 0;
    z-index: 5;
    padding-right: 64px; /* keep chips clear of the X */
    background: rgba(2,6,23,.78);
    backdrop-filter: blur(8px);
  }
  .spark-modal__body{
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding-bottom: 18px;
  }
  .spark-modal__indicators{max-width: calc(100vw - 120px);}
}
/* Landscape mobile: ensure volume visible (scroll if needed) */
@media (max-width: 820px) and (orientation: landscape){
  .spark-modal__panel{
    height: calc(100dvh - 10px);
    max-height: calc(100dvh - 10px);
  }
  #sparkModalVolume{height: clamp(70px,24vh,120px);}
}


/* --- v17 mobile fix: ensure close X is visible and tappable (mobile only) --- */
@media (max-width: 820px){
  .spark-modal__close{
    z-index: 999999;
    width: 44px;
    height: 44px;
    font-size: 20px;
    line-height: 1;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    right: 10px;
  }
  /* give header room so legend chips never collide with the X */
  .spark-modal__header{
    padding-right: 72px;
  }
}



/* ==============================
   Spark Modal - Light theme
   ============================== */
body.light-theme .spark-modal__backdrop{
  background: rgba(15,23,42,.28);
  backdrop-filter: blur(6px);
}
body.light-theme .spark-modal__panel{
  background: rgba(248,250,252,.98);
  border: 1px solid rgba(15,23,42,.12);
  box-shadow: 0 20px 60px rgba(2,6,23,.18);
}
body.light-theme .spark-modal__close{
  color: rgba(15,23,42,.95);
  border: 1px solid rgba(15,23,42,.14);
  background: rgba(255,255,255,.85);
}
body.light-theme .spark-modal__close:hover{
  background: rgba(241,245,249,.95);
}
body.light-theme .spark-modal__symbol,
body.light-theme .spark-modal__tf,
body.light-theme .spark-modal__price,
body.light-theme .spark-modal__topbarTitle,
body.light-theme .spark-modal__indicators,
body.light-theme .spark-modal__signals{
  color: rgba(15,23,42,.92);
}
body.light-theme .spark-modal__dot{ opacity:.45; }
body.light-theme .spark-modal__canvasWrap,
body.light-theme #sparkModalVolume{
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(15,23,42,.04);
}
body.light-theme .spark-modal__axis .line{ background: rgba(15,23,42,.35); }
body.light-theme .spark-modal__axis .label{
  color: rgba(15,23,42,.92);
  text-shadow: none;
}
body.light-theme .spark-modal__tooltip{
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(15,23,42,.14);
  color: rgba(15,23,42,.95);
  box-shadow: 0 10px 30px rgba(2,6,23,.12);
}


/* desktop-center-safe */
@media (min-width: 1024px) {
  .spark-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .spark-modal__panel {
    margin: 0;
  }
}

/* ======================================================================
   Estilos para el modal de desambiguación de símbolos (disambModal)
   ----------------------------------------------------------------------
   Cada opción dentro del modal se muestra como una tarjeta con título y
   subtítulo (nombre del proyecto y exchange). Estos estilos complementan
   los existentes de spark-modal para integrar visualmente la nueva ventana.
   ====================================================================== */
.disamb-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.22);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}
.disamb-item:hover {
  background: rgba(2, 6, 23, 0.35);
}
.disamb-item:focus {
  outline: 2px solid rgba(99, 102, 241, 0.7);
  outline-offset: 0;
}
.disamb-title {
  font-weight: 700;
  font-size: 14px;
  color: rgba(248, 250, 252, 0.96);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.disamb-sub {
  font-size: 12px;
  color: rgba(203, 213, 225, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Adaptaciones para modo claro */
body.light-theme .disamb-item {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(241, 245, 249, 0.88);
  color: #111827;
}
body.light-theme .disamb-item:hover {
  background: rgba(226, 232, 240, 0.75);
}
body.light-theme .disamb-title {
  color: #1e293b;
}
body.light-theme .disamb-sub {
  color: #334155;
}
