/* =========================================================
   FRETE+PRO 3.9.5 - REPRESENTANTE MOBILE-FIRST
   Ajuste final para celular + contraste da seleção de clientes.
========================================================= */

/* Portal do representante sempre no padrão claro institucional */
body.perfil-representante,
body.perfil-representante .app,
body.perfil-representante .main,
body.perfil-representante .content,
body.perfil-representante #conteudoPrincipal{
  background:var(--fv-bg,#f6f4ee)!important;
  color:var(--fv-text,#232823)!important;
}

body.perfil-representante .rep-mobile-content{
  width:100%!important;
  max-width:1080px!important;
  margin:0 auto!important;
  padding:18px 20px 28px!important;
}

body.perfil-representante .rep-mobile-kicker{
  color:var(--fv-green,#53673f)!important;
  font-size:10px!important;
  font-weight:900!important;
  letter-spacing:.11em!important;
}

body.perfil-representante .rep-mobile-nova{
  width:100%!important;
  min-height:64px!important;
  padding:12px 14px!important;
  display:grid!important;
  grid-template-columns:40px minmax(0,1fr) auto!important;
  gap:11px!important;
  align-items:center!important;
  border:1px solid #60764a!important;
  border-radius:11px!important;
  background:var(--fv-green,#53673f)!important;
  color:#fff!important;
  box-shadow:none!important;
}
body.perfil-representante .rep-mobile-nova>span{
  width:40px!important;height:40px!important;border-radius:9px!important;
  display:grid!important;place-items:center!important;
  background:rgba(255,255,255,.14)!important;color:#fff!important;font-size:25px!important;
}
body.perfil-representante .rep-mobile-nova b{font-size:15px!important;color:#fff!important;line-height:1.2!important}
body.perfil-representante .rep-mobile-nova small{font-size:11px!important;color:#eef4e8!important;opacity:1!important;white-space:nowrap!important}

body.perfil-representante .rep-mobile-list-head{
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  gap:10px!important;margin:16px 0 10px!important;
}
body.perfil-representante .rep-mobile-list-head h2{font-size:17px!important;color:var(--fv-text,#232823)!important;margin:0 0 2px!important}
body.perfil-representante .rep-mobile-list-head p{font-size:12px!important;color:var(--fv-muted,#737b73)!important;margin:0!important}
body.perfil-representante .rep-mobile-filter-btn{
  min-height:38px!important;padding:7px 11px!important;border:1px solid var(--fv-border-2,#cfc9bd)!important;
  border-radius:8px!important;background:#fff!important;color:#394239!important;font-size:12px!important;font-weight:700!important;
}
body.perfil-representante .rep-mobile-filtros{
  display:grid!important;grid-template-columns:1fr!important;gap:8px!important;margin:0 0 10px!important;padding:10px!important;
  border:1px solid var(--fv-border,#ddd9cf)!important;border-radius:10px!important;background:#fff!important;
}
body.perfil-representante .rep-mobile-filtros[hidden]{display:none!important}
body.perfil-representante .rep-mobile-filtros input{
  width:100%!important;min-height:44px!important;background:#fff!important;color:#252b25!important;-webkit-text-fill-color:#252b25!important;
  border:1px solid #cfc9bd!important;border-radius:8px!important;padding:0 12px!important;font-size:14px!important;
}

body.perfil-representante .rep-mobile-fretes{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
body.perfil-representante .rep-mobile-frete-card{
  min-width:0!important;padding:14px!important;border:1px solid var(--fv-border,#ddd9cf)!important;border-radius:11px!important;
  background:#fff!important;color:var(--fv-text,#232823)!important;box-shadow:0 2px 8px rgba(50,55,48,.04)!important;
}
body.perfil-representante .rep-mobile-frete-top{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:10px!important}
body.perfil-representante .rep-mobile-pedido{font-size:10px!important;font-weight:850!important;color:var(--fv-green,#53673f)!important;letter-spacing:.04em!important}
body.perfil-representante .rep-mobile-frete-card h3{margin:4px 0 0!important;color:#202620!important;font-size:15px!important;line-height:1.25!important;overflow-wrap:anywhere!important}
body.perfil-representante .rep-mobile-status{
  max-width:150px!important;padding:5px 8px!important;border-radius:999px!important;background:#f0f1ed!important;color:#505850!important;
  font-size:10px!important;font-weight:800!important;line-height:1.2!important;border:1px solid #e0e2dc!important;
}
body.perfil-representante .rep-mobile-status.ok{background:#edf5ef!important;color:#3e6748!important;border-color:#d5e7d8!important}
body.perfil-representante .rep-mobile-status.atencao{background:#f8f0df!important;color:#7a632d!important;border-color:#eadab2!important}
body.perfil-representante .rep-mobile-status.andamento{background:#edf1e8!important;color:#4d633b!important;border-color:#dbe4d3!important}
body.perfil-representante .rep-mobile-destino{margin:11px 0!important;color:#4d554d!important;font-size:12.5px!important;line-height:1.4!important}
body.perfil-representante .rep-mobile-destino small{color:#697269!important;font-size:11px!important}
body.perfil-representante .rep-mobile-meta{display:flex!important;flex-wrap:wrap!important;gap:6px!important}
body.perfil-representante .rep-mobile-meta span{
  padding:6px 8px!important;background:#f8f7f3!important;border:1px solid #e4e0d7!important;border-radius:7px!important;
  color:#687068!important;font-size:10.5px!important;
}
body.perfil-representante .rep-mobile-meta b{color:#283028!important;font-weight:800!important}
body.perfil-representante .rep-mobile-card-actions{display:flex!important;justify-content:flex-end!important;gap:7px!important;margin-top:12px!important}
body.perfil-representante .rep-mobile-card-actions button{min-height:38px!important;padding:7px 11px!important;font-size:12px!important}
body.perfil-representante .rep-mobile-empty,
body.perfil-representante .rep-mobile-loading{
  grid-column:1/-1!important;padding:24px 14px!important;border:1px dashed #cfc9bd!important;border-radius:10px!important;
  background:#fff!important;color:#6f776f!important;text-align:center!important;
}

/* Busca e seleção de clientes: remover azul e garantir contraste */
body.perfil-representante .solicitacao-cliente-wrap .cliente-sugestoes,
body.perfil-representante .cliente-sugestoes{
  z-index:2200!important;max-height:min(330px,45vh)!important;overflow-y:auto!important;
  border:1px solid #cfc9bd!important;border-radius:9px!important;background:#fff!important;
  box-shadow:0 10px 24px rgba(50,55,48,.12)!important;
}
body.perfil-representante .cliente-sugestao-item{
  min-height:58px!important;padding:10px 12px!important;display:flex!important;flex-direction:column!important;align-items:flex-start!important;
  gap:3px!important;border:0!important;border-bottom:1px solid #ece8df!important;border-radius:0!important;
  background:#fff!important;color:#232823!important;-webkit-text-fill-color:#232823!important;text-align:left!important;
}
body.perfil-representante .cliente-sugestao-item:last-child{border-bottom:0!important}
body.perfil-representante .cliente-sugestao-item:hover,
body.perfil-representante .cliente-sugestao-item:focus{
  background:#edf1e8!important;color:#232823!important;outline:none!important;
}
body.perfil-representante .cliente-sugestao-item strong{
  color:#202620!important;-webkit-text-fill-color:#202620!important;font-size:14px!important;font-weight:800!important;line-height:1.3!important;
}
body.perfil-representante .cliente-sugestao-item span{
  color:#687068!important;-webkit-text-fill-color:#687068!important;font-size:11.5px!important;opacity:1!important;line-height:1.35!important;
}
body.perfil-representante .cliente-sugestao-vazio{padding:13px!important;background:#fff!important;color:#687068!important;opacity:1!important}
body.perfil-representante .cliente-status{color:#6b736b!important;opacity:1!important;font-size:11.5px!important}
body.perfil-representante .cliente-selecionado-card{
  margin-top:9px!important;padding:12px!important;border:1px solid #d7dfcf!important;border-radius:9px!important;
  background:#f5f7f1!important;color:#232823!important;box-shadow:none!important;
}
body.perfil-representante .cliente-selecionado-card strong,
body.perfil-representante .cliente-selecionado-card span,
body.perfil-representante .cliente-selecionado-dados{color:#303730!important;-webkit-text-fill-color:#303730!important;opacity:1!important}
body.perfil-representante .cliente-trocar-btn{background:#fff!important;color:#455345!important;border-color:#cfd7c9!important}
body.perfil-representante .cliente-selecionado-aviso.completo{color:#476950!important}
body.perfil-representante .cliente-selecionado-aviso.incompleto{color:#8a6a28!important}

/* Nova cotação em telas pequenas */
@media(max-width:720px){
  body.perfil-representante .app{display:block!important;padding-bottom:74px!important}
  body.perfil-representante .main{width:100%!important;min-width:0!important}
  body.perfil-representante .content{padding:12px!important}

  body.perfil-representante .topbar.rep-mobile-topbar{
    min-height:auto!important;padding:12px 13px!important;background:#fff!important;border-bottom:1px solid var(--fv-border,#ddd9cf)!important;
    align-items:flex-start!important;
  }
  body.perfil-representante .rep-mobile-boasvindas{min-width:0!important}
  body.perfil-representante .rep-mobile-boasvindas h1{font-size:21px!important;line-height:1.14!important;margin:0!important;overflow-wrap:anywhere!important}
  body.perfil-representante .rep-mobile-boasvindas p{font-size:11.5px!important;line-height:1.35!important;margin-top:4px!important}
  body.perfil-representante .rep-mobile-topbar .user{display:none!important}

  body.perfil-representante .rep-mobile-content{max-width:none!important;padding:11px 10px 20px!important}
  body.perfil-representante .rep-mobile-nova{
    position:static!important;min-height:56px!important;padding:9px 10px!important;grid-template-columns:36px minmax(0,1fr)!important;border-radius:9px!important;
  }
  body.perfil-representante .rep-mobile-nova>span{width:36px!important;height:36px!important;font-size:21px!important}
  body.perfil-representante .rep-mobile-nova b{font-size:14px!important}
  body.perfil-representante .rep-mobile-nova small{display:none!important}
  body.perfil-representante .rep-mobile-list-head{margin:13px 0 8px!important}
  body.perfil-representante .rep-mobile-list-head h2{font-size:16px!important}

  body.perfil-representante .rep-mobile-fretes{grid-template-columns:1fr!important;gap:8px!important}
  body.perfil-representante .rep-mobile-frete-card{padding:12px!important;border-radius:9px!important}
  body.perfil-representante .rep-mobile-frete-top{flex-direction:row!important;gap:8px!important}
  body.perfil-representante .rep-mobile-status{max-width:42%!important;flex:0 0 auto!important}
  body.perfil-representante .rep-mobile-meta{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important}
  body.perfil-representante .rep-mobile-meta span{min-width:0!important;overflow-wrap:anywhere!important}
  body.perfil-representante .rep-mobile-card-actions{display:grid!important;grid-template-columns:1fr!important}
  body.perfil-representante .rep-mobile-card-actions button{width:100%!important;min-height:44px!important}

  /* Menu inferior do representante: sete filas navegáveis, sem esmagar os textos */
  body.perfil-representante .sidebar{
    position:fixed!important;z-index:1500!important;left:0!important;right:0!important;bottom:0!important;top:auto!important;
    width:100%!important;height:66px!important;padding:5px 6px!important;background:#fff!important;border:0!important;border-top:1px solid #d9d6cd!important;
    box-shadow:0 -4px 14px rgba(50,55,48,.07)!important;overflow:hidden!important;
  }
  body.perfil-representante .sidebar .logo,
  body.perfil-representante .sidebar .menu-separador,
  body.perfil-representante #btnLogoutFreteMais{display:none!important}
  body.perfil-representante .sidebar nav{
    height:100%!important;display:flex!important;flex-direction:row!important;align-items:stretch!important;justify-content:flex-start!important;
    gap:3px!important;overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:none!important;-webkit-overflow-scrolling:touch!important;
  }
  body.perfil-representante .sidebar nav::-webkit-scrollbar{display:none!important}
  body.perfil-representante .sidebar .menu-item{
    display:flex!important;flex:0 0 78px!important;min-width:78px!important;max-width:78px!important;height:54px!important;min-height:54px!important;
    padding:5px 3px!important;border-radius:8px!important;flex-direction:column!important;justify-content:center!important;align-items:center!important;gap:2px!important;
    background:transparent!important;color:#606860!important;box-shadow:none!important;
  }
  body.perfil-representante .sidebar .menu-item[style*="display: none"]{display:none!important}
  body.perfil-representante .sidebar .menu-item svg{width:17px!important;height:17px!important;stroke:#6f776f!important}
  body.perfil-representante .sidebar .menu-item span{
    display:block!important;width:100%!important;max-width:74px!important;font-size:8.5px!important;line-height:1.1!important;font-weight:700!important;
    white-space:normal!important;text-align:center!important;overflow:visible!important;text-overflow:clip!important;
  }
  body.perfil-representante .sidebar .menu-item.active{background:#edf1e8!important;color:#35462f!important;box-shadow:none!important}
  body.perfil-representante .sidebar .menu-item.active svg{stroke:#53673f!important}

  /* Wizard da solicitação claro e compacto */
  body.perfil-representante .solicitacao-card.rep-wizard-card{padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important}
  body.perfil-representante .rep-wizard-progress{
    display:grid!important;grid-template-columns:repeat(4,1fr)!important;gap:4px!important;position:sticky!important;top:4px!important;z-index:30!important;
    margin:0 0 10px!important;padding:6px!important;background:#fff!important;border:1px solid #ddd9cf!important;border-radius:9px!important;
  }
  body.perfil-representante .rep-wizard-dot{min-height:31px!important;border-radius:7px!important;background:#f2f1ec!important;color:#697069!important;font-size:10px!important}
  body.perfil-representante .rep-wizard-dot.ativo{background:#53673f!important;color:#fff!important}
  body.perfil-representante .rep-wizard-dot.concluido{background:#edf1e8!important;color:#435538!important}
  body.perfil-representante .rep-wizard-card .form-section,
  body.perfil-representante .rep-wizard-card .rep-antt-card{
    margin:0!important;padding:12px!important;border:1px solid #ddd9cf!important;border-radius:10px!important;background:#fff!important;box-shadow:none!important;
  }
  body.perfil-representante .rep-wizard-card .form-grid{grid-template-columns:1fr!important;gap:10px!important}
  body.perfil-representante .rep-wizard-card input,
  body.perfil-representante .rep-wizard-card select,
  body.perfil-representante .rep-wizard-card textarea{
    width:100%!important;min-width:0!important;min-height:46px!important;font-size:16px!important;background:#fff!important;color:#232823!important;-webkit-text-fill-color:#232823!important;
    border:1px solid #cfc9bd!important;border-radius:8px!important;
  }
  body.perfil-representante .rep-wizard-card textarea{min-height:90px!important}
  body.perfil-representante .rep-wizard-mobile-actions{
    display:flex!important;position:sticky!important;bottom:72px!important;z-index:25!important;gap:7px!important;margin-top:9px!important;padding:7px!important;
    background:rgba(255,255,255,.97)!important;border:1px solid #ddd9cf!important;border-radius:9px!important;box-shadow:0 4px 12px rgba(50,55,48,.08)!important;
  }
  body.perfil-representante .rep-wizard-mobile-actions button{flex:1!important;min-height:44px!important}

  body.perfil-representante .solicitacao-cliente-wrap .cliente-sugestoes{top:calc(100% - 17px)!important;max-height:42vh!important}
  body.perfil-representante .cliente-sugestao-item{min-height:56px!important;padding:9px 10px!important}
}

@media(max-width:390px){
  body.perfil-representante .rep-mobile-frete-top{flex-direction:column!important}
  body.perfil-representante .rep-mobile-status{max-width:100%!important;width:auto!important}
  body.perfil-representante .rep-mobile-meta{grid-template-columns:1fr!important}
  body.perfil-representante .rep-mobile-boasvindas h1{font-size:19px!important}
}

/* =====================================================
   FRETE+PRO 4.3.3.25 - MENU MOBILE REPRESENTANTE ESTAVEL
   Todas as 7 etapas ficam visiveis e clicaveis, sem rolagem horizontal.
===================================================== */
@media (max-width:720px){
  body.perfil-representante .app{
    padding-bottom:126px!important;
  }

  body.perfil-representante .sidebar{
    height:118px!important;
    padding:6px 7px calc(6px + env(safe-area-inset-bottom,0px))!important;
    overflow:visible!important;
  }

  body.perfil-representante .sidebar nav{
    width:100%!important;
    height:100%!important;
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    gap:4px!important;
    overflow:visible!important;
    align-items:stretch!important;
  }

  body.perfil-representante .sidebar .menu-item{
    display:flex!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    min-height:0!important;
    padding:5px 3px!important;
    touch-action:manipulation!important;
    -webkit-tap-highlight-color:rgba(83,103,63,.14)!important;
  }

  body.perfil-representante .sidebar .menu-item[style*="display: none"]{
    display:none!important;
  }

  body.perfil-representante .sidebar .menu-item span{
    font-size:8.5px!important;
    line-height:1.05!important;
    white-space:normal!important;
  }

  body.perfil-representante .rep-wizard-mobile-actions{
    bottom:126px!important;
  }
}

/* 4.3.3.27: no perfil Representante, nunca exibir menus de outros perfis.
   Esta regra evita que display:flex!important do layout mobile ressuscite
   os itens da Balança/Transporte que nasceram ocultos no HTML. */
body.perfil-representante .sidebar .menu-item:not(.menu-representante-etapa){
  display:none!important;
}
body.perfil-representante .sidebar .menu-representante-etapa{
  display:flex!important;
}
