/* WF Hub - marco del panel. Usa los tokens de wf-ui (con respaldo si no estan). */
.wfhub { --hb-line: var(--wf-line, #e2e8f0); --hb-surface: var(--wf-surface, #fff); --hb-bg: var(--wf-surface-2, #f1f5f9); --hb-ink: var(--wf-ink, #0f172a); --hb-mute: var(--wf-mute, #64748b); --hb-acc: var(--wf-gold-d, var(--wf-primary, #2563eb));
    display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 20px; align-items: start; color: var(--hb-ink); box-sizing: border-box; width: 100%; }
.wfhub *, .wfhub *::before, .wfhub *::after { box-sizing: border-box; }
.wfhub { font-family: inherit; }
.wfhub-sec img, .wfhub-sec svg { max-width: 100%; }
.wfhub-sec table { max-width: 100%; }
.wfhub-nav { position: sticky; top: 16px; background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: 16px; padding: 10px; max-height: calc(100vh - 32px); overflow-y: auto; }
.wfhub-group + .wfhub-group { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--hb-line); }
.wfhub-gt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hb-mute); padding: 4px 10px 6px; }
.wfhub-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--hb-mute); font-size: 14px; font-weight: 600; text-decoration: none; min-height: 40px; }
.wfhub-link:hover { background: var(--hb-bg); color: var(--hb-ink); }
.wfhub-link.is-on { background: var(--hb-bg); color: var(--hb-acc); box-shadow: inset 3px 0 0 var(--hb-acc); }
.wfhub-link svg { flex: 0 0 auto; }
.wfhub-lt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfhub-bd { flex: 0 0 auto; background: var(--hb-acc); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 7px; min-width: 20px; text-align: center; }
.wfhub-main { min-width: 0; position: relative; }
.wfhub-sec[hidden] { display: none !important; }
.wfhub-empty { padding: 24px; text-align: center; color: var(--wf-mute, #64748b); }
.wfhub-sk { display: grid; gap: 10px; padding: 4px 0; }
.wfhub-sk i { display: block; height: 64px; border-radius: 12px; background: linear-gradient(90deg, rgba(127,127,127,.14) 25%, rgba(127,127,127,.26) 37%, rgba(127,127,127,.14) 63%); background-size: 400% 100%; animation: wfhubsk 1.3s ease infinite; }
.wfhub-sk i:first-child { height: 30px; width: 40%; }
@keyframes wfhubsk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.wfhub-err { padding: 24px; border: 1px dashed var(--hb-line); border-radius: 14px; text-align: center; }
.wfhub-retry { appearance: none; border: 1px solid var(--hb-line); background: var(--hb-surface); color: var(--hb-ink); padding: 8px 16px; border-radius: 10px; font-weight: 600; cursor: pointer; min-height: 40px; }
@media (prefers-reduced-motion: reduce) { .wfhub-sk i { animation: none; } }

/* Pestanas de un area: las secciones del grupo, en una fila con scroll horizontal */
.wfhub-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 10px; margin: 0 0 6px; -webkit-overflow-scrolling: touch; }
.wfhub-tabs::-webkit-scrollbar { display: none; }
.wfhub-tabs[hidden] { display: none; }
.wfhub-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--hb-line); border-radius: 999px; background: var(--hb-surface); color: var(--hb-mute); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.wfhub-tab:hover { color: var(--hb-ink); background: var(--hb-bg); }
.wfhub-tab.is-on { background: var(--hb-acc); border-color: var(--hb-acc); color: #fff; }
.wfhub-tab .wfhub-bd { background: #fff; color: var(--hb-acc); }
.wfhub-tab.is-on .wfhub-bd { background: rgba(255, 255, 255, .25); color: #fff; }
.wfhub-tab.wfhub-ext { border-style: dashed; }
/* Movil: el menu pasa a barra horizontal fija abajo (los iconos arriba, el texto debajo) */
@media (max-width: 760px) {
    .wfhub { grid-template-columns: minmax(0, 1fr); gap: 0; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
    .wfhub-nav { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 99990; max-height: none; border-radius: 16px 16px 0 0; border-width: 1px 0 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; box-shadow: 0 -6px 20px rgba(15, 23, 42, .12); }
    .wfhub-nav::-webkit-scrollbar { display: none; }
    .wfhub-group { display: flex; gap: 2px; flex: 0 0 auto; }
    .wfhub-group + .wfhub-group { margin: 0 0 0 4px; padding: 0 0 0 6px; border-top: 0; border-left: 1px solid var(--hb-line); }
    .wfhub-gt { display: none; }
    .wfhub-link { flex-direction: column; justify-content: center; gap: 2px; padding: 6px 10px; min-width: 64px; font-size: 11px; position: relative; scroll-snap-align: center; box-shadow: none !important; }
    .wfhub-link.is-on { box-shadow: none; background: transparent; }
    .wfhub-link.is-on::after { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--hb-acc); }
    /* ANCHO COMPLETO: el contenedor de cada pantalla (los de Cerrajeria, Subscriptions... traen su propio relleno lateral y un ancho maximo de escritorio) ocupa todo el ancho del telefono */
    .wfhub-sec > :is(div, section, article):not(.wfhub-err):not(.wfhub-sk) { padding-left: 2px !important; padding-right: 2px !important; max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; width: 100% !important; }
    .wfhub-lt { max-width: 80px; white-space: normal; text-align: center; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
    /* cabeceras de seccion (titulo + botones) de los plugins: si no caben en una fila, el titulo va entero arriba y los botones debajo */
    .wfhub-sec :is(header, div)[class*="head"] { flex-wrap: wrap; }
    .wfhub-sec :is(h1, h2, h3) { overflow-wrap: break-word; hyphens: manual; }
    .wfhub-bd { position: absolute; top: 2px; right: 8px; font-size: 10px; padding: 1px 5px; min-width: 16px; }
}

/* Secciones en iframe (paneles antiguos que asumen ser la pagina): ocupan el alto visible y hacen su propio scroll, asi sus ventanas
   modales (position:fixed) quedan centradas en lo que se ve. */
.wfhub-sec.is-frame { margin: 0; }
.wfhub-frame { display: block; width: 100%; height: calc(100vh - 48px); height: calc(100dvh - 48px); min-height: 480px; border: 0; border-radius: 16px; background: var(--hb-surface); }
/* Movil: el iframe ocupa justo lo que queda entre arriba y la barra de abajo (sin segundo scroll de la pagina) */
@media (max-width: 760px) { .wfhub-frame { height: calc(100vh - 140px); height: calc(100dvh - 140px); min-height: 320px; border-radius: 12px; } body:not(.admin-bar) .wfhub-frame { height: calc(100vh - 96px); height: calc(100dvh - 96px); } }

/* El tema WF_Child pone relleno 1em !important a todos los input de texto y pisaba el hueco de la lupa de los buscadores (la lupa tapaba la primera letra) */
.wfhub .wfui-search input:not(.wfhub-x) { padding-left: 38px !important; }
