/* ACGS Academic Platform 0.6.20 — fixes globales del shell de cliente.
   Estas reglas deben estar disponibles en todas las secciones, no solo en Subir documento. */
body.acgs-ap-platform-page .acgs-ap-brand-image,
body.acgs-ap-platform-page .acgs-ap-mobile-brand .acgs-ap-brand-image {
  display: block !important;
  width: var(--acgs-ap-logo-size, 39px) !important;
  height: var(--acgs-ap-logo-size, 39px) !important;
  min-width: var(--acgs-ap-logo-size, 39px) !important;
  max-width: var(--acgs-ap-logo-size, 39px) !important;
  max-height: var(--acgs-ap-logo-size, 39px) !important;
  object-fit: contain !important;
  flex: 0 0 var(--acgs-ap-logo-size, 39px) !important;
  border-radius: 10px !important;
}
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-brand {
  display: flex !important;
  align-items: center !important;
  min-width: 0 !important;
}
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-brand > span:last-child,
body.acgs-ap-platform-page .acgs-ap-mobile-brand > span:last-child {
  min-width: 0 !important;
}
body.acgs-ap-platform-page .acgs-ap-sidebar-foot {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  margin-top: auto !important;
}
body.acgs-ap-platform-page .acgs-ap-sidebar-foot .acgs-ap-logout-link {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 14px 0 0 15px !important;
  padding: 0 !important;
  line-height: 1.4 !important;
  white-space: normal !important;
  text-decoration: none !important;
}
body.acgs-ap-platform-page .acgs-ap-logout-link svg {
  display: block !important;
  flex: 0 0 18px !important;
  width: 18px !important;
  height: 18px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}
body.acgs-ap-platform-page .acgs-ap-logout-link span {
  display: inline-block !important;
  width: auto !important;
  font-size: 11px !important;
  line-height: 1.4 !important;
}
/* Iconografía de créditos y productos: evitar el relleno negro heredado del tema. */
body.acgs-ap-platform-page .acgs-ap-credits-icon svg,
body.acgs-ap-platform-page .acgs-ap-credits-icon svg * {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}
body.acgs-ap-platform-page .acgs-ap-credits-icon svg {
  display: block !important;
  width: 36px !important;
  height: 36px !important;
  max-width: 100% !important;
}
/* Escritorio: sidebar a toda la altura visible y contenido ocupando el espacio restante. */
@media (min-width: 901px) {
  body.acgs-ap-platform-page .acgs-ap-app {
    display: grid !important;
    grid-template-columns: 252px minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    min-height: 100svh !important;
  }
  body.acgs-ap-platform-page .acgs-ap-sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: 252px !important;
    height: 100vh !important;
    height: 100svh !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  body.acgs-ap-platform-page .acgs-ap-main {
    grid-column: 2 !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
}
@media (max-width: 900px) {
  body.acgs-ap-platform-page .acgs-ap-mobile-brand .acgs-ap-brand-image {
    width: var(--acgs-ap-logo-size, 39px) !important;
    height: var(--acgs-ap-logo-size, 39px) !important;
  }
}

/* 0.6.21 — Identidad visual centralizada: todos los módulos consumen
   las variables guardadas en Configurar interfaz. Estas reglas se cargan
   al final del shell para neutralizar colores históricos hardcodeados. */
body.acgs-ap-platform-page .acgs-ap-app,
body.acgs-ap-platform-page .acgs-ap-main {
  background: var(--acgs-ap-main-bg, #F3F7FD) !important;
}
body.acgs-ap-platform-page .acgs-ap-sidebar {
  background: var(--acgs-ap-sidebar-bg, #B8DAFC) !important;
  color: var(--acgs-ap-menu-text, #082B55) !important;
}
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-brand,
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-brand strong,
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-nav-item,
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-nav-icon,
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-sidebar-foot,
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-sidebar-foot a {
  color: var(--acgs-ap-menu-text, #082B55) !important;
}
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-brand small,
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-nav-label {
  color: var(--acgs-ap-menu-text, #082B55) !important;
  opacity: .78;
}
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-nav-item:hover,
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-nav-item.is-active {
  background: var(--acgs-ap-menu-active-bg, #EAF3FF) !important;
  color: var(--acgs-ap-menu-active-text, #06264B) !important;
}
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-nav-item:hover .acgs-ap-nav-icon,
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-nav-item.is-active .acgs-ap-nav-icon {
  color: var(--acgs-ap-menu-active-text, #06264B) !important;
}
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-nav-item.is-active {
  box-shadow: inset 3px 0 #176EE5 !important;
}
body.acgs-ap-platform-page .acgs-ap-sidebar .acgs-ap-nav-icon svg {
  stroke: currentColor !important;
}
/* The footer is not the menu/content separator. Keep it visually neutral
   and independent from the configurable vertical divider. */
body.acgs-ap-platform-page .acgs-ap-sidebar-foot {
  border-top: 0 !important;
}
body.acgs-ap-platform-page .acgs-ap-mobile-header {
  background: var(--acgs-ap-sidebar-bg, #B8DAFC) !important;
  color: var(--acgs-ap-menu-text, #082B55) !important;
}
body.acgs-ap-platform-page .acgs-ap-mobile-brand,
body.acgs-ap-platform-page .acgs-ap-mobile-brand strong,
body.acgs-ap-platform-page .acgs-ap-mobile-brand small {
  color: var(--acgs-ap-menu-text, #082B55) !important;
}
body.acgs-ap-platform-page .acgs-ap-mobile-menu-toggle {
  border-color: var(--acgs-ap-divider-color, #D6E0EC) !important;
}
body.acgs-ap-platform-page .acgs-ap-mobile-menu-toggle span {
  background: var(--acgs-ap-menu-text, #082B55) !important;
}


/* 0.6.22 — Configurable vertical separator between sidebar and content.
   The setting applies to the sidebar's right edge, never to the account footer. */
@media (min-width: 901px) {
  html body.acgs-ap-platform-page .acgs-ap-sidebar {
    box-sizing: border-box !important;
    border-right-style: solid !important;
    border-right-color: var(--acgs-ap-divider-color, #D6E0EC) !important;
    border-right-width: var(--acgs-ap-divider-width, 1px) !important;
  }
}
@media (max-width: 900px) {
  html body.acgs-ap-platform-page .acgs-ap-sidebar {
    border-right: 0 !important;
  }
}
