:root {
  --primary: #6c5ce7;
  --primary-hover: #5649d1;
  --secondary: #a29bfe;
  --accent: #00cec9;
  --success: #00b894;
  --error: #ff7675;
  --warning: #f0a500;
  --wa: #25d366;
  --wa-dark: #128c7e;
  --bg: #f9fbff;
  --surface: #ffffff;
  --surface-2: #f5f7fc;
  --text: #2c3e50;
  --text-muted: #7f8c8d;
  --border: rgba(0, 0, 0, 0.06);
  --border-2: rgba(0, 0, 0, 0.1);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.09);
  --highlight: rgba(108, 92, 231, 0.1);
  --side-nav-width: 260px;
  --header-height: 70px;
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  color-scheme: light;
}

body.dark-mode {
  --primary: #29b6f6;
  --primary-hover: #0ea5e9;
  --secondary: #4fc3f7;
  --accent: #29b6f6;
  --success: #34d399;
  --error: #f87171;
  --warning: #fbbf24;
  --bg: #000000;
  --surface: #121212;
  --surface-2: #1a1a1a;
  --text: #ffffff;
  --text-muted: #b8b8b8;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 34px rgba(0, 0, 0, 0.55);
  --highlight: rgba(41, 182, 246, 0.12);
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; min-inline-size: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

body::-webkit-scrollbar { width: 8px; }
body::-webkit-scrollbar-track { background: var(--bg); }
body::-webkit-scrollbar-thumb { background: linear-gradient(45deg, var(--primary), var(--secondary)); border-radius: 10px; }

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
[hidden], .oculto { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* ── Menú lateral (móvil y tablet) y navegación superior (PC) ── */

.sidebar {
  position: fixed; left: 0; top: 0;
  width: var(--side-nav-width); height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 100; overflow-y: auto;
  box-shadow: var(--shadow);
}

.sidebar-header { padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--border); }

.logo {
  display: flex; align-items: center; gap: 0.7rem;
  font-size: 1.3rem; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.logo img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }

.sidebar-nav { padding: 0.5rem 0 1rem; }

.nav-section-title {
  padding: 0.35rem 1.5rem; margin-top: 0.6rem;
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  background: linear-gradient(90deg, #3b82f6, #6c5ce7, #00cec9, #22c55e, #8b5cf6, #06b6d4, #10b981, #3b82f6);
  background-size: 800% 100%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: rainbowShift 8s linear infinite;
}
@keyframes rainbowShift { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }

.nav-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.68rem 1.2rem; margin: 0.12rem 0.75rem;
  color: var(--text-muted); border-radius: 10px;
  font-weight: 600; font-size: 0.93rem;
  position: relative; transition: var(--transition);
}
.nav-link i { font-size: 1rem; width: 20px; text-align: center; transition: transform 0.3s ease; }
.nav-link:hover { color: var(--text); background: var(--highlight); transform: translateX(6px); }
.nav-link:hover i { transform: scale(1.1) rotate(5deg); }
.nav-link.active {
  color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.25); transform: translateX(4px);
}
body.dark-mode .nav-link.active { box-shadow: none; }
.nav-count { margin-left: auto; background: var(--primary); color: #fff; padding: 0.15rem 0.5rem; border-radius: 10px; font-size: 0.68rem; font-weight: 700; }
.nav-link.active .nav-count { background: rgba(255, 255, 255, 0.25); }

.main-content { margin-left: var(--side-nav-width); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.3s; }

.header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0 1.5rem;
  box-shadow: var(--shadow);
}
body.dark-mode .header { background: rgba(18, 18, 18, 0.96); }

.header-logo { display: none; }

.menu-toggle, .theme-toggle {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.menu-toggle { display: none; }
.menu-toggle:hover { background: var(--highlight); color: var(--primary); border-color: var(--primary); }
.theme-toggle:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(108, 92, 231, 0.3); }

.header-right { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }

.user-chip { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.75rem 0.3rem 0.3rem; border-radius: 12px; font-weight: 600; font-size: 0.88rem; color: var(--text); transition: var(--transition); }
.user-chip:hover { background: var(--highlight); }
.user-chip img, .avatar-ini { width: 30px; height: 30px; border-radius: 10px; object-fit: cover; }
.avatar-ini { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; font-size: 0.85rem; font-weight: 800; }

.overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); z-index: 99; }
.overlay.active { display: block; }

.top-nav { display: none; }

@media (min-width: 992px) {
  body.has-top-nav .sidebar, body.has-top-nav .menu-toggle, body.has-top-nav .overlay { display: none !important; }
  body.has-top-nav .main-content { margin-left: 0; }
  body.has-top-nav .header { height: 72px; padding: 0 clamp(24px, 3vw, 56px); }
  body.has-top-nav .header-logo { display: flex; margin-right: 0.75rem; }
  body.has-top-nav .header-logo span { font-size: 1.15rem; }
  .top-nav { display: flex; align-items: center; gap: 0.2rem; min-width: 0; }
  .top-nav-link {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 14px; border-radius: 12px;
    color: var(--text-muted); font-size: 0.94rem; font-weight: 500; white-space: nowrap;
    transition: var(--transition);
  }
  .top-nav-link i { font-size: 0.9rem; }
  .top-nav-link:hover, .top-nav-link.active { background: var(--highlight); color: var(--primary); }
  .top-nav-link.active { font-weight: 600; }
  .top-nav-link.salir:hover { background: rgba(244, 63, 94, 0.08); color: #f43f5e; }
  .top-nav-link .nav-count { margin-left: 0; }
}

@media (min-width: 992px) and (max-width: 1279px) {
  .top-nav-link span:not(.nav-count) { display: none; }
  .top-nav-link { padding: 8px 10px; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .header { padding: 0 1rem; }
  .user-chip span { display: none; }
}

/* ── Contenedores ── */

.container { max-width: 1240px; margin: 0 auto; padding: 1.75rem 1.5rem 3rem; width: 100%; }
@media (max-width: 768px) { .container { padding: 1rem 1rem 2.5rem; } }

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  font-weight: 800;
}

.seccion-titulo { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 2rem 0 1rem; }
.seccion-titulo h2 { font-size: 1.2rem; font-weight: 800; display: flex; align-items: center; gap: 0.55rem; }
.seccion-titulo h2 i { color: var(--primary); font-size: 1rem; }
.seccion-titulo .sub { color: var(--text-muted); font-size: 0.85rem; font-weight: 500; }
.page-head { margin-bottom: 1.4rem; }
.page-head h1 { font-size: 1.65rem; font-weight: 800; }
.page-head p { color: var(--text-muted); font-size: 0.92rem; margin-top: 0.25rem; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem;
}
.card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.card h3 i { color: var(--primary); font-size: 0.95rem; }
.card h3 small { margin-left: auto; color: var(--text-muted); font-weight: 500; font-size: 0.78rem; }

/* ── Botones ── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  height: 36px; padding: 0 0.95rem; border-radius: 9px;
  border: 1px solid var(--border-2);
  font-family: inherit; font-size: 0.85rem; font-weight: 600; line-height: 1; letter-spacing: 0.005em;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  position: relative; overflow: hidden; isolation: isolate;
  color: var(--text);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
body.dark-mode .btn { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.btn i { font-size: 0.85em; opacity: 0.9; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16, 24, 40, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.btn:active:not(:disabled) { transform: translateY(0); box-shadow: inset 0 2px 4px rgba(16, 24, 40, 0.12); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--highlight), 0 1px 2px rgba(16, 24, 40, 0.06); border-color: var(--primary); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn::after { content: ''; position: absolute; top: 0; left: -120%; width: 50%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent); transform: skewX(-20deg); transition: left 0.7s ease; pointer-events: none; }
.btn:hover:not(:disabled)::after { left: 140%; }

.btn-primario {
  color: #fff; border-color: var(--primary-hover);
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 82%, #fff), var(--primary) 55%, var(--primary-hover));
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12), 0 4px 12px color-mix(in srgb, var(--primary) 28%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}
.btn-primario:hover:not(:disabled) { box-shadow: 0 2px 4px rgba(16, 24, 40, 0.12), 0 8px 20px color-mix(in srgb, var(--primary) 36%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.28); }
.btn-primario:active:not(:disabled) { box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.22); }
body.dark-mode .btn-primario { color: #04131c; text-shadow: none; }

.btn-borde { color: var(--text); }
.btn-borde:hover:not(:disabled) { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 45%, var(--border-2)); }

.btn-suave { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 22%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 7%, var(--surface)), color-mix(in srgb, var(--primary) 13%, var(--surface))); }
.btn-suave:hover:not(:disabled) { border-color: color-mix(in srgb, var(--primary) 40%, transparent); }

.btn-peligro { color: #e11d48; border-color: rgba(225, 29, 72, 0.25); background: linear-gradient(180deg, #fff5f6, #ffe9ec); }
.btn-peligro:hover:not(:disabled) { color: #fff; border-color: #be123c; background: linear-gradient(180deg, #f43f5e, #e11d48); box-shadow: 0 6px 16px rgba(225, 29, 72, 0.28); }
body.dark-mode .btn-peligro { color: #fb7185; background: linear-gradient(180deg, rgba(244, 63, 94, 0.14), rgba(244, 63, 94, 0.08)); }

.btn-ok { color: #059669; border-color: rgba(5, 150, 105, 0.25); background: linear-gradient(180deg, #f0fdf8, #dcfaee); }
.btn-ok:hover:not(:disabled) { color: #fff; border-color: #047857; background: linear-gradient(180deg, #10b981, #059669); box-shadow: 0 6px 16px rgba(5, 150, 105, 0.28); }
body.dark-mode .btn-ok { color: #34d399; background: linear-gradient(180deg, rgba(52, 211, 153, 0.14), rgba(52, 211, 153, 0.08)); }

.btn-chico { height: 30px; padding: 0 0.7rem; font-size: 0.78rem; border-radius: 8px; }
.btn-bloque { width: 100%; }

.btn-icono {
  width: 34px; height: 34px; border-radius: 10px; border: 0;
  background: transparent; color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.88rem;
  transition: var(--transition);
}
.btn-icono:hover { color: var(--primary); transform: translateY(-1px) scale(1.08); }
.btn-icono.peligro:hover { color: #e11d48; }

.acciones { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* ── Formularios ── */

.campo { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.95rem; }
.campo > label, .campo > .etq { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }
.campo .ayuda { font-size: 0.76rem; color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%; padding: 0.68rem 0.85rem;
  border: 1.5px solid var(--border-2); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 0.92rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--highlight); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
.fila-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 0.9rem; }

