/* [EXCALIBUR SEAL] - S​﻿O​V​‍E​﻿‌‍R‌E​‌I﻿‍​﻿G​‌​‍N﻿‍​‌ ‌﻿‌I​N‌T﻿E‌﻿​﻿L﻿L‌‌E﻿‌‌​C‌‌‍‍T​​U‍‍﻿‍A‍L​​‌‍ ‌‍﻿​P‍R﻿﻿‍O‍‌‍‍P﻿E﻿R​﻿T﻿Y‍‌​:‍​﻿‌ ​G﻿‍​‌u‌i‌l‌l​‌‍‍e﻿r‍‍‍m﻿o‌‌​ ​A‌r​‌‌​t﻿​﻿u﻿​r‍‌o﻿‌‍ ﻿​﻿﻿L﻿﻿e﻿‌‍ó‍﻿n‍﻿ ﻿‍H﻿‌​e​‌s​‌​‍s﻿ ﻿﻿﻿-​ ​‌​M‍Q‍﻿N‍‌﻿​ ﻿2‍0﻿2‌​​6​‍﻿ */
/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   style.css â€” MQN Hub 2026 Â· SPA gemela completa Â· ESCALA CORREGIDA
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-neumo: #f5f7fa;
  --bg-panel: #f5f7fa;
  --bg-main: #f5f7fa;
  --bg-body: #f5f7fa;
  --bg-header: #f5f7fa;
  --bg-input: #f5f7fa;
  --bg-hover: #edf2f7;
  --green: #00d95f;
  /* Menta mÃ¡s vibrante */
  --green-dark: #00b34d;
  --green-msg: #e1fdec;
  --text-main: #1a202c;
  /* MÃ¡s profundo */
  --text-sub: #4a5568;
  /* Mejor contraste */
  --border: #e2e8f0;
  --font: 'Outfit', 'Inter', 'Segoe UI Emoji', 'Apple Color Emoji', -apple-system, sans-serif;
  --nav-h: 50px;
  /* Reducido */
  --tb-h: 35px;

  /* Sombras NeumÃ³rficas Refinadas */
  --shadow-out: 8px 8px 16px #d1d9e6, -8px -8px 16px #ffffff;
  --shadow-in: inset 6px 6px 12px #d1d9e6, inset -6px -6px 12px #ffffff;
  --shadow-tiny: 2px 2px 4px #d1d9e6, -1px -1px 4px #ffffff;
  --shadow-flat: 4px 4px 8px #d1d9e6, -4px -4px 8px #ffffff;

  /* Colores por Rol MQN 2026 â€” Identidad Unificada */
  --color-guest: #ffffff;
  --color-system: #3b82f6;    /* Azul Hub */
  --color-client: #10b981;    /* Verde Menta */
  --color-gold: #d4af37;      /* Oro MetÃ¡lico (VIP) */
  --color-reseller: #9333ea;  /* PÃºrpura Premium */
  --color-provider: #f97316;  /* Naranja Vibrante */
  --color-staff: #ef4444;     /* Rojo Staff */
  --accent: #667eea;
  --red: #ff4d4d;
  --blue: #3b82f6;
  /* Indigo-Blue MQN */
  --glass: rgba(255, 255, 255, 0.7);
  --grad-gold: linear-gradient(135deg, #d4af37 0%, #f1c40f 100%);
}

/* â”€â”€ Titlebar (Electron) â”€â”€ */
#titlebar {
  height: var(--tb-h);
  background: var(--bg-panel);
  display: flex;
  align-items: center;
  padding: 0 15px;
  gap: 15px;
  -webkit-app-region: drag;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 0.85em;
  z-index: 9999;
}

#titlebar .spacer {
  flex: 1;
}

.tb-btn {
  -webkit-app-region: no-drag;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  background: var(--bg-panel);
  box-shadow: var(--shadow-flat);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-sub);
}

.wt-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  color: var(--text-sub);
  margin-bottom: 12px;
  cursor: pointer;
  background: var(--bg-panel);
  box-shadow: var(--shadow-out);
  transition: all 0.2s;
}

.tb-btn:hover {
  box-shadow: 4px 4px 8px #bebebe, -4px -4px 8px #ffffff;
  color: var(--text-main);
  transform: translateY(-1px);
}

.tb-btn.close:hover {
  background: #ff4d4d;
  color: #718096;
  box-shadow: none;
}

.tb-btn:active {
  box-shadow: var(--shadow-in);
  transform: scale(0.95);
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-neumo);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 14px; /* [V16.2] ReducciÃ³n Industrial 15% */
}

/* â”€â”€ Estilos por Rol â”€â”€ */
/* Estilos de Rol (Scope Local) */
.role-guest    { --role-color: var(--color-guest); }
.role-system   { --role-color: var(--color-system); }
.role-client   { --role-color: var(--color-client); }
.role-reseller { --role-color: var(--color-reseller); }
.role-provider { --role-color: var(--color-provider); }
.role-gold     { --role-color: var(--color-gold); }
.role-staff    { --role-color: var(--color-staff); }

body.role-guest    { --role-color: var(--color-guest); }
body.role-system   { --role-color: var(--color-system); }
body.role-client   { --role-color: var(--color-client); }
body.role-reseller { --role-color: var(--color-reseller); }
body.role-provider { --role-color: var(--color-provider); }
body.role-gold     { --role-color: var(--color-gold); }
body.role-staff    { --role-color: var(--color-staff); }

.role-accent {
  border-left: 3px solid var(--role-color) !important;
}

.role-bg {
  background: var(--role-color) !important;
  color: #718096; !important;
}

/* â”€â”€ Utilidades NeumÃ³rficas â”€â”€ */
.neumo-card {
  background: var(--bg-panel);
  box-shadow: var(--shadow-tiny);
  border: none;
  border-radius: 12px;
  padding: 12px;
}

.neumo-inset {
  background: var(--bg-panel);
  box-shadow: var(--shadow-in);
  border: none;
  border-radius: 12px;
  outline: none;
  padding: 12px 18px;
  width: 100%;
  font-family: var(--font);
}

/* â”€â”€ Scrollbar NeumÃ³rfica MQN 2026 â”€â”€ */
.neumo-scroll::-webkit-scrollbar {
  width: 8px;
}
.neumo-scroll::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}
.neumo-scroll::-webkit-scrollbar-thumb {
  background: #ffffff; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff;, #764ba2);
  border-radius: 10px;
  border: 2px solid var(--bg-panel);
}
.neumo-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #5a6fd6, #6b42a0);
}
.neumo-scroll {
  scrollbar-width: thin;
  scrollbar-color: #718096; transparent;
}

#btn-login-enter {
  margin-top: 15px;
  padding: 15px;
  width: 100%;
  max-width: 400px; /* Centrado en vista wide */
  margin-inline: auto;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-main);
  background: var(--bg-panel);
  transition: all 0.3s;
}

#btn-login-enter:hover {
  transform: translateY(-2px);
  box-shadow: 8px 8px 16px #d1d1d1, -8px -8px 16px #ffffff;
}


.neumo-btn {
  background: var(--bg-panel);
  box-shadow: var(--shadow-flat);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

/* â”€â”€â”€ [MQN 2026] Sistema de Toasts Industrial â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#mqn-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.mqn-toast {
    min-width: 280px;
    padding: 12px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9em;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    border-left: 5px solid var(--accent);
    pointer-events: auto;
}

.mqn-toast.visible {
    transform: translateX(0);
}

.mqn-toast.success { border-left-color: var(--green); }
.mqn-toast.error { border-left-color: var(--red); }
.mqn-toast.info { border-left-color: var(--blue); }

.mqn-toast i {
    font-size: 1.2em;
}

/* â”€â”€â”€ Fin Glassmorphism Tabs â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* â”€â”€ Senior Vitamin Tabs â”€â”€ */
.senior-tabs .tab-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 0.8em;
  font-weight: 800;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s;
}

.senior-tabs .tab-btn.active {
  background: var(--bg-hover);
  box-shadow: var(--shadow-in);
  color: #718096;
}

.senior-tab {
  animation: slideUpSenior 0.3s ease-out;
}

@keyframes slideUpSenior {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* â”€â”€ NavegaciÃ³n Principal â”€â”€ */
#nav {
  height: var(--nav-h);
  background: var(--bg-panel);
  display: flex;
  align-items: center;
  padding: 0 15px;
  gap: 15px;
  flex-shrink: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-logo {
  font-weight: 900;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.nav-tab {
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
  color: var(--text-sub);
  border: none;
  font-size: 0.8em;
  background: var(--bg-panel);
  box-shadow: var(--shadow-tiny);
  cursor: pointer;
  transition: all 0.2s;
}

.nav-tab:hover {
  transform: translateY(-1px);
  box-shadow: 6px 6px 10px #bebebe, -6px -6px 10px #ffffff;
}

.nav-tab.active {
  background: var(--bg-panel);
  box-shadow: var(--shadow-in);
  color: #718096;
  transform: scale(0.96);
  font-weight: 900;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* BotÃ³n de Refrescar Chats */
#btn-refresh {
  background: var(--bg-panel);
  box-shadow: var(--shadow-flat);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1em;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-left: 10px;
  color: var(--green);
}

#btn-refresh:hover {
  transform: rotate(360deg) scale(1.1);
  box-shadow: 6px 6px 12px #bebebe, -6px -6px 12px #ffffff;
  color: var(--green-dark);
}

#btn-refresh:active {
  box-shadow: var(--shadow-in);
  transform: scale(0.9);
}

