/* COMASA V3.12.13.41 — isolated views and dialogs within the lower CRM pane. */
#brchat.bc37-combined #bc37CrmShell{position:relative;isolation:isolate;}
#brchat #bc41ViewBar[hidden]{display:none!important;}
#brchat .bc41-viewbar{display:flex;align-items:center;flex-wrap:wrap;gap:9px;padding:9px 14px;background:#f8fbfd;border-bottom:1px solid #e1eaf0;flex:0 0 auto;min-width:0;}
#brchat .bc41-viewbar label{font-weight:750;font-size:11px;color:#345b6f;white-space:nowrap;}
#brchat #bc41ViewSelect{min-height:34px;border-radius:8px;border:1px solid #b5cbd9;background:#fff;color:#153f55;max-width:270px;min-width:150px;font-size:12px;padding:6px 9px;}
#brchat .bc41-back{min-height:34px;padding:7px 11px;border:1px solid #a2cec2;background:#eaf8f1;color:#0e625c;border-radius:8px;font-weight:800;font-size:12px;cursor:pointer;}
#brchat .bc41-help{font-size:11px;color:#6b8393;margin-left:auto;white-space:nowrap;}
#brchat #crm.bc41-hidden-crm{display:none!important;}
#brchat .bc41-pane-section{display:block!important;position:relative!important;margin:0!important;padding:0 0 10px!important;min-width:0!important;max-width:100%!important;}
#brchat .bc41-pane-section .tabtitle{gap:8px;flex-wrap:wrap;}
#brchat .bc41-pane-section .tabtitle h2{font-size:17px;}
#brchat .bc41-pane-section .grid2,#brchat .bc41-pane-section .grid3,#brchat .bc41-pane-section .grid4{min-width:0;}
/* Original .modal nodes are moved into the CRM shell, not recreated. */
#brchat #bc37CrmShell .modal.bc41-embedded-modal,
#brchat #bc37CrmShell [role="dialog"].bc41-embedded-modal{
  position:absolute!important;inset:0!important;top:0!important;left:0!important;
  width:100%!important;height:100%!important;max-width:100%!important;
  z-index:45!important;margin:0!important;padding:0!important;
  align-items:stretch!important;justify-content:stretch!important;
  border:0!important;border-radius:inherit!important;background:#f3f8fb!important;
  overflow:hidden!important;display:none!important;
}
#brchat #bc37CrmShell .bc41-embedded-modal.open{display:flex!important;}
#brchat #bc37CrmShell .bc41-embedded-modal>.modalbox{
  flex:1 1 auto!important;width:100%!important;max-width:100%!important;
  min-width:0!important;min-height:0!important;height:100%!important;
  max-height:100%!important;box-sizing:border-box!important;
  margin:0!important;padding:14px 17px 26px!important;
  border:0!important;border-radius:0!important;
  background:#fff;overflow:auto!important;overscroll-behavior:contain;
  scrollbar-width:thin;
}
#brchat #bc37CrmShell .bc41-embedded-modal .modalhead{
  position:sticky;top:-14px;z-index:3;background:#fff;
  padding:8px 0 12px;border-bottom:1px solid #dbe7ef;
  flex-wrap:wrap;gap:9px;
}
#brchat #bc37CrmShell .bc41-embedded-modal .modalhead h2{font-size:17px;}
#brchat.bc37-combined.bc41-dialog-visible{--bc37-chat-height:clamp(230px,29dvh,440px);--bc37-crm-height:clamp(475px,61dvh,910px);}
#brchat.bc37-combined.bc41-dialog-visible.bc38-ficha-visible{--bc37-chat-height:clamp(230px,29dvh,440px);--bc37-crm-height:clamp(475px,61dvh,910px);}
@media(max-width:900px){
  #brchat .bc41-viewbar{padding:8px 10px;gap:7px;}
  #brchat .bc41-help{display:none;}
  #brchat #bc37CrmShell .bc41-embedded-modal>.modalbox{padding:11px 12px 18px!important;}
  #brchat #bc37CrmShell .bc41-embedded-modal .modalhead{top:-11px;}
}
@media(max-width:600px){
  #brchat #bc41ViewSelect{flex:1;min-width:160px;max-width:none;}
  #brchat .bc41-back{font-size:11px;}
  #brchat.bc37-combined.bc41-dialog-visible{--bc37-chat-height:255px;--bc37-crm-height:clamp(450px,60dvh,780px);}
  #brchat #bc37CrmShell .bc41-embedded-modal .formgrid,
  #brchat #bc37CrmShell .bc41-embedded-modal .grid2,
  #brchat #bc37CrmShell .bc41-embedded-modal .grid3,
  #brchat #bc37CrmShell .bc41-embedded-modal .grid4{grid-template-columns:minmax(0,1fr);}
  #brchat #bc37CrmShell .bc41-embedded-modal .formgrid .full{grid-column:auto;}
}
@media print{
  #brchat #bc37CrmShell .bc41-embedded-modal{position:static!important;}
}