.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.interruptor:last-child { border-bottom: 0; }
.interruptor b { display: block; font-size: 0.9rem; }
.interruptor small { color: var(--text-muted); font-size: 0.78rem; }
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--border-2); cursor: pointer; transition: 0.25s; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: 0.25s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(18px); }

.check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.86rem; cursor: pointer; padding: 0.3rem 0; }
.check input { accent-color: var(--primary); width: 16px; height: 16px; }

.msg { padding: 0.65rem 0.85rem; border-radius: 10px; font-size: 0.85rem; font-weight: 600; line-height: 1.45; margin-bottom: 0.9rem; }
.msg.error { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.msg.ok { background: rgba(0, 184, 148, 0.12); color: var(--success); }
.msg.info { background: var(--highlight); color: var(--primary); }
body.dark-mode .msg.error { color: #f87171; }

/* ── Selector de país ── */

.selpais { position: relative; }
.selpais-btn { display: flex; align-items: center; gap: 0.5rem; text-align: left; cursor: pointer; }
.selpais-btn span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selpais-btn .vacio { color: var(--text-muted); }
.selpais-panel {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; right: 0; min-width: 240px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 0.5rem; display: none;
}
.selpais.abierto .selpais-panel { display: block; animation: fadeIn 0.18s ease; }
.selpais-panel .input { padding: 0.55rem 0.75rem; font-size: 0.86rem; margin-bottom: 0.4rem; }
.selpais-lista { max-height: 250px; overflow-y: auto; }
.selpais-op { display: flex; align-items: center; gap: 0.55rem; width: 100%; padding: 0.48rem 0.6rem; border: 0; border-radius: 8px; background: none; color: var(--text); font-family: inherit; font-size: 0.86rem; text-align: left; cursor: pointer; }
.selpais-op:hover, .selpais-op.foco { background: var(--highlight); color: var(--primary); }
.selpais-op small { margin-left: auto; color: var(--text-muted); font-size: 0.72rem; }
.selpais-nada { padding: 0.8rem; text-align: center; color: var(--text-muted); font-size: 0.84rem; }
.bandera { width: 16px; height: 12px; border-radius: 2px; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 1px var(--border); }

/* ── Chips y etiquetas ── */

.chips { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.2rem 0.1rem 0.6rem; scrollbar-width: thin; }
.chip {
  display: inline-flex; align-items: center; gap: 0.45rem; flex-shrink: 0;
  padding: 0.45rem 0.85rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-size: 0.84rem; font-weight: 600; transition: var(--transition); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.chip i { color: var(--primary); font-size: 0.8rem; }
.chip small { font-size: 0.7rem; color: var(--text-muted); font-weight: 700; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.activo { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(108, 92, 231, 0.3); }
.chip.activo i, .chip.activo small { color: rgba(255, 255, 255, 0.9); }

.chip-cat { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.6rem; border-radius: 999px; background: var(--highlight); color: var(--primary); font-size: 0.74rem; font-weight: 700; max-width: 55%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chip-cat i { font-size: 0.7rem; }

.etiqueta { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--text-muted); }
.etiqueta.activo { background: rgba(0, 184, 148, 0.12); color: var(--success); }
.etiqueta.vencido { background: rgba(127, 140, 141, 0.14); color: var(--text-muted); }
.etiqueta.pendiente { background: rgba(240, 165, 0, 0.14); color: #c28400; }
.etiqueta.oculto, .etiqueta.enlace_roto { background: rgba(244, 63, 94, 0.1); color: #e11d48; }
.etiqueta.verif { background: var(--highlight); color: var(--primary); }
body.dark-mode .etiqueta.pendiente { color: var(--warning); }
body.dark-mode .etiqueta.oculto, body.dark-mode .etiqueta.enlace_roto { color: #fb7185; }

/* ── Tarjetas de grupo ── */

.grid-grupos { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 0.9rem; }

.gcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.95rem; display: flex; flex-direction: column; gap: 0.7rem;
  box-shadow: var(--shadow); transition: var(--transition); position: relative;
}
.gcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(108, 92, 231, 0.25); }
body.dark-mode .gcard:hover { border-color: rgba(41, 182, 246, 0.35); }
.gcard.es-verificado { background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--primary), var(--secondary), var(--accent)) border-box; border: 1.5px solid transparent; }

.gcard-top { display: flex; gap: 0.75rem; align-items: center; }
.gcard-foto { width: 54px; height: 54px; border-radius: 15px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.gcard-foto.vacia { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.3rem; color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.gcard-info { flex: 1; min-width: 0; }
.gcard-nombre { font-size: 0.97rem; font-weight: 700; line-height: 1.25; display: flex; align-items: center; gap: 0.35rem; }
.gcard-nombre span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.verif { color: #1d9bf0; font-size: 0.85rem; flex-shrink: 0; }
.gcard-meta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.3rem; color: var(--text-muted); font-size: 0.78rem; font-weight: 500; }
.gcard-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.gcard-meta i { font-size: 0.72rem; }
.gcard-desc { color: var(--text-muted); font-size: 0.83rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.gcard-pie { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: auto; }
.gcard-acciones { display: flex; align-items: center; gap: 0.3rem; }

.vacio { grid-column: 1 / -1; text-align: center; padding: 2.75rem 1rem; color: var(--text-muted); }
.vacio i { font-size: 2rem; margin-bottom: 0.6rem; color: var(--primary); opacity: 0.6; }
.vacio p { font-size: 0.92rem; }
.vacio .btn { margin-top: 0.9rem; }

.esqueleto { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: brillo 1.2s infinite; border-radius: var(--radius); min-height: 150px; }
@keyframes brillo { to { background-position: -200% 0; } }

.paginas { display: flex; justify-content: center; align-items: center; gap: 0.8rem; margin-top: 1.5rem; color: var(--text-muted); font-size: 0.85rem; }

/* ── Hero del directorio ── */

.hero { display: flex; align-items: center; justify-content: space-between; gap: clamp(24px, 4vw, 64px); padding: 0.75rem 0 1.5rem; }
.hero-texto { flex: 1; min-width: 0; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.1; margin-bottom: 0.6rem; }
.hero h1 i { -webkit-text-fill-color: var(--wa); color: var(--wa); font-size: 0.85em; margin-left: 0.15em; }
.hero p { color: var(--text-muted); font-size: 1rem; line-height: 1.6; max-width: 580px; }
.hero-datos { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; list-style: none; }
.hero-datos li { padding: 0.4rem 0.85rem; border-radius: 999px; background: var(--highlight); border: 1px solid var(--border); font-size: 0.82rem; font-weight: 600; color: var(--text); }
.hero-datos b { color: var(--primary); }
.hero-img {
  width: clamp(150px, 13vw, 200px); height: clamp(150px, 13vw, 200px); flex-shrink: 0;
  object-fit: cover; padding: 6px; border-radius: 28px; background: var(--surface);
  box-shadow: 0 16px 50px rgba(108, 92, 231, 0.28), 0 6px 20px rgba(0, 0, 0, 0.1);
  animation: flotar 6s ease-in-out infinite;
}
@keyframes flotar { 0%, 100% { transform: rotate(3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-12px); } }
@media (max-width: 768px) {
  .hero { flex-direction: column-reverse; text-align: center; padding-top: 0.5rem; }
  .hero p { margin: 0 auto; }
  .hero-datos { justify-content: center; }
  .hero-img { width: 96px; height: 96px; border-radius: 22px; padding: 4px; }
}

.buscador {
  display: flex; gap: 0.5rem; align-items: stretch;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 0.45rem; box-shadow: var(--shadow); margin-bottom: 1.1rem;
}
.buscador-q { flex: 1; display: flex; align-items: center; gap: 0.55rem; padding: 0 0.6rem; min-width: 0; }
.buscador-q i { color: var(--text-muted); font-size: 0.9rem; }
.buscador-q input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-family: inherit; font-size: 0.94rem; padding: 0.5rem 0; min-width: 0; }
.buscador .selpais { width: 220px; flex-shrink: 0; }
.buscador .selpais-btn { height: 100%; border: 0; background: var(--surface-2); }
@media (max-width: 640px) {
  .buscador { flex-wrap: wrap; }
  .buscador-q { flex-basis: 100%; }
  .buscador .selpais { flex: 1; width: auto; }
}

.planes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.9rem; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.35rem; position: relative; transition: var(--transition); }
.plan:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.plan.recomendado { border-color: var(--primary); }
.plan .cinta { overflow: hidden; box-shadow: 0 4px 12px rgba(108, 92, 231, 0.35); position: absolute; top: -10px; right: 14px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; font-size: 0.68rem; font-weight: 800; padding: 0.2rem 0.6rem; border-radius: 99px; }
.plan h4 { font-size: 0.92rem; font-weight: 700; color: var(--text-muted); }
.plan .precio { font-size: 1.75rem; font-weight: 800; }
.plan .precio small { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.plan ul { list-style: none; margin-top: 0.4rem; display: flex; flex-direction: column; gap: 0.35rem; }
.plan li { font-size: 0.82rem; color: var(--text-muted); display: flex; gap: 0.45rem; }
.plan li i { color: var(--success); font-size: 0.75rem; margin-top: 0.22rem; }

.cta {
  margin-top: 2.5rem; padding: 1.6rem; border-radius: 20px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.09), rgba(0, 206, 201, 0.07));
  border: 1px solid var(--border);
}
body.dark-mode .cta { background: linear-gradient(135deg, rgba(41, 182, 246, 0.1), rgba(41, 182, 246, 0.03)); }
.cta-cab { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.cta-cab h2 { font-size: 1.3rem; font-weight: 800; }
.cta-cab p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.2rem; }

.faq { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.9rem; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0.9rem 1rem; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 700; font-size: 0.9rem; list-style: none; display: flex; justify-content: space-between; gap: 0.75rem; }
.faq summary::after { content: '+'; color: var(--primary); font-weight: 800; }
.faq details[open] summary::after { content: '–'; }
.faq p { color: var(--text-muted); font-size: 0.85rem; line-height: 1.6; margin-top: 0.6rem; }

.footer { border-top: 1px solid var(--border); margin-top: auto; padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.82rem; }
.footer nav { display: flex; justify-content: center; gap: 1.1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.footer a { color: var(--text-muted); font-weight: 600; }
.footer a:hover { color: var(--primary); }

/* ── Modal y avisos ── */

.modal-fondo { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 1rem; animation: fadeIn 0.2s ease; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 460px; max-height: calc(100dvh - 2rem); overflow-y: auto; padding: 1.35rem; }
.modal.ancho { max-width: 720px; }
.modal-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.modal-cab h3 { font-size: 1.08rem; font-weight: 800; }
.modal-cab p { color: var(--text-muted); font-size: 0.84rem; margin-top: 0.2rem; }
.modal-pie { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.1rem; flex-wrap: wrap; }

.toasts { position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 300; display: flex; flex-direction: column; gap: 0.5rem; max-width: calc(100vw - 2.4rem); }
.toast { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 0.87rem; font-weight: 600; animation: entrar 0.3s cubic-bezier(0.22, 1, 0.36, 1); max-width: 380px; }
.toast i { font-size: 1rem; }
.toast.ok i { color: var(--success); }
.toast.error i { color: #e11d48; }
.toast.info i { color: var(--primary); }
.toast.sale { opacity: 0; transform: translateY(8px); transition: 0.25s; }
@keyframes entrar { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.cargando { display: flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 2rem; color: var(--text-muted); font-size: 0.9rem; }
.cargando::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--border-2); border-top-color: var(--primary); animation: girar 0.8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ── Panel y admin ── */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.85rem; margin-bottom: 1.25rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); display: flex; align-items: center; gap: 0.85rem; }
.kpi-ico {
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; color: var(--primary);
  background: none;
}
.kpi-ico i {
  background: linear-gradient(135deg, var(--secondary), var(--primary) 60%, var(--primary-hover));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 6px color-mix(in srgb, var(--primary) 35%, transparent));
}
.kpi { transition: var(--transition); }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi b { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.15; }
.kpi span { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.kpi em { display: block; font-style: normal; font-size: 0.7rem; color: var(--success); font-weight: 700; margin-top: 0.1rem; }

.filtros { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filtros .input, .filtros .select { width: auto; padding: 0.5rem 0.75rem; font-size: 0.85rem; }
.filtros .select { padding-right: 2.1rem; }
.filtros .input { min-width: 200px; flex: 1; }
.filtros .selpais { width: 200px; }
.filtros .selpais-btn { padding: 0.5rem 0.75rem; font-size: 0.85rem; }

.pestanas { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0.3rem; width: fit-content; max-width: 100%; overflow-x: auto; }
.pestana { border: 0; background: none; padding: 0.45rem 0.85rem; border-radius: 9px; font-family: inherit; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 0.4rem; align-items: center; }
.pestana small { background: var(--surface-2); padding: 0.05rem 0.4rem; border-radius: 6px; font-size: 0.7rem; }
.pestana:hover { color: var(--primary); }
.pestana.activa { background: var(--highlight); color: var(--primary); }

.lista-filas { display: flex; flex-direction: column; gap: 0.6rem; }
.fila {
  display: flex; align-items: center; gap: 0.85rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 0.75rem 0.9rem; box-shadow: var(--shadow); transition: var(--transition);
}
.fila:hover { border-color: rgba(108, 92, 231, 0.22); }
.fila-foto { width: 46px; height: 46px; border-radius: 13px; object-fit: cover; flex-shrink: 0; }
.fila-foto.vacia { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.fila-cuerpo { flex: 1; min-width: 0; }
.fila-titulo { font-weight: 700; font-size: 0.92rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.fila-titulo span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.fila-sub { color: var(--text-muted); font-size: 0.78rem; margin-top: 0.2rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.fila-sub span { display: inline-flex; align-items: center; gap: 0.3rem; }
.fila-sub i { font-size: 0.7rem; }
.fila-acciones { display: flex; gap: 0.3rem; align-items: center; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .fila { flex-wrap: wrap; }
  .fila-acciones { width: 100%; justify-content: flex-start; padding-top: 0.5rem; border-top: 1px solid var(--border); }
}

.tabla-caja { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.tabla { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.tabla th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 700; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.tabla td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 420px) { .grid-2 { grid-template-columns: 1fr; } }

.pasos { display: flex; gap: 0.5rem; margin-bottom: 1.2rem; }
.paso { flex: 1; display: flex; align-items: center; gap: 0.55rem; padding: 0.6rem 0.8rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.paso b { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface-2); font-size: 0.75rem; flex-shrink: 0; }
.paso.activo { color: var(--primary); border-color: var(--primary); }
.paso.activo b { background: var(--primary); color: #fff; }
.paso.hecho b { background: var(--success); color: #fff; }
@media (max-width: 560px) { .paso span { display: none; } .paso { justify-content: center; } }

.vista-grupo { display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 1rem; }
.vista-grupo img, .vista-grupo .gcard-foto { width: 60px; height: 60px; border-radius: 16px; object-fit: cover; }
.vista-grupo b { font-size: 1rem; display: block; }
.vista-grupo span { color: var(--text-muted); font-size: 0.82rem; }

.opciones-plan { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.op-plan { border: 1.5px solid var(--border-2); border-radius: 12px; padding: 0.8rem; cursor: pointer; background: var(--surface); text-align: left; font-family: inherit; color: var(--text); transition: var(--transition); }
.op-plan b { display: block; font-size: 0.9rem; }
.op-plan strong { display: block; font-size: 1.25rem; margin: 0.2rem 0; }
.op-plan span { font-size: 0.74rem; color: var(--text-muted); }
.op-plan:hover { border-color: var(--primary); }
.op-plan.sel { border-color: var(--primary); background: var(--highlight); box-shadow: 0 0 0 3px var(--highlight); }
.op-plan:disabled { opacity: 0.45; cursor: not-allowed; }

.perfil-cab { display: flex; align-items: center; gap: 1rem; }
.perfil-cab img, .perfil-cab .avatar-ini { width: 64px; height: 64px; border-radius: 18px; font-size: 1.5rem; }
.perfil-cab b { font-size: 1.1rem; display: block; }
.perfil-cab span { color: var(--text-muted); font-size: 0.85rem; }

.permisos { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.2rem 1rem; }

/* ── Gráficos ── */

.barras { display: flex; flex-direction: column; gap: 0.55rem; }
.barra { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 0.6rem; font-size: 0.8rem; position: relative; }
.barra-nombre { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-pista { display: block; height: 10px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.barra-relleno { display: block; height: 100%; border-radius: 4px; background: var(--primary); min-width: 2px; transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.barra-valor { color: var(--text-muted); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; min-width: 66px; text-align: right; }
.barra-valor b { color: var(--text); }
.barra:hover .barra-relleno { background: var(--primary-hover); }

.columnas { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-top: 0.5rem; border-bottom: 1px solid var(--border-2); position: relative; }
.columna { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; position: relative; }
.columna span { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 1px; transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.columna:hover span { background: var(--primary-hover); }
.columnas-ejes { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 0.7rem; margin-top: 0.35rem; }
.grafico-total { font-size: 1.4rem; font-weight: 800; margin: -0.4rem 0 0.6rem; }
.grafico-total small { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; margin-left: 0.3rem; }

.tooltip { position: fixed; z-index: 400; pointer-events: none; background: var(--text); color: var(--bg); padding: 0.4rem 0.6rem; border-radius: 8px; font-size: 0.76rem; font-weight: 600; line-height: 1.4; box-shadow: var(--shadow-lg); transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; }

.apilada { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--surface); margin-bottom: 0.75rem; }
.apilada span { height: 100%; }
.leyenda { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.78rem; color: var(--text-muted); }
.leyenda span { display: inline-flex; align-items: center; gap: 0.4rem; }
.leyenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.leyenda b { color: var(--text); }

.consola { background: #0d1117; color: #c9d1d9; border-radius: 12px; padding: 0.9rem 1rem; font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 0.78rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow: auto; }

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

.legal { margin-bottom: 1rem; }
.legal h2 { font-size: 1.08rem; font-weight: 800; display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.8rem; }
.legal h2 i { color: var(--primary); font-size: 0.95rem; }
.legal ul { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.legal li { position: relative; padding-left: 1.1rem; color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
.legal li::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.legal li b { color: var(--text); }

.unirse { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text); font-weight: 700; font-size: 0.86rem; }
.wa-bola {
  position: relative; overflow: hidden; flex-shrink: 0;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3be47a, var(--wa) 45%, var(--wa-dark));
  color: #fff; font-size: 1.25rem;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.3s ease;
}
.wa-bola::after { content: ''; position: absolute; top: -10%; left: -130%; width: 55%; height: 120%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); transform: skewX(-20deg); animation: brilloWa 3.2s ease-in-out infinite; }
@keyframes brilloWa { 0%, 55% { left: -130%; } 85%, 100% { left: 150%; } }
.unirse-txt { text-shadow: 0 2px 10px rgba(37, 211, 102, 0.45); transition: color 0.25s ease; }
.unirse:hover .wa-bola { transform: scale(1.1) rotate(-6deg); box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.unirse:hover .unirse-txt { color: var(--wa-dark); }
body.dark-mode .unirse:hover .unirse-txt { color: var(--wa); }

.plan .cinta::after { content: ''; position: absolute; top: 0; left: -130%; width: 50%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent); transform: skewX(-20deg); animation: brilloWa 3.5s ease-in-out infinite; }
.plan.recomendado { box-shadow: 0 10px 30px rgba(108, 92, 231, 0.16); }
.seccion-titulo h2 i, .card h3 i { filter: drop-shadow(0 2px 6px rgba(108, 92, 231, 0.35)); }
.etiqueta.activo { box-shadow: 0 2px 8px rgba(0, 184, 148, 0.15); }

/* ── Estilo AlyaApi ── */

.menu-toggle, .theme-toggle {
  width: 42px; height: 42px; border: 0; border-radius: 12px;
  background: none; color: var(--text); font-size: 1.35rem;
  box-shadow: none;
}
.theme-toggle { font-size: 1.2rem; }
.menu-toggle:hover, .theme-toggle:hover {
  background: var(--highlight); color: var(--primary); border: 0;
  transform: scale(1.06); box-shadow: none;
}
.menu-toggle:active, .theme-toggle:active { transform: scale(0.94); }
.menu-toggle i, .theme-toggle i { transition: transform 0.3s ease; }
.menu-toggle.abierto i { transform: rotate(90deg); }
.theme-toggle:hover i { transform: rotate(-20deg); }

.header {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}
body.dark-mode .header { background: color-mix(in srgb, var(--bg) 88%, transparent); box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5); }
.header::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent); opacity: 0.35;
}

.sidebar {
  background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--bg) 95%, transparent) 100%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
body.dark-mode .sidebar { background: linear-gradient(180deg, #121212 0%, rgba(0, 0, 0, 0.96) 100%); }
.sidebar::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 110px; z-index: -1;
  background: linear-gradient(135deg, var(--primary), var(--secondary)); opacity: 0.07;
}
.sidebar-header { position: relative; border-bottom: 0; padding: 1.3rem 1.4rem 1.1rem; }
.sidebar-header::after {
  content: ''; position: absolute; left: 1.4rem; right: 1.4rem; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-2), transparent);
}
.sidebar .logo { font-size: 1.45rem; letter-spacing: -0.02em; }
.sidebar .logo img { width: 42px; height: 42px; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 25%, transparent); }

.nav-section-title {
  animation: none; background: none; -webkit-text-fill-color: currentColor;
  color: var(--text-muted); font-weight: 600; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: none;
  margin: 0.6rem 0.75rem 0.25rem; padding: 0.45rem 0.6rem;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.nav-section-title:first-child { border-top: 0; }
.nav-link { padding: 0.62rem 1rem; gap: 0.85rem; font-weight: 500; overflow: hidden; }
.nav-link i { font-size: 1.2rem; min-width: 28px; width: auto; }
.nav-link::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary)); border-radius: 0 4px 4px 0; transition: width 0.3s ease;
}
.nav-link:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); color: var(--text); transform: translateX(8px); }
.nav-link:hover::before { width: 4px; }
.nav-link.active { box-shadow: 0 4px 15px color-mix(in srgb, var(--primary) 32%, transparent); }
.nav-link.active::before { width: 4px; background: rgba(255, 255, 255, 0.3); }

.page-head h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); letter-spacing: -0.01em; position: relative; display: inline-block; padding-bottom: 0.5rem; }
.page-head h1::after, .seccion-titulo h2::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 56px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.page-head p { margin-top: 0.6rem; }
.seccion-titulo h2 { position: relative; padding-bottom: 0.55rem; font-size: 1.3rem; }
.seccion-titulo { align-items: flex-end; }

.card, .gcard, .plan, .faq details, .fila, .tabla-caja {
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 70%, var(--bg)));
}
.gcard:hover, .plan:hover, .kpi:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--primary) 35%, transparent); box-shadow: var(--shadow-lg); }
.gcard.es-verificado { background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--primary), var(--secondary), var(--accent)) border-box; }

