/* ══════════════════════════════════════════════════════════════════════════
   SELLO VIMEDIA · fondo fijo para TODOS los portales (05/08/26)
   Una sola imagen, quieta detrás de todo: escritorio de empleados y los
   portales de los centros. Las tarjetas y paneles siguen blancos, así que
   ningún texto pierde contraste.

   Va enlazado DE ÚLTIMO en cada portal, porque las órdenes de "fondo blanco"
   (29 y 30/07) dejaron `#ffffff !important` al final de modern.css y de
   launcher-centros.css: si no, el blanco taparía la imagen.
   ══════════════════════════════════════════════════════════════════════════ */

/* la capa del sello: fija, cubre la pantalla, nunca scrollea */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url('fondo-vimedia.png');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  pointer-events: none;
}
/* un velo blanco muy suave para que el texto oscuro siempre se lea encima */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, .38);
  pointer-events: none;
}

/* ── destapar los lienzos que hoy están pintados de blanco ── */
body { background: transparent !important; }

/* escritorio de empleados */
body:not(.ws-marcas-active).gk-launcher-mode,
body:not(.ws-marcas-active).gk-launcher-mode .main-content,
body:not(.ws-marcas-active) #section-home.gk-launcher,
body:not(.ws-marcas-active) #dashboard-view .app-layout,
body:not(.ws-marcas-active).gk-launcher-mode #dashboard-view,
body:not(.ws-marcas-active).gk-launcher-mode .app-layout { background: transparent !important; }

/* portales de los centros */
body[data-centro].gk-centro-launcher-mode,
body[data-centro].gk-centro-module-mode,
body[data-centro].gk-centro-launcher-mode .main-content,
#section-home.gk-launcher-centro[data-centro] { background: transparent !important; }

/* el login conserva su identidad de color: el sello no lo toca */
#login-view::before,
#login-view::after { display: none !important; }

/* dentro de un módulo (bandeja, catálogo, etc.) el trabajo va sobre blanco:
   el sello se ve en el borde, no debajo del contenido */
