/* ALA PRODUCT — Sprint correctivo UX/UI definitivo · 2026-10-16.
   Capa final de presentación: no modifica datos, permisos ni reglas comerciales. */

/* UX-C07 · Inicio / Oportunidades de inventario.
   "Ver todas" conserva la lógica existente; aquí sólo se normaliza su presencia visual. */
html[data-ala-theme] body.premium-ui-v2 #home #pr6InventoryCard{
  display:flex;
  flex-direction:column;
  align-items:stretch;
}
html[data-ala-theme] body.premium-ui-v2 #home #pr6InventoryCard .pr6-list{
  width:100%;
  margin:0!important;
}
html[data-ala-theme] body.premium-ui-v2 #home #pr6InventoryCard #pr6InventoryPending:not(:empty){
  margin:12px 0 0!important;
}
html[data-ala-theme] body.premium-ui-v2 #home #pr6InventoryCard #pr6InventoryMore:not([hidden]){
  align-self:flex-start;
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  margin:16px 0 0!important;
  min-height:40px;
}
html[data-ala-theme] body.premium-ui-v2 #home #pr6InventoryCard :is(#pr6InventoryStatus,#pr6InventoryError,#pr6InventoryPending):empty{
  display:none!important;
}

/* UX-C01 · Contactos.
   Jerarquía legible en Light/Dark y scroll horizontal sólo cuando el ancho real lo exige. */
html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table{
  overflow-x:auto!important;
  overflow-y:visible!important;
  scrollbar-gutter:auto!important;
  max-width:100%!important;
}
html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table .ala-contact-name{
  max-width:100%;
  white-space:normal!important;
  overflow-wrap:anywhere;
}
html[data-ala-theme="light"] body.premium-ui-v2 #leads .ala-contact-table .ala-contact-name{
  font-weight:700!important;
}
html[data-ala-theme="dark"] body.premium-ui-v2 #leads .ala-contact-table .ala-contact-name{
  font-weight:600!important;
}
html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table .ala-contact-meta{
  color:var(--ala-text-secondary)!important;
}
html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table :is(th,td):first-child{
  min-width:178px;
}
html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table :is(th,td):last-child{
  min-width:92px;
  white-space:nowrap!important;
}
html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-row-action{
  vertical-align:middle!important;
}
html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-row-action .btn{
  margin:0!important;
  min-width:76px!important;
  min-height:36px!important;
}
@media (min-width:1440px){
  html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table table{
    width:100%!important;
    min-width:0!important;
    table-layout:auto!important;
  }
  html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table th{
    width:auto!important;
  }
  html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table :is(th,td){
    padding-inline:10px!important;
  }
  html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table :is(th,td):first-child{
    width:17%;
    padding-left:16px!important;
  }
  html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table :is(th,td):nth-child(2){width:15%}
  html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table :is(th,td):nth-child(3){width:10%}
  html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table :is(th,td):nth-child(4){width:14%}
  html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table :is(th,td):nth-child(5){width:13%}
  html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table :is(th,td):nth-child(6){width:16%}
  html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table :is(th,td):nth-child(7){width:8%}
  html[data-ala-theme] body.premium-ui-v2 #leads .ala-contact-table :is(th,td):last-child{
    width:1%;
    padding-right:16px!important;
  }
}

/* UX-C02 · Kanban.
   El mismo control horizontal se porta a body; queda fuera del scroll vertical del tablero. */
