/* ✨ Aspecto Glass del panel de NightClub — ver public/js/glass.js. Todo cuelga de <html data-ui="glass">, que
   solo se pone en el panel de NightClub: los paneles de las clientas no se tocan. */
html[data-ui="glass"] body { background: #06070c; }
html[data-ui="glass"] body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 8% 0%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 62%),
    radial-gradient(800px 560px at 96% 10%, color-mix(in srgb, var(--violet) 24%, transparent), transparent 60%),
    radial-gradient(900px 640px at 70% 100%, rgba(255,140,60,.14), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, color-mix(in srgb, var(--cyan) 12%, transparent), transparent 60%); }
html[data-ui="glass"] .sidebar { background: rgba(14,17,26,.55); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); border-right-color: rgba(255,255,255,.09); }
html[data-ui="glass"] #nav a:hover { background: rgba(255,255,255,.07); }
html[data-ui="glass"] #nav a.active { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 34%, transparent), color-mix(in srgb, var(--violet) 20%, transparent)); box-shadow: 0 0 0 1px rgba(255,255,255,.1) inset, 0 8px 22px -12px var(--accent); }
html[data-ui="glass"] .card, html[data-ui="glass"] .login-card {
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.028));
  border-color: rgba(255,255,255,.11); border-radius: 18px;
  box-shadow: 0 1px 0 rgba(255,255,255,.07) inset, 0 24px 44px -28px rgba(0,0,0,.8);
  backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%); }
/* Lo anidado no repite el desenfoque: más ligero y sin coste de rendimiento */
html[data-ui="glass"] .card .card, html[data-ui="glass"] .card .stat {
  backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.09); box-shadow: none; border-radius: 14px; }
