/* ════════════════════════════════════════════════════════════════════
   NV seguridad 6.0 (nv-seguridad-600.css)
   Aviso de cambios sin subir, "Cerrar sesión en todos los dispositivos",
   ventana de permisos de moderador, sección Tasa y bloqueo en iframes.
   Necesita nv-util-600.css (botones e interruptor).
   ════════════════════════════════════════════════════════════════════ */

/* ── Cambios sin subir ─────────────────────────────────────────────── */
.nvs6-cola {
  position: fixed; z-index: 900; /* v6.0 integración: debajo de las ventanas (1000) para no tapar sus botones */ left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: min(460px, calc(100vw - 32px));
  padding: 10px 10px 10px 12px; border-radius: 14px; border: 1px solid var(--border2, var(--border));
  background: var(--bg2); color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.35);
  font-size: 13px;
}
.nvs6-cola[hidden] { display: none; }
.nvs6-cola.is-in { animation: nvs6Entra .32s cubic-bezier(.32,1.28,.5,1); }
@keyframes nvs6Entra { from { opacity: 0; transform: translate(-50%, 12px) scale(.96); } }
@keyframes nvs6EntraM { from { opacity: 0; transform: translateY(12px); } }
.nvs6-cola-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(var(--nv-accent-rgb, 99,102,241), .16); color: var(--accent2, var(--accent)); flex-shrink: 0; }
.nvs6-cola-ic.is-off { background: rgba(251,191,36,.14); color: var(--amber2, #fbbf24); }
.nvs6-cola-ic.is-bad { background: rgba(248,113,113,.14); color: var(--red2, #f87171); }
.nvs6-cola-tx { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 2px; }
.nvs6-cola-tx b { font-size: 13px; font-weight: 700; }
.nvs6-cola-tx small { font-size: 11.5px; color: var(--text3); }
.nvs6-cola-btn {
  display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 11px; border-radius: 9px;
  border: 1px solid var(--border2, var(--border)); background: var(--bg3); color: var(--text); font: 600 12px/1 inherit; cursor: pointer;
}
.nvs6-cola-btn:hover { border-color: var(--accent); }
.nvs6-cola-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nvs6-cola-btn.is-ghost { background: transparent; }
.nvs6-cola-sep { flex-basis: 100%; height: 0; }
.nvs6-cola.is-busy .nvs6-cola-btn[data-c="reintentar"] svg { animation: nvs6Gira .8s linear infinite; }
@media (max-width: 600px) {
  .nvs6-cola { left: 10px; right: 10px; max-width: none; transform: none; }
  .nvs6-cola.is-in { animation-name: nvs6EntraM; }
  html.nvp-has-bnav .nvs6-cola { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ── v6.1 · Cerrar sesión en todos (página Dispositivos) ────────────── */
/* Ya no va en el menú del usuario; por si quedó de una versión en caché */
#user-panel-menu #nvs6-cerrar-todo { display: none !important; }
.nvdsp-todo {
  --nvdsp-red: var(--red2, #f87171);
  margin: 18px 0 8px; padding: 16px 18px; border-radius: 16px; box-sizing: border-box; max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--nvdsp-red) 28%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--nvdsp-red) 7%, var(--bg2)), var(--bg2));
  color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1);
  transition: border-color .2s ease, box-shadow .25s ease;
  animation: nvdspEntra .35s cubic-bezier(.32,1.2,.5,1) both;
}
.nvdsp-todo { scroll-margin-bottom: 24px; }
/* Con la barra de abajo del teléfono y la tablet, la tarjeta no queda tapada */
html.nvp-has-bnav .nvdsp-todo { scroll-margin-bottom: calc(96px + env(safe-area-inset-bottom)); margin-bottom: calc(96px + env(safe-area-inset-bottom)); }
.nvdsp-todo.is-open { border-color: color-mix(in srgb, var(--nvdsp-red) 50%, var(--border)); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
@keyframes nvdspEntra { from { opacity: 0; transform: translateY(8px); } }
.nvdsp-todo-h { display: flex; align-items: center; gap: 14px; min-width: 0; }
.nvdsp-todo-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0; background: color-mix(in srgb, var(--nvdsp-red) 14%, transparent); color: var(--nvdsp-red); transition: transform .35s cubic-bezier(.32,1.3,.5,1); }
.nvdsp-todo.is-open .nvdsp-todo-ic { transform: rotate(-90deg) scale(1.04); }
.nvdsp-todo-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nvdsp-todo-tx b { font-size: 14.5px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.nvdsp-todo-tx small { font-size: 12.5px; line-height: 1.5; color: var(--text3); }
.nvdsp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 11px;
  border: 1px solid var(--border2, var(--border)); background: var(--bg3); color: var(--text); font: 600 13px/1.2 inherit; cursor: pointer;
  flex-shrink: 0; white-space: nowrap; transition: background .15s ease, border-color .15s ease, transform .12s ease, opacity .2s ease;
}
.nvdsp-btn:active:not(:disabled) { transform: scale(.97); }
.nvdsp-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nvdsp-btn:disabled { opacity: .55; cursor: default; }
.nvdsp-btn.is-ghost { background: transparent; }
.nvdsp-btn.is-ghost:hover:not(:disabled) { background: var(--bg3); }
.nvdsp-btn.is-danger { color: var(--nvdsp-red); border-color: color-mix(in srgb, var(--nvdsp-red) 35%, transparent); background: color-mix(in srgb, var(--nvdsp-red) 9%, transparent); }
.nvdsp-btn.is-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--nvdsp-red) 16%, transparent); }
.nvdsp-btn.is-danger.is-solid { background: var(--nvdsp-red); border-color: var(--nvdsp-red); color: #fff; }
.nvdsp-btn.is-danger.is-solid:hover:not(:disabled) { filter: brightness(1.08); }
/* Confirmación: se despliega con animación (alto de 0 a su tamaño) */
.nvdsp-conf { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s cubic-bezier(.3,.9,.3,1); }
.nvdsp-conf-in { min-height: 0; overflow: hidden; opacity: 0; transform: translateY(-6px); transition: opacity .22s ease, transform .3s ease; }
.nvdsp-todo.is-open .nvdsp-conf { grid-template-rows: 1fr; }
.nvdsp-todo.is-open .nvdsp-conf-in { opacity: 1; transform: none; transition-delay: .06s; }
.nvdsp-conf-t { margin: 14px 0 6px; font-size: 13px; font-weight: 700; }
.nvdsp-pts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.nvdsp-pts li { position: relative; padding-left: 16px; font-size: 12.5px; line-height: 1.5; color: var(--text2, var(--text)); }
.nvdsp-pts li::before { content: ''; position: absolute; left: 3px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--nvdsp-red); opacity: .8; }
.nvdsp-pts li.is-warn { display: flex; gap: 7px; padding: 8px 10px; border-radius: 10px; background: rgba(251,191,36,.1); color: var(--amber2, #fbbf24); }
.nvdsp-pts li.is-warn::before { display: none; }
.nvdsp-pts li.is-warn svg { flex-shrink: 0; margin-top: 2px; }
.nvdsp-btns { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
/* Progreso y check final */
.nvdsp-prog { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 11px; background: var(--bg3); font-size: 13px; font-weight: 600; animation: nvdspEntra .25s ease both; }
.nvdsp-prog[hidden] { display: none; }
.nvdsp-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border2, var(--border)); border-top-color: var(--nvdsp-red); animation: nvdspGira .7s linear infinite; flex-shrink: 0; }
.nvdsp-okic { display: none; color: var(--green2, #34d399); flex-shrink: 0; }
.nvdsp-chk { stroke-dasharray: 24; stroke-dashoffset: 24; }
.nvdsp-todo.is-done .nvdsp-spin { display: none; }
.nvdsp-todo.is-done .nvdsp-okic { display: inline-flex; animation: nvdspPop .4s cubic-bezier(.32,1.4,.5,1) both; }
.nvdsp-todo.is-done .nvdsp-chk { animation: nvdspTraza .45s .1s ease forwards; }
.nvdsp-todo.is-err .nvdsp-spin { display: none; }
.nvdsp-todo.is-err .nvdsp-prog { background: color-mix(in srgb, var(--nvdsp-red) 10%, transparent); color: var(--nvdsp-red); }
.nvdsp-todo.is-busy .nvdsp-conf { grid-template-rows: 0fr; }
.nvdsp-todo.is-busy .nvdsp-conf-in { opacity: 0; }
@keyframes nvdspGira { to { transform: rotate(360deg); } }
@keyframes nvdspPop { from { opacity: 0; transform: scale(.4); } }
@keyframes nvdspTraza { to { stroke-dashoffset: 0; } }
@media (max-width: 600px) {
  .nvdsp-todo { padding: 14px; margin-top: 14px; }
  .nvdsp-todo-h { flex-wrap: wrap; align-items: flex-start; }
  .nvdsp-todo-tx { flex-basis: calc(100% - 56px); }
  .nvdsp-todo-h > .nvdsp-btn { width: 100%; min-height: 44px; }
  .nvdsp-btns .nvdsp-btn { flex: 1 1 140px; min-height: 44px; }
}

/* ── Permisos de moderador ─────────────────────────────────────────── */
.nvu-act.nvs6-perm-btn svg { width: 16px; height: 16px; }
.nvs6-ov {
  position: fixed; inset: 0; z-index: 9850; display: grid; place-items: center; padding: 16px;
  background: rgba(0,0,0,.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s ease;
}
.nvs6-ov.is-open { opacity: 1; }
.nvs6-sheet {
  width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; overscroll-behavior: contain;
  padding: 18px 18px 16px; border-radius: 18px; border: 1px solid var(--border2, var(--border));
  background: var(--bg2); color: var(--text); box-shadow: 0 24px 60px rgba(0,0,0,.5);
  transform: translateY(12px) scale(.98); transition: transform .26s cubic-bezier(.32,1.28,.5,1);
}
.nvs6-ov.is-open .nvs6-sheet { transform: none; }
.nvs6-sheet-h { display: flex; align-items: flex-start; gap: 12px; }
.nvs6-sheet-h > div { flex: 1; min-width: 0; }
.nvs6-sheet-h h3 { margin: 2px 0 0; font-size: 17px; line-height: 1.3; font-weight: 700; overflow-wrap: anywhere; }
.nvs6-sheet-h p { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--text3); }
.nvs6-sheet-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0; background: rgba(var(--nv-accent-rgb, 99,102,241), .16); color: var(--accent2, var(--accent)); }
.nvs6-x { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent; color: var(--text3); cursor: pointer; flex-shrink: 0; }
.nvs6-x:hover { background: var(--bg3); color: var(--text); }
.nvs6-list { margin-top: 12px; padding: 2px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); }
.nvs6-note { display: flex; gap: 8px; margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--text3); }
.nvs6-note svg { flex-shrink: 0; margin-top: 2px; }
.nvs6-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
@media (max-width: 600px) {
  .nvs6-ov { place-items: end center; padding: 0; }
  .nvs6-sheet { width: 100%; border-radius: 18px 18px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); max-height: 92vh; }
  .nvs6-btns .nvs6-btn { flex: 1; }
}

