/* ═══════════════════════════════════════════════════════════════════
   B-Empire CRM — messagerie interne + accès restreint
   ═══════════════════════════════════════════════════════════════════ */
#beChatFab { position: fixed; right: 22px; bottom: 22px; z-index: 9000; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #E3C66E, #C9A84C 60%, #A8873A); color: #120E06; font-size: 21px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 14px 30px -10px rgba(201,168,76,.75), 0 4px 10px rgba(0,0,0,.4); transition: transform .15s ease; }
#beChatFab:hover { transform: translateY(-2px) scale(1.04); }
#beChatBadge { position: absolute; top: -3px; right: -3px; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 11px; background: #EF4444; color: #fff;
  font: 700 11px/21px Inter, sans-serif; box-shadow: 0 0 0 2px #0A0A0A; }

#beChat { position: fixed; right: 22px; bottom: 92px; z-index: 9001; width: 400px; max-width: calc(100vw - 24px); height: min(620px, calc(100vh - 120px));
  display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; opacity: 0; pointer-events: none; transform: translateY(14px) scale(.98);
  transition: opacity .2s ease, transform .2s ease; background: rgba(18,15,12,.96); border: 1px solid rgba(201,168,76,.3);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
#beChat.show { opacity: 1; pointer-events: auto; transform: none; }
[data-theme="light"] #beChat { background: rgba(255,253,249,.97); border-color: rgba(138,110,90,.3); }
.bc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.bc-eyebrow { font: 600 9.5px Inter, sans-serif; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); }
.bc-title { font: 700 16px 'Playfair Display', Georgia, serif; color: var(--text); margin-top: 2px; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-head-act { display: flex; gap: 4px; }
.bc-ic { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: transparent; color: var(--text2); cursor: pointer; }
.bc-ic:hover { color: var(--gold); border-color: rgba(201,168,76,.45); }
.bc-list { flex: 1; overflow-y: auto; padding: 6px 8px 10px; }
.bc-group { font: 600 10px Inter, sans-serif; letter-spacing: 1.8px; text-transform: uppercase; color: var(--text3); padding: 12px 10px 6px; }
.bc-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 11px; cursor: pointer; }
.bc-item:hover { background: rgba(201,168,76,.08); }
.bc-item > i { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--bg3); color: var(--gold); flex: 0 0 auto; }
.bc-item-main { flex: 1; min-width: 0; } .bc-item-main b { display: block; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-item-main span { font-size: 11.5px; color: var(--text3); }
.bc-item.unread b { color: var(--gold); }
.bc-item em { font-style: normal; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--gold); color: #120E06; font: 700 11px/22px Inter, sans-serif; text-align: center; }
.bc-conv { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.bc-members { padding: 8px 16px; font-size: 11.5px; color: var(--text3); border-bottom: 1px solid var(--border); }
.bc-members a { color: var(--gold); margin-left: 6px; }
.bc-msgs { flex: 1; overflow-y: auto; padding: 14px 14px 6px; }
.bc-msg { margin-bottom: 12px; max-width: 84%; } .bc-msg.mine { margin-left: auto; text-align: right; }
.bc-author { font-size: 11px; color: var(--gold); margin: 0 0 3px 4px; font-weight: 600; }
.bc-bubble { display: inline-block; text-align: left; padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: var(--bg3); color: var(--text);
  font-size: 13.5px; line-height: 1.5; word-wrap: break-word; border: 1px solid var(--border); }
.bc-msg.mine .bc-bubble { border-radius: 14px 14px 4px 14px; background: linear-gradient(180deg, rgba(201,168,76,.28), rgba(201,168,76,.16)); border-color: rgba(201,168,76,.35); }
.bc-bubble a { color: var(--gold); }
.bc-time { font-size: 10.5px; color: var(--text3); margin: 3px 6px 0; }
.bc-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border); }
.bc-compose textarea { flex: 1; resize: none; max-height: 140px; min-height: 40px !important; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg2); color: var(--text); font: 400 13.5px/1.45 Inter, sans-serif; outline: 0; }
.bc-compose textarea:focus { border-color: rgba(201,168,76,.5); }
.bc-send { width: 42px; height: 42px; border-radius: 12px; border: 0; cursor: pointer; background: linear-gradient(180deg, #E3C66E, #C9A84C); color: #120E06; }
.bc-foot { padding: 7px 14px 9px; font-size: 10.5px; color: var(--text3); text-align: center; border-top: 1px solid var(--border); }
.bc-empty { text-align: center; color: var(--text3); font-size: 13px; padding: 28px 10px; }
.bc-pick { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 6px; }
.bc-pick label { display: flex; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text); }
.bc-pick label:hover { background: rgba(201,168,76,.08); } .bc-pick span { margin-left: auto; font-size: 11px; color: var(--text3); }

/* accès restreint : un cadenas signale les actions soumises à autorisation */
body.be-restricted a[href*="action=download"]::before, body.be-restricted [onclick*="previewDoc"]::before,
body.be-restricted [onclick*="exportData"]::before, body.be-restricted [onclick*="downloadContactTemplate"]::before, body.be-restricted [onclick*="exportLogs"]::before {
  content: "\f023"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 6px; font-size: .85em; color: var(--gold); }
body.be-restricted .nr-cover { -webkit-user-drag: none; }

@media (max-width: 600px) { #beChat { right: 12px; bottom: 84px; height: calc(100vh - 100px); } #beChatFab { right: 14px; bottom: 14px; } }