/* â”€â”€ Pantalla de Bienvenida â”€â”€ */
#welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 60px;
  position: relative;
  overflow: hidden;
}

#welcome::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(37, 211, 102, 0.05) 0%, transparent 70%);
  animation: pulseBg 10s linear infinite;
}

@keyframes pulseBg {
  0% {
    transform: scale(1);
    opacity: 0.3;
  }

  50% {
    transform: scale(1.2);
    opacity: 0.5;
  }

  100% {
    transform: scale(1);
    opacity: 0.3;
  }
}

#welcome .wa-icon {
  font-size: 8em;
  margin-bottom: 30px;
  filter: drop-shadow(10px 10px 20px rgba(0, 0, 0, 0.1));
  z-index: 10;
  animation: float 5s ease-in-out infinite;
}

#welcome h3 {
  font-size: 3.5em;
  font-weight: 900;
  margin-bottom: 15px;
  color: var(--text-main);
  letter-spacing: -2px;
  z-index: 10;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

#welcome p {
  color: var(--text-sub);
  font-size: 1.3em;
  max-width: 450px;
  line-height: 1.6;
  margin-bottom: 35px;
  z-index: 10;
}

#welcome .pill {
  z-index: 10;
  transition: all 0.3s;
}

#welcome .pill:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-out);
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

.wa-sb-header {
  padding: 12px 15px;
  display: flex;
  align-items: center;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

/* â”€â”€ Layout Principal â”€â”€ */
#root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

#main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  width: 100vw;
  /* Contenedor para paneles + CRM */
}

.panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  /* Permitir scroll vertical en el panel principal */
  overflow-x: hidden;
  height: 100%;
  background: var(--bg-neumo);
  /* Evita transparencias */
}

.panel.active {
  display: flex;
}

/* â”€â”€ Login Proporcional â”€â”€ */
#panel-login {
  background: var(--bg-neumo);
  justify-content: center;
  align-items: center;
}

#login-box {
  padding: 30px;
  border-radius: 25px;
  max-width: 920px; /* Ancho completo para staff */
  width: 95%;
  text-align: center;
  box-shadow: var(--shadow-out);
  transform: translateY(0);
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
}

/* Reducir tÃ­tulos de login */
#login-box h1 { font-size: 1.5em !important; margin-bottom: 5px !important; }
#login-box p { font-size: 0.85em !important; margin-bottom: 15px !important; }
#login-box div[style*="font-size:3.5em"] { font-size: 2em !important; margin-bottom: 10px !important; }
#login-auth-area { max-width: 400px; margin-inline: auto; width: 100%; }

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
  margin: 20px 0;
  padding: 10px;
  animation: fadeInLogin 0.5s ease-out both;
}

/* Personalizar scroll del grid de login */
.role-grid::-webkit-scrollbar { width: 4px; }
.role-grid::-webkit-scrollbar-thumb { background: #ffffff; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff; border-radius: 10px; }

.role-card {
  padding: 12px 10px;
  border-radius: 15px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.role-card:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: var(--shadow-out);
  background: var(--bg-hover);
}

.role-card.active {
  box-shadow: var(--shadow-in);
  border: 2px solid var(--accent);
  transform: scale(0.95);
}

.role-icon {
  font-size: 2.2em;
  margin-bottom: 5px;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
  flex-shrink: 0;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeInLogin {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* â”€â”€ WhatsApp Compacto â”€â”€ */
#wa-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

#wa-layout > div {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#wa-tools {
  width: 65px;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
  z-index: 100;
}

.wt-btn {
  width: 38px;
  /* Reducido 15% */
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15em;
  /* Ajustado */
  margin-bottom: 12px;
  flex-shrink: 0;
  background: linear-gradient(145deg, #f0f0f0, #ffffff);
  box-shadow: 5px 5px 10px #d1d1d1, -5px -5px 10px #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: var(--text-sub);
}

.wt-btn:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 8px 8px 16px #bebebe, -8px -8px 16px #ffffff;
  color: var(--green);
}

.wt-btn.active {
  background: var(--bg-panel);
  box-shadow: inset 4px 4px 8px #d1d1d1, inset -4px -4px 8px #ffffff;
  color: var(--green);
  transform: scale(0.94);
}

.wt-sep {
  width: 30px;
  height: 2px;
  background: var(--border);
  margin: 5px 0 15px;
  opacity: 0.5;
}

.wt-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.wt-user-ava {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f0f0f0, #ffffff);
  box-shadow: 5px 5px 10px #d1d1d1, -5px -5px 10px #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid white;
}

.wt-user-ava:hover {
  box-shadow: 6px 6px 12px #bebebe, -6px -6px 12px #ffffff;
  transform: scale(1.05);
}

/* ETIQUETAS SIDEBAR */
.et-filtro {
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 0.82em;
  font-weight: 700;
  background: linear-gradient(145deg, #f5f5f5, #ffffff);
  box-shadow: 4px 4px 8px #d1d1d1, -4px -4px 8px #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.et-filtro:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 6px 6px 12px #bebebe, -6px -6px 12px #ffffff;
  color: var(--green);
}

#wa-sidebar {
  width: 100%; /* Ajuste elÃ¡stico al contenedor industrial */
  height: 100%; /* Forzar herencia de altura */
  flex-shrink: 0;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

.wa-view {
  display: none;
  flex-direction: column;
  flex: 1 1 0%;
  height: 0;
  min-height: 0;
}

.wa-view.active {
  display: flex;
}

#busq {
  width: 95%;
  font-family: var(--font);
  font-size: 0.9em;
  padding: 12px 15px;
  margin: 15px auto;
  border-radius: 20px;
  background: var(--bg-panel);
  box-shadow: var(--shadow-in);
  border: none;
  outline: none;
  display: block;
}

#contactos {
  flex: 1 1 0%;
  height: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
  min-height: 0;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}



.cv-info {
  margin-left: 14px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.cvn {
  font-weight: 400;
  font-size: 1.05em;
  color: #111b21;
}

.cvm {
  font-size: 0.9em;
  color: #667781;
}

.cvt {
  font-size: 0.75em;
  color: #667781;
}

.badge {
  background-color: #25d366 !important;
  color: #718096; !important;
  border-radius: 50%;
  font-size: 0.8em;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  border: none !important;
}

#contactos::-webkit-scrollbar {
  width: 8px;
}

#contactos::-webkit-scrollbar-thumb {
  background: #ffffff; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff;
  border-radius: 10px;
  border: 2px solid var(--bg-panel);
}

#contactos::-webkit-scrollbar-track {
  background: transparent;
}

.cv {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 0 10px;
  /* Reducido para densidad industrial */
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  background: var(--bg-panel);
  box-shadow: var(--shadow-tiny);
  flex-shrink: 0;
  position: relative;
}

.cv:hover {
  background: var(--bg-hover);
}

.cv:hover .cv-more-btn {
  opacity: 0.8 !important;
}

.cv-more-btn:hover {
  background: rgba(0,0,0,0.08) !important;
  color: #718096;
  transform: scale(1.2);
}

/* [MQN 2026] Efecto Cascada para SincronizaciÃ³n Real */
@keyframes cascadeIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
.cascade-in {
  animation: cascadeIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.cv.activo {
  box-shadow: var(--shadow-in);
  background: var(--bg-hover);
}

.cva {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #718096;
  font-weight: 800;
  flex-shrink: 0;
  aspect-ratio: 1/1;
  font-size: 0.85em;
}

.cvn {
  font-weight: 710;
  font-size: 0.88em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px; /* ExpansiÃ³n Suprema para Paridad Total */
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.cvm {
  font-size: 0.78em;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 195px;
  line-height: 1.4;
}

/* â”€â”€ ÃREA DE MENSAJES â”€â”€ */
#wa-main {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-neumo);
  position: relative;
  overflow: hidden;
}

#chat-area {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#chat-header {
  padding: 10px 15px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

#chat-ava {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #718096;
  font-weight: 800;
  flex-shrink: 0;
  aspect-ratio: 1/1;
  font-size: 0.85em;
}

#chat-msgs {
  flex: 1;
  height: 0;           /* Forzar expansiÃ³n flex progresiva */
  min-height: 0;       /* Evitar colapso en Chromium */
  padding: 15px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-neumo);
  scrollbar-width: thin;
}

#btn-send {
  width: 50px !important;
  height: 50px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--bg-panel) !important;
  box-shadow: var(--shadow-out) !important;
  margin-left: 10px !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

