:root{
  --bg:#0b0b0f;
  --panel:#12121a;
  --text:#f3f3f6;
  --muted:#a1a1b3;
  --primary1:#7c4dff; /* violeta */
  --primary2:#18a0fb; /* azul */
  --accent:#00e1b9;   /* turquesa */
  --danger:#ff5470;
  --ring: 0 0 0 2px rgba(124,77,255,.35);



  /* =======================================================
     Onboarding / popouts (SIN capa oscura encima)
     - Solo degradado (la parte bonita)
     - Sin base sólida
     ======================================================= */

  /* Degradado “celeste bonito” al frente */
  --ob-surface-bg: linear-gradient(
    135deg,
    rgba(24, 160, 251, 0.78) 0%,
    rgba(24, 160, 251, 0.35) 45%,
    rgba(0, 225, 185, 0.30) 100%
  );

  /* Borde degradado */
  --ob-border-gradient: linear-gradient(90deg, var(--primary1), var(--primary2));

}

*{box-sizing:border-box}
html,body,#app{height:100%}
body{
  margin:0;
  background:
    radial-gradient(1200px 800px at 10% 10%, rgba(124,77,255,.10), transparent 60%),
    radial-gradient(900px 600px at 90% 20%, rgba(24,160,251,.10), transparent 60%),
    radial-gradient(700px 500px at 50% 90%, rgba(0,225,185,.08), transparent 60%),
    var(--bg);
  /* Texto base en gris claro para todo excepto títulos */
  color:var(--muted);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  font-size:14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-header{
  height:56px; display:flex; align-items:center; justify-content:space-between;
  padding:0 16px; position:sticky; top:0; z-index:10;
  background: linear-gradient(180deg, rgba(11,11,15,.8), rgba(11,11,15,.4));
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,.04);
}

/* Ocultar header global SOLO en Menú principal:
   lo controlamos vía JS añadiendo/quitarndo la clase .hide-on-home */
body.hide-on-home .app-header{ display:none; }

.brand{display:flex; align-items:center; gap:10px}
.brand-logo{
  width:28px;
  height:28px;
  object-fit:contain;
  filter: drop-shadow(0 8px 18px rgba(0,225,185,.16));
}
.brand h1{
  margin:0; font-size:18px; font-weight:900; letter-spacing:.3px
}
.brand h1 span{
  font-family: "Playfair Display", serif;
  font-weight:700; font-size:18px;
  background: linear-gradient(90deg, var(--primary2), var(--accent));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}

.header-actions{display:flex; align-items:center; gap:10px}
.account-chip{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.account-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(0,225,185,.35);
}
.user-email{color:var(--muted); font-size:12px; margin:0}

/* Encabezado de página (para todas las vistas excepto Home y config bot) */
.page-header{ margin-bottom: 16px; }
.page-header-row{
  display:flex;
  align-items:center;
  gap:10px;
}
.page-back{
  padding: 8px 10px;
  border-radius: 12px;
  line-height: 1;
}
.page-header .title{ margin: 0; }
.page-header .subtitle{ margin: 6px 0 0; }

.view{display:none; padding:28px; animation: fade .35s ease both}
.view.active{display:block}

/* Menú principal (home) sin scroll */
#view-home{ padding: 18px; }
#view-home .subtitle{ margin-bottom: 14px; }

.panel{
  max-width:980px; margin:0 auto; background:linear-gradient(180deg,#111219, #0c0c12);
  border:1px solid rgba(255,255,255,.06);
  border-radius:16px; padding:24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

/* Panel principal (home) más ancho para que los tiles ocupen más pantalla */
.home-panel{
  max-width: 1180px;
  padding: 18px;
}

.home-title-row{
  display:flex;
  align-items:center;
  gap:12px;
}

.home-welcome-logo{
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0,225,185,.18));
}

.title{
  font-family:"Playfair Display", serif;
  font-weight:700; font-size:28px; margin:0 0 6px;
  color:#fff; /* títulos en blanco */
}
.subtitle{margin:0 0 20px; color:var(--muted)}

/* Tipografía y colores unificados */
h1, h2, h3,
.panel h3,
.metrics-section > h3,
.tile-title,
.card h3{
  color:#fff; /* Títulos blancos */
}

h1, h2, .title{ font-size:28px; }
h3, .tile-title, .panel h3{ font-size:16px; }

/* Asegurar que párrafos y texto general se vean gris claro */
p, li, label, small, span, td, th { color: var(--muted); }

/* Mantener textos críticos con buen contraste */
.btn, .btn.primary, .btn.outline, .btn.ghost { color: var(--text); }
input, textarea, select { color: var(--text); }