html[data-ala-theme] body.premium-ui-v2 #pipeline .opp-scroll-shell{
  padding-bottom:0!important;
}
html[data-ala-theme] body.premium-ui-v2 #pipeline .opp-board-scroll{
  overflow-x:auto!important;
  overflow-y:auto!important;
  scrollbar-width:none!important;
  padding-bottom:54px!important;
  overscroll-behavior:contain!important;
  scroll-padding-bottom:54px;
}
html[data-ala-theme] body.premium-ui-v2 #pipeline .opp-board-scroll::-webkit-scrollbar{
  width:10px!important;
  height:0!important;
}
html[data-ala-theme] body.premium-ui-v2>.ala-kanban-viewport-nav.opp-bottom-nav{
  box-sizing:border-box!important;
  position:fixed!important;
  left:var(--ala-kanban-nav-left,244px)!important;
  right:var(--ala-kanban-nav-right,24px)!important;
  bottom:12px!important;
  width:auto!important;
  max-width:none!important;
  height:44px!important;
  margin:0!important;
  padding:8px 12px!important;
  z-index:900!important;
  display:none!important;
  align-items:center!important;
  background:var(--ala-surface)!important;
  border:1px solid var(--ala-border)!important;
  border-radius:10px!important;
  box-shadow:var(--ala-shadow-dropdown)!important;
}
html[data-ala-theme] body.premium-ui-v2>.ala-kanban-viewport-nav.opp-bottom-nav[data-ala-visible="true"]{
  display:flex!important;
}
html[data-ala-theme] body.premium-ui-v2.lion-has-modal>.ala-kanban-viewport-nav.opp-bottom-nav{
  display:none!important;
}
html[data-ala-theme] body.premium-ui-v2>.ala-kanban-viewport-nav.opp-bottom-nav .opp-scroll-track{
  position:relative!important;
  flex:1 1 auto!important;
  width:100%!important;
  height:14px!important;
  min-height:14px!important;
  overflow:hidden!important;
  border-radius:999px!important;
  background:var(--ala-background)!important;
  cursor:pointer!important;
  touch-action:none!important;
  user-select:none!important;
}
html[data-ala-theme] body.premium-ui-v2>.ala-kanban-viewport-nav.opp-bottom-nav .opp-scroll-track.disabled{
  opacity:.45;
  cursor:default!important;
}
html[data-ala-theme] body.premium-ui-v2>.ala-kanban-viewport-nav.opp-bottom-nav .opp-scroll-thumb{
  height:100%!important;
  min-width:52px!important;
  border-radius:999px!important;
  background:var(--ala-control-border)!important;
  cursor:grab!important;
  touch-action:none!important;
  user-select:none!important;
  will-change:transform;
}
html[data-ala-theme] body.premium-ui-v2>.ala-kanban-viewport-nav.opp-bottom-nav .opp-scroll-thumb:active,
html[data-ala-theme] body.premium-ui-v2>.ala-kanban-viewport-nav.opp-bottom-nav .opp-scroll-thumb.dragging{
  cursor:grabbing!important;
  background:var(--ala-text-secondary)!important;
}

/* UX-C03 · Detalle ejecutivo / reuniones realizadas. */
html[data-ala-theme] body.premium-ui-v2 #controlDrill .control-drill-filters{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  padding:10px 24px!important;
  min-height:0!important;
}
html[data-ala-theme] body.premium-ui-v2 #controlDrill .meeting-drill-filters{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  margin:0 0 0 auto!important;
  padding:0!important;
}
html[data-ala-theme] body.premium-ui-v2 #controlDrill .meeting-drill-filters .btn{
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:36px!important;
  height:36px!important;
  margin:0!important;
  padding:6px 11px!important;
  border-radius:8px!important;
  white-space:nowrap!important;
}
html[data-ala-theme] body.premium-ui-v2 #controlDrill .meeting-drill-filters [aria-pressed="true"]{
  background:var(--ala-selected)!important;
  color:var(--ala-selected-text)!important;
  border-color:var(--ala-focus)!important;
}
html[data-ala-theme] body.premium-ui-v2 #controlDrill .control-drill-body{
  padding-top:0!important;
}

/* UX-C04 · Un único sistema global de cabecera: window-maximize.js + estos tokens finales. */
html[data-ala-theme] body.premium-ui-v2 .crm-window-layout .crm-window-heading{
  align-items:flex-start!important;
  gap:12px!important;
}
html[data-ala-theme] body.premium-ui-v2 .crm-window-controls{
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  margin:0!important;
  padding:0!important;
  flex:0 0 auto!important;
}
html[data-ala-theme] body.premium-ui-v2 .crm-window-controls>button.crm-window-control{
  box-sizing:border-box!important;
  position:static!important;
  display:inline-grid!important;
  place-items:center!important;
  flex:0 0 36px!important;
  width:36px!important;
  min-width:36px!important;
  max-width:36px!important;
  height:36px!important;
  min-height:36px!important;
  max-height:36px!important;
  margin:0!important;
  padding:0!important;
  border:1px solid var(--ala-border)!important;
  border-radius:9px!important;
  background:var(--ala-surface)!important;
  color:var(--ala-text-secondary)!important;
  box-shadow:none!important;
  line-height:1!important;
  transform:none!important;
}
html[data-ala-theme] body.premium-ui-v2 .crm-window-controls>button.crm-window-close{
  font-family:var(--ala-font)!important;
  font-size:22px!important;
  font-weight:500!important;
}
html[data-ala-theme] body.premium-ui-v2 .crm-window-controls>button.crm-window-control:hover{
  background:var(--ala-hover)!important;
  color:var(--ala-text)!important;
}
html[data-ala-theme] body.premium-ui-v2 .crm-window-controls>button.crm-window-control:active{
  transform:translateY(1px)!important;
}
html[data-ala-theme] body.premium-ui-v2 .crm-window-controls>button.crm-window-control:focus-visible{
  outline:2px solid var(--ala-focus)!important;
  outline-offset:2px!important;
}
html[data-ala-theme] body.premium-ui-v2 .crm-window-control svg{
  display:block!important;
  width:17px!important;
  height:17px!important;
}
html[data-ala-theme] body.premium-ui-v2 #controlDrill .control-drill-panel.crm-window-maximized{
  box-sizing:border-box!important;
  position:fixed!important;
  inset:8px!important;
  width:auto!important;
  max-width:none!important;
  height:auto!important;
  max-height:none!important;
  margin:0!important;
  border-radius:12px!important;
  transform:none!important;
  overflow:hidden!important;
}
html[data-ala-theme] body.premium-ui-v2 #controlDrill .control-drill-panel.crm-window-maximized .control-drill-body{
  min-height:0!important;
  overflow:auto!important;
}