#btn-send:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-in) !important;
}

#btn-send i {
  color: var(--green) !important;
  font-size: 1.8em !important;
  display: block !important;
}

#chat-msgs::-webkit-scrollbar {
  width: 6px;
}

#chat-msgs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

/* GLOBOS DE CHAT PREMIUM */
.msg-wrap {
  display: flex;
  width: 100%;
  position: relative;
}

.msg-wrap.ent {
  justify-content: flex-start;
}

.msg-wrap.sal {
  justify-content: flex-end;
}

.bubble {
  max-width: 400px;
  /* Limitado a 400px por peticiÃ³n */
  padding: 8px 12px;
  border-radius: 14px;
  position: relative;
  font-size: 0.9em;
  line-height: 1.4;
  box-shadow: var(--shadow-flat);
  background: var(--bg-panel);
  border: 1px solid rgba(0, 0, 0, 0.03);
  overflow: hidden;
  /* Asegura que nada se salga de los bordes redondeados */
  word-wrap: break-word;
  /* Evita que textos largos rompan el ancho */
}

.bubble img,
.bubble video {
  max-width: 100%;
  width: auto;
  max-height: 300px;
  display: block;
  border-radius: 8px;
  margin: 5px 0;
  object-fit: contain;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

.msg-img-preview,
.msg-sticker-preview {
  cursor: pointer;
  transition: transform 0.2s;
}

.msg-img-preview:hover,
.msg-sticker-preview:hover {
  transform: scale(1.05);
}

.msg-sticker-preview {
  max-width: 160px !important;
  max-height: 160px !important;
  display: block;
  margin: 5px auto;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

/* Las burbujas de stickers no deben tener fondo o sombra excesiva si son transparentes */
.bubble.has-sticker {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.msg-video-preview {
  width: 100%;
  border-radius: 10px;
  background: #000;
}

/* â”€â”€ PrevisualizaciÃ³n de Enlaces (Link Preview) â”€â”€ */
.msg-link-preview {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  margin: 8px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.msg-link-preview:hover {
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: var(--shadow-tiny);
  transform: translateY(-2px);
}

.msg-media-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-tiny);
  background: rgba(255,255,255,0.8);
}

.link-preview-container {
    max-width: 100%;
}

.msg-lp-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.msg-lp-body {
  padding: 10px;
}

.msg-lp-title {
  font-weight: 800;
  font-size: 0.9em;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.msg-lp-desc {
  font-size: 0.8em;
  color: var(--text-sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

/* â”€â”€ Omega Elite: Paridad de Formato y Banners â”€â”€ */
.msg-texto {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  font-size: 0.95em;
}

.chat-banner-security {
  background: #fef3c7;
  color: #92400e;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 0.8em;
  text-align: center;
  margin: 10px auto;
  max-width: 85%;
  box-shadow: var(--shadow-tiny);
  border: 1px solid rgba(217, 119, 6, 0.1);
  font-weight: 500;
}

.chat-banner-contact {
  background: white;
  padding: 15px;
  border-radius: 18px;
  margin: 15px auto;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-flat);
  border: 1px solid var(--border);
}

.chat-banner-contact-info {
  text-align: center;
}

.chat-banner-contact-name {
  font-weight: 900;
  font-size: 1.1em;
  color: var(--text-main);
}

.chat-banner-contact-sub {
  font-size: 0.85em;
  color: var(--text-sub);
}

.chat-banner-contact-btns {
  display: flex;
  gap: 15px;
  width: 100%;
}

.banner-btn {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: none;
  font-weight: 800;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-tiny);
}

.banner-btn.block { background: #fee2e2; color: #ef4444; }
.banner-btn.add { background: var(--bg-panel); color: var(--green-dark); }
.banner-btn:hover { transform: scale(1.02); box-shadow: var(--shadow-in); }

.msg-quoted {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  border-left: 3px solid #25d366;
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 0.95em;
  cursor: pointer;
  display: flex;
  justify-content: space-between; /* [V9.99] Thumbnail a la derecha */
  align-items: center;
  gap: 12px;
  max-height: 80px;
  overflow: hidden;
  transition: background 0.2s;
}

.msg-quoted:hover {
  background: rgba(0, 0, 0, 0.08);
}

.msg-quoted-thumb {
  width: 45px;
  height: 45px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,0.45);
}

.msg-quoted-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.msg-quoted-txt {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
  opacity: 1;
  font-weight: 500;
}

/* [V10.9] Omega Elite: Fichas de CatÃ¡logo / Producto */
.msg-product-card {
  background: rgba(var(--bubble-bg-rgb), 0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-tiny);
}

.msg-product-info {
  flex: 1;
  min-width: 0;
}

.msg-product-title {
  font-weight: 900;
  font-size: 0.95em;
  color: var(--text-main);
  margin-bottom: 4px;
}

.msg-product-price {
  font-size: 0.8em;
  color: #25d366;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.msg-product-thumb {
  width: 55px;
  height: 55px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #000;
}

.msg-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* El usuario pidiÃ³ lÃ­mite estÃ©tico estricto de 300px */
/* El usuario pidiÃ³ lÃ­mite estÃ©tico estricto de 300px */
.bubble img, .msg-img {
  max-width: 300px;
  border-radius: 12px;
  display: block;
  margin-bottom: 5px;
  cursor: pointer;
}
.msg-video {
  max-width: 300px;
  border-radius: 12px;
  margin-bottom: 5px;
}
.msg-doc {
  transition: all 0.2s;
}
.msg-doc:hover {
  background: rgba(0,0,0,0.05) !important;
}



.bubble.ent {
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 7px 11px;
}

.bubble.sal {
  border-bottom-right-radius: 4px;
  background: var(--green-msg);
  box-shadow: 2px 2px 5px #d1d9e6, -2px -2px 5px #ffffff;
  padding: 7px 11px;
}

.bubble-h {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.6em;
  color: var(--text-sub);
  margin-top: 4px;
  opacity: 0.8;
}

.msg-fecha {
  text-align: center;
  margin: 10px 0;
  font-size: 0.75em;
  font-weight: 800;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.msg-unread-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 25px 0;
  position: relative;
  text-align: center;
  width: 100%;
}

.msg-unread-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(239, 68, 68, 0.2) 50%, transparent 100%);
  z-index: 1;
}

.msg-unread-divider span {
  background: #fee2e2;
  color: #ef4444;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.72em;
  font-weight: 950;
  letter-spacing: 1.5px;
  box-shadow: var(--shadow-tiny);
  z-index: 2;
  position: relative;
}

/* [V84.0] TelemetrÃ­a Visual: Ticks de Lectura Industrial */
.msg-status-tick {
  font-size: 1.25em; /* +25-30% sobre el base */
  vertical-align: middle;
  margin-left: 4px;
  display: inline-block;
  transition: all 0.2s ease;
}

.msg-status-tick.read {
  filter: drop-shadow(0 0 1px rgba(52, 183, 241, 0.5));
}

#chat-input-area {
  padding: 8px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px;
  border-radius: 18px;
  background: var(--bg-panel);
  box-shadow: var(--shadow-out);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  /* Fondo transparente por defecto */
  border: none;
  cursor: pointer;
  color: var(--text-sub);
  font-size: 1.35em;
  /* Ligeramente mÃ¡s grande */
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  flex-shrink: 0;
}

.icon-btn:hover {
  color: var(--green);
  background: var(--bg-hover);
  box-shadow: var(--shadow-flat);
  transform: scale(1.1);
}

.icon-btn:active {
  box-shadow: var(--shadow-in);
  transform: scale(0.95);
}

#msg-input {
  flex: 1;
  padding: 10px 15px;
  font-family: var(--font);
  resize: none;
  font-size: 0.95em;
  background: var(--bg-panel);
  box-shadow: var(--shadow-in);
  border: none;
  border-radius: 12px;
  outline: none;
  max-height: 120px;
  min-height: 40px;
}

/* btn-send original movido y unificado arriba */

/* â”€â”€ CRM Y MILY AI â”€â”€ */
/* [PURGED] Reglas antiguas de crm-sidebar removidas */

.crm-tipo-badge {
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.65em;
  font-weight: 800;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.crm-tipo-badge.cliente {
  background: var(--color-client);
}

.crm-tipo-badge.reseller {
  background: var(--color-reseller);
}

.crm-tipo-badge.proveedor {
  background: var(--color-provider);
}

.crm-tipo-badge.familia {
  background: var(--color-family);
}

.crm-tipo-badge.usuario {
  background: var(--color-system);
}

#ai-suggestion-box {
  background: var(--bg-panel);
  border-radius: 15px;
  box-shadow: var(--shadow-out);
  padding: 12px;
  border-left: 4px solid var(--green);
  animation: slideIn 0.4s ease-out;
}

#ai-header-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75em;
  font-weight: 900;
  color: var(--green);
  margin-bottom: 8px;
}

#ai-btn-mini {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8em;
}

