/* Nota Smart Emissor: layouts responsivos de Empresas e Clientes.
   Corrige quebra prematura das 7 colunas da lista administrativa. */
#empresas .company-entry > div{min-width:0}
#empresas .company-entry .name-main,
#empresas .company-entry .name-sub,
#empresas .company-entry .value{overflow-wrap:anywhere}
#empresas .company-entry .company-pill{white-space:nowrap}
#empresas .company-entry .row-action-wrap{z-index:2}
#empresas .company-entry .row-action{cursor:pointer}

/* Uma única linha nas larguras usuais de notebook e desktop.
   Sobrescreve a grade de 4 colunas introduzida no admin_refresh. */
@media (min-width:1280px){
 #empresas .company-entry{
  grid-template-columns:minmax(190px,2.35fr) minmax(130px,1.25fr)
   minmax(118px,1.1fr) minmax(105px,1fr) minmax(150px,1.25fr)
   minmax(65px,.5fr) minmax(96px,.65fr)!important;
  gap:12px!important;min-height:94px!important;
  align-items:center!important;
 }
 #empresas .company-entry > div{grid-column:auto!important;grid-row:auto!important}
 #empresas .company-entry .row-action-wrap{justify-self:end!important}
}

/* Notebook estreito e janela redimensionada: duas linhas organizadas. */
@media (min-width:850px) and (max-width:1279px){
 #empresas .company-entry{
  grid-template-columns:repeat(12,minmax(0,1fr))!important;
  align-items:center!important;column-gap:12px!important;row-gap:16px!important;
  padding:17px 20px!important;
 }
 #empresas .company-entry > div:nth-child(1){grid-column:1 / span 5!important;grid-row:1}
 #empresas .company-entry > div:nth-child(2){grid-column:6 / span 4!important;grid-row:1}
 #empresas .company-entry > div:nth-child(3){grid-column:10 / span 3!important;grid-row:1}
 #empresas .company-entry > div:nth-child(4){grid-column:1 / span 3!important;grid-row:2}
 #empresas .company-entry > div:nth-child(5){grid-column:4 / span 5!important;grid-row:2}
 #empresas .company-entry > div:nth-child(6){grid-column:9 / span 2!important;grid-row:2}
 #empresas .company-entry > div:nth-child(7){grid-column:11 / span 2!important;grid-row:2;justify-self:end!important}
}

/* Tablet: nome em destaque, pares de campos e ações lado a lado. */
@media (min-width:501px) and (max-width:849px){
 #empresas .company-entry{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  row-gap:14px!important;column-gap:18px!important;
  padding:15px!important;
 }
 #empresas .company-entry > div:nth-child(1){grid-column:1/-1!important;grid-row:1}
 #empresas .company-entry > div:nth-child(2){grid-column:1!important;grid-row:2}
 #empresas .company-entry > div:nth-child(3){grid-column:2!important;grid-row:2}
 #empresas .company-entry > div:nth-child(4){grid-column:1!important;grid-row:3}
 #empresas .company-entry > div:nth-child(5){grid-column:2!important;grid-row:3}
 #empresas .company-entry > div:nth-child(6){grid-column:1!important;grid-row:4}
 #empresas .company-entry > div:nth-child(7){grid-column:2!important;grid-row:4;justify-self:end!important}
}
@media (max-width:500px){
 #empresas .company-entry{
  grid-template-columns:minmax(0,1fr)!important;
  gap:12px!important;padding:15px!important;
 }
 #empresas .company-entry > div{grid-column:1/-1!important;grid-row:auto!important}
 #empresas .company-entry .row-action-wrap{justify-self:start!important}
}

/* Listagem interna de clientes: status e ações mantidos juntos. */
@media (min-width:601px) and (max-width:1080px){
 .reg-workspace .reg-record[data-reg-kind="clientes"]{
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  gap:12px 15px!important;align-items:center!important;
 }
 .reg-workspace .reg-record[data-reg-kind="clientes"] > .reg-record-cell:nth-child(1){grid-column:1 / span 2!important;grid-row:1!important}
 .reg-workspace .reg-record[data-reg-kind="clientes"] > .reg-record-cell:nth-child(2){grid-column:3 / span 4!important;grid-row:1!important}
 .reg-workspace .reg-record[data-reg-kind="clientes"] > .reg-record-cell:nth-child(3){grid-column:1 / span 3!important;grid-row:2!important}
 .reg-workspace .reg-record[data-reg-kind="clientes"] > .reg-record-cell:nth-child(4){grid-column:4 / span 3!important;grid-row:2!important}
 .reg-workspace .reg-record[data-reg-kind="clientes"] > .reg-record-cell:nth-child(5){grid-column:1 / span 2!important;grid-row:3!important}
 .reg-workspace .reg-record[data-reg-kind="clientes"] > .reg-pill{grid-column:3 / span 2!important;grid-row:3!important;justify-self:start!important}
 .reg-workspace .reg-record[data-reg-kind="clientes"] > .reg-row-actions{grid-column:5 / span 2!important;grid-row:3!important;justify-self:end!important}
}
@media (max-width:600px){
 .reg-workspace .reg-record[data-reg-kind="clientes"]{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:13px!important;
 }
 .reg-workspace .reg-record[data-reg-kind="clientes"] > .reg-record-cell{grid-row:auto!important;grid-column:auto!important}
 .reg-workspace .reg-record[data-reg-kind="clientes"] > .reg-record-cell:nth-child(2){grid-column:1/-1!important;grid-row:1!important}
 .reg-workspace .reg-record[data-reg-kind="clientes"] > .reg-record-cell:nth-child(1){grid-column:1!important;grid-row:2!important}
 .reg-workspace .reg-record[data-reg-kind="clientes"] > .reg-record-cell:nth-child(3){grid-column:2!important;grid-row:2!important}
 .reg-workspace .reg-record[data-reg-kind="clientes"] > .reg-record-cell:nth-child(4){grid-column:1/-1!important;grid-row:3!important}
 .reg-workspace .reg-record[data-reg-kind="clientes"] > .reg-record-cell:nth-child(5){grid-column:1!important;grid-row:4!important}
 .reg-workspace .reg-record[data-reg-kind="clientes"] > .reg-pill{grid-column:2!important;grid-row:4!important;justify-self:end!important}
 .reg-workspace .reg-record[data-reg-kind="clientes"] > .reg-row-actions{grid-column:1/-1!important;grid-row:5!important;justify-self:end!important}
}

/* Paginação legível mesmo quando faltam pixels horizontais. */
#empresas .large-pager{justify-content:flex-end!important;flex-wrap:wrap!important;gap:9px 12px!important}
#empresas .large-pager > span{white-space:nowrap}
@media (max-width:850px){
 #empresas .toolbar-end{flex-wrap:wrap;justify-content:flex-end}
 #empresas .large-pager{justify-content:flex-end!important}
}
