/* RS Connect Next V2 — 22/10/2026
 * Correções baseadas nos prints de homologação: Login, Dashboard, Conversas, menu.
 * Estilos limitados ao tema padrão; a aplicação e a marca branca continuam
 * dependentes de app.css. Carregar após rs-connect-next.css.
 */

/* 1. Hierarquia global: fontes, botões e superfícies */
body.rs-next-theme,
body.rs-next-login {
  --rs-next-primary: #6246ea;
  --rs-next-primary-hover: #5135cf;
  --rs-next-navy: #19213b;
  --rs-next-border: #e2e7f1;
  --rs-next-muted: #64738c;
}
body.rs-next-theme .page-content { padding: clamp(17px, 2.1vw, 30px) clamp(14px, 2.25vw, 32px) 44px !important; }
body.rs-next-theme .topbar-title-block .eyebrow { font-size: .68rem !important; letter-spacing: .09em !important; }
body.rs-next-theme .topbar-title-block h1 { font-size: clamp(1.25rem, 1.65vw, 1.6rem) !important; line-height: 1.23 !important; }
body.rs-next-theme .page-content .eyebrow { font-size: .68rem; font-weight: 800; letter-spacing: .09em; }
body.rs-next-theme .page-content .btn { min-height: 41px; padding: 9px 14px; font-size: .83rem; font-weight: 700; letter-spacing: 0; line-height: 1.3; text-align: center; white-space: normal; }
body.rs-next-theme :is(.rs-next-dashboard,.rs-next-conversations) .page-content .btn-primary { background:var(--rs-next-primary)!important; color:#fff!important; border-color:var(--rs-next-primary)!important; }
body.rs-next-theme :is(.rs-next-dashboard,.rs-next-conversations) .page-content :is(.btn-outline,.btn-quiet,.btn-secondary,.btn-soft) {
  background:#fff!important; color:#425371!important; border:1px solid #dbe2f0!important; box-shadow:none!important;
}
body.rs-next-theme :is(.rs-next-dashboard,.rs-next-conversations) .page-content :is(.btn-outline,.btn-quiet,.btn-secondary,.btn-soft):hover {
  background:#f5f2ff!important; border-color:#a99af6!important; color:#4d38c4!important;
}
body.rs-next-theme :is(.rs-next-dashboard,.rs-next-conversations) .page-content .btn:focus-visible { outline:3px solid rgba(98,70,234,.38); outline-offset:2px; }

/* 2. Navegação: acabamento, legibilidade, rolagem contida */
body.rs-next-theme .sidebar { min-width:0; overflow:hidden; padding: 18px 12px 14px!important; }
body.rs-next-theme .sidebar .brand { flex-shrink:0; padding:10px 9px 18px!important; gap:12px; }
body.rs-next-theme .sidebar .brand > span:last-child { min-width:0; }
body.rs-next-theme .sidebar .brand strong { font-size:1rem; letter-spacing:0; line-height:1.3; }
body.rs-next-theme .sidebar .brand small { font-size:.75rem; line-height:1.3; }
body.rs-next-theme .sidebar .brand-mark.rs-next-brand-mark { flex-basis:46px!important; width:46px!important; min-width:46px!important; height:46px!important; }
body.rs-next-theme .sidebar-nav {
  min-height:0; flex:1 1 auto; padding: 8px 6px 16px 3px; overflow-y:auto; overflow-x:hidden;
  scrollbar-width:thin; scrollbar-color:#506080 transparent; overscroll-behavior:contain;
}
body.rs-next-theme .sidebar-nav::-webkit-scrollbar { width:5px; }
body.rs-next-theme .sidebar-nav::-webkit-scrollbar-track { background:transparent; }
body.rs-next-theme .sidebar-nav::-webkit-scrollbar-thumb { background:#465578; border-radius:10px; }
body.rs-next-theme .sidebar .nav-link { min-width:0; min-height:40px; padding:9px 10px!important; font-size:.85rem; line-height:1.3; overflow-wrap:break-word; }
body.rs-next-theme .sidebar .nav-link .nav-icon { flex:0 0 19px; width:19px; height:19px; }
body.rs-next-theme .sidebar .nav-caption { margin:19px 12px 7px; }
body.rs-next-theme .sidebar .sidebar-footer { flex:0 0 auto; padding:13px 4px 0; gap:9px; }
body.rs-next-theme .sidebar .sidebar-footer :is(.user-mini,.logout-button) { max-width:100%; }

/* 3. Dashboard: o carimbo de atualização não pode ocupar a mesma linha dos CTAs */
body.rs-next-theme .rs-next-dashboard .admin-executive-hero {
  display:grid!important; grid-template-columns:minmax(0,1.3fr) minmax(290px,.95fr);
  grid-template-areas: "copy actions" "updated updated"; align-items:center; gap:15px 20px!important;
  padding:26px 28px 19px!important; margin-bottom:17px!important;
}
body.rs-next-theme .rs-next-dashboard .admin-executive-hero-copy { grid-area:copy; min-width:0; }
body.rs-next-theme .rs-next-dashboard .admin-executive-hero-copy h2 { max-width:690px; margin:7px 0 8px; font-size:clamp(1.7rem,2.5vw,2.25rem); line-height:1.16; letter-spacing:-.045em; }
body.rs-next-theme .rs-next-dashboard .admin-executive-hero-copy p { max-width:610px; font-size:.91rem; line-height:1.6; }
body.rs-next-theme .rs-next-dashboard .admin-executive-hero-actions {
  grid-area:actions; min-width:0; display:flex; flex-wrap:wrap; gap:9px!important; justify-content:flex-end; align-content:center;
}
body.rs-next-theme .rs-next-dashboard .admin-executive-hero-actions .btn { flex:0 1 auto; }
body.rs-next-theme .rs-next-dashboard .admin-dashboard-updated {
  grid-area:updated; position:static!important; justify-self:start; display:block; margin:0!important;
  padding-top:11px; width:100%; border-top:1px solid #e7e7f5; color:#67758f; font-size:.73rem; line-height:1.45;
}
body.rs-next-theme .rs-next-dashboard .admin-kpi-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
body.rs-next-theme .rs-next-dashboard .admin-kpi-card { min-height:112px; gap:14px; padding:19px; }
body.rs-next-theme .rs-next-dashboard .admin-kpi-card small { font-size:.71rem; letter-spacing:.06em; line-height:1.4; }
body.rs-next-theme .rs-next-dashboard .admin-kpi-card strong { font-size:clamp(1.6rem,2.15vw,2.05rem); line-height:1.2; }
body.rs-next-theme .rs-next-dashboard .admin-kpi-card em { font-size:.78rem; line-height:1.4; white-space:normal; text-overflow:clip; }
body.rs-next-theme .rs-next-dashboard .admin-quick-actions { padding:20px!important; }
body.rs-next-theme .rs-next-dashboard .admin-quick-action-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
body.rs-next-theme .rs-next-dashboard .admin-quick-action { align-content:start; min-height:92px; }
body.rs-next-theme .rs-next-dashboard .admin-quick-action small { white-space:normal; line-height:1.35; }

/* 4. Conversas: filtros de largura real, nunca comprimir campos até ficarem ilegíveis */
body.rs-next-theme .rs-next-conversations .conversation-filters {
  display:flex!important; align-items:center!important; flex-wrap:wrap!important; gap:9px!important;
  padding:13px!important; margin-bottom:16px!important; border-radius:16px!important;
  background:#fff!important; overflow:visible;
}
body.rs-next-theme .rs-next-conversations .conversation-filters .filter-search {
  flex:2 1 260px!important; min-width:min(250px,100%)!important; max-width:none!important; width:auto!important;
  min-height:43px; background:#f9fbff; border:1px solid #dbe2ef; border-radius:11px;
}
body.rs-next-theme .rs-next-conversations .conversation-filters .filter-search input {
  min-width:0; width:100%; font-size:.84rem; color:#263451;
}
body.rs-next-theme .rs-next-conversations .conversation-filters select {
  flex:1 1 155px!important; width:auto!important; min-width:155px!important; max-width:none!important;
  height:43px; min-height:43px; padding:8px 10px; background:#fff; border-radius:10px; border:1px solid #dbe2ef;
  color:#34435d; font-size:.84rem;
}
body.rs-next-theme .rs-next-conversations .conversation-filters > .btn {
  flex:0 0 auto!important; width:auto!important; min-width:82px; min-height:43px;
}
body.rs-next-theme .rs-next-conversations .conversation-filters > .btn-secondary {
  background:var(--rs-next-primary)!important; color:#fff!important; border-color:var(--rs-next-primary)!important;
}
body.rs-next-theme .rs-next-conversations .conversation-filters > .btn-secondary:hover { background:var(--rs-next-primary-hover)!important; }
body.rs-next-theme .rs-next-conversations .conversation-workspace {
  display:grid; grid-template-columns:minmax(330px,365px) minmax(0,1fr)!important;
  gap:14px!important; min-height:calc(100vh - 245px)!important; align-items:stretch;
}
body.rs-next-theme .rs-next-conversations .conversation-workspace > :is(.conversation-inbox,.conversation-chat) {
  min-width:0; border:1px solid var(--rs-next-border)!important; border-radius:17px!important;
  background:#fff!important; overflow:hidden;
}
body.rs-next-theme .rs-next-conversations .conversation-panel-heading {
  display:flex; flex-direction:column; align-items:stretch!important; gap:12px; padding:18px 17px!important;
  border-bottom:1px solid #e7ecf4; min-width:0;
}
body.rs-next-theme .rs-next-conversations .conversation-panel-heading > div:first-child { min-width:0; }
body.rs-next-theme .rs-next-conversations .conversation-panel-heading h2 { margin-top:4px; font-size:1.12rem!important; line-height:1.25; }
body.rs-next-theme .rs-next-conversations .conversation-heading-actions {
  display:flex; width:100%; max-width:100%; flex-wrap:wrap; justify-content:flex-start!important; align-items:center; gap:6px 7px;
}
body.rs-next-theme .rs-next-conversations .conversation-heading-actions :is(.conversation-queue-filter,.conversation-sla-risk-counter,.badge) {
  flex:0 0 auto; white-space:nowrap;
}
body.rs-next-theme .rs-next-conversations .conversation-heading-actions .badge { order:0!important; }
body.rs-next-theme .rs-next-conversations .conversation-heading-actions .btn { order:10; flex:0 0 auto; margin-left:auto; padding:7px 11px; min-height:33px; font-size:.76rem; }
body.rs-next-theme .rs-next-conversations .conversation-heading-actions :is(.conversation-queue-filter,.conversation-sla-risk-counter,.badge) { font-size:.73rem; }
body.rs-next-theme .rs-next-conversations .conversation-list { min-width:0; }
body.rs-next-theme .rs-next-conversations .conversation-list-item { min-width:0; }
body.rs-next-theme .rs-next-conversations .conversation-chat.card { min-height:calc(100vh - 245px)!important; }
body.rs-next-theme .rs-next-conversations .chat-empty { font-size:.9rem; line-height:1.55; padding:20px; }

/* 5. Login: hierarquia mais compacta, leitura e CTA acima da dobra */
body.rs-next-login .login-grid-clean { grid-template-columns:minmax(0,1fr) minmax(460px,.96fr); min-height:100dvh; overflow:clip; }
body.rs-next-login .login-showcase { padding:clamp(28px,3.3vw,55px) clamp(30px,5vw,76px) 26px; }
body.rs-next-login .login-brand { gap:14px; }
body.rs-next-login .login-brand img { width:clamp(130px,13.5vw,185px); max-height:130px; }
body.rs-next-login .login-brand-copy { min-width:0; }
body.rs-next-login .login-brand-copy strong { font-size:clamp(1.5rem,2vw,2.2rem); }
body.rs-next-login .login-showcase-content { padding:22px 0!important; }
body.rs-next-login .login-showcase h1 { font-size:clamp(2rem,3vw,3.4rem); line-height:1.15; max-width:580px; }
body.rs-next-login .login-kicker { font-size:.7rem; letter-spacing:.12em; }
body.rs-next-login .login-benefits { gap:9px; margin-top:18px; }
body.rs-next-login .login-benefit { min-height:60px; padding:9px 12px; gap:12px; border-radius:13px; }
body.rs-next-login .login-benefit-icon { flex-basis:41px; width:41px; height:41px; border-radius:11px; }
body.rs-next-login .login-benefit-icon svg { width:24px; height:24px; }
body.rs-next-login .login-benefit small { font-size:.76rem; }
body.rs-next-login .login-panel-clean { padding:26px clamp(20px,3vw,44px); }
body.rs-next-login .login-card-clean { width:min(470px,100%); padding:clamp(23px,2.7vw,35px); border-radius:21px!important; }
body.rs-next-login .login-card-brand { margin-bottom:11px; gap:4px; }
body.rs-next-login .login-card-brand img { width:105px; max-height:78px; object-fit:contain; }
body.rs-next-login .login-card-brand strong { font-size:1.1rem; letter-spacing:.15em; }
body.rs-next-login .login-card-brand span { width:122px; }
body.rs-next-login .login-card-header { margin-bottom:17px; }
body.rs-next-login .login-card-header h2 { font-size:clamp(1.6rem,2.3vw,2.1rem); line-height:1.2; }
body.rs-next-login .login-card-header p { font-size:.86rem; line-height:1.45; }
body.rs-next-login .login-field { margin-top:12px; font-size:.81rem; }
body.rs-next-login .login-input-wrap input { min-height:47px; }
body.rs-next-login .login-remember { margin-top:12px; }
body.rs-next-login .login-submit { margin-top:16px; min-height:47px; }
body.rs-next-login .login-security { font-size:.72rem; }

/* 6. Quebras por espaço disponível: desktop compacto, tablet e telefone */
@media (max-width:1280px) {
  body.rs-next-theme .rs-next-dashboard .admin-executive-hero { grid-template-columns:minmax(0,1fr) minmax(260px,.85fr); padding:24px!important; }
  body.rs-next-theme .rs-next-dashboard .admin-quick-action-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:1100px) {
  body.rs-next-theme .rs-next-dashboard .admin-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.rs-next-theme .rs-next-conversations .conversation-workspace { grid-template-columns:1fr!important; min-height:0!important; }
  body.rs-next-theme .rs-next-conversations .conversation-chat.card { min-height:510px!important; }
  body.rs-next-theme .rs-next-conversations .conversation-inbox .conversation-list { max-height:350px; overflow-y:auto; }
}
@media (max-width:900px) {
  body.rs-next-theme .rs-next-dashboard .admin-executive-hero {
    grid-template-columns:1fr; grid-template-areas:"copy" "actions" "updated"; gap:13px!important;
  }
  body.rs-next-theme .rs-next-dashboard .admin-executive-hero-actions { justify-content:flex-start; }
  body.rs-next-theme .rs-next-dashboard .admin-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.rs-next-theme .rs-next-conversations .conversation-filters { flex-direction:row!important; }
  body.rs-next-theme .rs-next-conversations .conversation-filters > * { max-width:none; }
  body.rs-next-theme .rs-next-conversations .conversation-filters .filter-search { flex-basis:100%!important; }
  body.rs-next-theme .rs-next-conversations .conversation-filters select { flex:1 1 185px!important; }
}
@media (max-width:660px) {
  body.rs-next-theme .rs-next-dashboard .admin-executive-hero { padding:20px!important; }
  body.rs-next-theme .rs-next-dashboard .admin-executive-hero-copy h2 { font-size:1.75rem; }
  body.rs-next-theme .rs-next-dashboard .admin-executive-hero-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.rs-next-theme .rs-next-dashboard .admin-executive-hero-actions .btn { width:100%; }
  body.rs-next-theme .rs-next-dashboard .admin-executive-hero-actions .btn:first-child { grid-column:1/-1; }
  body.rs-next-theme .rs-next-dashboard .admin-kpi-grid { grid-template-columns:1fr; }
  body.rs-next-theme .rs-next-dashboard .admin-quick-action-grid { grid-template-columns:1fr; }
  body.rs-next-theme .rs-next-conversations .conversation-filters .filter-search { min-width:100%!important; }
  body.rs-next-theme .rs-next-conversations .conversation-filters select { min-width:min(150px,100%)!important; flex:1 1 150px!important; }
  body.rs-next-theme .rs-next-conversations .conversation-filters > .btn { flex:1 1 calc(50% - 5px)!important; }
  body.rs-next-theme .rs-next-conversations .conversation-workspace > :is(.conversation-inbox,.conversation-chat) { border-radius:12px!important; }
  body.rs-next-login .login-card-clean { padding:22px!important; }
}
@media (max-width:430px) {
  body.rs-next-theme .rs-next-conversations .conversation-filters select { flex:1 1 calc(50% - 5px)!important; min-width:calc(50% - 5px)!important; }
  body.rs-next-theme .rs-next-conversations .conversation-filters select:first-of-type { flex-basis:100%!important; }
  body.rs-next-theme .rs-next-conversations .conversation-heading-actions .btn { margin-left:0; }
}
@media (max-height:750px) and (min-width:961px) {
  body.rs-next-login .login-brand img { width:145px; }
  body.rs-next-login .login-showcase-content { padding:12px 0!important; }
  body.rs-next-login .login-showcase h1 { font-size:clamp(1.8rem,2.7vw,2.6rem); }
  body.rs-next-login .login-benefits { margin-top:13px; gap:7px; }
  body.rs-next-login .login-benefit { min-height:54px; padding:7px 10px; }
  body.rs-next-login .login-card-clean { padding:20px 30px; }
  body.rs-next-login .login-card-brand img { width:92px; max-height:62px; }
  body.rs-next-login .login-card-header { margin-bottom:12px; }
  body.rs-next-login .login-field { margin-top:10px; }
}