#ai-suggestion-body {
  font-size: 0.8em;
  line-height: 1.35;
}

.crm-ava {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #718096;
  font-size: 1.8em;
  font-weight: 800;
  flex-shrink: 0;
  aspect-ratio: 1/1;
  box-shadow: var(--shadow-flat);
}

.crm-client-name {
  text-align: center;
  font-weight: 800;
  font-size: 1em;
  color: var(--text-main);
  margin-top: 8px;
}

.crm-client-tel {
  text-align: center;
  font-size: 0.75em;
  color: var(--text-sub);
}

.crm-metrics {
  display: grid;
  gap: 6px;
}

.crm-metric {
  background: var(--bg-panel);
  padding: 10px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75em;
  box-shadow: var(--shadow-flat);
}

.crm-metric b {
  color: var(--green);
  font-size: 1em;
}

/* MENU CONTEXTUAL UNIFICADO (Premium) */
#ctx-menu {
  position: fixed;
  z-index: 10000;
  padding: 8px;
  border-radius: 18px;
  background: var(--bg-panel);
  box-shadow: 10px 10px 20px #d1d9e6, -10px -10px 20px #ffffff;
  display: none;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  animation: neumoIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ctx-item {
  border: none;
  background: none;
  padding: 10px 15px;
  cursor: pointer;
  text-align: left;
  font-size: 0.85em;
  font-weight: 700;
  border-radius: 12px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
}

.ctx-item:hover {
  background: var(--bg-hover);
  color: #718096;
  transform: translateX(3px);
  box-shadow: var(--shadow-tiny);
}

.ctx-item.danger {
  color: #ef4444;
}

.ctx-item.danger:hover {
  background: rgba(239, 68, 68, 0.05);
  color: #ef4444;
}

.ctx-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 8px;
  opacity: 0.5;
}

/* CARDS DE MEDIA Y AUDIO PREMIUM */
.msg-audio-card, .msg-media-card {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.msg-audio-card:hover, .msg-media-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-flat);
}

.msg-media-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-neumo);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-tiny);
  flex-shrink: 0;
}

/* SPINNER MILY AI */
.spinner-mily {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 217, 95, 0.1);
  border-top: 4px solid var(--green);
  border-radius: 50%;
  margin: 20px auto;
  animation: spinMily 1s linear infinite;
}

@keyframes spinMily {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text p {
  animation: pulseMily 1.5s ease-in-out infinite;
}

@keyframes pulseMily {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* FWD MODAL SPECIFICS */
.fwd-check {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--green);
}

#fwd-list::-webkit-scrollbar {
  width: 4px;
}

#fwd-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

/* MODALES NEUMÃ“RFICOS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(5px);
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  padding: 30px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* CITAS VISUALES (QUOTED) */
.msg-quoted {
  background: rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  align-items: stretch;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

.msg-quoted:hover {
  background: rgba(0, 0, 0, 0.08);
}

.msg-quoted-body {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-quoted-txt {
  color: var(--text-sub);
  font-style: italic;
  font-size: 0.85em !important;
  line-height: 1.2;
}

.msg-quoted-img {
  width: 32px;
  height: 32px;
  background: #eee;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
}

.msg-quoted-img-real {
  width: 76px;
  height: 76px;
  min-width: 76px;
  object-fit: cover;
  border-radius: 0 6px 6px 0;
  border-left: 1px solid rgba(0, 0, 0, 0.1);
}

@keyframes neumoIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-thumb {
  background: #bebebe;
  border-radius: 10px;
}

/* ETIQUETAS SIDEBAR */
.wa-view-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

/* CATÃLOGO SIDEBAR WA */
.cat-sidebar-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 5px;
}

.cat-item-wa {
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 15px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: var(--bg-panel);
}

.cat-item-wa:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 6px 6px 12px #d1d1d1, -6px -6px 12px #ffffff;
  border-color: #718096;
}

.cat-item-wa:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-in);
}

.cat-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-item-title {
  font-size: 0.85em;
  font-weight: 800;
  color: var(--text-main);
}

.cat-item-price {
  font-size: 0.75em;
  font-weight: 900;
  color: var(--green);
}

.cat-item-action {
  font-size: 1.2em;
  opacity: 0.3;
  transition: all 0.2s;
}

.cat-item-wa:hover .cat-item-action {
  opacity: 1;
  color: #718096;
  transform: rotate(15deg);
}

.et-filtro-grupo {
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 15px;
  margin-bottom: 12px;
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.05);
}

.et-filtro-titulo {
  width: 100%;
  font-size: 0.72em;
  font-weight: 800;
  color: var(--text-sub);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.et-filtro {
  padding: 10px 15px;
  border-radius: 12px;
  font-size: 0.82em;
  font-weight: 600;
  background: var(--bg-panel);
  box-shadow: var(--shadow-flat);
  border: 1px solid rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.et-filtro:hover {
  transform: translateY(-2px);
  box-shadow: 6px 6px 12px #bebebe, -6px -6px 12px #ffffff;
  color: var(--green);
}

.et-filtro:active {
  box-shadow: var(--shadow-in);
  transform: scale(0.96);
}

.et-filtro.active {
  box-shadow: var(--shadow-in);
  color: var(--green);
  border-color: var(--green);
  background: rgba(37, 211, 102, 0.03);
}

.btn-add-tag {
  width: calc(100% - 24px);
  margin: 5px 12px 15px;
  padding: 14px;
  border-radius: 15px;
  background: var(--bg-panel);
  box-shadow: var(--shadow-flat);
  border: 2px dashed rgba(37, 211, 102, 0.4);
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.92em;
}

.btn-add-tag:hover {
  border-style: solid;
  border-color: var(--green);
  background: var(--green);
  color: #718096;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

.btn-add-tag:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-in);
}

.et-resultados {
  margin-top: 10px;
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  padding-top: 15px;
}

/* MODALES GENERALES */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.45);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  width: 90%;
  max-width: 500px;
  padding: 30px;
  animation: modalIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ms-fij-ico {
  position: absolute;
  top: 5px;
  right: 17px;
  font-size: 0.8em;
  opacity: 0.7;
}

@keyframes modalIn {
  from {
    transform: scale(0.8) translateY(20px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* --- MQN BUSINESS SUITE STYLES --- */
.tool-item {
  display: flex !important;
  align-items: center !important;
  padding: 12px 15px !important;
  margin-bottom: 12px !important;
  cursor: pointer;
  gap: 15px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 12px;
}

.tool-item:hover {
  transform: translateY(-2px);
  box-shadow: 8px 8px 16px #d1d1d1, -8px -8px 16px #ffffff;
}

.tool-item:active {
  transform: scale(0.98);
  box-shadow: inset 4px 4px 8px #d1d1d1, inset -4px -4px 8px #ffffff;
}

.tool-icon {
  width: 42px !important;
  height: 42px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 10px !important;
  font-size: 1.35em !important;
  color: #718096;
  flex-shrink: 0;
  padding: 0 !important;
}

.tool-info {
  flex: 1;
  min-width: 0;
}

.tool-title {
  font-weight: 800;
  font-size: 0.95em;
  color: var(--text-main);
  margin-bottom: 2px;
}

.tool-desc {
  font-size: 0.78em !important;
  opacity: 0.7;
  color: var(--text-sub) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  margin-left: 5px;
}

.tool-indicator.active {
  background: #ffffff; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff;
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.5);
}

.neumo-scroll::-webkit-scrollbar {
  width: 6px;
}

.neumo-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

#quick-suggestions {
  position: absolute;
  bottom: 80px;
  left: 20px;
  width: 280px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  padding: 10px;
  display: flex !important;
  flex-direction: column;
  gap: 5px;
  background: var(--bg-panel);
  border-radius: 15px;
  box-shadow: 10px 10px 20px #bebebe, -10px -10px 20px #ffffff;
  animation: modalIn 0.3s ease-out;
}

.tool-section-title {
  padding: 10px 5px;
  font-size: 0.85em;
  font-weight: 800;
  color: #718096;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}


/* Mily AI Sidebar Styles */
.ai-body {
  padding: 0 15px 15px;
  overflow-y: auto;
}

.ai-prompt-area {
  background: var(--bg-panel);
  padding: 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.tool-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--bg-panel);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 8px 8px 16px #d1d1d1, -8px -8px 16px #ffffff;
}

.tool-item:active {
  transform: scale(0.98);
  box-shadow: inset 4px 4px 8px #d1d1d1, inset -4px -4px 8px #ffffff;
}

.tool-icon {
  width: 42px !important;
  height: 42px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 10px !important;
  font-size: 1.35em !important;
  color: #718096;
  flex-shrink: 0;
  padding: 0 !important;
}

.tool-info {
  flex: 1;
  min-width: 0;
}

.tool-title {
  font-weight: 800;
  font-size: 0.95em;
  color: var(--text-main);
  margin-bottom: 2px;
}

.tool-desc {
  font-size: 0.78em !important;
  opacity: 0.7;
  color: var(--text-sub) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  margin-left: 5px;
}

.tool-indicator.active {
  background: #ffffff; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff;
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.5);
}

