/* P28.6: evita que dropdowns de empresas sejam cortados por tabelas e modais com scroll. */
.company-search { min-width:0; }
.company-search > .company-search-list.company-search-global-open {
  position:fixed !important;
  z-index:2147483000 !important;
  margin:0;
  overflow-y:auto;
  overscroll-behavior:contain;
}
.company-search > .company-search-input { width:100%; }
.company-search > .company-search-input:disabled { opacity:.65; cursor:not-allowed; }
/* Em tabelas, não aumentar desnecessariamente a largura da célula. */
td .company-search { min-width:155px; }
@media (max-width:650px) {
 td .company-search {min-width:125px}
 .company-search > .company-search-list.company-search-global-open {max-width:calc(100vw - 8px)}
}

/* O Portal de Suporte usa variáveis de tema próprias, distintas da administração. */
#support-ticket-create-form .company-search > .company-search-input,
#support-ticket-create-form .company-search > .company-search-list {
  background:#202e43; color:var(--text,#f1f5fe); border-color:var(--line,#465872);
}
#support-ticket-create-form .company-search > .company-search-clear {color:var(--text,#f1f5fe)}
#support-ticket-create-form .company-search > .company-search-option,
#support-ticket-create-form .company-search > .company-search-list > .company-search-option {
  color:var(--text,#f1f5fe); background:transparent;
}
#support-ticket-create-form .company-search > .company-search-list > .company-search-option:hover,
#support-ticket-create-form .company-search > .company-search-list > .company-search-option.is-active {
  color:#f1f5fe; background:#324765;
}


/* P28.7: uniformiza a altura dos filtros na barra de Postos para coincidir com a caixa pesquisável de Empresa. */
#devices-section .endpoint-toolbar-controls .compact-field > select,
#devices-section .endpoint-list-head .device-page-size > select {
  min-height: 42px;
  height: 42px;
  padding-top: 10px;
  padding-bottom: 10px;
  line-height: 1.2;
}
#devices-section .endpoint-toolbar-controls .compact-field > .company-search,
#devices-section .endpoint-toolbar-controls .compact-field > .company-search > .company-search-input {
  min-height: 42px;
}

/* P28.7.1: campo de pesquisa da barra de Postos com 42 px, tal como os selects.
   Seletor limitado à listagem de Postos/Equipamentos; não altera outros formulários. */
#devices-section .endpoint-toolbar-controls > .endpoint-search {
  box-sizing: border-box;
  height: 42px;
  min-height: 42px;
}
#devices-section .endpoint-toolbar-controls > .endpoint-search > input#device-list-search {
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* RulNexo P28.8.2 — selector pesquisável + Guardar na ficha de Postos.
   O wrapper .company-search, criado dinamicamente pela P28.6, ocupa 100%
   por defeito, forçando Guardar a cair na linha seguinte. */
.device-company-card .device-company-controls {
  flex-wrap: nowrap;
  align-items: center;
}
.device-company-card .device-company-controls > .company-search {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
}
.device-company-card .device-company-controls > button[data-detail-company-save] {
  flex: 0 0 auto;
  align-self: center;
  margin: 0;
  min-height: 42px;
  height: 42px;
}
.device-company-card .device-company-controls > .company-search > .company-search-input {
  box-sizing: border-box;
  height: 42px;
  min-height: 42px;
  margin: 0 !important;
}
@media (max-width: 500px) {
  .device-company-card .device-company-controls { flex-wrap: wrap; }
  .device-company-card .device-company-controls > .company-search { flex-basis: 100%; }
  .device-company-card .device-company-controls > button[data-detail-company-save] { width: 100%; }
}