.login-grid{display:grid; grid-template-columns: 1fr 1fr; gap:18px}
.card{
  background:#0f1017; border:1px solid rgba(255,255,255,.06);
  border-radius:14px; padding:18px; animation: rise .5s ease both;
}
.card h3{margin:0 0 10px}
label{display:block; font-size:13px; margin:12px 0 6px; color:var(--muted)}
input{
  width:100%; background:#0b0c14; color:var(--text); border:1px solid rgba(255,255,255,.07);
  border-radius:10px; padding:10px 12px; outline:none;
}
input:focus{box-shadow: var(--ring); border-color: rgba(124,77,255,.6)}

.row{display:flex; gap:10px; align-items:center}
.g{margin-top:12px}
.w100{width:100%}
.muted{color:var(--muted); font-size:12px}
.error{margin-top:12px; color: var(--danger); font-weight:600}
.hidden{display:none}

.btn{
  background:#181a24; color:var(--text); border:1px solid rgba(255,255,255,.08);
  padding:10px 14px; border-radius:12px; cursor:pointer; transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn:hover{transform: translateY(-1px); box-shadow: 0 10px 24px rgba(124,77,255,.15)}
.btn:active{transform: translateY(0)}
.btn.primary{
  background: linear-gradient(90deg, var(--primary1), var(--primary2));
  border:0;
}
.btn.outline{background:transparent; border-color: rgba(255,255,255,.18)}
.btn.ghost{background:transparent; border-color: rgba(255,255,255,.08)}
.btn.google{
  background:linear-gradient(90deg, #ffffff, #e3e3e3);
  color:#111; border:0;
}

.tiles{
  display:grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap:14px;
  margin-top:12px;
}

/* Tiles más compactos, centrados (sin scroll en el menú) */
.tile{
  background: linear-gradient(180deg,#10121a, #0d0f17);
  border:1px solid rgba(255,255,255,.07);
  border-radius:18px;
  padding:14px;
  text-align:center;
  cursor:pointer;
  transition: transform .18s ease, box-shadow .25s ease, border-color .2s ease, filter .2s ease;
  position:relative;
  overflow:hidden;

  /* Normalizar <a> y <button> */
  color: inherit;
  text-decoration: none;
  font: inherit;

  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  min-height: 150px;
}

.tile:focus{ outline: none; }
.tile:focus-visible{
  box-shadow: var(--ring), 0 14px 48px rgba(124,77,255,.18);
  border-color: rgba(124,77,255,.55);
}

.tile.neon::after{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius:22px;
  z-index:0;
  background: conic-gradient(
    from 180deg,
    rgba(124,77,255,.0),
    rgba(124,77,255,.35),
    rgba(24,160,251,.3),
    rgba(0,225,185,.28),
    rgba(124,77,255,.0)
  );
  filter: blur(26px);
  opacity:.24;
}

/* Brillito interno */
.tile::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
  background:
    radial-gradient(500px 200px at 10% 10%, rgba(24,160,251,.18), transparent 60%),
    radial-gradient(400px 220px at 90% 20%, rgba(0,225,185,.14), transparent 60%);
  opacity:.8;
  pointer-events:none;
}

.tile:hover{
  transform: translateY(-4px) scale(1.015);
  border-color: rgba(124,77,255,.48);
  box-shadow: 0 14px 48px rgba(124,77,255,.18);
  filter: brightness(1.05);
}

.tile:active{ transform: translateY(-2px) scale(1.01); }

.tile > *{ position:relative; z-index:1; }

.tile-icon{
  width:50px;
  height:50px;
  border-radius:16px;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 14px 35px rgba(0,0,0,.25);
  color: rgba(255,255,255,.92);
}

.tile-icon svg{ width:24px; height:24px; }

.tile-body{ margin-top:10px; }

.tile-title{ font-weight:900; letter-spacing:.2px; margin-bottom:0; font-size:15px; }
.tile-desc{ color:var(--muted); font-size:13px; line-height:1.25 }

/* Responsive */
@media (max-width: 980px){
  .tiles{ grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}
@media (max-width: 640px){
  .view{ padding:18px; }
  .tiles{ grid-template-columns: 1fr; }
  .tile{ min-height: 140px; }
}

.back{margin-top:12px}

.fade-in{animation: fade .45s ease both}
.fade-in-up{animation: fadeUp .45s ease both}

/* Aparición (stagger) de tiles en Home */
.tile{
  /* estado base de animación (solo aplica cuando se agrega .tiles-animate al contenedor) */
  opacity: 1;
  transform: none;
}

.tiles.tiles-animate .tile{
  opacity: 0;
  transform: translateY(10px) scale(.98);
  animation: tileIn .35s cubic-bezier(.2,.9,.2,1) forwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}

@keyframes tileIn{
  to{ opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fade{
  from{opacity:0} to{opacity:1}
}
@keyframes rise{
  from{transform: translateY(8px); opacity:.0}
  to{transform: translateY(0); opacity:1}
}
@keyframes fadeUp{
  from{transform: translateY(8px); opacity:0}
  to{transform: translateY(0); opacity:1}
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =======================================================
   Onboarding (tips + spotlight)
   ======================================================= */
.ob-root{
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none; /* por defecto */
}

/* ✅ Default: todo lo del onboarding en BLANCO */
.ob-popover,
.ob-modal-card{
  color:#fff;
}

.ob-popover{
  position: fixed;
  max-width: 360px;
  padding: 12px 12px;
  border-radius: 14px;

  border: 1px solid transparent;
  background:
    var(--ob-surface-bg) padding-box,
    var(--ob-border-gradient) border-box;

  box-shadow: 0 18px 60px rgba(0,0,0,.45);

  /* sin “glass” para que no se oscurezca raro */
  -webkit-backdrop-filter: none;
  backdrop-filter: none;

  pointer-events: auto;
  overflow: hidden;
}

.ob-popover .ob-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

/* ✅ “TIP” como título: negrita + mayúsculas */
.ob-badge{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight: 900;
  letter-spacing: .9px;
  text-transform: uppercase;
  color:#fff;
}

/* ✅ Icono “?” + círculo: BLANCO y que resalte */
.ob-q{
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display:grid;
  place-items:center;

  color:#fff;
  font-weight: 900;

  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.92);

  box-shadow:
    0 10px 26px rgba(0,0,0,.22),
    0 0 0 2px rgba(255,255,255,.08) inset;
  font-size: 13px;
}

/* ✅ Texto principal del TIP: BLANCO, título, mayúsculas */
.ob-popover .ob-text{
  color:#fff;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .35px;
  line-height: 1.25;
  position: relative;
  z-index: 1;
}

/* ✅ Botón cerrar en blanco y visible */
.ob-close{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.65);
  background: rgba(0,0,0,.10);
  color: #fff;
  cursor: pointer;
}
.ob-close:hover{
  background: rgba(0,0,0,.18);
}

/* spotlight: bloquea/desvanece los otros tiles */
.tiles.ob-locked .tile{ transition: opacity .2s ease, filter .2s ease; }
.tiles.ob-locked .tile.ob-disabled{
  opacity: .28;
  filter: grayscale(1) blur(.2px);
  pointer-events: none;
}
.tiles.ob-locked .tile.ob-active{
  opacity: 1;
  filter: none;
  box-shadow: 0 18px 70px rgba(0,225,185,.14);
  border-color: rgba(0,225,185,.35);
}

/* Brillo animado alrededor del tile activo */
.tiles.ob-locked .tile.neon.ob-active::after{
  opacity: .55;
  filter: blur(18px);
  animation: obSpin 2.2s linear infinite;
  transform-origin: center;
}

@keyframes obSpin{
  to{ transform: rotate(360deg); }
}

/* Modal / Popout */
.ob-modal{
  position: fixed;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;

  background: transparent;
  backdrop-filter: none;
  pointer-events: auto;
}

.ob-modal-card{
  width: min(640px, calc(100vw - 32px));

  border: 1px solid transparent;
  background:
    var(--ob-surface-bg) padding-box,
    var(--ob-border-gradient) border-box;

  border-radius: 18px;
  box-shadow: 0 22px 80px rgba(0,0,0,.45);
  padding: 16px;
  position: relative;
  overflow: hidden;

  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Barra superior llamativa */
.ob-modal-card::after{
  content:"";
  position:absolute;
  top:0;
  left:0;
  right:0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary1), var(--primary2));
  opacity:.9;
}

/* ✅ Título del Popout: negrita + mayúsculas */
.ob-modal-card h3{
  margin: 0 0 8px;
  color:#fff;
  font-size:18px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .8px;
  position: relative;
  z-index: 1;
}

/* ✅ Texto del Popout: BLANCO (override del p global) */
.ob-modal-card p{
  margin: 0;
  color: #fff;
  line-height: 1.45;
  position: relative;
  z-index: 1;
}

.ob-modal-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
/* =======================================================
   ✅ Modal Enviar plantilla WhatsApp (test)
   ======================================================= */
.bgma-modal.hidden { display: none; }

.bgma-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
}

.bgma-modal-card{
  width: min(520px, 92vw);
  border-radius: 18px;
  padding: 14px;
  background: rgba(20,20,28,0.92);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.bgma-modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