.neumo-scroll::-webkit-scrollbar {
  width: 6px;
}

.neumo-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

#quick-suggestions {
  position: absolute;
  bottom: 80px;
  left: 20px;
  width: 280px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  padding: 10px;
  display: flex !important;
  flex-direction: column;
  gap: 5px;
  background: var(--bg-panel);
  border-radius: 15px;
  box-shadow: 10px 10px 20px #bebebe, -10px -10px 20px #ffffff;
  animation: modalIn 0.3s ease-out;
}

.tool-section-title {
  padding: 10px 5px;
  font-size: 0.85em;
  font-weight: 800;
  color: #718096;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}


/* Mily AI Sidebar Styles */
/* Unificado arriba */

.ai-prompt-area {
  background: var(--bg-panel);
  padding: 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-working {
  animation: blink 1s infinite;
}

/* ðŸŽ¨ Distintivos Laterales en Chats */
.cv {
  position: relative;
  overflow: hidden;
  padding-left: 15px !important;
}

.cv-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: #ddd;
  /* Default */
  transition: background 0.3s, width 0.2s;
}

.cv.activo .cv-bar {
  width: 9px;
}

/* ðŸ”¥ [MQN 2026] ESTILOS DE BARRA DINÃMICOS POR ROL */
.cv.role-system .cv-bar { background: var(--color-system); }
.cv.role-client .cv-bar { background: var(--color-client); }
.cv.role-gold .cv-bar { background: var(--color-gold); }
.cv.role-reseller .cv-bar { background: var(--color-reseller); }
.cv.role-provider .cv-bar { background: var(--color-provider); }
.cv.role-staff .cv-bar { background: var(--color-staff); }
.cv.role-family .cv-bar { background: #ef4444; }
.cv.role-group .cv-bar { background: var(--orange); }

/* âš™ï¸ CompactaciÃ³n CRM MÃ©tricas */
.metric-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.metric-card-mini {
  flex: 1;
  padding: 8px !important;
  text-align: center;
  border-radius: 12px !important;
}

.metric-label-mini {
  font-size: 0.65em !important;
  font-weight: 800;
  color: var(--text-sub);
  text-transform: uppercase;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

.metric-value-mini {
  font-weight: 900;
  font-size: 0.95em !important;
}


/* ðŸ”µ Indicador de No LeÃ­dos (Glow) */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.7em;
  font-weight: 900;
  color: #718096;
  border-radius: 10px;
  background: #ffffff; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
  z-index: 10;
}

.cv.activo .badge {
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

/* ðŸ”µ Separador de No LeÃ­dos en Chat */
.msg-unread-divider {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 25px 0;
  font-size: 0.72em;
  font-weight: 900;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 2px;
  width: 100%;
}

.msg-unread-divider::before,
.msg-unread-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ffffff; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff;, transparent);
  opacity: 0.5;
}

/* V252: FORCE Z-INDEX */
#modal-editor-maestro, #modal-editor-maestro-container {
    position: relative !important;
    z-index: 9999999 !important;
}
#modal-buscador-maquila {
    z-index: 1000 !important;
}

.crm-tabs-nav {
  margin: 10px 0 !important;
}

.crm-tab-btn {
  padding: 6px 4px !important;
  font-size: 0.7em !important;
}

.social-item {
  margin-bottom: 5px !important;
  font-size: 0.8em !important;
}

#ai-suggestion-box {
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
}

#ai-header-toggle {
  padding: 12px 15px !important;
  background: linear-gradient(135deg, var(--green), var(--accent));
  color: #718096;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 0 0 15px 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#ai-header-toggle strong {
  font-size: 0.9em;
  letter-spacing: 1px;
}

#ai-suggestion-body {
  flex: 1;
  min-height: 150px !important;
  max-height: 300px !important;
  padding: 15px !important;
  background: rgba(255, 255, 255, 0.2);
}

#mily-chat-area {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 12px;
  background: var(--bg-hover);
  margin: 0 -15px -15px -15px;
  padding: 15px;
}

#mily-msgs {
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-in);
  margin-bottom: 12px;
}

/* Role Badges */
.crm-tipo-badge {
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.65em;
  font-weight: 800;
}

.crm-tipo-badge.usuario {
  background: #a78bfa !important;
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.3);
}

/* Compact Scroll */
.crm-tabs-content {
  max-height: 250px !important;
}


/* --- CRM ADVANCED STYLES --- */
.crm-tabs-nav {
  display: flex;
  gap: 5px;
  margin: 15px 0;
  padding: 5px;
  background: var(--bg-panel);
  box-shadow: var(--shadow-in);
  border-radius: 12px;
}

.crm-tab-btn {
  flex: 1;
  padding: 8px 5px;
  border: none;
  background: none;
  font-size: 0.75em;
  font-weight: 800;
  color: var(--text-sub);
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.3s;
}

.crm-tab-btn:hover {
  color: #718096;
}

.crm-tab-btn.active {
    color: #718096;
    background: var(--bg-main);
    box-shadow: var(--shadow-in) !important;
    transform: scale(0.98);
}

.crm-tabs-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 5px;
}

.crm-tab-pane {
  display: none;
  animation: modalIn 0.3s ease-out;
}

.crm-tab-pane.active {
  display: block;
}

.social-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.85em;
}

.social-item i {
  font-size: 1.2em;
  color: #718096;
}

/* --- ROLE BADGE COLORS --- */
.crm-tipo-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-flat);
  color: #718096;
}

/* ðŸ“± CRM TABS & 360 INTERFACE */
.crm-tabs-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 5px;
}

.crm-tab-btn {
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 0.75em;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 8px 8px 0 0;
}

.crm-tab-btn:hover {
  background: rgba(0, 0, 0, 0.02);
  color: #718096;
}

.crm-tab-btn.active {
    color: #718096;
    background: var(--bg-main);
    box-shadow: var(--shadow-in) !important;
    transform: scale(0.98);
}

.crm-tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.crm-tab-pane.active {
  display: block;
}

.crm-tipo-badge.usuario {
  background: #a78bfa !important;
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.4);
}

.crm-tipo-badge.cliente {
  background: #10b981 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.crm-tipo-badge.proveedor {
  background: #f59e0b !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.crm-tipo-badge.reseller {
  background: #6366f1 !important;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.crm-tipo-badge.familia {
  background: #ef4444 !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.crm-tipo-badge.otro {
  background: #64748b !important;
}


.loading-text {
  display: inline-block;
  animation: pulse 1.5s infinite;
  font-style: italic;
  opacity: 0.7;
}

@keyframes pulse {
  0% {
    opacity: 0.4;
    transform: scale(0.98);
  }

  50% {
    opacity: 0.9;
    transform: scale(1);
  }

  100% {
    opacity: 0.4;
    transform: scale(0.98);
  }
}

/* ðŸ­ Kanban Pipeline OptimizaciÃ³n */
.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
}

.kanban-board::-webkit-scrollbar {
  height: 6px;
}

.kanban-board::-webkit-scrollbar-thumb {
  background: #ffffff; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff;
  border-radius: 10px;
}

.kb-item {
  transition: transform 0.2s ease;
}

.kb-item:hover {
  transform: scale(1.02);
}

/* â”€â”€ MQN 2026: STAFF & MILY GLOBAL â”€â”€ */
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
  width: 100%;
}

.role-card {
  padding: 15px;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 2px solid transparent;
}

.role-card:hover {
  transform: translateY(-5px);
  background: var(--bg-hover);
}

.role-card.active {
  box-shadow: var(--shadow-in);
  border-color: #718096;
  background: var(--bg-neumo);
}

.role-icon {
  font-size: 2.2em;
}

.role-name {
  font-weight: 900;
  font-size: 0.8em;
  color: var(--text-main);
}

/* Mily Global Bubble */
#mily-bubble {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: #ffffff; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8em;
  cursor: pointer;
  z-index: 200000;
  transition: all 0.3s ease;
  border: 3px solid #fff;
}

#mily-bubble:hover {
  transform: scale(1.15) rotate(10deg);
  box-shadow: 0 15px 40px rgba(59, 130, 246, 0.6);
}

#mily-bubble.open {
  transform: scale(0.8) rotate(-90deg);
  opacity: 0.5;
}

/* Global Chat Panel */
#mily-global-chat {
  position: fixed;
  bottom: 90px;
  right: 25px;
  width: 380px;
  height: 500px;
  max-height: 80vh;
  background: var(--bg-panel);
  border-radius: 20px;
  box-shadow: var(--shadow-out), 0 20px 50px rgba(0, 0, 0, 0.1);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 2001;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

#mily-global-chat.active {
  display: flex;
  animation: milySlideIn 0.3s ease-out;
}