.kpi {
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 7%, var(--surface)), color-mix(in srgb, var(--accent) 6%, var(--surface)));
  border: 1px solid var(--border);
}
.kpi b { font-size: 1.55rem; color: var(--primary); letter-spacing: -0.01em; }
.kpi span { font-size: 0.76rem; }

.btn { border-radius: 13px; font-weight: 700; height: 38px; padding: 0 1.05rem; }
.btn-chico { border-radius: 10px; height: 31px; padding: 0 0.75rem; font-weight: 700; }
.btn-primario {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: 1px solid color-mix(in srgb, var(--primary) 55%, transparent);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 26%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primario:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 14px 30px color-mix(in srgb, var(--primary) 34%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-borde { background: transparent; border: 1px solid var(--border-2); box-shadow: none; }
.btn-borde:hover:not(:disabled) { background: linear-gradient(180deg, var(--highlight), transparent); box-shadow: none; }
.btn-suave {
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 12%, transparent), color-mix(in srgb, var(--accent) 10%, transparent));
  border: 1px solid color-mix(in srgb, var(--primary) 32%, transparent);
}

.buscador { border-radius: 16px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06); }
.buscador .selpais-btn { border-radius: 12px; }
.input, .select, .textarea { border-radius: 12px; }
.chip { border-radius: 999px; }
.hero-datos li { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 10%, transparent), color-mix(in srgb, var(--accent) 8%, transparent)); border-color: color-mix(in srgb, var(--primary) 20%, transparent); }
.hero h1 { background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent)); background-size: 250% 250%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: panGradiente 10s linear infinite; }
@keyframes panGradiente { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.pestanas { border-radius: 14px; }
.pestana { border-radius: 10px; }
.pestana.activa { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 14%, transparent), color-mix(in srgb, var(--accent) 8%, transparent)); }