/* ── Tasa en Configuración ─────────────────────────────────────────── */
.nvs6-tasa-hora { font-size: 11.5px; color: var(--text3); }
.nvs6-tasas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.nvs6-tasas > div { padding: 10px 12px; border-radius: 11px; background: var(--bg3); min-width: 0; }
.nvs6-tasas small { display: block; font-size: 11.5px; color: var(--text3); }
.nvs6-tasas b { display: block; margin-top: 3px; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.nvs6-tasa-val { font-variant-numeric: tabular-nums; color: var(--accent2, var(--accent)); }
.nvs6-tasa-f { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.nvs6-tasa-f label { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text3); }
.nvs6-tasa-f input {
  height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border2, var(--border));
  background: var(--bg); color: var(--text); font: 600 15px/1 inherit; font-variant-numeric: tabular-nums; width: 100%; box-sizing: border-box;
}
.nvs6-tasa-f input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--nv-accent-rgb, 99,102,241), .2); }
@media (max-width: 600px) {
  .nvs6-tasas { grid-template-columns: 1fr; }
  .nvs6-tasa-f .nvs6-btn { flex: 1; }
}

/* ── Dentro de un iframe de otro sitio (SEG-12) ────────────────────── */
html.nvs6-enmarcado body > *:not(#nvs6-marco) { display: none !important; }
#nvs6-marco { position: fixed; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; padding: 24px; background: var(--bg, #0b0b14); color: var(--text, #fff); font: 15px/1.5 system-ui, sans-serif; }
#nvs6-marco a { color: var(--accent, #818cf8); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .nvs6-cola.is-in, .nvs6-sheet, .nvs6-ov { animation: none; transition: none; }
  .nvdsp-todo, .nvdsp-todo *, .nvdsp-conf, .nvdsp-conf-in { animation: none !important; transition: none !important; }
  .nvdsp-chk { stroke-dashoffset: 0; }
  .nvdsp-spin { border-top-color: var(--nvdsp-red); }
}