html[data-ui="glass"] .card.stat { transition: transform .16s ease, border-color .16s ease; }
html[data-ui="glass"] .card.stat:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.22); }
html[data-ui="glass"] input, html[data-ui="glass"] select, html[data-ui="glass"] textarea { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.12); }
html[data-ui="glass"] .modal { background: rgba(18,21,30,.86); border: 1px solid rgba(255,255,255,.13); backdrop-filter: blur(28px) saturate(150%); -webkit-backdrop-filter: blur(28px) saturate(150%); border-radius: 20px; }
html[data-ui="glass"] .modal-overlay { backdrop-filter: blur(4px); background: rgba(3,4,8,.55); }
html[data-ui="glass"] .topbar { border-bottom-color: rgba(255,255,255,.08); }
/* Entrada escalonada de las tarjetas de la página */
@keyframes ncg-sube { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
html[data-ui="glass"] #page > .card, html[data-ui="glass"] #page > .grid > .card { animation: ncg-sube .5s cubic-bezier(.2,.7,.2,1) both; }
html[data-ui="glass"] #page > .grid > .card:nth-child(2) { animation-delay: .06s; }
html[data-ui="glass"] #page > .grid > .card:nth-child(3) { animation-delay: .12s; }
html[data-ui="glass"] #page > .grid > .card:nth-child(4) { animation-delay: .18s; }
@media (prefers-reduced-motion: reduce) { html[data-ui="glass"] #page > .card, html[data-ui="glass"] #page > .grid > .card { animation: none; } }
@supports not (backdrop-filter: blur(1px)) { html[data-ui="glass"] .card { background: var(--card); } }

/* ---------- Barra lateral flotante de iconos (escritorio) ---------- */
.rail-logo, #rail-toggle, #ncg-tip { display: none; }
@media (min-width: 881px) {
  html[data-ui="glass"] .sidebar { margin: 14px 0 14px 14px; height: calc(100vh - 28px); border: 1px solid rgba(255,255,255,.12); border-radius: 30px;
    box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 30px 60px -30px rgba(0,0,0,.85); transition: width .22s ease; }
  html[data-ui="glass"] .sidebar.rail { width: 74px; padding: 16px 10px 14px; align-items: center; gap: 12px; overflow-x: hidden; scrollbar-width: none; }
  html[data-ui="glass"] .sidebar.rail::-webkit-scrollbar { display: none; }
  html[data-ui="glass"] .sidebar.rail .brand-box, html[data-ui="glass"] .sidebar.rail .nav-label, html[data-ui="glass"] .sidebar.rail #whoami { display: none; }
  html[data-ui="glass"] .sidebar.rail .rail-logo { display: grid; place-items: center; order: 1; width: 42px; height: 42px; border-radius: 15px; flex-shrink: 0; font-family: var(--font-head, inherit); font-weight: 800; font-size: 14px;
    color: #fff; background: linear-gradient(135deg, var(--accent), var(--violet)); box-shadow: 0 10px 24px -10px var(--accent); }
  html[data-ui="glass"] .sidebar.rail #rail-toggle { display: grid; place-items: center; order: 2; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255,255,255,.06); color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; transform: rotate(180deg); flex-shrink: 0; }
  html[data-ui="glass"] .sidebar.rail #rail-toggle:hover { color: var(--text); background: rgba(255,255,255,.12); }
  html[data-ui="glass"] .sidebar:not(.rail) #rail-toggle { display: grid; place-items: center; align-self: flex-end; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.06); color: var(--muted); cursor: pointer; }
  /* Con ~20 secciones el menú no cabe entero: el logo, el botón de expandir y el de salir se quedan fijos y SOLO los iconos hacen scroll */
  html[data-ui="glass"] .sidebar { overflow-y: hidden; scrollbar-width: none; }
  html[data-ui="glass"] .sidebar:not(.rail) #nav { flex: 1 1 0; min-height: 0; overflow-y: auto; scrollbar-width: none; }
  html[data-ui="glass"] .sidebar:not(.rail) #nav::-webkit-scrollbar { display: none; }
  html[data-ui="glass"] .sidebar.rail #nav { order: 3; width: 100%; align-items: center; gap: 4px; flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; padding: 2px 0; }
  html[data-ui="glass"] .sidebar.rail #nav::-webkit-scrollbar { display: none; }
  html[data-ui="glass"] .sidebar.rail .sidebar-footer { order: 4; }
  html[data-ui="glass"] .sidebar.rail #nav a { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 15px; flex: 0 0 auto; transition: background .16s ease, transform .16s ease, box-shadow .16s ease; }
  html[data-ui="glass"] .sidebar.rail #nav a:hover { transform: translateX(2px); }
  html[data-ui="glass"] .sidebar.rail #nav a.active::before { display: none; }
  html[data-ui="glass"] .sidebar.rail #nav a.active { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--violet))); color: #fff; box-shadow: 0 10px 24px -8px var(--accent), 0 0 0 1px rgba(255,255,255,.18) inset; }
  html[data-ui="glass"] .sidebar.rail .nav-icon { font-size: 19px; width: auto; }
  html[data-ui="glass"] .sidebar.rail #logout-btn { font-size: 0; width: 42px; height: 42px; padding: 0; border-radius: 15px; background: rgba(255,255,255,.06); border: 0; }
  html[data-ui="glass"] .sidebar.rail #logout-btn::before { content: '⏻'; font-size: 17px; color: var(--muted); }
  html[data-ui="glass"] .sidebar.rail #logout-btn:hover::before { color: var(--red, #fb6767); }
  html[data-ui="glass"] #nav .nav-icon { display: inline-block; width: 18px; text-align: center; }
  #ncg-tip { display: block; position: fixed; z-index: 120; transform: translateY(-50%); padding: 7px 13px; border-radius: 12px; background: rgba(8,10,16,.94); border: 1px solid rgba(255,255,255,.14);
    color: var(--text); font-size: 12.5px; font-weight: 600; white-space: nowrap; pointer-events: none; box-shadow: 0 12px 28px -10px rgba(0,0,0,.8); animation: ncg-tip .14s ease both; }
  #ncg-tip[hidden] { display: none; }
  #ncg-tip::before { content: ''; position: absolute; left: -5px; top: 50%; width: 9px; height: 9px; background: inherit; border-left: 1px solid rgba(255,255,255,.14); border-bottom: 1px solid rgba(255,255,255,.14); transform: translateY(-50%) rotate(45deg); }
}
@keyframes ncg-tip { from { opacity: 0; transform: translate(-6px, -50%); } to { opacity: 1; transform: translate(0, -50%); } }

/* ---------- Inicio de NightClub: hero con KPI, minigráficos y gráfico ---------- */
.ncg-hero { margin: 0 0 16px; }
.ncg-saludo h3 { font-size: 24px; letter-spacing: -.02em; margin: 0 0 2px; }
.ncg-saludo p { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.ncg-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.ncg-kpi { padding: 14px 14px 12px; transition: transform .18s ease, border-color .18s ease; }
.ncg-kpi:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.24); }
.ncg-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.ncg-kpi .value { font-size: 25px; margin-top: 8px; }
.ncg-kpi .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ncg-kpi.k-accent .value { color: var(--accent); } .ncg-kpi.k-green .value { color: var(--green); } .ncg-kpi.k-cyan .value { color: var(--cyan); } .ncg-kpi.k-violet .value { color: var(--violet); }
.ncg-spark { width: 78px; height: 28px; flex-shrink: 0; }
.ncg-spark path:last-child { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ncg-trazo 1.1s .15s ease forwards; }
.ncg-ring { width: 32px; height: 32px; flex-shrink: 0; }
.ncg-delta { font-weight: 700; padding: 1px 6px; border-radius: 999px; font-size: 11px; }
.ncg-delta.up { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.ncg-delta.down { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.ncg-chart { margin-bottom: 4px; }
.ncg-chart-body { position: relative; margin-top: 8px; }
.ncg-chart-svg { width: 100%; height: auto; display: block; }
.ncg-grid { stroke: rgba(255,255,255,.08); stroke-dasharray: 3 4; }
.ncg-eje { fill: var(--faint); font-size: 10.5px; }
.ncg-l-total { stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: ncg-trazo 1.2s ease forwards; }
.ncg-l-subs { stroke: var(--cyan); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; stroke-dasharray: 1; stroke-dashoffset: 1; animation: ncg-trazo 1.2s .1s ease forwards; }
.ncg-guia { stroke: rgba(255,255,255,.28); stroke-width: 1; opacity: 0; transition: opacity .12s; }
.ncg-punto { fill: var(--bg); stroke: var(--accent); stroke-width: 2.5; opacity: 0; transition: opacity .12s; pointer-events: none; }
.ncg-burbuja { position: absolute; transform: translateX(-50%); background: rgba(10,12,18,.94); border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 8px 10px; font-size: 12px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; white-space: nowrap; box-shadow: 0 10px 24px -10px rgba(0,0,0,.7); }
.ncg-burbuja[hidden] { display: none; }
.ncg-burbuja b { text-transform: capitalize; margin-bottom: 2px; }
.ncg-burbuja .t { color: var(--accent); } .ncg-burbuja .s { color: var(--cyan); } .ncg-burbuja .p { color: var(--violet); }
.ncg-leyenda { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.ncg-leyenda span::before { content: ''; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.ncg-leyenda .t::before { background: var(--accent); } .ncg-leyenda .s::before { background: var(--cyan); }
@keyframes ncg-trazo { to { stroke-dashoffset: 0; } }
@media (max-width: 980px) { .ncg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ncg-saludo h3 { font-size: 21px; } .ncg-kpi .value { font-size: 21px; } }
@media (prefers-reduced-motion: reduce) { .ncg-spark path:last-child, .ncg-l-total, .ncg-l-subs { animation: none; stroke-dashoffset: 0; } }

/* «Gestiona tu suscripción» (paneles de clienta): mismo formato icono + etiqueta que el resto del menú */
html[data-ui="glass"] #nav .nav-upgrade .nav-icon { display: inline-block; width: 18px; text-align: center; }
@media (min-width: 881px) {
  html[data-ui="glass"] .sidebar.rail #nav a.nav-upgrade { width: 44px; height: 44px; padding: 0; justify-content: center; }
}
