/* STD V9.1.7 · preproducción final responsive y perfil uniforme */

/* Cambio de módulo sin parpadeo: nunca se oculta la vista completa. */
.stdViewTransition915{position:relative!important;opacity:1!important;transform:none!important;filter:none!important}
.stdViewTransition915::after{display:none!important;content:none!important}
@keyframes stdSoftSwitch916{0%{opacity:0}35%{opacity:.78}100%{opacity:0}}
.main,.advisorMain,.stdMetricsMain54,.metricsMain{transition:none!important}

/* Atención y Configuración: módulo activo inequívoco y consistente. */
body.portalAttention #mainNav button.active,body.portalConfig #mainNav button.active,body.portalConfig #mainNav [data-view].stdConfigActive915{background:linear-gradient(135deg,#2180d5,#18b7d4)!important;color:#fff!important;border-color:transparent!important;box-shadow:0 8px 20px rgba(26,135,194,.16)!important}
body.portalAttention #mainNav button.active svg,body.portalConfig #mainNav button.active svg,body.portalConfig #mainNav [data-view].stdConfigActive915 svg{stroke:currentColor!important;color:#fff!important}

/* Ordenar por en Cobranza */
.stdCobSort915{display:flex;justify-content:flex-end;align-items:center;margin:0 0 14px;min-height:54px}
.stdCobSort915 label{display:flex;align-items:center;gap:10px;margin:0;color:#315473;font-size:12px;font-weight:850}
.stdCobSort915 select{min-width:220px;height:42px;padding:0 36px 0 13px;border:1px solid #cbdbe8;border-radius:12px;background:#fff;color:#153a5d;font-weight:800;outline:none}
.stdCobSort915 select:focus{border-color:#22a8d2;box-shadow:0 0 0 3px rgba(34,168,210,.12)}

/* Perfil único: una tarjeta, un avatar y dos líneas en todas las áreas. */
.stdUnifiedProfileButton915,.stdProfileButtonAttention913{width:100%!important;min-height:62px!important;display:flex!important;align-items:center!important;gap:10px!important;padding:10px 11px!important;border:1px solid #d7e6f0!important;border-radius:15px!important;background:#fff!important;color:#173f64!important;box-shadow:none!important;text-align:left!important;position:relative!important;overflow:hidden!important}
.stdUnifiedProfileButton915::before,.stdUnifiedProfileButton915::after{display:none!important;content:none!important}
.stdUnifiedProfileButton915>i,.stdUnifiedProfileButton915>#userInitial,.stdUnifiedProfileButton915>#advisorUserInitial{display:none!important}
.stdUnifiedAvatar915{width:42px!important;height:42px!important;flex:0 0 42px!important;border-radius:12px!important;display:grid!important;place-items:center!important;overflow:hidden!important;background:linear-gradient(135deg,#0d6fb4,#18b5cf)!important;background-image:linear-gradient(135deg,#0d6fb4,#18b5cf)!important;color:#fff!important;font-weight:950!important;font-style:normal!important;margin:0!important;padding:0!important;box-shadow:none!important;transform:none!important}
.stdUnifiedAvatar915 img{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important}
.stdUnifiedIdentity915{min-width:0!important;display:grid!important;gap:2px!important;flex:1!important}.stdUnifiedIdentity915 b{font-size:13px!important;line-height:1.16!important;color:#173f64!important;white-space:normal!important;margin:0!important}.stdUnifiedIdentity915 small{font-size:11px!important;color:#748ba0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;margin:0!important}
.stdUnifiedChevron915{font-size:14px!important;color:#7a9bb2!important;font-style:normal!important;margin-left:auto!important}
.stdUnifiedProfileMenu915{min-width:210px}
.sideFoot .sideUserBox.stdUnifiedProfileButton915,.advisorSideFoot .advisorUser.stdUnifiedProfileButton915{margin:0!important}
.stdMetricProfile54>button.stdUnifiedProfileButton915{height:auto!important}

/* Login limpio e inmediato */
#authOverlay .authBrand{justify-content:center!important;text-align:center!important;margin-bottom:18px!important}
#authOverlay .authBrand img{width:82px!important;height:82px!important}
#authOverlay .authBrand b{font-size:23px!important;line-height:1.08!important}
#authOverlay .authTabs,#authOverlay #tabLogin,#authOverlay #tabSignup{display:none!important}
#authOverlay #authUser,#authOverlay #authPass,#authOverlay #authBtn{pointer-events:auto!important;touch-action:manipulation}
#authOverlay .authCard{will-change:auto}
#authOverlay .authMsg:empty{display:none!important}

/* Feedback: icono de idea, no IA */
#stdFeedbackFab913 .stdFeedbackIcon915{width:18px;height:18px;display:grid;place-items:center;color:#0d8eb8!important;font-size:0!important}
#stdFeedbackFab913 .stdFeedbackIcon915 svg{width:18px;height:18px}

/* Métricas SVG */
.stdMetricGlyph56{display:inline-grid;place-items:center}.stdMetricGlyph56 svg{width:22px;height:22px;display:block}
.stdMetricNavIcon54 .stdMetricGlyph56 svg{width:21px;height:21px}

/* Propuestas: tres acciones idénticas */
.std910ProposalActions{display:grid!important;grid-template-columns:1fr!important;gap:9px!important}
.std910ProposalActions button,.std910ProposalActions .std910Complete{width:100%!important;min-height:44px!important;margin:0!important}

/* Evita saltos de layout de tablas durante render */
#viewCRM,#viewCobranza,#viewDashboard,#viewLiquidaciones,.advisorView{min-width:0;contain:layout style}
@media(max-width:760px){.stdCobSort915{justify-content:stretch}.stdCobSort915 label{width:100%;justify-content:space-between}.stdCobSort915 select{min-width:0;flex:1}.stdUnifiedProfileButton915{min-height:58px!important}}


/* V9.1.7 · Perfil inferior: una sola tarjeta, fondo transparente y sin rol. */
.stdUnifiedProfileButton915,.stdProfileButtonAttention913{
  background:transparent!important;background-image:none!important;box-shadow:none!important;
  min-height:58px!important;padding:8px 10px!important;border-radius:15px!important;
}
.stdUnifiedProfileButton915 .stdUnifiedIdentity915,
.sideFoot .sideUserBox.stdUnifiedProfileButton915>.stdUnifiedIdentity915,
.advisorSideFoot .advisorUser.stdUnifiedProfileButton915>.stdUnifiedIdentity915{
  width:auto!important;height:auto!important;min-width:0!important;flex:1 1 auto!important;flex-basis:auto!important;
  display:block!important;background:transparent!important;background-image:none!important;border:0!important;border-radius:0!important;
  padding:0!important;margin:0!important;color:inherit!important;overflow:visible!important;
}
.stdUnifiedProfileButton915 .stdUnifiedIdentity915 b{display:block!important;margin:0!important;max-width:none!important;white-space:normal!important;overflow:hidden!important;text-overflow:ellipsis!important}
.stdUnifiedProfileButton915 small,.stdUnifiedProfileButton915 [data-profile-role],#userRole,#advisorUserRole{display:none!important}
.stdUnifiedProfileButton915>:not([data-profile-avatar]):not(.stdUnifiedIdentity915):not(.stdUnifiedChevron915){display:none!important}
body.portalAttention .stdUnifiedProfileButton915,body.portalConfig .stdUnifiedProfileButton915{border-color:#d7e6f0!important;color:#173f64!important}
body.portalAdvisory .stdUnifiedProfileButton915,body.portalMetrics .stdUnifiedProfileButton915{border-color:rgba(255,255,255,.20)!important;color:#fff!important}
body.portalAdvisory .stdUnifiedProfileButton915 .stdUnifiedIdentity915 b,body.portalMetrics .stdUnifiedProfileButton915 .stdUnifiedIdentity915 b{color:#fff!important}
body.portalAdvisory .stdUnifiedChevron915,body.portalMetrics .stdUnifiedChevron915{color:rgba(255,255,255,.72)!important}

/* Salida secundaria en cabecera. */
.stdTopLogout917{height:40px;display:inline-flex;align-items:center;justify-content:center;padding:0 14px;border:1px solid #d2e2ee;border-radius:12px;background:#fff;color:#17496f;font:800 13px Inter,Roboto,Arial,sans-serif;cursor:pointer;white-space:nowrap;box-shadow:none}
.stdTopLogout917:hover{background:#eef8fd;border-color:#a8d6e8}
body.portalAdvisory .advisorTop .stdTopLogout917{border-color:#cfdfec;background:#fff;color:#17496f}
.metricsTop .stdTopLogout917{align-self:end}

/* Responsive real: escritorio pequeño, iPad/tablet y móvil. */
html,body{max-width:100%;overflow-x:hidden}
.main,.advisorMain,.stdMetricsMain54,.metricsMain{min-width:0!important}
.view,.advisorView,#stdMetricsContent{min-width:0!important;max-width:100%!important}
@media(max-width:1280px){
  .main{padding-left:clamp(14px,2vw,28px)!important;padding-right:clamp(14px,2vw,28px)!important}
  .topbar,.advisorTop,.metricsTop{gap:12px!important;flex-wrap:wrap!important}
  .topActions,.advisorTopActions,.metricsFilters{max-width:100%!important;flex-wrap:wrap!important}
  .portalChooserPanel{width:min(980px,calc(100vw - 28px))!important;max-height:calc(100dvh - 28px)!important;overflow:auto!important}
}
@media(max-width:900px){
  .topbar,.advisorTop,.metricsTop{align-items:flex-start!important}
  .topActions,.advisorTopActions,.metricsFilters{width:100%!important;justify-content:flex-end!important}
  .stdTopLogout917{margin-left:auto!important}
  .card,.panel,.advisorCard{max-width:100%!important}
  .stdTableWrap,.advisorTableWrap,.cobTableWrap,.crmTableWrap,.resultsTableWrap{overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;max-width:100%!important}
  table{max-width:none}
  dialog,.stdNativeCard,.advisorModal{max-width:calc(100vw - 20px)!important}
}
@media(max-width:720px){
  .appShell{display:block!important;min-width:0!important}
  .sidebar{height:auto!important;position:relative!important;top:auto!important;z-index:120!important;padding:8px 10px!important;gap:7px!important}
  .sidebar .brandBlock{display:none!important}
  .sidebar .nav{display:flex!important;flex-direction:row!important;overflow-x:auto!important;overscroll-behavior-x:contain!important;gap:6px!important;padding-bottom:3px!important}
  .sidebar .nav>button,.sidebar .nav>.navTree{flex:0 0 auto!important}
  .sidebar .nav button{min-height:42px!important;padding:8px 11px!important;border-radius:12px!important;white-space:nowrap!important}
  .sideFoot{display:flex!important;align-items:center!important;gap:8px!important;padding-top:4px!important;border-top:0!important}
  .sideFoot .sync,.sideFoot>.logoutClean{display:none!important}
  .sideFoot .sideUserBox{max-width:min(300px,100%)!important}
  .main{padding:12px!important}
  .topbar{position:sticky!important;top:0!important;z-index:90!important;background:rgba(247,251,254,.96)!important;padding:8px 0!important;backdrop-filter:blur(10px)}
  .topbar h1,.advisorTop h1,.metricsTop h1{font-size:clamp(20px,6vw,26px)!important}
  .stdTopLogout917{height:38px!important;padding:0 12px!important}
  .stdCobSort915 label{flex-direction:column!important;align-items:stretch!important}.stdCobSort915 select{width:100%!important}
  .portalChooser{padding:8px!important;overflow:auto!important;align-items:flex-start!important}
  .portalChooserPanel{width:100%!important;min-height:0!important;max-height:none!important;padding:14px!important;border-radius:18px!important}
  .portalOptionGrid{grid-template-columns:1fr!important}
  .portalOption{min-height:0!important}
  input,select,textarea,button{max-width:100%}
}
@media(max-width:480px){
  .main,.advisorMain,.stdMetricsMain54,.metricsMain{padding:10px!important}
  .topbar,.advisorTop,.metricsTop{padding-left:0!important;padding-right:0!important}
  .stdNativeModal{padding:8px!important}.stdNativeCard{width:100%!important;border-radius:16px!important}
  .stdNativeHead,.stdNativeFoot{padding-left:14px!important;padding-right:14px!important}
}


/* V9.3.2 · móvil operativo: sin reordenamiento accidental ni cierre de sesión manual */
@media (max-width:900px), (pointer:coarse){
  .std81649SortHandle,.std81649CardHandle,.stdMetricNavHandle59,.stdMetricCardHandle59,
  .stdPointerDragHandle,.std81647SortHandle,.stdV81637DragHandle,.stdDragHandle,.stdNavGrip,
  [aria-label="Mover módulo"],[aria-label="Mover"]{display:none!important;pointer-events:none!important;touch-action:auto!important}
  #stdTopLogout917,#advisorLogout,#stdMetricsTopLogout917,#profileLogout,#attentionProfileLogout,#stdMetricLogout54,
  [data-profile-action="logout"],[data-std-logout]{display:none!important;visibility:hidden!important;pointer-events:none!important}
  body.std81649Sorting,body.stdMetricPointerSorting65,body.stdReorderingModules{user-select:auto!important;touch-action:auto!important}
}