/* PR8 compatibility contract: all close affordances share the same optical box. */
html[data-ala-theme] body.premium-ui-v2 :is(.modalClose,.crm-window-close,.ux-window-close){
  box-sizing:border-box!important;
  display:inline-grid!important;
  place-items:center!important;
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  min-height:36px!important;
  padding:0!important;
  line-height:1!important;
}
html[data-ala-theme] body.premium-ui-v2 :is(.modalClose,.crm-window-close,.ux-window-close):active{
  transform:translateY(1px)!important;
}
html[data-ala-theme] body.premium-ui-v2 :is(.modalClose,.crm-window-close,.ux-window-close):focus-visible{
  outline:2px solid var(--ala-focus)!important;
  outline-offset:2px!important;
}

/* UX-C05 · Cursor semántico: sólo superficies realmente interactivas. */
html[data-ala-theme] body.premium-ui-v2 :where(
  button:not(:disabled),
  select:not(:disabled),
  summary,
  a[href],
  [role="button"]:not([aria-disabled="true"]),
  [onclick]:not([aria-disabled="true"]),
  input[type="checkbox"]:not(:disabled),
  input[type="radio"]:not(:disabled),
  input[type="range"]:not(:disabled)
){
  cursor:pointer!important;
}
html[data-ala-theme] body.premium-ui-v2 :where(
  button:disabled,
  select:disabled,
  input[type="checkbox"]:disabled,
  input[type="radio"]:disabled,
  [aria-disabled="true"]
){
  cursor:not-allowed!important;
}
html[data-ala-theme] body.premium-ui-v2 :where(
  textarea,
  [contenteditable="true"],
  input:not([type]),
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  input[type="url"]
):not(:disabled){
  cursor:text!important;
}
html[data-ala-theme] body.premium-ui-v2 label:has(input[type="checkbox"]:not(:disabled)),
html[data-ala-theme] body.premium-ui-v2 label:has(input[type="radio"]:not(:disabled)){
  cursor:pointer!important;
}

/* UX-C06 · Detalles ejecutivos: botoneras consistentes y sin márgenes legacy. */
html[data-ala-theme] body.premium-ui-v2 #controlDrill .control-drill-actions{
  box-sizing:border-box!important;
  min-width:196px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  white-space:normal!important;
}
html[data-ala-theme] body.premium-ui-v2 #controlDrill .control-drill-actions .control-action-btn{
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:1 1 88px!important;
  min-width:88px!important;
  min-height:36px!important;
  margin:0!important;
  padding:7px 10px!important;
  line-height:20px!important;
  white-space:nowrap!important;
}

@media(max-width:700px){
  html[data-ala-theme] body.premium-ui-v2>.ala-kanban-viewport-nav.opp-bottom-nav{
    left:12px!important;
    right:12px!important;
    bottom:10px!important;
    height:42px!important;
  }
  html[data-ala-theme] body.premium-ui-v2 #controlDrill .control-drill-filters{
    padding:8px 14px!important;
  }
  html[data-ala-theme] body.premium-ui-v2 #controlDrill .meeting-drill-filters{
    width:100%;
    margin-left:0!important;
  }
  html[data-ala-theme] body.premium-ui-v2 #controlDrill .meeting-drill-filters .btn{
    flex:1 1 132px;
  }
  html[data-ala-theme] body.premium-ui-v2 #controlDrill .control-drill-actions{
    min-width:170px!important;
    gap:6px!important;
  }
}