/* ── Botones (estilo comunidad de la web de sub-bots) ── */

.btn {
  --tono: var(--primary);
  height: auto; padding: 0.62rem 1.1rem; border-radius: 12px;
  border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text);
  font-size: 0.88rem; font-weight: 700; line-height: 1.2; text-shadow: none;
  overflow: visible; isolation: auto;
  box-shadow: none;
  transition: var(--transition);
}
.btn::after, .btn::before { display: none; }
.btn i { font-size: 0.95em; opacity: 1; }
.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--tono) 8%, var(--surface));
  border-color: var(--tono);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--tono) 20%, transparent);
}
.btn:active:not(:disabled) { transform: translateY(0); box-shadow: 0 4px 10px color-mix(in srgb, var(--tono) 18%, transparent); }
.btn:focus-visible { outline: none; border-color: var(--tono); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tono) 18%, transparent); }

.btn-primario, .btn-suave { --tono: var(--primary); color: var(--primary); border-color: var(--primary); background: var(--surface); }
.btn-suave { border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.btn-borde { --tono: var(--primary); background: var(--surface); }
.btn-borde:hover:not(:disabled) { color: var(--primary); }
.btn-peligro { --tono: #f43f5e; color: #f43f5e; border-color: rgba(244, 63, 94, 0.28); background: var(--surface); }
.btn-ok { --tono: var(--success); color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); background: var(--surface); }
.btn-primario:hover:not(:disabled), .btn-suave:hover:not(:disabled), .btn-peligro:hover:not(:disabled), .btn-ok:hover:not(:disabled) { color: var(--tono); }
body.dark-mode .btn-primario, body.dark-mode .btn-peligro, body.dark-mode .btn-ok { color: var(--tono); background: var(--surface); text-shadow: none; }
body.dark-mode .btn-primario:hover:not(:disabled), body.dark-mode .btn-peligro:hover:not(:disabled), body.dark-mode .btn-ok:hover:not(:disabled) { background: color-mix(in srgb, var(--tono) 10%, var(--surface)); }

.btn-chico { padding: 0.42rem 0.8rem; font-size: 0.78rem; border-radius: 10px; height: auto; }

.btn-punteado { --tono: var(--primary); border: 1.5px dashed var(--border-2); background: transparent; color: var(--text-muted); }
.btn-punteado:hover:not(:disabled) { color: var(--primary); border-style: dashed; background: var(--highlight); box-shadow: none; }

.wa-bola {
  width: auto; height: auto; border-radius: 0; overflow: visible;
  background: none; box-shadow: none;
  color: var(--wa); font-size: 1.7rem;
  filter: drop-shadow(0 3px 8px rgba(37, 211, 102, 0.45));
}
.wa-bola::after { display: none; }
.unirse:hover .wa-bola { box-shadow: none; transform: scale(1.15) rotate(-8deg); filter: drop-shadow(0 4px 12px rgba(37, 211, 102, 0.6)); }

.avatar-editable { position: relative; display: block; cursor: pointer; flex-shrink: 0; border-radius: 18px; }
.avatar-editable img, .avatar-editable .avatar-ini { display: flex; transition: filter 0.25s ease; }
.avatar-camara {
  position: absolute; right: -6px; bottom: -6px; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-size: 0.75rem;
  border: 3px solid var(--surface); box-shadow: 0 4px 10px color-mix(in srgb, var(--primary) 35%, transparent);
  transition: transform 0.25s ease;
}
.avatar-editable:hover .avatar-camara { transform: scale(1.12); }
.avatar-editable:hover img, .avatar-editable:hover .avatar-ini { filter: brightness(0.9); }
.avatar-editable.subiendo img, .avatar-editable.subiendo .avatar-ini { filter: brightness(0.6) blur(1px); }
.avatar-editable.subiendo .avatar-camara i { animation: girar 0.8s linear infinite; }
.avatar-editable.subiendo .avatar-camara i::before { content: '\f110'; }
.avatar-ayuda { display: block; color: var(--text-muted); font-size: 0.74rem; margin-top: 0.2rem; }

.fila-avatar img, .fila-avatar .avatar-ini { width: 46px; height: 46px; border-radius: 14px; object-fit: cover; font-size: 1.05rem; flex-shrink: 0; display: flex; }
.fila-avatar { flex-shrink: 0; }

@media (max-width: 767px) {
  .hero-img { display: none; }
}

.nav-cat { display: none !important; }
@media (max-width: 767px) {
  .sidebar .nav-cat { display: flex !important; }
  .sidebar .nav-solo-grande { display: none; }
  #categorias.chips { display: none; }
}

@media (max-width: 767px) {
  .container { padding: 1.4rem 1.25rem 3rem; }
  .hero { gap: 1rem; padding: 0.5rem 0 1.75rem; }
  .hero h1 { margin-bottom: 0.9rem; }
  .hero p { line-height: 1.7; }
  .hero-datos { margin-top: 1.3rem; gap: 0.6rem; }
  .buscador { margin-bottom: 1.75rem; padding: 0.6rem; gap: 0.6rem; }
  .seccion-titulo { margin: 2.5rem 0 1.25rem; }
  .grid-grupos { gap: 1.1rem; }
  .gcard { padding: 1.1rem; gap: 0.85rem; }
  .cta { margin-top: 2.75rem; padding: 1.4rem 1.2rem; }
  .cta-cab { margin-bottom: 1.4rem; }
  .planes, .faq { gap: 1rem; }
  .page-head { margin-bottom: 1.6rem; }
  .kpis { gap: 0.9rem; margin-bottom: 1.6rem; }
  .lista-filas { gap: 0.85rem; }
  .card { padding: 1.3rem 1.15rem; }
  .grid-2 { gap: 1.1rem; }
}

@media (min-width: 768px) {
  .container { padding: 2.25rem 2rem 4rem; }
  .hero { padding: 1rem 0 2.25rem; }
  .hero h1 { margin-bottom: 0.9rem; }
  .hero-datos { margin-top: 1.4rem; gap: 0.65rem; }
  .buscador { margin-bottom: 1.5rem; padding: 0.55rem; }
  .chips { margin-bottom: 0.5rem; padding-bottom: 0.8rem; gap: 0.6rem; }
  .seccion-titulo { margin: 2.75rem 0 1.4rem; }
  .grid-grupos { gap: 1.2rem; }
  .gcard { padding: 1.15rem; gap: 0.85rem; }
  .cta { margin-top: 3.25rem; padding: 2rem; }
  .cta-cab { margin-bottom: 1.6rem; }
  .planes, .faq { gap: 1.15rem; }
  .page-head { margin-bottom: 1.9rem; }
  .kpis { gap: 1.1rem; margin-bottom: 1.75rem; }
  .lista-filas { gap: 0.9rem; }
  .card { padding: 1.5rem; }
  .grid-2 { gap: 1.25rem; margin-bottom: 1.25rem; }
  .filtros { margin-bottom: 1.25rem; gap: 0.65rem; }
  .pestanas { margin-bottom: 1.25rem; }
}

/* ── Bordes punteados (estilo "Ver reportes" de la web de sub-bots) ── */

:root { --borde-punteado: 1.5px dashed color-mix(in srgb, var(--primary) 24%, var(--border-2)); }

.kpi {
  background: var(--surface);
  border: var(--borde-punteado);
  box-shadow: none;
}
.kpi b { color: var(--text); }
.kpi:hover { border-style: dashed; border-color: var(--primary); background: color-mix(in srgb, var(--primary) 4%, var(--surface)); box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 12%, transparent); }

