/* RBS Desk v1.8.18 — Sprint 14
   Portal do Cliente: Navigation Rail premium SOMENTE no desktop + correções responsivas de conteúdo no mobile.
   REGRA: a bottom-nav mobile NÃO é redesenhada nesta release. */

/* --------------------------------------------------------------------------
   DESKTOP — mesma linguagem visual da Navigation Rail da operação
   -------------------------------------------------------------------------- */
body.v1818-client-desktop-rail{
  overflow:hidden;
  background:#eef3f7;
}
body.v1818-client-desktop-rail .v1813-client-shell{
  display:grid!important;
  grid-template-columns:84px minmax(0,1fr)!important;
  height:100dvh!important;
  min-height:100dvh!important;
  overflow:hidden!important;
  background:#eef3f7!important;
}
body.v1818-client-desktop-rail .v1813-client-rail{
  display:flex!important;
  flex-direction:column!important;
  grid-column:1!important;
  grid-row:1!important;
  min-height:100dvh!important;
  padding:14px 10px 12px!important;
  overflow:hidden!important;
  border-right:0!important;
  color:#fff!important;
  background:linear-gradient(180deg,#0d2238 0%,#0d2946 58%,#102f50 100%)!important;
  box-shadow:10px 0 28px rgba(13,34,56,.08)!important;
}
body.v1818-client-desktop-rail .v1813-client-brand{
  display:grid!important;
  place-items:center!important;
  gap:0!important;
  padding:0 0 8px!important;
}
body.v1818-client-desktop-rail .v1813-client-brand>span{
  width:44px!important;
  height:44px!important;
  border-radius:13px!important;
  display:grid!important;
  place-items:center!important;
  background:linear-gradient(145deg,#155081,#2379b7)!important;
  color:#fff!important;
  box-shadow:0 8px 20px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.18)!important;
  font-size:14px!important;
  font-weight:900!important;
  letter-spacing:-.03em!important;
}
body.v1818-client-desktop-rail .v1813-client-brand>strong{display:none!important}
body.v1818-client-desktop-rail .v1813-client-rail nav{
  display:flex!important;
  flex-direction:column!important;
  gap:7px!important;
  width:100%!important;
  margin-top:8px!important;
}
body.v1818-client-desktop-rail .v1813-client-rail nav button,
body.v1818-client-desktop-rail .v1813-client-rail-foot>button{
  appearance:none!important;
  border:0!important;
  width:100%!important;
  min-height:58px!important;
  padding:6px 4px!important;
  border-radius:14px!important;
  background:transparent!important;
  color:#bfd0df!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:5px!important;
  font:inherit!important;
  font-size:10px!important;
  line-height:1.12!important;
  font-weight:750!important;
  text-align:center!important;
  transition:background .16s ease,color .16s ease,transform .16s ease,box-shadow .16s ease!important;
}
body.v1818-client-desktop-rail .v1813-client-rail nav button svg,
body.v1818-client-desktop-rail .v1813-client-rail-foot>button svg{
  width:21px!important;
  height:21px!important;
  flex:0 0 auto!important;
}
body.v1818-client-desktop-rail .v1813-client-rail nav button:hover,
body.v1818-client-desktop-rail .v1813-client-rail-foot>button:hover{
  background:rgba(255,255,255,.08)!important;
  color:#fff!important;
}
body.v1818-client-desktop-rail .v1813-client-rail nav button.active{
  background:linear-gradient(145deg,rgba(51,139,201,.34),rgba(255,255,255,.10))!important;
  color:#fff!important;
  box-shadow:inset 3px 0 0 #63b8ee,0 8px 18px rgba(0,0,0,.10)!important;
}
body.v1818-client-desktop-rail .v1813-client-rail nav button:active,
body.v1818-client-desktop-rail .v1813-client-rail-foot>button:active{transform:translateY(1px)!important}
body.v1818-client-desktop-rail .v1813-client-rail-foot{
  margin-top:auto!important;
  width:100%!important;
  display:grid!important;
  gap:7px!important;
  padding-top:12px!important;
}
body.v1818-client-desktop-rail .v1813-client-profile{min-height:58px!important}
body.v1818-client-desktop-rail .v1813-client-profile>.ow-avatar{
  width:36px!important;
  height:36px!important;
  border:2px solid rgba(255,255,255,.30)!important;
  box-shadow:0 4px 12px rgba(0,0,0,.16)!important;
}
body.v1818-client-desktop-rail .v1813-client-profile>span:last-child{display:none!important}
body.v1818-client-desktop-rail .v1813-client-stage{
  grid-column:2!important;
  grid-row:1!important;
  height:100dvh!important;
  min-width:0!important;
  min-height:0!important;
  overflow:hidden!important;
  background:#f4f7fa!important;
}
body.v1818-client-desktop-rail .v1813-client-topbar{
  height:68px!important;
  min-height:68px!important;
  flex:0 0 68px!important;
  display:flex!important;
  align-items:center!important;
  padding:0 22px!important;
  border-bottom:1px solid #dfe7ee!important;
  background:rgba(255,255,255,.94)!important;
  backdrop-filter:blur(18px)!important;
  -webkit-backdrop-filter:blur(18px)!important;
}
body.v1818-client-desktop-rail .v1813-mobile-brand{display:none!important}
body.v1818-client-desktop-rail .v1813-desktop-title{
  display:grid!important;
  gap:2px!important;
  min-width:0!important;
}
body.v1818-client-desktop-rail .v1813-desktop-title small{
  font-size:10px!important;
  font-weight:800!important;
  color:#718294!important;
  text-transform:uppercase!important;
  letter-spacing:.08em!important;
}
body.v1818-client-desktop-rail .v1813-desktop-title strong{
  font-size:18px!important;
  color:#102235!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
body.v1818-client-desktop-rail .v1813-client-search-top{display:grid!important}
body.v1818-client-desktop-rail .v1813-client-shell .topbar .avatar{
  width:42px!important;
  height:42px!important;
  border-radius:13px!important;
}
body.v1818-client-desktop-rail .v1813-client-shell .page{
  flex:1!important;
  min-width:0!important;
  min-height:0!important;
  width:100%!important;
  max-width:none!important;
  overflow:auto!important;
  padding:22px 28px 30px!important;
}
/* IMPORTANTE: a bottom-nav só é suprimida no modo desktop detectado. */
body.v1818-client-desktop-rail .v1813-client-mobile-nav{display:none!important}
body.v1818-client-desktop-rail .v1813-client-shell :where(.portal-home,.v186-portal-ticket,.portal-new,.kb-page-head,.kb-grid,.v1815-help-page){
  max-width:1240px;
  margin-left:auto;
  margin-right:auto;
}

/* --------------------------------------------------------------------------
   MOBILE — apenas correções de conteúdo/responsividade. A navegação permanece.
   -------------------------------------------------------------------------- */
@media (max-width:759px){
  body.portal-client,
  body.portal-client #app,
  body.portal-client .v1813-client-shell,
  body.portal-client .v1813-client-stage{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow-x:hidden!important;
  }

  /* Shell/content: espaço correto para safe-area e taskbar existente. */
  body.portal-client .v1813-client-topbar{
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    min-height:60px!important;
    padding:calc(env(safe-area-inset-top) + 8px) 12px 8px!important;
    gap:8px!important;
    background:rgba(248,250,252,.96)!important;
    border-bottom:1px solid rgba(215,226,235,.78)!important;
    backdrop-filter:blur(16px)!important;
    -webkit-backdrop-filter:blur(16px)!important;
  }
  body.portal-client .v1813-client-topbar .brand{min-width:0!important;gap:9px!important}
  body.portal-client .v1813-client-topbar .mark{width:40px!important;height:40px!important;border-radius:13px!important;flex:0 0 40px!important}
  body.portal-client .v1813-client-topbar .brand>div:last-child{min-width:0!important}
  body.portal-client .v1813-client-topbar .brand strong{font-size:18px!important;line-height:1.15!important;white-space:nowrap!important}
  body.portal-client .v1813-client-topbar .brand small{font-size:12px!important;line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  body.portal-client .v1813-client-top-actions{min-width:0!important;flex:0 0 auto!important}
  body.portal-client .v1813-client-shell .topbar .avatar{width:42px!important;height:42px!important;flex:0 0 42px!important}

  body.portal-client .v1813-client-stage>.page{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    padding:12px 12px calc(104px + env(safe-area-inset-bottom))!important;
    overflow-x:hidden!important;
  }

  /* Guardrails: componentes nunca atravessam o viewport. */
  body.portal-client .page :where(section,article,div,header,footer,form,fieldset,button,input,select,textarea){max-width:100%}
  body.portal-client .page :where(h1,h2,h3,h4,p,strong,small,span,label,a,b,em){overflow-wrap:anywhere}
  body.portal-client .page :where(.card,.section,.portal-hero,.portal-attention,.portal-recent,.portal-help-strip,
    .portal-ticket-card,.v186-portal-shortcuts>button,.kb-card,.v1815-help-card,.v1815-help-hero){min-width:0!important;width:100%!important}

  /* Home cliente: compacta e legível sem alterar a taskbar. */
  body.portal-client .v186-portal-home{gap:12px!important}
  body.portal-client .v186-portal-hero{
    padding:18px!important;
    border-radius:22px!important;
    gap:15px!important;
    grid-template-columns:minmax(0,1fr)!important;
  }
  body.portal-client .v186-hero-copy{display:grid!important;grid-template-columns:42px minmax(0,1fr)!important;gap:12px!important;min-width:0!important}
  body.portal-client .v186-hero-icon{width:42px!important;height:42px!important;border-radius:13px!important}
  body.portal-client .v186-portal-hero h1{font-size:clamp(25px,7.2vw,31px)!important;line-height:1.08!important;letter-spacing:-.035em!important;margin:4px 0 7px!important}
  body.portal-client .v186-portal-hero p{font-size:clamp(13px,3.7vw,16px)!important;line-height:1.48!important;overflow-wrap:normal!important;word-break:normal!important}
  body.portal-client .v186-portal-hero .eyebrow{font-size:11px!important;letter-spacing:.12em!important}
  body.portal-client .v186-hero-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
  }
  body.portal-client .v186-hero-actions .rbs-ui-btn{width:100%!important;min-width:0!important;min-height:48px!important;padding:9px 10px!important;font-size:13px!important;white-space:normal!important}

  body.portal-client .v186-portal-shortcuts{grid-template-columns:minmax(0,1fr)!important;gap:9px!important}
  body.portal-client .v186-portal-shortcuts>button{grid-template-columns:38px minmax(0,1fr) 18px!important;padding:12px!important;border-radius:16px!important}
  body.portal-client .v186-portal-shortcuts strong{font-size:13px!important;line-height:1.25!important}
  body.portal-client .v186-portal-shortcuts small{font-size:11px!important;line-height:1.3!important}

  body.portal-client .portal-home-grid.v186-stats{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:8px!important;
  }
  body.portal-client .v186-stats .portal-stat{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    align-content:start!important;
    gap:6px!important;
    padding:11px!important;
    min-height:116px!important;
    overflow:hidden!important;
  }
  body.portal-client .v186-stats .portal-stat-icon{width:34px!important;height:34px!important}
  body.portal-client .v186-stats .portal-stat strong{font-size:23px!important;line-height:1!important}
  body.portal-client .v186-stats .portal-stat small{font-size:11px!important;line-height:1.22!important;overflow-wrap:normal!important;word-break:normal!important}

  body.portal-client .portal-section-head{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;align-items:start!important}
  body.portal-client .portal-section-head h2{font-size:18px!important;line-height:1.2!important}
  body.portal-client .portal-kicker{font-size:10px!important;line-height:1.2!important}
  body.portal-client .v186-ticket-card{grid-template-columns:36px minmax(0,1fr) 18px!important;gap:9px!important;padding:12px!important;overflow:hidden!important}
  body.portal-client .v186-ticket-card-body{min-width:0!important;overflow:hidden!important}
  body.portal-client .v186-ticket-card-body>strong{font-size:13px!important;line-height:1.32!important;white-space:normal!important;overflow-wrap:anywhere!important}
  body.portal-client .v186-ticket-card-body>small{font-size:10px!important;line-height:1.35!important;white-space:normal!important;overflow-wrap:anywhere!important}
  body.portal-client .portal-ticket-top{min-width:0!important;flex-wrap:wrap!important;align-items:flex-start!important}
  body.portal-client .portal-ticket-top>*{min-width:0!important;max-width:100%!important}
  body.portal-client .portal-next-inline{min-width:0!important;flex-wrap:wrap!important}
  body.portal-client .v186-help-strip{grid-template-columns:38px minmax(0,1fr)!important;gap:10px!important;padding:13px!important}
  body.portal-client .v186-help-strip>.rbs-ui-btn{grid-column:1/-1!important;width:100%!important}

  /* Base de Conhecimento: título, filtros, chips e cards sem deformação. */
  body.portal-client .kb-page-head{margin:8px 0 14px!important}
  body.portal-client .kb-page-head h1{font-size:clamp(26px,7.4vw,32px)!important;line-height:1.1!important;letter-spacing:-.035em!important}
  body.portal-client .kb-page-head p{font-size:14px!important;line-height:1.48!important;overflow-wrap:normal!important;word-break:normal!important}
  body.portal-client .kb-search-row,
  body.portal-client .kb-search-row:has(#kbStatusFilter){grid-template-columns:minmax(0,1fr)!important;gap:8px!important;width:100%!important}
  body.portal-client .kb-search{width:100%!important;min-width:0!important;min-height:46px!important;padding:0 12px!important}
  body.portal-client .kb-search input{min-width:0!important;width:100%!important;font-size:16px!important}
  body.portal-client .kb-search-row select{width:100%!important;min-width:0!important;font-size:16px!important}
  body.portal-client .kb-category-chips{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-inline:contain!important;
    scrollbar-width:none!important;
    padding:2px 1px 7px!important;
    margin:0 0 11px!important;
  }
  body.portal-client .kb-category-chips::-webkit-scrollbar{display:none!important}
  body.portal-client .kb-category-chips button{flex:0 0 auto!important;max-width:78vw!important;padding:8px 11px!important;font-size:12px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  body.portal-client .kb-grid{grid-template-columns:minmax(0,1fr)!important;gap:10px!important;width:100%!important}
  body.portal-client .kb-card{padding:15px!important;border-radius:18px!important;overflow:hidden!important}
  body.portal-client .kb-card-top{min-width:0!important;flex-wrap:wrap!important}
  body.portal-client .kb-category{font-size:11px!important}
  body.portal-client .kb-card h3{font-size:18px!important;line-height:1.3!important;margin:8px 0 6px!important;white-space:normal!important;overflow-wrap:anywhere!important}
  body.portal-client .kb-card p{font-size:13px!important;line-height:1.5!important;white-space:normal!important;overflow-wrap:anywhere!important}
  body.portal-client .kb-card-meta{gap:6px!important}
  body.portal-client .kb-card-meta span{font-size:11px!important;max-width:100%!important;white-space:normal!important}

  /* Chamados, novo chamado e detalhes: grids viram uma coluna antes de esmagar texto. */
  body.portal-client :where(.portal-service-grid,.portal-choice-grid,.portal-review,.portal-ticket-grid){grid-template-columns:minmax(0,1fr)!important}
  body.portal-client .portal-service-card{grid-template-columns:40px minmax(0,1fr) 18px!important;padding:12px!important}
  body.portal-client .portal-service-card strong{font-size:13px!important;line-height:1.3!important}
  body.portal-client .portal-service-card small{font-size:11px!important;line-height:1.38!important}
  body.portal-client .portal-wizard-card{padding:15px!important}
  body.portal-client .portal-wizard-title h1{font-size:clamp(23px,6.5vw,28px)!important;line-height:1.12!important}
  body.portal-client .portal-stepper{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:4px!important;overflow:hidden!important}
  body.portal-client .portal-step span{font-size:9px!important;line-height:1.15!important;overflow-wrap:normal!important}
  body.portal-client .portal-ticket-header h1{font-size:clamp(23px,6.5vw,29px)!important;line-height:1.15!important;overflow-wrap:anywhere!important}
  body.portal-client .portal-sla-dates{grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important}
  body.portal-client .portal-sla-dates>span{min-width:0!important;padding:9px!important}
  body.portal-client .portal-message{grid-template-columns:32px minmax(0,1fr)!important;gap:8px!important;min-width:0!important}
  body.portal-client .portal-message>div:last-child{min-width:0!important;padding:10px!important}
  body.portal-client .portal-message header{flex-wrap:wrap!important;align-items:flex-start!important}
  body.portal-client .portal-message p{font-size:13px!important;line-height:1.5!important;overflow-wrap:anywhere!important}
  body.portal-client .portal-attachment-list>div{grid-template-columns:28px minmax(0,1fr)!important}
  body.portal-client .portal-attachment-list>div>a,
  body.portal-client .portal-attachment-list>div>span:last-child{grid-column:2!important;justify-self:start!important}

  /* Mais / Ajuda: cards flexíveis e CTAs em largura segura. */
  body.portal-client .more-grid,
  body.portal-client .v1813-client-more{grid-template-columns:minmax(0,1fr)!important}
  body.portal-client .hub-card{min-width:0!important;width:100%!important}
  body.portal-client .v1815-help-page{gap:12px!important;width:100%!important}
  body.portal-client .v1815-help-hero{padding:18px!important;border-radius:20px!important;gap:16px!important}
  body.portal-client .v1815-help-hero h1{font-size:clamp(25px,7vw,31px)!important;line-height:1.1!important}
  body.portal-client .v1815-help-hero p{font-size:13px!important;line-height:1.5!important}
  body.portal-client .v1815-help-hero-actions{display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;gap:8px!important}
  body.portal-client .v1815-help-hero-actions .btn{width:100%!important}
  body.portal-client .v1815-help-grid,
  body.portal-client .v1815-help-info-grid,
  body.portal-client .v1815-help-steps{grid-template-columns:minmax(0,1fr)!important}
  body.portal-client .v1815-help-card{grid-template-columns:40px minmax(0,1fr) 18px!important;gap:10px!important;padding:13px!important}
  body.portal-client .v1815-help-card strong{font-size:13px!important;line-height:1.3!important}
  body.portal-client .v1815-help-card small{font-size:11px!important;line-height:1.4!important}
}

@media (max-width:360px){
  body.portal-client .v186-hero-actions{grid-template-columns:minmax(0,1fr)!important}
  body.portal-client .portal-home-grid.v186-stats{grid-template-columns:minmax(0,1fr)!important}
  body.portal-client .v186-stats .portal-stat{min-height:0!important;grid-template-columns:34px minmax(0,1fr)!important;align-items:center!important}
}