@keyframes milySlideIn {
  from {
    transform: translateY(30px) scale(0.9);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

#mily-chat-header {
  padding: 15px;
  background: #ffffff; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff;
  color: #718096;
  display: flex;
  align-items: center;
  gap: 12px;
}

#mily-chat-msgs {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#mily-chat-input-area {
  padding: 15px;
  background: var(--bg-neumo);
  display: flex;
  gap: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.mily-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85em;
  line-height: 1.4;
}

.mily-msg.ai {
  background: #fff;
  align-self: flex-start;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.05);
  border-bottom-left-radius: 2px;
}

.mily-msg.user {
  background: #ffffff; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff;
  color: #718096;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

/* Context Menu System */
@keyframes neumoPop {
  from {
    transform: scale(0.95) translateY(10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.ctx-menu {
  position: fixed;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.15), -10px -10px 30px rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  padding: 8px;
  z-index: 10000;
  min-width: 200px;
  animation: neumoPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ctx-item {
  padding: 12px 15px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 4px;
}

.ctx-item i {
  font-size: 1.25em;
  color: #718096;
}

.ctx-item:hover {
  background: var(--bg-neumo);
  box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.05), inset -2px -2px 5px rgba(255, 255, 255, 0.5);
  color: #718096;
}

.ctx-item.danger:hover {
  color: var(--red);
}

.ctx-sep {
  height: 1px;
  background: rgba(0, 0, 0, 0.05);
  margin: 6px 8px;
}

/* [MQN 2026] Reactions Overlay: Glassmorphic Hub */
.reactions-overlay {
  position: absolute;
  top: -55px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(15px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 15px;
  border-radius: 40px;
  display: flex;
  gap: 10px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.12);
  z-index: 1000;
  animation: reactPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes reactPop {
  from { opacity: 0; transform: translateX(-50%) translateY(15px) scale(0.7); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.reaction-btn {
  font-size: 1.6em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.1));
}

.reaction-btn:hover {
  transform: scale(1.4) translateY(-5px);
  filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
}

.reaction-btn:active {
  transform: scale(0.9);
}

/* Badge de ReacciÃ³n en Burbuja */
.msg-reaction-badge {
  position: absolute;
  bottom: -15px;
  right: 15px;
  background: #fff;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.9em;
  box-shadow: var(--shadow-out);
  border: 1px solid rgba(0,0,0,0.05);
  z-index: 10;
  cursor: pointer;
}

/* â”€â”€ Editor Maestro HD (Fase 9: Legibilidad & Estilo) â”€â”€ */
.editor-hd-container {
  padding: 20px;
  border-radius: 20px;
  background: var(--bg-panel);
  box-shadow: var(--shadow-out);
  border: 3px solid rgba(0, 0, 0, 0.05); /* Marquito sutil base */
  transition: all 0.3s;
}

.editor-hd-container.blue { border-color: rgba(102, 126, 234, 0.4); }
.editor-hd-container.green { border-color: rgba(16, 185, 129, 0.4); }
.editor-hd-container.orange { border-color: rgba(217, 119, 6, 0.4); }
.editor-hd-container.pink { border-color: rgba(219, 39, 119, 0.4); }
.editor-hd-container.purple { border-color: rgba(124, 58, 237, 0.4); }
.editor-hd-container.sky { border-color: rgba(2, 132, 199, 0.4); }

.editor-hd-title {
  margin-top: 0;
  margin-bottom: 15px;
  opacity: 0.9;
  font-size: 0.9em;
  text-transform: uppercase;
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 10px;
  font-weight: 900;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-hd-label {
  display: block;
  font-weight: 900;
  color: #444;
  font-size: 0.75em;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.editor-hd-label.cvt {
    font-size: 0.6em;
    font-weight: 900;
    opacity: 0.4;
    letter-spacing: 0.5px;
    margin-left: 8px;
    flex-shrink: 0;
}

/* [V42.3] TESTIGO DE FECHA REAL */
.cvd {
    font-size: 0.55em;
    font-weight: 1000;
    opacity: 0.25;
    color: var(--text-main);
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

.cv:hover .cvd {
    opacity: 0.5;
}

.editor-hd-input {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: inset 4px 4px 8px #d1d9e6, inset -4px -4px 8px #ffffff;
  border-radius: 12px;
  padding: 12px;
  font-weight: 800;
  color: #000; /* Texto Negro como solicitÃ³ el usuario */
  font-size: 1em;
  outline: none;
  font-family: var(--font);
  transition: all 0.2s;
  appearance: none; /* Uniformidad para select */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23667eea'%3E%3Cpath d='M12 16L6 10H18L12 16Z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 18px;
}

.editor-hd-input:focus {
  box-shadow: inset 4px 4px 8px #d1d9e6, inset -4px -4px 8px #ffffff;
  background: #ffffff;
}

.input-price-venta { background: #ecfdf5 !important; color: #047857 !important; border-color: #10b981 !important; }
.input-price-reseller { background: #eef2ff !important; color: #4338ca !important; border-color: #6366f1 !important; }
.input-price-vip { background: #f8fafc !important; color: #334155 !important; border-color: #94a3b8 !important; }

.editor-hd-container:hover {
  box-shadow: 12px 12px 20px #d1d9e6, -12px -12px 20px #ffffff;
  transform: translateY(-2px);
}

.editor-hd-textarea {
  min-height: 100px;
  line-height: 1.4;
  font-weight: 700;
}

.editor-hd-btn-search {
  border: 2px solid #bae6fd;
  font-weight: 900;
  border-radius: 10px;
  padding: 0 15px;
  background: #e0f2fe;
  color: #0369a1;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-hd-btn-search:hover {
  background: #fff;
  transform: translateY(-1px);
}

.editor-hd-btn-search:active {
  transform: scale(0.95);
}

/* â”€â”€ ELITE SCROLLBAR SYSTEM â”€â”€ */
.scroll-elite::-webkit-scrollbar {
  width: 10px;
}
.scroll-elite::-webkit-scrollbar-track {
  background: transparent;
  margin: 15px 0; /* Aleja el scroll de las esquinas redondeadas */
}
.scroll-elite::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.45);
  border-radius: 10px;
  border: 3px solid transparent; /* Crea un margen visual alrededor de la barra */
  background-clip: content-box;
}
.scroll-elite::-webkit-scrollbar-thumb:hover {
  background: #ffffff; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff;
  background-clip: content-box;
}

/* Clases para Modales Ã‰lite */
.modal-content.neumo-card.elite {
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
}

.modal-elite-header {
    padding: 25px 30px 10px 30px;
    flex-shrink: 0;
}

.modal-elite-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 30px 30px 30px;
}

/* â”€â”€ MILY TACTICAL CARDS (MQN 2026) â”€â”€ */
.mily-cards-container {
    padding: 5px;
    margin: -5px;
}
.mily-cards-container::-webkit-scrollbar {
    height: 4px;
}
.mily-cards-container::-webkit-scrollbar-thumb {
    background: #ffffff; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff;
    border-radius: 10px;
}
.tactic-card {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    user-select: none;
}
.tactic-card:active {
    transform: scale(0.95) !important;
    box-shadow: var(--shadow-in) !important;
}
.tactic-card i {
    font-size: 1.2em;
    opacity: 0.8;
}

/* â”€â”€ CRM SKELETON & ANTI-FLICKER (MQN 2026) â”€â”€ */
@keyframes crm-shimmer {
  0% { background-position: -468px 0; }
  100% { background-position: 468px 0; }
}

.crm-loading-ghost {
  background: #f6f7f8;
  background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
  background-repeat: no-repeat;
  background-size: 800px 104px;
  animation: crm-shimmer 1.5s linear infinite forwards;
  border-radius: 8px;
  opacity: 0.6;
}

#ai-mily-content {
  transition: opacity 0.2s ease-in-out;
}

/* â”€â”€ CRM SIDEBAR NAVIGATION & POS â”€â”€ */
#crm-sidebar {
    width: 0;
    height: 100%;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
    background: var(--bg-panel);
    overflow: hidden;
}

#crm-sidebar.active {
    width: 50% !important;
    flex: 0 0 50vw !important;
    min-width: 500px !important;
}

/* [MATRIX 2026] ESTILOS INDUSTRIALES PROFUNDOS */
.phase-card-industrial:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: #718096; !important;
    box-shadow: 0 15px 40px rgba(255,140,0,0.2) !important;
}

.matrix-prompt-btn {
    background: transparent;
    border: none;
    color: #718096;
    cursor: pointer;
    font-size: 1em;
    padding: 2px;
    transition: all 0.2s;
    opacity: 0.6;
}

.matrix-prompt-btn:hover {
    opacity: 1;
    transform: scale(1.2);
    text-shadow: 0 0 10px var(--accent);
}

.matrix-task-row {
    transition: all 0.2s;
}

.matrix-task-row:hover {
    background: rgba(255,255,255,0.02);
    padding-left: 5px !important;
}

.matrix-structure-block {
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Fallback para cuando el CRM se usa fuera de WhatsApp (si aplica) */
/* body:not(.panel-wa-active) #crm-sidebar rules pruned */

/* â”€â”€ LINK PREVIEW CARDS (RICH LINKS) â”€â”€ */
.link-preview-card {
    background: var(--bg-hover);
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
    margin: 8px 0;
    overflow: hidden;
    max-width: 350px;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: var(--shadow-tiny);
}
.link-preview-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-flat);
}
.link-preview-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #eee;
}
.link-preview-info {
    padding: 10px 12px;
}
.link-preview-title {
    font-weight: 800;
    font-size: 0.9em;
    color: var(--text-main);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
}
.link-preview-desc {
    font-size: 0.75em;
    color: var(--text-sub);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
}
.link-preview-url {
    font-size: 0.7em;
    color: #718096;
    margin-top: 5px;
    display: block;
    text-transform: lowercase;
}

.crm-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--bg-hover);
  box-shadow: var(--shadow-tiny);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  z-index: 1010;
  color: var(--text-sub);
}