body.gk-module-mode .main-content,
body.gk-centro-module-mode .main-content { background: #ffffff !important; }

/* el chrome flotante se separa del fondo con un vidrio suave */
body.gk-launcher-mode .gk-uni-dots,
body.gk-launcher-mode .gk-uni-cfg-btn,
body.gk-launcher-mode .gk-topbar-date {
  background: rgba(255, 255, 255, .88) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

@media (prefers-reduced-motion: reduce) {
  body::before { background-attachment: scroll; }
}

/* ══════════════════════════════════════════════════════════════════════════
   INICIO · ideas del demo `vimedia_dashboard_inicio_demo.html` (05/08/26)
   Nada se quita: se le agrega identidad (logo + frase), accesos rápidos a los
   MISMOS módulos que ya viven en el panel de aplicaciones, y un pie discreto.
   ══════════════════════════════════════════════════════════════════════════ */

/* rótulo del lugar, junto a los puntos */
body.gk-launcher-mode .gk-uni-lugar {
  position: fixed; top: 26px; left: 74px; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 650; color: #6d7480; letter-spacing: .01em;
  padding: 0 4px 0 14px; border-left: 1px solid #e4e7ec; height: 24px;
}
body:not(.gk-launcher-mode) .gk-uni-lugar { display: none !important; }
body.gk-launcher-mode .gk-uni-lugar-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent, #5e2ced);
}

/* accesos rápidos — justo debajo del buscador, que es fijo al centro */
body:not(.ws-marcas-active).gk-launcher-mode.gk-uni-ready .gk-uni-accesos {
  position: fixed; top: calc(50% + 62px); left: 50%; transform: translateX(-50%);
  z-index: 930;
  width: min(760px, calc(100vw - 48px));
  margin: 0;
  transition: opacity .18s ease;
}
body.gk-search-open .gk-uni-accesos,
body.gk-uni-open .gk-uni-accesos { opacity: 0; pointer-events: none; }
body.gk-launcher-mode .gk-uni-accesos.hidden,
body:not(.gk-launcher-mode) .gk-uni-accesos { display: none !important; }
body.gk-launcher-mode .gk-uni-accesos-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
body.gk-launcher-mode .gk-uni-accesos-head h2 {
  font-size: 13px; margin: 0; color: #444a56; font-weight: 700; letter-spacing: .01em;
}
body.gk-launcher-mode .gk-uni-accesos-head button {
  border: 0; background: transparent; color: var(--accent, #5e2ced);
  font-size: 12px; font-weight: 700; padding: 4px; cursor: pointer;
}
body.gk-launcher-mode .gk-uni-accesos-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}
body.gk-launcher-mode .gk-uni-acceso {
  border: 1px solid #e4e7ec; background: rgba(255, 255, 255, .82);
  border-radius: 14px; padding: 15px; min-height: 72px;
  display: flex; align-items: center; gap: 12px; text-align: left;
  color: #17191f; cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
body.gk-launcher-mode .gk-uni-acceso:hover {
  border-color: #d8d2fb; background: #fff; transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(25, 27, 36, .07);
}
body.gk-launcher-mode .gk-uni-acceso-ico {
  width: 36px; height: 36px; border-radius: 10px; background: #f5f5f7;
  display: grid; place-items: center; color: #383d49; flex: none;
}
body.gk-launcher-mode .gk-uni-acceso-ico svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
body.gk-launcher-mode .gk-uni-acceso-ico img { width: 18px; height: 18px; object-fit: contain; }
body.gk-launcher-mode .gk-uni-acceso strong { display: block; font-size: 13px; line-height: 1.2; }
body.gk-launcher-mode .gk-uni-acceso span span,
body.gk-launcher-mode .gk-uni-acceso-txt span { display: block; font-size: 11px; color: #6d7480; margin-top: 4px; }

/* pie discreto */
body.gk-launcher-mode .gk-uni-pie {
  position: fixed; bottom: 22px; left: 0; right: 0; text-align: center;
  color: #a1a6af; font-size: 11px; pointer-events: none; z-index: 1;
}
body:not(.gk-launcher-mode) .gk-uni-pie { display: none !important; }

/* buscador con la medida del demo (60px, radio 18, sombra suave) */
body.gk-launcher-mode .gk-uni-search {
  height: 60px !important; border-radius: 18px !important;
  border: 1px solid #d8dce3 !important; background: #fff !important;
  box-shadow: 0 10px 30px rgba(25, 27, 36, .07) !important;
  transition: border-color .2s ease, box-shadow .2s ease;
}
body.gk-launcher-mode .gk-uni-search:focus-within {
  border-color: rgba(94, 44, 237, .55) !important;
  box-shadow: 0 0 0 4px rgba(94, 44, 237, .09), 0 10px 30px rgba(25, 27, 36, .07) !important;
}
body.gk-launcher-mode .gk-uni-search input { font-size: 16px !important; }

/* la tira de "nuevas esperando" era blanco sobre blanco: se vuelve legible */
body.gk-launcher-mode .gk-inbox-recent {
  background: rgba(255, 255, 255, .88) !important;
  border: 1px solid #e4e7ec !important;
  backdrop-filter: blur(14px);
}
body.gk-launcher-mode .gk-inbox-recent,
body.gk-launcher-mode .gk-inbox-recent * { color: #17191f !important; }

/* móvil: los accesos en dos columnas y la marca centrada */
@media (max-width: 720px) {
  body.gk-launcher-mode .gk-uni-lugar { display: none !important; }
  body.gk-launcher-mode .gk-uni-accesos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── con un DIÁLOGO abierto, los accesos y el pie descansan igual que el
      nombre y el buscador (si no, quedaban encima de "Nueva publicación") ── */
body.vm-fab-open .gk-uni-accesos,
body.vm-fab-open .gk-uni-pie,
body.vm-fab-open .gk-uni-lugar,
body:has(.modal.show) .gk-uni-accesos,
body:has(.modal.show) .gk-uni-pie,
body:has(.modal.show) .gk-uni-lugar,
body:has(.modal[style*="flex"]) .gk-uni-accesos,
body:has(.modal[style*="flex"]) .gk-uni-pie,
body:has(.modal[style*="flex"]) .gk-uni-lugar {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity .18s ease;
}

/* ── en la pestaña Ficha el texto ya está en el editor: el bloque de lectura
      "Texto del post" descansa ahí (sigue visible en Diseños, Subir, IA e
      Historial, donde no hay editor a la vista) ── */
body #solicitud-modal.vm-ws-modal-centered[data-active-tab="ficha"] #sol-disenos-texto {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   05/08/26 · ARRANQUE SÓLIDO
   Al recargar, los accesos, el pie y el rótulo se dibujaban ANTES de que la
   pantalla estuviera lista: aparecían arriba a la izquierda, encima del
   chrome, y después saltaban a su lugar. Eso era lo que se sentía "inseguro".
   Ahora no existen hasta que la pantalla está lista (`gk-uni-ready`).
   ══════════════════════════════════════════════════════════════════════════ */
.gk-uni-accesos,
.gk-uni-pie,
.gk-uni-lugar { display: none !important; }

body.gk-uni-ready:not(.ws-marcas-active).gk-launcher-mode .gk-uni-accesos { display: block !important; }
body.gk-uni-ready:not(.ws-marcas-active).gk-launcher-mode .gk-uni-pie     { display: block !important; }
body.gk-uni-ready:not(.ws-marcas-active).gk-launcher-mode .gk-uni-lugar   { display: flex  !important; }
/* con el diálogo abierto siguen descansando (regla de arriba) */
body.vm-fab-open .gk-uni-accesos,
body.vm-fab-open .gk-uni-pie,
body:has(.modal.show) .gk-uni-accesos,
body:has(.modal.show) .gk-uni-pie { opacity: 0 !important; pointer-events: none !important; }

/* ── la tira de "nuevas esperando" tenía su propio lugar en el flujo y se
      encimaba con el nombre y el buscador: ahora va fija, arriba de la marca ── */
body.gk-uni-ready:not(.ws-marcas-active).gk-launcher-mode #section-home.gk-launcher .gk-inbox-recent {
  position: fixed !important;
  top: calc(50% - 188px) !important; left: 50% !important;
  transform: translateX(-50%) !important;
  width: max-content !important; max-width: min(760px, calc(100vw - 48px)) !important;
  margin: 0 !important; z-index: 935;
  background: rgba(255, 255, 255, .88) !important;
  border: 1px solid #e4e7ec !important;
  box-shadow: 0 10px 30px rgba(25, 27, 36, .07) !important;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: opacity .18s ease;
}
body:not(.gk-uni-ready) #section-home.gk-launcher .gk-inbox-recent { display: none !important; }
body.vm-fab-open #section-home.gk-launcher .gk-inbox-recent,
body:has(.modal.show) #section-home.gk-launcher .gk-inbox-recent,
body.gk-search-open #section-home.gk-launcher .gk-inbox-recent,
body.gk-uni-open #section-home.gk-launcher .gk-inbox-recent { opacity: 0 !important; pointer-events: none !important; }

/* si hay muchas fichas nuevas, la tira no se desborda: se desliza a lo ancho */
body.gk-uni-ready .gk-inbox-recent .gk-ir-list {
  display: flex !important; flex-wrap: nowrap !important;
  gap: 8px !important; overflow-x: auto !important; scrollbar-width: none;
  max-width: 100%;
}
body.gk-uni-ready .gk-inbox-recent .gk-ir-list::-webkit-scrollbar { display: none; }
