/* Staff chat: topbar button with badge, and the two-pane chat page. */
.dm-chat-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.dm-chat-btn:hover { color: #fff; background: rgba(255, 255, 255, .16); }
.dm-chat-badge { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #d64545; color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--dm-navy); }
.dm-chat-badge[hidden] { display: none; }

.dm-chat { display: flex; background: var(--dm-card); border: 1px solid var(--dm-border, #e3e8f0); border-radius: var(--dm-radius, 16px); box-shadow: var(--dm-shadow); overflow: hidden; height: calc(100vh - 210px); min-height: 420px; }
.dm-chat-side { width: 320px; flex: none; display: flex; flex-direction: column; border-inline-end: 1px solid var(--dm-border, #e3e8f0); min-height: 0; }
.dm-chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dm-chat-tools { display: flex; gap: 8px; padding: 10px; border-bottom: 1px solid var(--dm-border, #e3e8f0); }
.dm-chat-tools .btn { white-space: nowrap; }
.dm-chat-list { flex: 1; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.dm-chat-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--dm-soft-2); background: none; text-align: start; color: inherit; }
.dm-chat-item:hover, .dm-chat-item.active { background: var(--dm-soft); }
.dm-chat-av { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--dm-navy-grad, var(--dm-navy)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.dm-chat-av.general { background: var(--dm-gold-grad, var(--dm-gold)); color: var(--dm-navy); }
.dm-chat-meta { flex: 1; min-width: 0; }
.dm-chat-name { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.dm-chat-name small { font-weight: 400; color: var(--dm-muted); white-space: nowrap; }
.dm-chat-last { display: flex; justify-content: space-between; gap: 8px; color: var(--dm-muted); font-size: .86rem; }
.dm-chat-last span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-chat-unread { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--dm-gold); color: var(--dm-navy); font-size: .74rem; font-weight: 700; text-align: center; line-height: 20px; }

.dm-chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--dm-border, #e3e8f0); font-weight: 700; }
.dm-chat-head .dm-chat-back { display: none; }
.dm-chat-head .dm-chat-grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--dm-soft); min-height: 0; }
.dm-chat-day { align-self: center; font-size: .75rem; color: var(--dm-muted); background: var(--dm-card); border-radius: 10px; padding: 2px 10px; margin: 6px 0; }
.dm-msg { max-width: min(78%, 560px); padding: 7px 11px; border-radius: 14px; background: var(--dm-card); box-shadow: 0 1px 1px rgba(26, 39, 128, .08); align-self: flex-start; position: relative; }
.dm-msg.mine { align-self: flex-end; background: var(--dm-navy); color: #fff; }
.dm-msg-who { font-size: .76rem; font-weight: 700; color: var(--dm-gold-dark); }
.dm-msg-body { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.dm-msg.gone .dm-msg-body { font-style: italic; opacity: .7; }
.dm-msg-time { font-size: .7rem; opacity: .65; text-align: end; margin-top: 2px; }
.dm-msg-del { position: absolute; top: 2px; inset-inline-end: 4px; border: 0; background: none; color: inherit; opacity: 0; font-size: .75rem; padding: 2px 4px; }
.dm-msg:hover .dm-msg-del, .dm-msg-del:focus { opacity: .7; }
.dm-chat-older { align-self: center; }
.dm-chat-empty { margin: auto; color: var(--dm-muted); text-align: center; padding: 20px; }
.dm-chat-compose { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--dm-border, #e3e8f0); background: var(--dm-card); align-items: flex-end; }
.dm-chat-compose textarea { resize: none; max-height: 120px; }
.dm-chat-pick { padding: 10px; overflow-y: auto; flex: 1; }

@media (max-width: 767.98px) {
    .dm-chat { height: calc(100vh - 190px); }
    .dm-chat-side { width: 100%; border-inline-end: 0; }
    .dm-chat-main { display: none; }
    .dm-chat.in-thread .dm-chat-side { display: none; }
    .dm-chat.in-thread .dm-chat-main { display: flex; }
    .dm-chat-head .dm-chat-back { display: inline-flex; }
}
[dir="ltr"] .dm-flip { transform: scaleX(-1); }
body.dm-chat-page .dm-fab { display: none; }
@media (max-width: 767.98px) { .dm-chat { height: calc(100vh - 215px); } }

/* Notification bell, reminders page, attachments, backup page */
.dm-bell { position: relative; }
.dm-bell-menu { width: min(360px, 92vw); max-height: 70vh; overflow-y: auto; padding: 0; }
.dm-bell-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--dm-border, #e3e8f0); }
.dm-bell-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--dm-soft-2); background: none; text-align: start; color: inherit; }
.dm-bell-item:hover { background: var(--dm-soft); }
.dm-bell-item.unread { background: var(--dm-soft); box-shadow: inset 3px 0 0 #c9a227; }
.dm-bell-item > i { margin-top: 3px; color: var(--dm-navy, #1b2a49); }
.dm-bell-item span { display: flex; flex-direction: column; min-width: 0; }
.dm-bell-item small { overflow-wrap: anywhere; }
.dm-bell-foot { display: block; padding: 10px 12px; text-align: center; text-decoration: none; }
.dm-rem-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--dm-soft-2); }
.dm-rem-row.fired .dm-rem-main b { color: #b54708; }
.dm-rem-main { display: flex; flex-direction: column; min-width: 0; }
.dm-rem-act { display: flex; gap: 4px; flex: none; }
.dm-attach { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--dm-border, #e3e8f0); }
.dm-attach-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--dm-soft-2); }
.dm-attach-name { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.dm-attach-act { display: flex; gap: 4px; flex: none; }
.dm-attach-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dm-attach-add input[type=file] { flex: 1 1 200px; }
.dm-attach-add input[type=text] { flex: 1 1 140px; }
.dm-print-mode .dm-attach { display: none; }
@media print { .dm-attach { display: none !important; } }
.dm-bk-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.dm-bk-top small { display: block; color: var(--dm-muted, #6b7280); }
.dm-bk-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* Files in chat and the viewer window */
.dm-chat-compose .dm-chat-clip { flex: none; }
.dm-chat-pending { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-top: 1px solid var(--dm-border, #e3e8f0); background: var(--dm-soft); }
.dm-chat-pending .progress { flex: 1; height: 6px; }
.dm-chat-pending .btn { margin-inline-start: auto; }
.dm-msg-file { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 10px; margin: 2px 0; border: 1px solid var(--dm-border, #e3e8f0); border-radius: 10px; background: rgba(255, 255, 255, .65); color: inherit; text-align: start; }
.dm-msg-file > i { font-size: 1.4rem; color: var(--dm-navy, #1b2a49); }
.dm-msg-file span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.dm-msg.mine .dm-msg-file { background: rgba(255, 255, 255, .85); color: #1b2a49; }
.dm-v-body { min-height: 200px; }
.dm-v-pdf { width: 100%; height: 72vh; border: 1px solid var(--dm-border, #e3e8f0); border-radius: 8px; background: #fff; }
.dm-v-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 70vh; overflow: auto; background: var(--dm-soft); padding: 12px; border-radius: 8px; direction: auto; }
.dm-v-doc { max-width: 820px; margin: 0 auto; line-height: 1.8; }
.dm-v-doc .dm-v-gap { margin: 0; height: .6em; }
.dm-v-table td { white-space: pre-wrap; vertical-align: top; min-width: 60px; }
.dm-v-sheet { max-height: 68vh; overflow: auto; }
.dm-chat-pending[hidden] { display: none; }