.gcard:not(.es-verificado), .fila {
  background: var(--surface);
  border: var(--borde-punteado);
}
.gcard:not(.es-verificado):hover, .fila:hover { border-style: dashed; border-color: var(--primary); }

.cat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.cat-layout #formCategoriaCaja { position: sticky; top: 92px; }
.fila-cat .fila-titulo span.n { white-space: normal; }
@media (max-width: 991px) {
  .cat-layout { grid-template-columns: 1fr; }
  .cat-layout #formCategoriaCaja { position: static; order: -1; }
}
@media (max-width: 640px) {
  .fila-cat { gap: 0.75rem; }
  .fila-cat .fila-cuerpo { flex: 1 1 calc(100% - 60px); }
  .fila-cat .fila-acciones { justify-content: space-between; gap: 0.25rem; }
  .fila-cat .fila-sub { gap: 0.6rem; }
}

@media (min-width: 768px) {
  .sidebar .nav-movil { display: none !important; }
}

.sidebar::before { display: none; }
.sidebar-header { background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 7%, transparent), color-mix(in srgb, var(--secondary) 5%, transparent)); }

@media (min-width: 1280px) {
  html { font-size: 17px; }
  .container { max-width: 1400px; }
  .grid-grupos { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1.1rem; }
  .gcard { padding: 1.1rem; }
  .gcard-foto { width: 62px; height: 62px; border-radius: 17px; }
  .wa-bola { width: 42px; height: 42px; font-size: 1.35rem; }
  .cat-layout { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (min-width: 1600px) {
  html { font-size: 18px; }
  .container { max-width: 1560px; }
  .grid-grupos { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
}

@media (max-width: 991px) {
  .header, body.dark-mode .header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); box-shadow: 0 1px 0 var(--border); }
  .sidebar, body.dark-mode .sidebar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); box-shadow: none; }
  .sidebar.active { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18); }
  .overlay, .modal-fondo { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .wa-bola::after, .plan .cinta::after { display: none; animation: none; }
  .hero-img { animation: none; transform: rotate(3deg); box-shadow: 0 8px 24px rgba(108, 92, 231, 0.22); }
  .hero h1 { animation: none; background-size: 100% 100%; }
  .unirse-txt { text-shadow: none; }
  .seccion-titulo h2 i, .card h3 i { filter: none; }
  .gcard, .btn, .chip { transition: none; }
}
@media (hover: none) {
  .gcard:hover, .btn-primario:hover:not(:disabled) { transform: none; }
  .unirse:hover .wa-bola { transform: none; }
}

