/* ENJAZ communications: extend the existing RTL dashboard components. */
.db-chat-live { min-height: min(72vh, 760px); }
.db-chat-live .db-thread-list { padding: 14px 0; }
.db-chat-live .db-thread-list > h2 { font-size: 15px; padding: 0 15px 12px; margin: 0; }
.db-chat-live .db-thread-list > h2 small { color: var(--db-muted); font-weight: 500; }
.db-chat-live .db-thread { display: flex; align-items: center; gap: 10px; min-width: 0; }
.db-chat-live .db-thread .db-avatar { width: 38px; height: 38px; }
.db-avatar-initials { display: inline-grid; place-items: center; color: var(--db-primary); font-weight: 800; }
.db-thread-copy { display: grid; gap: 4px; min-width: 0; flex: 1; }
.db-thread-copy strong, .db-thread-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-thread-copy small { margin: 0; font-size: 10px; }
.db-unread-count { display: inline-flex; align-items: center; justify-content: center; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 99px; background: #663bff; color: #fff; font-size: 10px; }
.db-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.db-chat-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.db-chat-person .db-avatar { width: 40px; height: 40px; }
.db-chat-person strong, .db-chat-person small { display: block; }
.db-chat-person strong { font-size: 15px; }
.db-chat-person small { color: var(--db-muted); font-size: 11px; margin-top: 4px; }
.db-chat-info { display: flex; align-items: center; gap: 8px; padding: 9px 18px; border-bottom: 1px solid var(--db-line); }
.db-chat-body { min-height: 290px; }
.db-chat-empty { align-self: center; max-width: 440px; margin: auto; padding: 20px; color: var(--db-muted); text-align: center; line-height: 1.8; }
.db-chat-empty h3 { color: var(--db-text); margin: 0 0 8px; }
.db-bubble p { white-space: pre-wrap; overflow-wrap: anywhere; }
.db-bubble > small { display: block; margin-top: 7px; text-align: end; }
.db-chat-file-wrap { display: grid; gap: 7px; margin: 7px 0; }
.db-chat-image { display: block; max-width: min(100%, 360px); max-height: 260px; object-fit: contain; border-radius: 10px; background: #fff; }
.db-chat-file { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 10px; border: 1px solid var(--db-line); border-radius: 9px; background: #fff; color: var(--db-text); cursor: pointer; text-align: right; }
.db-bubble.mine .db-chat-file { color: var(--db-text); }
.db-chat-file svg { width: 17px; height: 17px; flex: 0 0 auto; }
.db-chat-file span { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-chat-file small { color: var(--db-muted); font-size: 10px; white-space: nowrap; }
.db-chat-form { align-items: flex-end; flex-wrap: wrap; }
.db-chat-form textarea { min-height: 44px; max-height: 150px; flex: 1; min-width: 150px; resize: vertical; border: 1px solid var(--db-line); border-radius: 10px; padding: 10px 12px; background: var(--db-surface); outline: 0; }
.db-chat-form textarea:focus { border-color: var(--db-primary); box-shadow: 0 0 0 3px #663bff18; }
.db-file-picker { flex: 0 0 auto; position: relative; }
.db-file-picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.db-file-picker:focus-within { outline: 3px solid #663bff33; }
.db-chat-form-hint { width: 100%; color: var(--db-muted); font-size: 10px; padding-inline: 4px; }
.db-communications-note { margin: 13px 0 0; color: var(--db-muted); font-size: 12px; line-height: 1.8; }
.db-notifications-live { padding-top: 8px; }
.db-notification { align-items: center; }
.db-notification-copy { min-width: 0; flex: 1; }
.db-notification-link { display: block; text-decoration: none; }
.db-notification-link strong { color: var(--db-text); }
.db-notification-link p { margin: 4px 0 0; color: var(--db-muted); font-size: 12px; line-height: 1.7; }
.db-notification-copy > small { display: block; }
.db-notification-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.db-nav .db-unread-count { margin-inline-start: auto; }

@media (max-width: 1000px) {
  .db-chat-live { min-height: 66vh; }
  .db-chat-live .db-thread-list { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--db-line); border-left: 0; padding: 8px 0; }
  .db-chat-live .db-thread-list > h2 { display: none; }
  .db-chat-live .db-thread { min-width: 205px; border-left: 1px solid var(--db-line); border-bottom: 0; }
  .db-chat-live .db-thread-copy small:nth-child(3) { display: none; }
  .db-notification { align-items: flex-start; }
}
@media (max-width: 650px) {
  .db-chat-live { min-height: 68vh; grid-template-columns: minmax(0, 1fr); }
  .db-chat-live .db-thread-list { direction: rtl; }
  .db-chat-live .db-thread { min-width: 180px; padding: 10px; }
  .db-chat-live .db-chat-head { padding: 13px; }
  .db-chat-live .db-chat-info { padding: 8px 13px; font-size: 10px; }
  .db-chat-live .db-chat-body { min-height: 250px; padding: 14px; }
  .db-chat-form { padding: 10px; }
  .db-chat-form .db-btn { padding: 9px 10px; }
  .db-chat-form textarea { min-width: 100%; order: 2; }
  .db-chat-form .db-file-picker { order: 1; }
  .db-chat-form button[type="submit"] { order: 1; margin-inline-start: auto; }
  .db-chat-form-hint { order: 3; }
  .db-notification { flex-wrap: wrap; }
  .db-notification-actions { width: 100%; margin-inline-start: 54px; }
}