.crm-close-btn:hover {
  background: var(--red);
  color: #718096;
}

/* â”€â”€â”€ [MQN 2026] Animaciones de Agentes (Matriz de Inteligencia) â”€â”€â”€â”€â”€â”€â”€ */
@keyframes pulseGreen {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 217, 95, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 217, 95, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 217, 95, 0); }
}

.pulse-green {
    animation: pulseGreen 2s infinite !important;
}

.agent-active-glow {
    border: 1px solid rgba(0, 217, 95, 0.3) !important;
    box-shadow: 0 0 20px rgba(0, 217, 95, 0.1), var(--shadow-flat) !important;
}

.agent-card:hover {
    transform: translateY(-8px) scale(1.03) !important;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1), var(--shadow-out) !important;
}

/* â”€â”€â”€ [MQN 2026] Estados de ConexiÃ³n (Industrial) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@keyframes blink-red {
    0% { background-color: var(--red); box-shadow: 0 0 15px var(--red); }
    50% { background-color: #8b0000; box-shadow: 0 0 0px transparent; }
    100% { background-color: var(--red); box-shadow: 0 0 15px var(--red); }
}

/* â”€â”€â”€ [MQN 2026] Status Pills & Health Indicators (Refined) â”€â”€â”€ */
.est-pill-main { transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

.est-pill-main.online {
    background: var(--green) !important;
    color: #718096; !important;
    box-shadow: 0 4px 15px rgba(0, 217, 95, 0.4);
    font-weight: 1000;
}

.est-pill-main.offline {
    background: var(--red) !important;
    color: #718096; !important;
    box-shadow: 0 4px 15px rgba(255, 77, 77, 0.5);
    animation: mqn-blink-red 1.2s infinite;
    font-weight: 1000;
}

.est-pill-main.warming {
    background: #f1c40f !important;
    color: #000 !important;
    font-weight: 1000;
}

@keyframes mqn-blink-red {
    0% { opacity: 1; transform: scale(1); filter: brightness(1); }
    50% { opacity: 0.8; transform: scale(0.96); filter: brightness(1.2); }
    100% { opacity: 1; transform: scale(1); filter: brightness(1); }
}

.pulse-green {
    box-shadow: 0 0 0 0 rgba(0, 217, 95, 0.7);
    animation: pulse-green-glow 2s infinite;
}

@keyframes pulse-green-glow {
    0% { box-shadow: 0 0 0 0 rgba(0, 217, 95, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 217, 95, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 217, 95, 0); }
}





/* [V42.4] RECTIFICACION SUPREMA: ESTILOS DE BARRA LATERAL (FECHA Y HORA) */
.cvt {
    font-size: 0.65em;
    font-weight: 900;
    opacity: 0.5;
    letter-spacing: 0.5px;
    margin-left: 8px;
    flex-shrink: 0;
    color: var(--text-main);
}

.cvd {
    font-size: 0.55em;
    font-weight: 1000;
    opacity: 0.35;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
    transition: opacity 0.3s ease;
}

.cv:hover .cvd {
    opacity: 0.7;
}

/* â”€â”€ [V67] CRM 360: GRAFO RELACIONAL Y SEMIÃ“TICA INDUSTRIAL â”€â”€ */
.crm-panorama-360 { animation: fadeIn 0.4s ease-out; }

.crm-context-switch {
    display: flex;
    gap: 10px;
    padding: 5px;
    background: var(--bg-neumo);
    border-radius: 12px;
    box-shadow: var(--shadow-in);
}

.crm-context-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 8px;
    font-size: 0.7em;
    font-weight: 800;
    cursor: pointer;
    background: transparent;
    transition: 0.3s;
    color: var(--text-sub);
}

.crm-context-btn.active {
    background: var(--bg-panel);
    color: #718096;
    box-shadow: var(--shadow-out);
}

.crm-financial-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 25px;
    color: var(--text-primary);
    box-shadow: var(--shadow-out);
    border: 1px solid rgba(255,255,255,0.8);
}

.crm-metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.crm-metric-item {
    display: flex;
    flex-direction: column;
}

.crm-metric-label { font-size: 0.6em; opacity: 0.6; text-transform: uppercase; letter-spacing: 1px; }
.crm-metric-value { font-size: 1.1em; font-weight: 900; }

