/* Portal Vifer v3 · capas flotantes: desplegable (avisos, cuenta), hoja inferior (movil), panel lateral (detalle)
   y buscador universal. Entran con transform/opacity; sin movimiento si se pide reducirlo. */
.overlay { position: fixed; inset: 0; z-index: 100; }
.overlay--sheet, .overlay--drawer { background: rgba(3, 4, 6, 0.6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity 200ms; }
.overlay.is-in { opacity: 1; }
.overlay.is-out { opacity: 0; }

/* Desplegable */
.pop { position: fixed; width: min(380px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 90px)); overflow-y: auto; border: 1px solid var(--border-mid); border-radius: var(--r-xl); background: var(--surface-2); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(16, 24, 40, 0.12); opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: top right; transition: opacity 180ms, transform 220ms var(--ease-out); outline: none; }
.overlay.is-in .pop { opacity: 1; transform: none; }
.pop--menu { width: 260px; }

/* Hoja inferior */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 12px; max-height: 86vh; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; border-top: 1px solid var(--border-mid); border-radius: 20px 20px 0 0; background: var(--surface-2); box-shadow: var(--shadow-lg); transform: translateY(100%); transition: transform 280ms var(--ease-out); outline: none; }
.overlay.is-in .sheet { transform: none; }
.sheet__grip { justify-self: center; width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); }
.sheet__x { position: absolute; top: 8px; right: 8px; }

/* Panel lateral */
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); overflow-y: auto; border-left: 1px solid var(--border-mid); background: linear-gradient(180deg, var(--surface-2), var(--surface-1)); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform 300ms var(--ease-out); outline: none; }
.drawer--wide { width: min(640px, 100vw); }
.overlay.is-in .drawer { transform: none; }
.drawer__x { position: sticky; top: 10px; float: right; margin: 10px 10px 0 0; z-index: 2; background: var(--surface-2); }
.drawer__body { padding: 24px 24px 40px; }

/* Buscador universal: centrado arriba en escritorio */
.drawer.is-pal { top: 12vh; right: auto; bottom: auto; left: 50%; width: min(640px, calc(100vw - 32px)); max-height: 70vh; border: 1px solid var(--border-cyan); border-radius: var(--r-xl); transform: translate(-50%, -10px) scale(0.98); opacity: 0; transition: transform 220ms var(--ease-out), opacity 180ms; box-shadow: var(--shadow-lg), var(--glow-cyan-sm); }
.overlay.is-in .drawer.is-pal { transform: translate(-50%, 0); opacity: 1; }
.drawer.is-pal .drawer__x { display: none; }
.drawer.is-pal .drawer__body { padding: 0; }
.pal { display: grid; }
.pal__bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); color: var(--fg-dim); }
.pal__in { flex: 1; min-width: 0; border: 0; background: none; color: var(--fg); font-size: 17px; outline: none; }
.pal__in::placeholder { color: var(--fg-dim); }
.pal__l { max-height: 50vh; overflow-y: auto; padding: 6px; }
.pal__g { padding: 10px 10px 4px; color: var(--fg-dim); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; }
.pal__i { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 8px 10px; border-radius: var(--r-md); cursor: pointer; }
.pal__i .ico { flex: none; color: var(--fg-dim); }
.pal__i.is-sel { background: var(--cyan-tint-12); box-shadow: inset 2px 0 0 var(--cyan); }
.pal__i.is-sel .ico { color: var(--cyan); }
.pal__t { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pal__s { flex: none; font-size: 12px; }
.pal__foot { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--border-subtle); font-size: 12px; }
.sheet.is-pal .pal__bar { padding: 4px 36px 12px 2px; }

/* Avisos */
.bellp { display: grid; }
.bellp__h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.bellp__h h2 { font-size: 16px; }
.bellp__l { display: grid; padding: 0 6px; }
.note { display: flex; gap: 12px; padding: 10px; border-radius: var(--r-md); color: var(--fg); }
.note:hover { background: var(--surface-3); color: var(--fg); }
.note.is-new { background: rgba(0, 194, 209, 0.05); }
.note.is-new .note__txt b::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--cyan); vertical-align: middle; }
.note__ico { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--r-md); background: var(--surface-3); color: var(--cyan); }
.note__ico.is-warn { color: var(--warning); background: rgba(240, 179, 74, 0.1); }
.note__ico.is-ok { color: var(--success); background: rgba(77, 213, 153, 0.1); }
.note__txt { display: grid; gap: 2px; min-width: 0; font-size: 13.5px; line-height: 1.35; }
.note__txt b { font-weight: 500; }
.note__txt .dim { font-size: 12px; }
.bellp__empty { padding: 8px 16px 14px; }
.bellp__all { padding: 12px 16px 14px; border-top: 1px solid var(--border-subtle); font-size: 13px; }

/* Menu de cuenta */
.menu { display: grid; gap: 2px; padding: 8px; }
.menu__who { display: grid; padding: 8px 10px 10px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 6px; }
.menu__who .dim { font-size: 12px; }
.menu__lang { display: flex; gap: 4px; padding: 6px 8px 10px; }
.menu__i { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: var(--r-md); background: none; color: var(--fg-muted); font-size: 14px; text-align: left; }
.menu__i:hover { background: var(--surface-3); color: var(--fg); }
body.has-overlay { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .overlay, .pop, .sheet, .drawer, .drawer.is-pal { transition: none !important; } }