.gcard-nombre a { color: inherit; min-width: 0; }
.gcard-nombre a:hover { color: var(--primary); }
.detalle-grupo { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; align-items: start; margin-bottom: 1.75rem; }
.gcard-completa .gcard-desc { display: block; -webkit-line-clamp: unset; white-space: pre-line; }
.detalle-texto h2 { font-size: 1.05rem; font-weight: 800; margin-bottom: 0.6rem; }
.detalle-texto p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.65; }
.detalle-texto p + p { margin-top: 0.6rem; }
@media (max-width: 768px) { .detalle-grupo { grid-template-columns: 1fr; } }


#alertas:empty { display: none; }
#alertas { margin-bottom: 1.5rem; }
.alerta {
  --tono: #3b82f6;
  position: relative; overflow: hidden;
  padding: 1.5rem 1.6rem 1.25rem; border-radius: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tono) 9%, var(--surface)), color-mix(in srgb, var(--tono) 3%, var(--surface)));
  border: 1px solid var(--tono);
}
.alerta::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--tono), transparent); }
.alerta-logo {
  position: absolute; top: 0.9rem; right: 1.1rem; font-size: 2.6rem; line-height: 1;
  background: linear-gradient(135deg, #1ebe5d 0%, #eafff4 50%, #1ebe5d 100%); background-size: 220% 220%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #25d366;
  animation: alertaWaFlota 3s ease-in-out infinite, alertaWaBrillo 4s linear infinite;
}
@keyframes alertaWaFlota { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-6px) rotate(6deg); } }
@keyframes alertaWaBrillo { 0% { background-position: 100% 100%; } 100% { background-position: 0% 0%; } }
.alerta-titulo {
  font-size: 1.55rem; font-weight: 800; line-height: 1.2; margin-bottom: 0.7rem; padding-right: 4.5rem; word-break: break-word;
  background: linear-gradient(90deg, #3b82f6, #6c5ce7, #00cec9, #22c55e, #8b5cf6, #06b6d4, #10b981, #3b82f6); background-size: 800% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: rainbowShift 8s linear infinite;
}
.alerta-msg { color: var(--text); line-height: 1.7; font-size: 1rem; margin-bottom: 1rem; word-break: break-word; }
.alerta-msg a { color: var(--primary); text-decoration: underline; font-weight: 600; }
.rt-sombra { text-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 55%, transparent); font-weight: 600; }
.rt-codigo { font-family: ui-monospace, 'JetBrains Mono', monospace; font-size: 0.88em; padding: 0.1em 0.4em; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.alerta-imgs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 1rem; padding-bottom: 4px; }
.alerta-imgs img { height: 120px; flex-shrink: 0; object-fit: cover; cursor: zoom-in; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); transition: transform 0.2s; }
.alerta-imgs img:hover { transform: scale(1.04); }
.forma-rounded img { border-radius: 12px; }
.forma-circular img { border-radius: 50%; width: 120px; aspect-ratio: 1; }
.forma-rectangular img { border-radius: 4px; aspect-ratio: 16 / 9; }
.forma-opaque img { border-radius: 10px; opacity: 0.85; }
.alerta-pie { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.alerta-reloj { display: flex; flex-direction: column; gap: 0.2rem; color: var(--text-muted); }
.alerta-reloj span, .alerta-reloj b { display: flex; align-items: center; gap: 0.5rem; }
.alerta-reloj > span { font-size: 0.82rem; text-transform: capitalize; }
.alerta-reloj b { font-size: 1rem; font-family: 'Courier New', monospace; }
.alerta-reacciones { display: flex; align-items: center; gap: 0.5rem; }
.alerta-reaccion { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.8rem; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text-muted); font-family: inherit; font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: var(--transition); }
.alerta-reaccion:hover { border-color: var(--tono); }
.alerta-reaccion.corazon.activo { color: #ef4444; border-color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.alerta-reaccion.like.activo { color: #3b82f6; border-color: #3b82f6; background: rgba(59, 130, 246, 0.08); }
.alerta-reaccion.pulso i { animation: pulsoReaccion 0.4s ease; }
@keyframes pulsoReaccion { 50% { transform: scale(1.45); } }
.alerta-bateria { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 1.05rem; margin-left: 0.2rem; }
.alerta-bateria span { font-size: 0.74rem; font-weight: 700; }
.alerta-bateria .carga { color: #facc15; font-size: 0.7rem; }
.alerta-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; width: fit-content; margin: 1rem auto 0; padding: 0.35rem 0.9rem; border-radius: 999px; background: var(--highlight); border: 1px solid var(--border); }
.alerta-nav button { background: none; border: 0; color: var(--text-muted); cursor: pointer; font-size: 0.95rem; padding: 0.2rem 0.35rem; border-radius: 50%; }
.alerta-nav button:hover { color: var(--primary); }
.alerta-nav span { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }
.alerta-zoom { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.92); opacity: 0; visibility: hidden; transition: opacity 0.25s; }
.alerta-zoom.abierto { opacity: 1; visibility: visible; }
.alerta-zoom img { max-width: 92vw; max-height: 86vh; border-radius: 10px; }
.alerta-zoom-cerrar { position: absolute; top: 20px; right: 24px; width: 44px; height: 44px; line-height: 42px; text-align: center; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 30px; cursor: pointer; }
#vistaAlerta .alerta { margin: 0; }
@keyframes na-heartbeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.015); } }
.na-heartbeat { animation: na-heartbeat 2s infinite ease-in-out; }
@keyframes na-flash { 0%, 50%, 100% { opacity: 1; } 25%, 75% { opacity: 0.82; } }
.na-flash { animation: na-flash 1.6s infinite; }
@keyframes na-shake { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(0.6deg); } 75% { transform: rotate(-0.6deg); } }
.na-shake { animation: na-shake 0.6s infinite; }
@keyframes na-glow { 0%, 100% { box-shadow: 0 0 10px var(--tono); } 50% { box-shadow: 0 0 28px var(--tono); } }
.na-glow { animation: na-glow 2s infinite; }
@keyframes na-slide { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.na-slide { animation: na-slide 0.6s ease-out both; }
@media (max-width: 768px) {
  .alerta { padding: 1.2rem 1.1rem 1rem; }
  .alerta-titulo { font-size: 1.25rem; padding-right: 3.6rem; animation: none; background-size: 100% 100%; }
  .alerta-logo { font-size: 2.1rem; animation: alertaWaFlota 3s ease-in-out infinite; }
  .alerta-imgs img { height: 96px; }
  .forma-circular img { width: 96px; }
}

.alerta { isolation: isolate; box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--tono) 45%, transparent), 0 2px 6px rgba(0, 0, 0, 0.04); }
.alerta::after {
  content: ''; position: absolute; inset: -20% auto -20% 0; width: 45%; z-index: 2; pointer-events: none;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0) 70%, transparent 100%);
  transform: translateX(-160%) skewX(-18deg);
  animation: alertaReflejo 7s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