/* Niveles de Cliente - SemiÃ³tica MQN */
.crm-level-bronze { color: #cd7f32 !important; border-color: #cd7f32 !important; }
.crm-level-silver { color: #8e8e8e !important; border-color: #8e8e8e !important; }
.crm-level-gold { color: #d4af37 !important; border-color: #d4af37 !important; }
.crm-level-platinum { color: #a0aec0 !important; border-color: #a0aec0 !important; text-shadow: 0 0 10px rgba(160,174,192,0.5); }

.crm-badge { padding: 4px 10px; border-radius: 20px; font-size: 0.65em; font-weight: 900; }
.crm-badge-vip { background: var(--yellow); color: black; }
.crm-badge-revendedor { background: #ffffff; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff; color: #718096; }
.crm-badge-publico { background: rgba(0,0,0,0.05); color: var(--text-sub); }

.crm-history-lite { margin-top: 10px; }
.crm-order-row {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 8px;
    font-size: 0.8em;
}

.crm-order-status {
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.8em;
}
.status-completado { background: rgba(72,187,120,0.1); color: #48bb78; }
.status-pendiente { background: rgba(237,137,54,0.1); color: #ed8936; }

/* â”€â”€ MQN 2026: RESTAURACIÃ“N CROMÃTICA (V86.0) â”€â”€ */
:root {
  --bg-neumo: #f5f7fa;
  --bg-panel: #f5f7fa;
  --text-main: #1a202c;
  --text-sub: #4a5568;
  --shadow-out: 8px 8px 16px #d1d9e6, -8px -8px 16px #ffffff;
  --shadow-in: inset 6px 6px 12px #d1d9e6, inset -6px -6px 12px #ffffff;
  
  /* RestauraciÃ³n de Colores Originales */
  --color-guest: #adb5bd;
  --color-system: #6c757d;
  --color-client: #00d95f;
  --color-reseller: #764ba2;
  --color-provider: #ff8c00;
  --color-gold: #f59e0b;
  --color-staff: #3b82f6; 
}

body { background: #f5f7fa !important; color: #1a202c !important; }

/* Tarjetas de Rol con Color Vibrante (Si el usuario dijo SI) */
.role-card {
  background: #f5f7fa !important;
  box-shadow: 10px 10px 20px #d1d9e6, -10px -10px 20px #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.role-card:hover, .role-card.active {
  background: var(--role-color) !important;
  color: #718096; !important;
  transform: translateY(-8px) !important;
  background: #f5f7fa !important;
  box-shadow: 8px 8px 16px #d1d9e6, -8px -8px 16px #ffffff !important;
  border: 1px solid rgba(255,255,255,0.7) !important;
}

#panel-login { background: #f5f7fa !important; }
#login-box { padding: 40px !important; }

.modal-content { background: #f5f7fa !important; box-shadow: var(--shadow-out) !important; }

/* Purga de colores de rol */
.role-guest, .role-system, .role-client, .role-reseller, .role-provider, .role-gold, .role-staff {
  --role-color: #4a5568 !important;
}

/* [V95.0] Radar E2E Animations */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1.5s linear infinite; }
@keyframes pulseRed { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.pulse-red { animation: pulseRed 2s infinite; }
.neumo-btn-circle { padding: 8px; border-radius: 50%; background: var(--bg-panel); box-shadow: var(--shadow-tiny); border: none; transition: all 0.3s; }
.neumo-btn-circle:hover { box-shadow: var(--shadow-out); transform: translateY(-1px); }
.neumo-btn-circle:active { box-shadow: var(--shadow-in); transform: scale(0.95); }

/* --- [V102] OMNISCIENCIA VISUAL: GRID & GLOW --- */
.grid-mando {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-gap: 12px;
    padding: 12px;
    align-items: start; /* AlineaciÃ³n al inicio */
    align-content: start;
    width: 100%;
}

.widget-card {
    grid-column: span 4;
    height: max-content; /* Evitar gigantismo */
    background: var(--bg-panel);
    box-shadow: var(--shadow-flat);
    border-radius: 15px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255,255,255,0.7);
    overflow: hidden;
}

.widget-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-flat); border-color: #718096; }
.widget-card:active { cursor: grabbing; }

.widget-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    box-shadow: var(--shadow-in);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.widget-title {
    font-size: 0.85em;
    font-weight: 900;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Guardiï¿½n Pulsante */
.glow-pulse-red { animation: glow-pulse-red 2s infinite; }
@keyframes glow-pulse-red {
    0% { filter: drop-shadow(0 0 2px rgba(255, 77, 77, 0.4)); }
    50% { filter: drop-shadow(0 0 10px rgba(255, 77, 77, 0.8)); }
    100% { filter: drop-shadow(0 0 2px rgba(255, 77, 77, 0.4)); }
}

.glow-pulse-orange { animation: glow-pulse-orange 2s infinite; }
@keyframes glow-pulse-orange {
    0% { filter: drop-shadow(0 0 2px rgba(249, 115, 22, 0.4)); }
    50% { filter: drop-shadow(0 0 10px rgba(249, 115, 22, 0.8)); }
    100% { filter: drop-shadow(0 0 2px rgba(249, 115, 22, 0.4)); }
}

.glow-pulse-blue { animation: glow-pulse-blue 2s infinite; }
@keyframes glow-pulse-blue {
    0% { filter: drop-shadow(0 0 2px rgba(59, 130, 246, 0.4)); }
    50% { filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.8)); }
    100% { filter: drop-shadow(0 0 2px rgba(59, 130, 246, 0.4)); }
}

.nav-tab:active { transform: scale(0.96); box-shadow: var(--shadow-in) !important; color: #718096; }

/* 🔰 [MATRIX 2026] PROTECCIÓN DE INTERFAZ INDUSTRIAL */
.mqn-modal-protected {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.mqn-modal-protected.active {
    display: flex !important;
    opacity: 1;
    pointer-events: auto;
}

/* V252: FORCE Z-INDEX */
#modal-editor-maestro-container {
    position: relative !important;
.crm-metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.crm-metric-item {
    display: flex;
    flex-direction: column;
}

.crm-metric-label { font-size: 0.6em; opacity: 0.6; text-transform: uppercase; letter-spacing: 1px; }
.crm-metric-value { font-size: 1.1em; font-weight: 900; }

/* Niveles de Cliente - SemiÃ³tica MQN */
.crm-level-bronze { color: #cd7f32 !important; border-color: #cd7f32 !important; }
.crm-level-silver { color: #8e8e8e !important; border-color: #8e8e8e !important; }
.crm-level-gold { color: #d4af37 !important; border-color: #d4af37 !important; }
.crm-level-platinum { color: #a0aec0 !important; border-color: #a0aec0 !important; text-shadow: 0 0 10px rgba(160,174,192,0.5); }

.crm-badge { padding: 4px 10px; border-radius: 20px; font-size: 0.65em; font-weight: 900; }
.crm-badge-vip { background: var(--yellow); color: black; }
.crm-badge-revendedor { background: #ffffff; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff; color: #718096; }
.crm-badge-publico { background: rgba(0,0,0,0.05); color: var(--text-sub); }

.crm-history-lite { margin-top: 10px; }
.crm-order-row {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 8px;
    font-size: 0.8em;
}

.crm-order-status {
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.8em;
}
.status-completado { background: rgba(72,187,120,0.1); color: #48bb78; }
.status-pendiente { background: rgba(237,137,54,0.1); color: #ed8936; }

/* â”€â”€ MQN 2026: RESTAURACIÃ“N CROMÃ TICA (V86.0) â”€â”€ */
:root {
  --bg-neumo: #f5f7fa;
  --bg-panel: #f5f7fa;
  --text-main: #1a202c;
  --text-sub: #4a5568;
  --shadow-out: 8px 8px 16px #d1d9e6, -8px -8px 16px #ffffff;
  --shadow-in: inset 6px 6px 12px #d1d9e6, inset -6px -6px 12px #ffffff;
  
  /* RestauraciÃ³n de Colores Originales */
  --color-guest: #adb5bd;
  --color-system: #6c757d;
  --color-client: #00d95f;
  --color-reseller: #764ba2;
  --color-provider: #ff8c00;
  --color-gold: #f59e0b;
  --color-staff: #3b82f6; 
}

body { background: #f5f7fa !important; color: #1a202c !important; }

/* Tarjetas de Rol con Color Vibrante (Si el usuario dijo SI) */
.role-card {
  background: #f5f7fa !important;
  box-shadow: 10px 10px 20px #d1d9e6, -10px -10px 20px #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.role-card:hover, .role-card.active {
  background: var(--role-color) !important;
  color: #718096; !important;
  transform: translateY(-8px) !important;
  background: #f5f7fa !important;
  box-shadow: 8px 8px 16px #d1d9e6, -8px -8px 16px #ffffff !important;
  border: 1px solid rgba(255,255,255,0.7) !important;
}

#panel-login { background: #f5f7fa !important; }
#login-box { padding: 40px !important; }

.modal-content { background: #f5f7fa !important; box-shadow: var(--shadow-out) !important; }

/* Purga de colores de rol */
.role-guest, .role-system, .role-client, .role-reseller, .role-provider, .role-gold, .role-staff {
  --role-color: #4a5568 !important;
}

/* [V95.0] Radar E2E Animations */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1.5s linear infinite; }
@keyframes pulseRed { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.pulse-red { animation: pulseRed 2s infinite; }
.neumo-btn-circle { padding: 8px; border-radius: 50%; background: var(--bg-panel); box-shadow: var(--shadow-tiny); border: none; transition: all 0.3s; }
.neumo-btn-circle:hover { box-shadow: var(--shadow-out); transform: translateY(-1px); }
.neumo-btn-circle:active { box-shadow: var(--shadow-in); transform: scale(0.95); }

/* --- [V102] OMNISCIENCIA VISUAL: GRID & GLOW --- */
.grid-mando {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-gap: 12px;
    padding: 12px;
    align-items: start; /* AlineaciÃ³n al inicio */
    align-content: start;
    width: 100%;
}

.widget-card {
    grid-column: span 4;
    height: max-content; /* Evitar gigantismo */
    background: var(--bg-panel);
    box-shadow: var(--shadow-flat);
    border-radius: 15px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255,255,255,0.7);
    overflow: hidden;
}

.widget-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-flat); border-color: #718096; }
.widget-card:active { cursor: grabbing; }

.widget-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    box-shadow: var(--shadow-in);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.widget-title {
    font-size: 0.85em;
    font-weight: 900;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Guardiï¿½n Pulsante */
.glow-pulse-red { animation: glow-pulse-red 2s infinite; }
@keyframes glow-pulse-red {
    0% { filter: drop-shadow(0 0 2px rgba(255, 77, 77, 0.4)); }
    50% { filter: drop-shadow(0 0 10px rgba(255, 77, 77, 0.8)); }
    100% { filter: drop-shadow(0 0 2px rgba(255, 77, 77, 0.4)); }
}

.glow-pulse-orange { animation: glow-pulse-orange 2s infinite; }
@keyframes glow-pulse-orange {
    0% { filter: drop-shadow(0 0 2px rgba(249, 115, 22, 0.4)); }
    50% { filter: drop-shadow(0 0 10px rgba(249, 115, 22, 0.8)); }
    100% { filter: drop-shadow(0 0 2px rgba(249, 115, 22, 0.4)); }
}

.glow-pulse-blue { animation: glow-pulse-blue 2s infinite; }
@keyframes glow-pulse-blue {
    0% { filter: drop-shadow(0 0 2px rgba(59, 130, 246, 0.4)); }
    50% { filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.8)); }
    100% { filter: drop-shadow(0 0 2px rgba(59, 130, 246, 0.4)); }
}

.nav-tab:active { transform: scale(0.96); box-shadow: var(--shadow-in) !important; color: #718096; }

/* 🔰 [MATRIX 2026] PROTECCIÓN DE INTERFAZ INDUSTRIAL */
.mqn-modal-protected {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.mqn-modal-protected.active {
    display: flex !important;
    opacity: 1;
    pointer-events: auto;
}

/* V252: FORCE Z-INDEX */
#modal-editor-maestro-container {
    position: relative !important;
    z-index: 9999999 !important;
}
#modal-editor-maestro {
    z-index: 9999999 !important;
}
#modal-buscador-maquila {
    z-index: 105000 !important;
}

/* SUTURA: Forzar que las validaciones de Swal (SweetAlert) queden por encima del Kardex Maestro (que tiene 9999999) */
.swal2-container {
    z-index: 99999999 !important;
}
.pulse-active { transform: scale(0.92) !important; background: var(--accent-hover) !important; box-shadow: var(--shadow-in) !important; transition: all 0.1s ease !important; }
