/* =========================================================
   EU CIDADÃO - TRAVA FINAL DE LOGOS
   Carregado por último.
   NÃO mexe em Font Awesome, botões, campos ou banco.
========================================================= */

/* Topo: qualquer logo/imagem dentro da marca nunca pode estourar */
.top .logo,
.top .ec-top-brand{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:hidden !important;
  max-height:58px !important;
}

.top .logo img,
.top .ec-top-brand img,
.top .ec-platform-logo img,
.top .ec-citizen-top-logo img{
  display:block !important;
  object-fit:contain !important;
  width:100% !important;
  height:100% !important;
  max-width:100% !important;
  max-height:100% !important;
}

/* Logo da plataforma no topo */
.top .ec-platform-logo{
  width:154px !important;
  height:46px !important;
  min-width:154px !important;
  max-width:154px !important;
  min-height:46px !important;
  max-height:46px !important;
  padding:7px 12px !important;
  border-radius:14px !important;
  background:#fff !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}

/* Cidadão: logo pequena no topo */
.top .ec-citizen-top-brand{
  width:96px !important;
  min-width:96px !important;
  max-width:96px !important;
  height:52px !important;
  min-height:52px !important;
  max-height:52px !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:2px !important;
}

.top .ec-citizen-top-logo{
  width:82px !important;
  height:38px !important;
  min-width:82px !important;
  max-width:82px !important;
  min-height:38px !important;
  max-height:38px !important;
  padding:6px !important;
  border-radius:10px !important;
  background:#fff !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}

/* Texto by */
.top .ec-citizen-by{
  height:10px !important;
  max-height:10px !important;
  overflow:hidden !important;
  font-size:8px !important;
  line-height:1 !important;
  white-space:nowrap !important;
}

/* Sidebar: card da Câmara/Entidade travado */
.sidebar .ec-sidebar-entity-logo,
.ec-mobile-drawer .ec-sidebar-entity-logo{
  width:100% !important;
  height:120px !important;
  min-height:120px !important;
  max-height:120px !important;
  padding:20px !important;
  border-radius:14px !important;
  background:#fff !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}

.sidebar .ec-sidebar-entity-logo img,
.ec-mobile-drawer .ec-sidebar-entity-logo img{
  display:block !important;
  width:100% !important;
  height:100% !important;
  max-width:100% !important;
  max-height:100% !important;
  object-fit:contain !important;
}

/* Sidebar: logo da plataforma travada */
.sidebar .ec-sidebar-platform-only,
.ec-mobile-drawer .ec-sidebar-platform-only{
  width:100% !important;
  height:104px !important;
  min-height:104px !important;
  max-height:104px !important;
  padding:16px !important;
  border-radius:14px !important;
  background:#fff !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}

.sidebar .ec-sidebar-platform-only .ec-platform-logo,
.ec-mobile-drawer .ec-sidebar-platform-only .ec-platform-logo{
  width:150px !important;
  height:78px !important;
  min-width:150px !important;
  max-width:150px !important;
  min-height:78px !important;
  max-height:78px !important;
  padding:12px !important;
  box-shadow:none !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}

/* Admin Master: preview da logo nunca estoura */
.admin-main .platform-logo-card{
  overflow:hidden !important;
}

.admin-main .platform-logo-form{
  display:flex !important;
  align-items:center !important;
  gap:18px !important;
  flex-wrap:wrap !important;
  overflow:hidden !important;
}

.admin-main .platform-logo-preview{
  width:150px !important;
  height:104px !important;
  min-width:150px !important;
  max-width:150px !important;
  min-height:104px !important;
  max-height:104px !important;
  padding:16px !important;
  border-radius:16px !important;
  background:#fff !important;
  border:1px solid #dbeafe !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  flex:0 0 150px !important;
}

.admin-main .platform-logo-preview img{
  display:block !important;
  width:100% !important;
  height:100% !important;
  max-width:100% !important;
  max-height:100% !important;
  object-fit:contain !important;
}

/* Proteção geral: imagens de logos em uploads dentro da interface */
.top img[src*="uploads/plataforma"],
.top img[src*="uploads/entidades"],
.sidebar img[src*="uploads/plataforma"],
.sidebar img[src*="uploads/entidades"],
.admin-main .platform-logo-card img[src*="uploads/plataforma"],
.admin-main .platform-logo-card img[src*="uploads/entidades"]{
  object-fit:contain !important;
}

/* Mobile */
@media(max-width:900px){
  .top .ec-platform-logo{
    width:112px !important;
    height:38px !important;
    min-width:112px !important;
    max-width:112px !important;
    min-height:38px !important;
    max-height:38px !important;
    padding:6px 10px !important;
  }

  .top .ec-citizen-top-brand{
    width:74px !important;
    min-width:74px !important;
    max-width:74px !important;
    height:44px !important;
    min-height:44px !important;
    max-height:44px !important;
  }

  .top .ec-citizen-top-logo{
    width:62px !important;
    height:30px !important;
    min-width:62px !important;
    max-width:62px !important;
    min-height:30px !important;
    max-height:30px !important;
    padding:4px !important;
  }

  .top .ec-citizen-by{
    font-size:7px !important;
  }

  .sidebar .ec-sidebar-entity-logo,
  .ec-mobile-drawer .ec-sidebar-entity-logo{
    height:74px !important;
    min-height:74px !important;
    max-height:74px !important;
    padding:10px !important;
  }

  .sidebar .ec-sidebar-platform-only,
  .ec-mobile-drawer .ec-sidebar-platform-only{
    height:78px !important;
    min-height:78px !important;
    max-height:78px !important;
    padding:10px !important;
  }

  .admin-main .platform-logo-preview{
    width:120px !important;
    height:76px !important;
    min-width:120px !important;
    max-width:120px !important;
    min-height:76px !important;
    max-height:76px !important;
    flex:0 0 120px !important;
    padding:10px !important;
  }
}