body.dark-mode .alerta::after { background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0) 70%, transparent 100%); }
@keyframes alertaReflejo { 0%, 70% { transform: translateX(-160%) skewX(-18deg); } 100% { transform: translateX(330%) skewX(-18deg); } }

.alerta-firma { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid color-mix(in srgb, var(--tono) 30%, var(--border)); color: var(--text-muted); font-size: 0.78rem; line-height: 1.55; text-align: center; word-break: break-word; }
.alerta-firma a { color: var(--primary); font-weight: 600; }


.insignia {
  --roseta: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0.3L13.68 2.46Q14.33 3.31 15.32 2.9L17.85 1.87L18.22 4.58Q18.36 5.64 19.42 5.78L22.13 6.15L21.1 8.68Q20.69 9.67 21.54 10.32L23.7 12L21.54 13.68Q20.69 14.33 21.1 15.32L22.13 17.85L19.42 18.22Q18.36 18.36 18.22 19.42L17.85 22.13L15.32 21.1Q14.33 20.69 13.68 21.54L12 23.7L10.32 21.54Q9.67 20.69 8.68 21.1L6.15 22.13L5.78 19.42Q5.64 18.36 4.58 18.22L1.87 17.85L2.9 15.32Q3.31 14.33 2.46 13.68L0.3 12L2.46 10.32Q3.31 9.67 2.9 8.68L1.87 6.15L4.58 5.78Q5.64 5.64 5.78 4.58L6.15 1.87L8.68 2.9Q9.67 3.31 10.32 2.46Z'/%3E%3C/svg%3E");
  --palomita: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.6 12.3l3 3 5.9-6.1' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  position: relative; display: inline-block; flex-shrink: 0;
  width: 1.3em; height: 1.3em; vertical-align: -0.25em;
  background:
    linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, 0.9) 50%, transparent 62%) 100% 0 / 250% 100% no-repeat,
    linear-gradient(150deg, #fbe7a1 0%, #eec350 30%, #d4a12a 62%, #a87412 100%);
  -webkit-mask: var(--roseta) center / contain no-repeat; mask: var(--roseta) center / contain no-repeat;
  animation: insigniaBrillo 5s ease-in-out infinite;
}
.insignia::after {
  content: ''; position: absolute; inset: 0; background: #fff;
  -webkit-mask: var(--palomita) center / contain no-repeat; mask: var(--palomita) center / contain no-repeat;
}
@keyframes insigniaBrillo { 0%, 70% { background-position: 100% 0, 0 0; } 100% { background-position: 0% 0, 0 0; } }
.gcard-nombre .insignia { font-size: 0.9rem; }
.fila-titulo .insignia { font-size: 0.82rem; }

.menu-toggle, .theme-toggle { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.menu-toggle { background: transparent; font-size: 1.3rem; }
.theme-toggle { background: var(--surface); font-size: 1.1rem; }
.menu-toggle:hover { background: var(--highlight); color: var(--primary); transform: scale(1.05); border-color: var(--primary); }
.theme-toggle:hover { background: var(--primary); color: #fff; transform: translateY(-2px) scale(1.05); box-shadow: 0 6px 16px rgba(108, 92, 231, 0.4); border-color: var(--primary); }
.theme-toggle:hover i { transform: none; }
.header-right { gap: 0.75rem; }
@media (max-width: 768px) {
  .header-right { gap: 0.5rem; }
  .user-chip { padding: 0.3rem 0.6rem 0.3rem 0.3rem; font-size: 0.85rem; }
  .user-chip span { display: inline-block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.hero-datos { gap: 0; margin-top: 1.4rem; }
.hero-datos li { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.1rem 1.5rem; background: none; border: 0; border-left: 1px solid var(--border-2); border-radius: 0; }
.hero-datos li:first-child { padding-left: 0; border-left: 0; }
.hero-datos b { color: var(--text); font-size: 1.65rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero-datos span { color: var(--text-muted); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
@media (max-width: 768px) {
  .hero-datos li { padding: 0.1rem 1rem; align-items: center; }
  .hero-datos li:first-child { padding-left: 1rem; }
  .hero-datos b { font-size: 1.35rem; }
  .hero-datos span { font-size: 0.66rem; letter-spacing: 0.06em; }
}

.faq { display: block; max-width: 880px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.faq details { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; border-top: 1px solid var(--border); }
.faq details:first-child { border-top: 0; }
.faq summary { padding: 1.05rem 1.35rem; font-size: 0.95rem; font-weight: 700; align-items: center; transition: color 0.2s ease, background 0.2s ease; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 4%, transparent); }
.faq summary::after, .faq details[open] summary::after {
  content: ''; flex-shrink: 0; width: 0.5rem; height: 0.5rem; margin-right: 0.2rem;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: translateY(-2px) rotate(45deg); transition: transform 0.25s ease, border-color 0.25s ease;
}
.faq details[open] summary { color: var(--primary); }
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); border-color: var(--primary); }
.faq p { margin: 0; padding: 0 1.35rem 1.15rem; max-width: 760px; font-size: 0.9rem; line-height: 1.7; }
@media (max-width: 768px) {
  .faq summary { padding: 0.95rem 1.05rem; font-size: 0.92rem; }
  .faq p { padding: 0 1.05rem 1rem; }
}

.user-chip .rol { font-style: normal; padding: 0.22rem 0.6rem; border-radius: 10px; font-size: 0.7rem; font-weight: 700; line-height: 1.2; border: 1px solid transparent; flex-shrink: 0; transition: var(--transition); }
.user-chip .rol.admin { background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4); }
.user-chip .rol.premium { background: linear-gradient(135deg, #8b5cf6, #a78bfa); color: #fff; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4); }
.user-chip .rol.free { background: var(--border); color: var(--text-muted); border-color: var(--border); }
.user-chip:hover .rol { transform: scale(1.05); }
@media (max-width: 768px) {
  .user-chip .rol { padding: 0.18rem 0.5rem; font-size: 0.64rem; }
  .user-chip span { max-width: 90px; }
}

.hero { padding-bottom: 2.25rem; }
#alertas { margin: 0.5rem 0 2.5rem; }
.detalle-grupo { margin-top: 0.5rem; }
@media (max-width: 768px) {
  .hero { padding-bottom: 1.75rem; }
  #alertas { margin: 0.25rem 0 2rem; }
}

.planes { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; align-items: stretch; }
.plan { padding: 1.6rem 1.5rem 1.4rem; gap: 0; border-radius: 20px; }
.plan h4 { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.plan h4::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); }
.plan:nth-child(2) h4::before { background: var(--accent); }
.plan.recomendado h4::before { background: var(--primary); }
.plan-desc { margin-top: 0.35rem; color: var(--text-muted); font-size: 0.86rem; }
.plan .precio { display: flex; align-items: baseline; gap: 0.4rem; margin-top: 1.1rem; font-size: inherit; }
.plan .precio b { font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.plan .precio small { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.plan-mes { display: block; margin-top: 0.4rem; font-size: 0.78rem; font-weight: 600; color: var(--success); }
.plan ul { margin: 1.2rem 0 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--border); gap: 0.7rem; flex: 1; }
.plan li { font-size: 0.86rem; color: var(--text); align-items: flex-start; gap: 0.6rem; line-height: 1.45; }
.plan li i { flex-shrink: 0; width: 18px; height: 18px; margin-top: 0.05rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.6rem; color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.plan-btn { width: 100%; justify-content: center; }
.plan.recomendado {
  border: 1.5px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--primary), var(--secondary), var(--accent)) border-box;
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--primary) 55%, transparent);
}
.plan.recomendado li i { color: var(--primary); background: var(--highlight); }
.plan .cinta { top: -12px; left: 50%; right: auto; transform: translateX(-50%); padding: 0.3rem 0.85rem; font-size: 0.7rem; letter-spacing: 0.04em; white-space: nowrap; }
.plan .cinta::after { display: none; animation: none; }
@media (min-width: 992px) {
  .plan.recomendado { transform: translateY(-8px); }
  .plan.recomendado:hover { transform: translateY(-12px); }
}
@media (max-width: 768px) {
  .plan { padding: 1.4rem 1.25rem 1.2rem; }
  .plan .precio b { font-size: 2.25rem; }
}

.cta, body.dark-mode .cta { background: none; border: 0; padding: 0; border-radius: 0; box-shadow: none; }
.cta-cab { margin-bottom: 1.75rem; }
