/* ============================================================
   CDK Chat â€” UI Styles
   Glassmorphism / messenger layout matching CDK theme
   ============================================================ */

/* â”€â”€ Container â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-chat-page {
  padding: 0 !important;
}
.cdk-chat-container {
  display: flex;
  height: calc(100vh - 70px);
  overflow: hidden;
  background: #f0f2f8;
}

/* â”€â”€ Sidebar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-chat-sidebar {
  width: 320px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid rgba(200,210,230,0.4);
  box-shadow: 2px 0 16px rgba(80,100,160,0.07);
  z-index: 2;
}

.cdk-chat-sidebar-header {
  padding: 18px 16px 10px;
  border-bottom: 1px solid rgba(200,210,230,0.35);
}

.cdk-chat-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: #2d3561;
  letter-spacing: 0.01em;
}
.cdk-chat-title .fa {
  margin-right: 8px;
  color: var(--cdk-primary, #6366f1);
}

.cdk-chat-filter-tabs {
  display: flex;
  gap: 4px;
}
.cdk-tab {
  flex: 1;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(99,102,241,0.06);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 20px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.cdk-tab:hover { background: rgba(99,102,241,0.12); color: #4338ca; }
.cdk-tab.active {
  background: var(--cdk-primary, #6366f1);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

/* â”€â”€ Conversation list â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.cdk-conv-loading {
  text-align: center;
  padding: 32px;
  color: #9ca3af;
}

.cdk-conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  border-bottom: 1px solid rgba(200,210,230,0.18);
}
.cdk-conv-item:hover {
  background: rgba(99,102,241,0.05);
}
.cdk-conv-item.active {
  background: rgba(99,102,241,0.08);
  border-left-color: var(--cdk-primary, #6366f1);
}
.cdk-conv-item.has-unread .cdk-conv-name {
  font-weight: 700;
}

.cdk-conv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}
.cdk-online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
}

.cdk-conv-body {
  flex: 1;
  min-width: 0;
}
.cdk-conv-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cdk-conv-preview {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.cdk-conv-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.cdk-conv-time {
  font-size: 10px;
  color: #cbd5e1;
}
.cdk-unread-badge {
  background: var(--cdk-primary, #6366f1);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}

.cdk-conv-empty {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
  font-size: 13px;
}

/* â”€â”€ Main chat window â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.cdk-chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  color: #cbd5e1;
}
.cdk-chat-empty .fa {
  opacity: 0.3;
}
.cdk-chat-empty p {
  font-size: 15px;
  color: #94a3b8;
  margin: 0;
}

.cdk-chat-window {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* â”€â”€ Window header â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(200,210,230,0.35);
  box-shadow: 0 2px 8px rgba(80,100,160,0.06);
  flex-shrink: 0;
}

.cdk-contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cdk-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}
.cdk-contact-meta strong {
  display: block;
  font-size: 14px;
  color: #1e293b;
}
.cdk-contact-meta small {
  font-size: 11px;
  color: #94a3b8;
}

.cdk-window-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cdk-assign-wrap select {
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  color: #4b5563;
  background: rgba(255,255,255,0.9);
  outline: none;
  cursor: pointer;
}

.cdk-btn-action {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 20px;
  background: transparent;
  color: #6366f1;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.cdk-btn-action:hover {
  background: rgba(99,102,241,0.08);
}
.cdk-btn-action.danger {
  color: #ef4444;
  border-color: rgba(239,68,68,0.3);
}
.cdk-btn-action.danger:hover {
  background: rgba(239,68,68,0.06);
}

.cdk-btn-settings {
  padding: 6px 10px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.cdk-btn-settings:hover { color: #6366f1; }

/* â”€â”€ Messages area â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cdk-msg-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}
.cdk-msg-group.outgoing {
  align-items: flex-end;
}
.cdk-msg-group.incoming {
  align-items: flex-start;
}

.cdk-msg-sender-label {
  font-size: 10px;
  color: #94a3b8;
  margin-bottom: 3px;
  padding: 0 4px;
}

.cdk-msg-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}

.cdk-msg-group.outgoing .cdk-msg-bubble {
  background: linear-gradient(135deg, var(--cdk-primary, #6366f1), #8b5cf6);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 3px 12px rgba(99,102,241,0.3);
}

.cdk-msg-group.incoming .cdk-msg-bubble {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  color: #1e293b;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(80,100,160,0.1);
}

.cdk-msg-time {
  font-size: 10px;
  color: #cbd5e1;
  margin-top: 4px;
  padding: 0 4px;
}

.cdk-msg-attachment a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.2);
  color: inherit;
  text-decoration: none;
  margin-top: 4px;
  border: 1px solid rgba(255,255,255,0.3);
}
.cdk-msg-group.incoming .cdk-msg-attachment a {
  background: rgba(99,102,241,0.08);
  color: #6366f1;
  border-color: rgba(99,102,241,0.2);
}

/* â”€â”€ Typing indicator â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-typing-indicator {
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cdk-typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: cdkBounce 1.2s infinite ease-in-out;
}
.cdk-typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.cdk-typing-indicator span:nth-child(3) { animation-delay: 0.3s; }
.cdk-typing-indicator small { font-size: 11px; color: #94a3b8; margin-left: 2px; }

@keyframes cdkBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-5px); }
}

/* â”€â”€ Input area â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-input-area {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(200,210,230,0.35);
  flex-shrink: 0;
}

.cdk-attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(99,102,241,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6366f1;
  font-size: 15px;
  transition: background 0.2s;
  flex-shrink: 0;
  margin-bottom: 0;
}
.cdk-attach-btn:hover { background: rgba(99,102,241,0.15); }

#cdkMessageInput {
  flex: 1;
  border: 1px solid rgba(200,210,230,0.5);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13.5px;
  resize: none;
  outline: none;
  background: rgba(255,255,255,0.9);
  color: #1e293b;
  line-height: 1.5;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.2s;
}
#cdkMessageInput:focus {
  border-color: rgba(99,102,241,0.5);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.cdk-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cdk-primary, #6366f1), #8b5cf6);
  border: none;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.2s;
  box-shadow: 0 3px 10px rgba(99,102,241,0.35);
}
.cdk-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(99,102,241,0.45);
}
.cdk-send-btn:active { transform: scale(0.95); }

/* â”€â”€ Day separator â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-day-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: #94a3b8;
  font-size: 11px;
}
.cdk-day-separator::before,
.cdk-day-separator::after {
  content: '';
  flex: 1;
  border-top: 1px solid rgba(200,210,230,0.4);
}

/* â”€â”€ Widget (public embed) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* Pulse ring + launcher animations */
@keyframes cdk-pulse-ring {
  0%   { transform: scale(1);    opacity: 0.65; }
  60%  { transform: scale(1.65); opacity: 0;    }
  100% { transform: scale(1.65); opacity: 0;    }
}
@keyframes cdk-launcher-bounce {
  0%   { transform: scale(0.35); opacity: 0; }
  60%  { transform: scale(1.12); }
  80%  { transform: scale(0.94); }
  100% { transform: scale(1);    opacity: 1; }
}
@keyframes cdk-badge-pop {
  0%,100% { transform: scale(1); }
  40%     { transform: scale(1.45); }
  70%     { transform: scale(0.86); }
}

.cdk-widget-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cdk-primary, #6366f1) 0%, #8b5cf6 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 24px rgba(99,102,241,0.5), 0 2px 8px rgba(99,102,241,0.25);
  z-index: 999997;
  animation: cdk-launcher-bounce 0.55s cubic-bezier(0.34,1.56,0.64,1) both;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
  overflow: visible;
}
.cdk-widget-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 32px rgba(99,102,241,0.6), 0 3px 12px rgba(99,102,241,0.3);
}
.cdk-launcher-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--cdk-primary, #6366f1);
  animation: cdk-pulse-ring 2.5s ease-out infinite;
  pointer-events: none;
  z-index: 0;
}
.cdk-widget-launcher.cdk-open .cdk-launcher-pulse { animation: none; opacity: 0; }
.cdk-launcher-icon { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; }
.cdk-launcher-text { font-size: 14px; font-weight: 600; white-space: nowrap; position: relative; z-index: 1; }

.cdk-widget-launcher .cdk-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 18px;
  text-align: center;
  border: 2px solid #fff;
  z-index: 2;
  animation: cdk-badge-pop 0.35s ease;
}

.cdk-widget-box {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 368px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 112px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(60,80,160,0.2), 0 6px 20px rgba(60,80,160,0.1);
  border: 1px solid rgba(200,210,230,0.3);
  display: flex;
  flex-direction: column;
  z-index: 999996;
  overflow: hidden;
  transform-origin: bottom right;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.22s ease;
}
.cdk-widget-box.cdk-hidden {
  transform: scale(0.82) translateY(24px);
  opacity: 0;
  pointer-events: none;
}

/* Rich header */
.cdk-widget-header {
  background: linear-gradient(135deg, var(--cdk-primary, #6366f1) 0%, #8b5cf6 100%);
  color: #fff;
  flex-shrink: 0;
  padding: 0;
}
.cdk-widget-header h4 { display: none; }
.cdk-widget-hdr-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
}
.cdk-widget-hdr-ava {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.35);
}
.cdk-widget-hdr-ava img { width: 100%; height: 100%; object-fit: cover; }
.cdk-widget-hdr-info { flex: 1; min-width: 0; }
.cdk-widget-hdr-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cdk-widget-hdr-status {
  font-size: 11px;
  color: rgba(255,255,255,0.82);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.cdk-widget-hdr-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}
.cdk-widget-hdr-close {
  background: rgba(255,255,255,0.18);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.15s;
}
.cdk-widget-hdr-close:hover { background: rgba(255,255,255,0.32); }
.cdk-widget-hdr-greeting {
  padding: 0 16px 14px;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  margin: 0;
}
.cdk-embed-code {
  background: rgba(30,41,59,0.95);
  color: #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  max-height: 200px;
}

/* â”€â”€ Scrollbar styling â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-conv-list::-webkit-scrollbar,
.cdk-messages::-webkit-scrollbar,
.cdk-widget-messages::-webkit-scrollbar { width: 4px; }
.cdk-conv-list::-webkit-scrollbar-track,
.cdk-messages::-webkit-scrollbar-track,
.cdk-widget-messages::-webkit-scrollbar-track { background: transparent; }
.cdk-conv-list::-webkit-scrollbar-thumb,
.cdk-messages::-webkit-scrollbar-thumb,
.cdk-widget-messages::-webkit-scrollbar-thumb {
  background: rgba(99,102,241,0.25);
  border-radius: 4px;
}

/* â”€â”€ Responsive â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 768px) {
  .cdk-chat-sidebar {
    width: 100%;
    position: absolute;
    top: 0; left: 0; bottom: 0;
    z-index: 5;
    transform: translateX(0);
    transition: transform 0.3s ease;
  }
  .cdk-chat-sidebar.hidden {
    transform: translateX(-100%);
  }
  .cdk-chat-container { position: relative; }
}

/* -- Internal notes panel ---------------------------------- */
.cdk-notes-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  border-left: 1px solid rgba(200,210,230,0.4);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  box-shadow: -4px 0 20px rgba(80,100,160,0.1);
}
.cdk-notes-panel.open {
  transform: translateX(0);
}

.cdk-chat-window {
  position: relative;
  overflow: hidden;
}

.cdk-notes-header {
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 1px solid rgba(200,210,230,0.35);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(248,250,252,0.9);
  flex-shrink: 0;
}
.cdk-notes-header .fa { color: #f59e0b; }
.cdk-notes-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.cdk-notes-close:hover { color: #ef4444; }

.cdk-notes-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cdk-no-notes {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  margin-top: 20px;
}

.cdk-note-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cdk-note-bubble {
  background: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #78350f;
  line-height: 1.5;
  word-break: break-word;
}
.cdk-note-item.handover .cdk-note-bubble {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #4c1d95;
}
.cdk-note-item.system .cdk-note-bubble {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #14532d;
  font-style: italic;
}
.cdk-note-meta {
  font-size: 10px;
  color: #94a3b8;
  padding: 0 4px;
}

.cdk-notes-add {
  padding: 12px;
  border-top: 1px solid rgba(200,210,230,0.35);
  flex-shrink: 0;
}
.cdk-notes-add textarea {
  width: 100%;
  border: 1px solid rgba(200,210,230,0.5);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12.5px;
  resize: none;
  outline: none;
  color: #1e293b;
  background: rgba(255,255,255,0.9);
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.cdk-notes-add textarea:focus {
  border-color: rgba(245,158,11,0.5);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.08);
}

/* Notes toggle button active state */
.cdk-btn-action.active {
  background: rgba(245,158,11,0.1);
  color: #d97706;
  border-color: rgba(245,158,11,0.35);
}

/* -- Handover modal custom styles -------------------------- */
#cdkHandoverModal .modal-header {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-radius: 5px 5px 0 0;
}
#cdkHandoverModal .modal-header .close { color: #fff; opacity: 0.8; }
#cdkHandoverModal .modal-header .close:hover { opacity: 1; }

/* -- Phase 3: Tags, Priority, Follow-ups -------------------------------- */

/* Tag pills in notes panel */
.cdk-tags-active { padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 6px; min-height: 36px; }
.cdk-tag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 12px;
  color: #fff; font-size: .75rem; font-weight: 600;
}
.cdk-tag-remove {
  background: none; border: none; color: rgba(255,255,255,.8);
  cursor: pointer; padding: 0; font-size: .85rem; line-height: 1;
}
.cdk-tag-remove:hover { color: #fff; }

/* Priority select in toolbar */
.cdk-priority-sel {
  appearance: none; -webkit-appearance: none;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.1);
  color: inherit; border-radius: 5px;
  padding: 0 8px; font-size: .78rem;
  height: 32px; cursor: pointer;
}
.cdk-priority-sel:focus { outline: none; border-color: rgba(255,255,255,.6); }
.cdk-priority-sel option { color: #333; background: #fff; }

/* Third panel variants (tags, follow-up use same styles as notes) */
#cdkTagsPanel, #cdkFollowUpPanel {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0; right: 0;
  width: 300px;
  height: 100%;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  z-index: 10;
  box-shadow: -4px 0 16px rgba(0,0,0,.08);
}

/* ============================================================
   CDK Chat â€” Phase 4 UI Overhaul (Premium Design)
   ============================================================ */

/* â”€â”€ Background & container improvement â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-chat-container {
  background: #f4f6fb;
  border-radius: 0;
}

/* â”€â”€ Sidebar header rework â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-chat-sidebar {
  width: 340px;
  background: #fff;
  border-right: 1px solid #e8ecf4;
  box-shadow: 2px 0 12px rgba(60,80,160,.06);
}
.cdk-chat-sidebar-header {
  padding: 20px 18px 14px;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  border-bottom: none;
}
.cdk-chat-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: .02em;
}
.cdk-chat-title .fa { color: rgba(255,255,255,.8); }

/* Pill tabs on gradient bg */
.cdk-tab {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.85);
  font-size: 10px;
  padding: 5px 2px;
  border-radius: 20px;
  transition: background .15s, border-color .15s;
}
.cdk-tab:hover {
  background: rgba(255,255,255,.25);
  color: #fff;
}
.cdk-tab.active {
  background: #fff;
  border-color: transparent;
  color: #6366f1;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}

/* â”€â”€ Better conversation items â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-conv-item {
  padding: 13px 18px;
  gap: 13px;
  border-bottom: 1px solid #f3f4f8;
  border-left: 3px solid transparent;
  transition: background .12s;
}
.cdk-conv-item:hover { background: #f7f8fc; }
.cdk-conv-item.active {
  background: #f0f0fe;
  border-left-color: #6366f1;
}
.cdk-conv-avatar {
  width: 44px;
  height: 44px;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(99,102,241,.25);
}
.cdk-conv-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1d2e;
}
.cdk-conv-preview {
  font-size: 12px;
  color: #8891a7;
  margin-top: 3px;
}
.cdk-conv-time { font-size: 11px; color: #b0bac8; }
.cdk-unread-badge {
  background: #6366f1;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

/* Priority badge in conv list */
.cdk-conv-priority {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.cdk-conv-priority.high   { background: #fee2e2; color: #b91c1c; }
.cdk-conv-priority.medium { background: #fef3c7; color: #92400e; }
.cdk-conv-priority.low    { background: #dcfce7; color: #166534; }

/* â”€â”€ Empty state polish â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-chat-empty {
  background: transparent;
  gap: 20px;
}
.cdk-chat-empty .fa {
  color: #d1d5e8;
  opacity: 1;
}
.cdk-chat-empty p {
  font-size: 16px;
  font-weight: 500;
  color: #9ca3b8;
}
.cdk-chat-empty::before {
  content: '';
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, rgba(99,102,241,.08) 0%, transparent 70%);
  border-radius: 50%;
  position: absolute;
}

/* â”€â”€ Window header polish â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-window-header {
  padding: 16px 22px;
  background: #fff;
  border-bottom: 1px solid #eceef5;
  box-shadow: 0 2px 6px rgba(60,80,160,.04);
}
.cdk-contact-meta strong { font-size: 15px; color: #1a1d2e; font-weight: 700; }
.cdk-contact-meta small  { font-size: 12px; color: #8891a7; }

/* Toolbar buttons */
.cdk-btn-action {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid #e4e7f0;
  background: #fff;
  color: #5a6178;
  transition: background .15s, border-color .15s, color .15s;
}
.cdk-btn-action:hover {
  background: #f0f0fe;
  border-color: #c4b5fd;
  color: #6366f1;
}

/* â”€â”€ Message bubbles rework â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-messages {
  padding: 22px 28px;
  gap: 2px;
  background: #f8f9fd;
}
.cdk-msg-group { margin-bottom: 12px; }

.cdk-msg-group.outgoing .cdk-msg-bubble {
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 4px 14px rgba(99,102,241,.3);
}
.cdk-msg-group.incoming .cdk-msg-bubble {
  background: #fff;
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 2px 10px rgba(60,80,160,.07);
  border: 1px solid #eceef5;
  color: #1e293b;
}
.cdk-msg-bubble {
  font-size: 14px;
  padding: 11px 16px;
}
.cdk-msg-time { font-size: 10.5px; color: #b0bac8; }
.cdk-msg-sender-label { font-size: 11px; color: #8891a7; margin-bottom: 4px; }

/* â”€â”€ Input area â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-input-area {
  padding: 14px 22px;
  background: #fff;
  border-top: 1px solid #eceef5;
  box-shadow: 0 -2px 8px rgba(60,80,160,.04);
}
#cdkMessageInput {
  border-color: #e4e7f0;
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 14px;
  background: #f8f9fd;
  color: #1e293b;
}
#cdkMessageInput:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.cdk-send-btn {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  box-shadow: 0 4px 12px rgba(99,102,241,.4);
}

/* â”€â”€ Messaging page â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-msg-page { padding: 20px !important; }
.cdk-msg-container {
  display: flex;
  height: calc(100vh - 140px);
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(60,80,160,.1);
}
.cdk-msg-sidebar {
  width: 300px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #eceef5;
}
.cdk-msg-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid #f0f2f8;
  background: #fafbfe;
}
.cdk-msg-sidebar-header .form-control {
  border-radius: 10px;
  border-color: #e4e7f0;
  background: #fff;
  font-size: 13px;
  padding: 7px 14px;
}
.cdk-msg-sidebar-header .form-control:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.08); }
.cdk-msg-tabs > li > a {
  font-size: 13px;
  font-weight: 600;
  color: #8891a7;
  padding: 10px 20px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.cdk-msg-tabs > li.active > a,
.cdk-msg-tabs > li > a:hover { border-bottom-color: #6366f1; color: #6366f1; background: transparent; }

.cdk-person-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex: 1; }
.cdk-person-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f8;
  transition: background .12s;
  position: relative;
}
.cdk-person-item:hover { background: #f7f8fc; }
.cdk-person-item.active { background: #f0f0fe; }

.cdk-avatar-wrap { position: relative; flex-shrink: 0; }
.cdk-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #fff;
  overflow: hidden;
}
.cdk-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cdk-avatar-initials { font-size: 14px; font-weight: 700; }
.cdk-avatar-group { background: linear-gradient(135deg, #0ea5e9, #6366f1); }

.cdk-presence-dot {
  position: absolute; bottom: 1px; right: 1px;
  width: 10px; height: 10px;
  border-radius: 50%; border: 2px solid #fff;
  background: #d1d5db;
}
.cdk-presence-dot.online  { background: #22c55e; }
.cdk-presence-dot.away    { background: #f59e0b; }
.cdk-presence-dot.busy    { background: #ef4444; }

.cdk-person-name { font-size: 14px; font-weight: 600; color: #1a1d2e; }
.cdk-person-sub  { font-size: 12px; color: #8891a7; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.cdk-person-item .cdk-unread-badge { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }

.cdk-msg-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8f9fd;
  overflow: hidden;
}
.cdk-msg-placeholder {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px; color: #b0bac8;
}
.cdk-msg-placeholder .fa { font-size: 52px; color: #d1d5e8; }
.cdk-msg-placeholder p   { font-size: 15px; color: #9ca3b8; font-weight: 500; }

.cdk-msg-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  background: #fff; border-bottom: 1px solid #eceef5;
  box-shadow: 0 2px 6px rgba(60,80,160,.04);
  flex-shrink: 0;
}
.cdk-msg-header-left { display: flex; align-items: center; gap: 12px; }
.cdk-msg-header-name { font-size: 15px; font-weight: 700; color: #1a1d2e; }
.cdk-msg-header-status { font-size: 12px; color: #8891a7; margin-top: 2px; }

.cdk-msg-messages {
  flex: 1; overflow-y: auto; padding: 20px 24px;
  display: flex; flex-direction: column; gap: 2px;
}
.cdk-msg-messages::-webkit-scrollbar { width: 4px; }
.cdk-msg-messages::-webkit-scrollbar-thumb { background: rgba(99,102,241,.2); border-radius: 4px; }

/* DM message bubbles reuse .cdk-msg-group styles */
.cdk-dm-msg { display: flex; flex-direction: column; margin-bottom: 10px; }
.cdk-dm-msg.out { align-items: flex-end; }
.cdk-dm-msg.in  { align-items: flex-start; }
.cdk-dm-bubble {
  max-width: 70%; padding: 10px 15px; border-radius: 18px;
  font-size: 14px; line-height: 1.5; word-break: break-word;
}
.cdk-dm-msg.out .cdk-dm-bubble {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff; border-radius: 18px 18px 4px 18px;
  box-shadow: 0 3px 12px rgba(99,102,241,.3);
}
.cdk-dm-msg.in .cdk-dm-bubble {
  background: #fff; color: #1e293b;
  border: 1px solid #eceef5; border-radius: 18px 18px 18px 4px;
  box-shadow: 0 2px 8px rgba(60,80,160,.06);
}
.cdk-dm-time { font-size: 10px; color: #b0bac8; margin-top: 4px; padding: 0 4px; }

.cdk-msg-input-area {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 14px 20px;
  background: #fff; border-top: 1px solid #eceef5;
  flex-shrink: 0;
}
.cdk-msg-textarea {
  flex: 1; border-radius: 14px; border-color: #e4e7f0;
  background: #f8f9fd; font-size: 14px;
  padding: 10px 16px; resize: none; outline: none; color: #1e293b;
}
.cdk-msg-textarea:focus { border-color: #6366f1; background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.08); }
.cdk-msg-send-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  border: none; color: #fff; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; align-self: flex-end;
  box-shadow: 0 3px 12px rgba(99,102,241,.4);
  transition: transform .15s, box-shadow .2s;
}
.cdk-msg-send-btn:hover { transform: scale(1.08); box-shadow: 0 5px 16px rgba(99,102,241,.5); }
.cdk-msg-tab-content { flex: 1; overflow-y: auto; }

.cdk-groups-header { padding: 10px 14px; border-bottom: 1px solid #f0f2f8; }

/* â”€â”€ Analytics stat cards improvement â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-stat-card {
  border-radius: 14px !important;
  border: 1px solid #eef0f8;
  box-shadow: 0 2px 16px rgba(60,80,160,.08) !important;
  transition: box-shadow .2s, transform .2s !important;
  overflow: hidden;
}
.cdk-stat-card:hover {
  box-shadow: 0 6px 24px rgba(60,80,160,.14) !important;
  transform: translateY(-2px) !important;
}
/* Colored top-border accent helpers */
.cdk-accent-indigo { border-top: 4px solid #6366f1 !important; }
.cdk-accent-green  { border-top: 4px solid #22c55e !important; }
.cdk-accent-amber  { border-top: 4px solid #f59e0b !important; }
.cdk-accent-sky    { border-top: 4px solid #0ea5e9 !important; }
.cdk-stat-card .panel-body {
  padding: 24px 20px !important;
  text-align: center;
}
.cdk-stat-card .cdk-stat-icon { font-size: 32px; margin-bottom: 10px; }
.cdk-stat-card .cdk-stat-value {
  font-size: 36px; font-weight: 800;
  color: #1a1d2e; line-height: 1; margin-bottom: 6px;
}
.cdk-stat-card .cdk-stat-label {
  font-size: 13px; color: #8891a7; font-weight: 500;
}

/* â”€â”€ History page â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-history-table thead th {
  background: #f8f9fd;
  border-bottom: 2px solid #e8ecf4;
  font-size: 12px; font-weight: 700;
  color: #6b7280; text-transform: uppercase; letter-spacing: .05em;
}
.cdk-history-table tbody tr:hover { background: #f7f8fc; }

/* â”€â”€ Tags panel â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-tag-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; color: #fff;
  margin: 2px;
}
.cdk-tag-pill .cdk-tag-remove {
  cursor: pointer; opacity: .7; font-size: 13px; line-height: 1;
  margin-left: 2px;
}
.cdk-tag-pill .cdk-tag-remove:hover { opacity: 1; }

/* â”€â”€ Priority selector â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-priority-sel { cursor: pointer; }
.cdk-priority-sel option { background: #fff; }

/* â”€â”€ Follow-up task items â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-task-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid #f3f4f8;
}
.cdk-task-item.done .cdk-task-title { text-decoration: line-through; color: #9ca3af; }
.cdk-task-title { font-size: 13px; color: #1e293b; flex: 1; }
.cdk-task-meta  { font-size: 10px; color: #b0bac8; margin-top: 2px; }
.cdk-task-check { cursor: pointer; flex-shrink: 0; margin-top: 2px; }

/* â”€â”€ Admin area note cards â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-note-bubble {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(245,158,11,.1);
}

/* â”€â”€ Scrollbars â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.cdk-person-list::-webkit-scrollbar,
.cdk-conv-list::-webkit-scrollbar,
.cdk-notes-list::-webkit-scrollbar { width: 4px; }
.cdk-person-list::-webkit-scrollbar-thumb,
.cdk-conv-list::-webkit-scrollbar-thumb,
.cdk-notes-list::-webkit-scrollbar-thumb {
  background: rgba(99,102,241,.15); border-radius: 4px;
}

/* ============================================================
   CDK Chat â€” Phase 5: Bug Fixes + Features
   ============================================================ */

/* Fix: DM bubble alignment in messaging page (#cdkMsgMessages) */
#cdkMsgMessages {
  display: flex !important;
  flex-direction: column !important;
}
.cdk-msg-bubble.cdk-bubble-out {
  margin-left: auto;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 3px 12px rgba(99,102,241,.3);
}
.cdk-msg-bubble.cdk-bubble-in {
  margin-right: auto;
  background: #fff;
  color: #1e293b;
  border-radius: 18px 18px 18px 4px;
  border: 1px solid #eceef5;
  box-shadow: 0 2px 8px rgba(60,80,160,.06);
}
.cdk-bubble-name {
  font-size: 10px;
  color: rgba(255,255,255,.7);
  margin-bottom: 3px;
}
.cdk-msg-bubble.cdk-bubble-in .cdk-bubble-name { color: #8891a7; }
.cdk-bubble-time {
  font-size: 10px;
  color: rgba(255,255,255,.6);
  margin-top: 4px;
}
.cdk-msg-bubble.cdk-bubble-in .cdk-bubble-time { color: #b0bac8; }

/* Fix: Presence dot cdk-dot-* classes */
.cdk-presence-dot.cdk-dot-online  { background: #22c55e; }
.cdk-presence-dot.cdk-dot-away    { background: #f59e0b; }
.cdk-presence-dot.cdk-dot-busy    { background: #ef4444; }
.cdk-presence-dot.cdk-dot-offline { background: #d1d5db; }

/* Inbox conversation search wrapper */
.cdk-conv-search-wrap {
  position: relative;
  padding: 8px 14px;
  background: #fff;
  border-bottom: 1px solid #f0f2f8;
  flex-shrink: 0;
}
.cdk-conv-search {
  width: 100%;
  border: 1px solid #e4e7f0;
  border-radius: 10px;
  padding: 7px 14px 7px 34px;
  font-size: 13px;
  outline: none;
  color: #1e293b;
  background: #f8f9fd;
  box-sizing: border-box;
  transition: border-color .2s;
}
.cdk-conv-search:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,.08);
}
.cdk-conv-search-icon {
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  color: #b0bac8;
  font-size: 12px;
  pointer-events: none;
}

/* Priority dot in conv item */
.cdk-conv-pri-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.cdk-conv-pri-dot.high   { background: #ef4444; }
.cdk-conv-pri-dot.medium { background: #f59e0b; }
.cdk-conv-pri-dot.low    { background: #22c55e; }

/* Quick reply chips above input */
.cdk-quick-replies {
  display: flex;
  gap: 6px;
  padding: 6px 20px 0;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  background: rgba(255,255,255,.85);
  border-top: 1px solid rgba(200,210,230,.2);
}
.cdk-quick-replies::-webkit-scrollbar { display: none; }
.cdk-quick-reply {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 16px;
  border: 1px solid #e4e7f0;
  background: #fff;
  font-size: 11.5px;
  color: #6366f1;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.cdk-quick-reply:hover { background: #f0f0fe; border-color: #c4b5fd; }

/* Analytics quick stats */
.cdk-qs-val { font-size: 32px; font-weight: 800; color: #1a1d2e; line-height: 1; }
.cdk-qs-lbl { font-size: 12px; color: #8891a7; margin-top: 4px; }

/* Settings page tabs */
.nav-tabs.cdk-settings-tabs > li > a {
  font-weight: 600; font-size: 13px; padding: 10px 18px;
  color: #6b7280; border-bottom: 2px solid transparent;
  border-left: none; border-right: none; border-top: none; border-radius: 0;
  transition: color .15s, border-color .15s;
}
.nav-tabs.cdk-settings-tabs > li.active > a,
.nav-tabs.cdk-settings-tabs > li > a:hover {
  color: #6366f1; border-bottom-color: #6366f1; background: transparent;
}
.nav-tabs.cdk-settings-tabs { border-bottom: 2px solid #e8ecf4; margin-bottom: 0; }

/* Staff table / toggle */
.cdk-staff-card {
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(60,80,160,.08) !important;
}
.cdk-staff-card thead th {
  background: #f8f9fd; border-bottom: 2px solid #e8ecf4 !important;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #6b7280; border-top: none;
}
.cdk-staff-card tbody tr:hover { background: #f7f8fc; }
.cdk-toggle-wrap { display: flex; justify-content: center; }
.cdk-toggle { position: relative; display: inline-block; width: 42px; height: 24px; margin: 0; }
.cdk-toggle input { opacity: 0; width: 0; height: 0; }
.cdk-toggle-slider {
  position: absolute; inset: 0;
  background: #d1d5db; border-radius: 24px; cursor: pointer; transition: background .25s;
}
.cdk-toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%;
  transition: transform .25s; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.cdk-toggle input:checked + .cdk-toggle-slider { background: #6366f1; }
.cdk-toggle input:checked + .cdk-toggle-slider::before { transform: translateX(18px); }

/* History filter panel + table */
.cdk-history-filters {
  background: #fff; border-radius: 14px;
  box-shadow: 0 2px 12px rgba(60,80,160,.07); margin-bottom: 20px;
}
.cdk-history-filters .panel-body { padding: 20px 20px 10px; }
.cdk-history-table-wrap {
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(60,80,160,.07);
}
.cdk-history-table thead th {
  background: #f8f9fd; border-bottom: 2px solid #e8ecf4 !important;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #6b7280; border-top: none;
}
.cdk-history-table tbody tr:hover { background: #f7f8fc; }
.badge-open   { background: #d1fae5 !important; color: #065f46 !important; font-size: 11px; padding: 3px 8px; border-radius: 12px; }
.badge-closed { background: #f3f4f6 !important; color: #374151 !important; font-size: 11px; padding: 3px 8px; border-radius: 12px; }

/* Analytics improvement */
.cdk-stat-card .panel-body { text-align: center; padding: 22px 16px !important; }
.cdk-stat-card .cdk-stat-icon i { font-size: 2rem; }

/* Messaging container - ensure proper rounded card */
.cdk-msg-container {
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 4px 24px rgba(60,80,160,.1) !important;
  border: 1px solid #eceef5 !important;
  min-height: 500px;
}
.cdk-msg-container > .panel-body { padding: 0 !important; }

/* Page title premium styling */
.cdk-page-header {
  display: flex; align-items: center; gap: 12px;
  padding: 0 0 18px; border-bottom: 2px solid #eceef5; margin-bottom: 24px;
}
.cdk-page-header .fa {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
}
.cdk-page-header h4 { margin: 0; font-size: 18px; font-weight: 700; color: #1a1d2e; }

/* Settings panel card */
.cdk-settings-section {
  background: #fff; border-radius: 14px; padding: 24px 28px;
  box-shadow: 0 2px 12px rgba(60,80,160,.07); margin-bottom: 20px;
  border: 1px solid #f0f2f8;
}
.cdk-settings-section h5 {
  font-size: 13px; font-weight: 700; color: #4b5563; text-transform: uppercase;
  letter-spacing: .07em; margin: 0 0 16px; padding-bottom: 10px;
  border-bottom: 1px solid #f0f2f8;
}

/* -- Settings Widget Live Preview ------------------------- */
.cdk-settings-preview {
  position: relative;
  background: #f0f2f8;
  border-radius: 16px;
  padding: 20px;
  min-height: 280px;
  border: 1px solid #e4e7f0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.cdk-prev-widget {
  width: 280px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  background: #fff;
  font-size: 13px;
  display: flex;
  flex-direction: column;
}
.cdk-prev-header {
  background: #6366f1;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cdk-prev-header-left { display: flex; align-items: center; gap: 10px; }
.cdk-prev-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.cdk-prev-title { font-weight: 700; font-size: 14px; line-height: 1.2; }
.cdk-prev-subtitle { font-size: 11px; opacity: .75; }
.cdk-prev-close { cursor: pointer; opacity: .7; font-size: 13px; }
.cdk-prev-body {
  padding: 14px 12px;
  min-height: 100px;
  background: #f7f8fc;
}
.cdk-prev-bubble {
  max-width: 80%;
  margin-bottom: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.4;
}
.cdk-prev-bubble-in {
  background: #fff;
  color: #374151;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.cdk-prev-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #eee;
  background: #fff;
}
.cdk-prev-input {
  flex: 1; border: 1px solid #e4e7f0; border-radius: 20px;
  padding: 7px 12px; font-size: 12px; outline: none;
  background: #f7f8fc; color: #9ca3af;
}
.cdk-prev-btn {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: #6366f1; color: #fff; cursor: default;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.cdk-prev-launcher {
  width: 52px; height: 52px; border-radius: 50%;
  background: #6366f1; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; box-shadow: 0 4px 16px rgba(99,102,241,.4);
  flex-shrink: 0;
}

/* -- Pre-chat form preview box ---------------------------- */
.cdk-prechat-preview-box {
  width: 300px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  background: #fff;
  margin-top: 20px;
  margin-bottom: 8px;
}
.cdk-prechat-preview-box .cdk-prev-header {
  background: #6366f1;
  color: #fff;
  padding: 16px;
  font-weight: 700;
  font-size: 15px;
}
.cdk-prechat-preview-box .cdk-prev-body {
  padding: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cdk-prechat-preview-box .cdk-prev-body input[type=text] {
  width: 100%;
  border: 1px solid #e4e7f0;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  background: #f7f8fc;
  color: #9ca3af;
  box-sizing: border-box;
  display: block;
}
.cdk-prechat-preview-box .cdk-prev-btn {
  display: block;
  width: 100%;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: default;
  margin-top: 4px;
}

/* Pre-chat preview mock fields */
.cdk-prev-field-mock {
  border: 1px solid #e4e7f0;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  background: #f7f8fc;
  color: #9ca3af;
  margin-bottom: 8px;
  line-height: 1.4;
}
.cdk-prev-field-mock .cdk-prev-req {
  color: #ef4444;
  font-weight: 700;
}

/* Analytics chart empty state */
.cdk-chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #9ca3af;
  gap: 10px;
  font-size: 13px;
}

/* ============================================================
   CDK Chat — Messaging page redesign (cdkm-*)
   ============================================================ */

/* Page wrapper */
.cdkm-page { padding: 0 !important; }
.cdkm-page .content { padding: 0 !important; }

/* Full-viewport shell */
.cdkm-shell {
  display: flex;
  height: calc(100vh - 66px);
  min-height: 540px;
  overflow: hidden;
  background: #f0f2f8;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.cdkm-sidebar {
  width: 280px;
  min-width: 240px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid rgba(99,102,241,.12);
  overflow: hidden;
}

/* Search */
.cdkm-search-wrap {
  position: relative;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(99,102,241,.08);
  flex-shrink: 0;
}
.cdkm-search-icon {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 12px;
  pointer-events: none;
}
.cdkm-search {
  width: 100%;
  padding: 7px 10px 7px 30px;
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 20px;
  background: #f4f5fb;
  font-size: 13px;
  color: #1e293b;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}
.cdkm-search:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

/* Section headers */
.cdkm-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #94a3b8;
  flex-shrink: 0;
}
.cdkm-section-btn {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(99,102,241,.1);
  color: #6366f1;
  font-size: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.cdkm-section-btn:hover { background: rgba(99,102,241,.2); }

/* Person list */
.cdkm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 0 0 auto;
  max-height: 46%;
}
.cdkm-list-groups { max-height: 30%; }
.cdkm-list::-webkit-scrollbar { width: 3px; }
.cdkm-list::-webkit-scrollbar-thumb { background: rgba(99,102,241,.2); border-radius: 3px; }

.cdkm-list-empty {
  padding: 10px 16px;
  font-size: 12px;
  color: #b0bac8;
  font-style: italic;
}

/* Person item */
.cdkm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid rgba(99,102,241,.04);
}
.cdkm-item:hover     { background: rgba(99,102,241,.05); }
.cdkm-item.active    { background: rgba(99,102,241,.1); }

/* Avatar */
.cdkm-ava-wrap { position: relative; flex-shrink: 0; }
.cdkm-ava {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  background: #6366f1;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.cdkm-ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cdkm-ava-group { background: #10b981; }

/* Presence dot */
.cdkm-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #cbd5e1;
}
.cdkm-dot-online  { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.25); }
.cdkm-dot-away    { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.25); }
.cdkm-dot-busy    { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.25); }
.cdkm-dot-offline { background: #cbd5e1; }

/* Item body (name + preview) */
.cdkm-item-body { flex: 1; min-width: 0; }
.cdkm-item-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
}
.cdkm-item-name {
  font-size: .875rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cdkm-item-time {
  font-size: .72rem;
  color: #b0bac8;
  white-space: nowrap;
  flex-shrink: 0;
}
.cdkm-item-preview {
  font-size: .76rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Unread badge */
.cdkm-unread-badge {
  background: #ef4444;
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Main area ───────────────────────────────────────────── */
.cdkm-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #f4f5fb;
  position: relative;
}

/* Placeholder */
.cdkm-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #94a3b8;
  padding: 40px;
  text-align: center;
}
.cdkm-ph-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(99,102,241,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #6366f1;
}
.cdkm-ph-title {
  font-size: 18px;
  font-weight: 700;
  color: #475569;
}
.cdkm-ph-sub {
  font-size: 13.5px;
  color: #94a3b8;
  line-height: 1.6;
}

/* Thread container */
.cdkm-thread {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Thread header */
.cdkm-thread-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #fff;
  border-bottom: 1px solid rgba(99,102,241,.1);
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(99,102,241,.05);
}
.cdkm-thread-hdr-left { display: flex; align-items: center; gap: 12px; }
.cdkm-thread-name  { font-size: 15px; font-weight: 700; color: #1e293b; }
.cdkm-thread-status { font-size: 12px; color: #64748b; margin-top: 1px; }
.cdkm-thread-hdr-actions { display: flex; align-items: center; gap: 8px; }
.cdkm-hdr-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(99,102,241,.07);
  color: #6366f1;
  font-size: 13px;
  text-decoration: none;
  transition: background .2s;
}
.cdkm-hdr-btn:hover { background: rgba(99,102,241,.15); color: #4f46e5; }

/* Messages scroll area */
.cdkm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cdkm-messages::-webkit-scrollbar { width: 4px; }
.cdkm-messages::-webkit-scrollbar-thumb { background: rgba(99,102,241,.2); border-radius: 4px; }

/* Date separator */
.cdkm-date-sep {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: .04em;
  margin: 12px 0 8px;
  position: relative;
}
.cdkm-date-sep::before,
.cdkm-date-sep::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: rgba(99,102,241,.12);
}
.cdkm-date-sep::before { left: 0; }
.cdkm-date-sep::after  { right: 0; }

/* Sender label */
.cdkm-sender-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin: 8px 0 2px;
  padding-left: 2px;
}

/* Message rows */
.cdkm-msg-row {
  display: flex;
  margin-bottom: 1px;
}
.cdkm-msg-row.out { justify-content: flex-end; }
.cdkm-msg-row.in  { justify-content: flex-start; }

/* Bubbles */
.cdkm-bubble {
  max-width: 70%;
  padding: 9px 14px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
.cdkm-bubble.out {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.cdkm-bubble.in {
  background: #fff;
  color: #1e293b;
  border-bottom-left-radius: 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* Attachment inside bubble */
.cdkm-attach {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  opacity: .85;
  text-decoration: underline;
  color: inherit;
}
.cdkm-bubble.out .cdkm-attach { color: rgba(255,255,255,.9); }
.cdkm-bubble.in  .cdkm-attach { color: #6366f1; }

/* Timestamp */
.cdkm-msg-time {
  font-size: 10.5px;
  color: #b0bac8;
  margin-bottom: 6px;
  padding: 0 4px;
}
.cdkm-msg-time.out { text-align: right; }
.cdkm-msg-time.in  { text-align: left; }

/* Typing bar */
.cdkm-typing-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  font-size: 12px;
  color: #94a3b8;
  flex-shrink: 0;
}
.cdkm-typing-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.cdkm-typing-dots span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #94a3b8;
  animation: cdkm-dot-bounce 1.2s ease-in-out infinite;
}
.cdkm-typing-dots span:nth-child(2) { animation-delay: .2s; }
.cdkm-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes cdkm-dot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-4px); }
}

/* Compose bar */
.cdkm-compose {
  padding: 10px 16px 14px;
  background: #fff;
  border-top: 1px solid rgba(99,102,241,.1);
  flex-shrink: 0;
}
.cdkm-compose-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #f4f5fb;
  border: 1.5px solid rgba(99,102,241,.2);
  border-radius: 14px;
  padding: 8px 10px;
  transition: border-color .2s, box-shadow .2s;
}
.cdkm-compose-box:focus-within {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.cdkm-compose-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  color: #1e293b;
  resize: none;
  line-height: 1.5;
  max-height: 120px;
  overflow-y: auto;
}
.cdkm-compose-input::placeholder { color: #94a3b8; }
.cdkm-send-btn {
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity .2s, transform .15s;
}
.cdkm-send-btn:hover:not(:disabled) { opacity: .9; transform: scale(1.05); }
.cdkm-send-btn:disabled { opacity: .35; cursor: not-allowed; }
.cdkm-compose-hint {
  font-size: 11px;
  color: #b0bac8;
  margin-top: 5px;
  padding-left: 4px;
}
.cdkm-emoji-btn {
  width: 30px; height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.cdkm-emoji-btn:hover { color: #6366f1; background: rgba(99,102,241,.08); }

/* ── Emoji picker (shared) ─────────────────────────────── */
.cdk-emoji-picker {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 8px 32px rgba(60,80,160,.18), 0 2px 8px rgba(60,80,160,.1);
  display: grid;
  grid-template-columns: repeat(8, 32px);
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
}
.cdk-emoji-picker::-webkit-scrollbar { width: 4px; }
.cdk-emoji-picker::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }
.cdk-emoji-btn-item {
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s;
  line-height: 1;
}
.cdk-emoji-btn-item:hover { background: #f1f5f9; }

/* ── Group modal ─────────────────────────────────────────── */
.cdkm-modal { border-radius: 14px; overflow: hidden; }
.cdkm-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.cdkm-modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.cdkm-modal-close:hover { color: #fff; }
.cdkm-label { font-size: 12.5px; font-weight: 600; color: #475569; margin-bottom: 5px; display: block; }
.cdkm-member-picker {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid rgba(99,102,241,.15);
  border-radius: 8px;
  padding: 4px 0;
}
.cdkm-member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: background .15s;
  margin: 0;
  font-weight: 400;
}
.cdkm-member-row:hover { background: rgba(99,102,241,.05); }
.cdkm-member-cb { flex-shrink: 0; accent-color: #6366f1; }

/* ============================================================
   CDK Chat — Inbox redesign (cdki-* namespace)
   ============================================================ */

/* ── Layout ─────────────────────────────────────────────── */
.cdki-page { padding: 0 !important; }

.cdki-shell {
  display: flex;
  height: calc(100vh - 66px);
  overflow: hidden;
  background: #f8f8fb;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.cdki-sidebar {
  width: 320px;
  min-width: 280px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #e8eaf0;
  overflow: hidden;
}

.cdki-sidebar-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #f1f1f5;
}

.cdki-sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e1b4b;
  letter-spacing: -.2px;
}

.cdki-settings-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #6b7280;
  transition: background .15s, color .15s;
}

.cdki-settings-btn:hover {
  background: #f3f4f6;
  color: #6366f1;
}

/* ── Filter tabs ─────────────────────────────────────────── */
.cdki-filter-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px 8px;
}

.cdki-ftab {
  flex: 1;
  padding: 5px 0;
  border: none;
  border-radius: 20px;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.cdki-ftab:hover { background: #f3f4f6; color: #4b5563; }

.cdki-ftab.active {
  background: #6366f1;
  color: #fff;
}

/* ── Search ──────────────────────────────────────────────── */
.cdki-search-wrap {
  position: relative;
  padding: 0 12px 10px;
}

.cdki-search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 12px;
  pointer-events: none;
}

.cdki-search {
  width: 100%;
  height: 34px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 0 12px 0 32px;
  font-size: 13px;
  background: #f9fafb;
  color: #111827;
  outline: none;
  transition: border-color .15s, background .15s;
  box-sizing: border-box;
}

.cdki-search:focus {
  border-color: #a5b4fc;
  background: #fff;
}

/* ── Conversation list ───────────────────────────────────── */
.cdki-conv-list {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 8px;
}

.cdki-loading {
  padding: 24px;
  text-align: center;
  color: #a0aec0;
}

.cdki-conv-empty {
  padding: 32px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
  line-height: 1.8;
}

.cdki-conv-empty i {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
  color: #d1d5db;
}

.cdki-load-more {
  padding: 10px 14px;
  text-align: center;
  font-size: 12px;
  color: #6366f1;
  cursor: pointer;
  border-top: 1px solid #f1f5f9;
  transition: background .12s;
}
.cdki-load-more:hover { background: #f8f9ff; }

/* ── Conversation item ───────────────────────────────────── */
.cdki-conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .12s;
  border-bottom: 1px solid #f5f5f9;
  position: relative;
}

.cdki-conv-item:hover  { background: #f5f5ff; }
.cdki-conv-item.active { background: #ede9fe; }

.cdki-conv-item.has-unread .cdki-conv-name {
  font-weight: 700;
  color: #1e1b4b;
}

.cdki-conv-ava {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.cdki-conv-body {
  flex: 1;
  min-width: 0;
}

.cdki-conv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.cdki-conv-name {
  font-size: 13px;
  font-weight: 500;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.cdki-conv-time {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
  flex-shrink: 0;
}

.cdki-conv-preview {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.cdki-conv-preview em { font-style: italic; }

.cdki-unread-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #6366f1;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cdki-cust-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  line-height: 14px;
  flex-shrink: 0;
  margin-right: 6px;
}
.cdki-cust-badge.cust-new   { background: #dcfce7; color: #15803d; }
.cdki-cust-badge.cust-reg   { background: #e0e7ff; color: #4338ca; }
.cdki-cust-badge.cust-guest { background: #f3f4f6; color: #6b7280; }

.cdki-pri-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  position: absolute;
  top: 10px;
  right: 10px;
}

.cdki-pri-dot.high   { background: #ef4444; box-shadow: 0 0 4px #ef444466; }
.cdki-pri-dot.medium { background: #f59e0b; }
.cdki-pri-dot.low    { background: #10b981; }

/* ── Main panel ──────────────────────────────────────────── */
.cdki-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ── Empty state ─────────────────────────────────────────── */
.cdki-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.cdki-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ede9fe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #6366f1;
  margin-bottom: 16px;
}

.cdki-empty-title {
  font-size: 17px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.cdki-empty-sub {
  font-size: 13px;
  color: #9ca3af;
  max-width: 300px;
  line-height: 1.5;
}

/* ── Active window ───────────────────────────────────────── */
.cdki-window {
  flex: 1;
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Window header ───────────────────────────────────────── */
.cdki-window-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e8eaf0;
  min-height: 60px;
  flex-shrink: 0;
  gap: 10px;
}

.cdki-hdr-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cdki-ava {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.cdki-contact { min-width: 0; }

.cdki-contact-name {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cdki-contact-sub {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Header actions ──────────────────────────────────────── */
.cdki-hdr-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.cdki-assign-wrap select {
  height: 32px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0 8px;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  max-width: 150px;
}

.cdki-assign-wrap select:focus {
  border-color: #6366f1;
  outline: none;
}

.cdki-action-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
  padding: 0;
}

.cdki-action-btn:hover,
.cdki-action-btn.active {
  background: #ede9fe;
  border-color: #a5b4fc;
  color: #6366f1;
}

.cdki-priority-sel {
  width: auto;
  padding: 0 8px;
  font-size: 11px;
}

.cdki-close-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all .15s;
  white-space: nowrap;
}

.cdki-close-btn:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.cdki-close-btn.danger { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }

/* ── Messages ────────────────────────────────────────────── */
.cdki-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #f8f8fb;
}

.cdki-date-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.cdki-date-sep::before,
.cdki-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

/* System event messages — centered pill with hairline rules */
.cdki-system-event {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  font-size: 11px;
  color: #9ca3af;
  margin: 6px 0;
  width: 100%;
}

.cdki-system-event::before,
.cdki-system-event::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.cdki-system-event span {
  white-space: nowrap;
  background: #f9fafb;
  padding: 2px 10px;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
}

.cdki-sender-lbl {
  font-size: 11px;
  color: #9ca3af;
  margin: 8px 0 2px 4px;
}

.cdki-msg-row {
  display: flex;
  max-width: 72%;
}

.cdki-msg-row.out { align-self: flex-end; justify-content: flex-end; }
.cdki-msg-row.in  { align-self: flex-start; }

.cdki-bubble {
  padding: 9px 13px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.45;
  max-width: 100%;
  word-break: break-word;
}

.cdki-bubble.out {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.cdki-bubble.in {
  background: #fff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.cdki-attach {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: inherit;
  opacity: .85;
  text-decoration: underline;
}

.cdki-msg-time {
  font-size: 10.5px;
  color: #9ca3af;
  margin: 2px 0 6px;
}

.cdki-msg-time.out { align-self: flex-end; text-align: right; }
.cdki-msg-time.in  { align-self: flex-start; }

/* ── Typing bar ──────────────────────────────────────────── */
.cdki-typing-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 12px;
  color: #9ca3af;
  background: #f8f8fb;
  flex-shrink: 0;
}

.cdki-typing-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.cdki-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a5b4fc;
  animation: cdki-dot-bounce .9s infinite;
}

.cdki-typing-dots span:nth-child(2) { animation-delay: .15s; }
.cdki-typing-dots span:nth-child(3) { animation-delay: .30s; }

@keyframes cdki-dot-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%            { transform: translateY(-5px); }
}

/* ── Quick replies ───────────────────────────────────────── */
.cdki-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  background: #f8f8fb;
  border-top: 1px solid #f1f1f5;
  flex-shrink: 0;
}

.cdki-qr {
  padding: 4px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  font-size: 11.5px;
  color: #374151;
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
}

.cdki-qr:hover {
  border-color: #a5b4fc;
  background: #ede9fe;
  color: #4f46e5;
}

/* ── Compose bar ─────────────────────────────────────────── */
.cdki-compose {
  padding: 10px 14px 8px;
  background: #fff;
  border-top: 1px solid #e8eaf0;
  flex-shrink: 0;
}

.cdki-compose-box {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  padding: 6px 6px 6px 10px;
  background: #f9fafb;
  transition: border-color .15s;
}

.cdki-compose-box:focus-within {
  border-color: #a5b4fc;
  background: #fff;
}

.cdki-attach-lbl {
  cursor: pointer;
  color: #9ca3af;
  font-size: 15px;
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: color .12s;
}

.cdki-attach-lbl:hover { color: #6366f1; }

.cdki-compose-input {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 22px;
  max-height: 120px;
  overflow-y: auto;
  padding: 2px 0;
  color: #1f2937;
}

.cdki-compose-input::placeholder { color: #9ca3af; }

.cdki-qr-toggle,
.cdki-send-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition: all .15s;
}

.cdki-qr-toggle {
  background: transparent;
  color: #9ca3af;
}

.cdki-qr-toggle:hover { background: #f3f4f6; color: #6366f1; }

.cdki-send-btn {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
}

.cdki-send-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #6d28d9);
  transform: scale(1.05);
}

.cdki-compose-hint {
  font-size: 10.5px;
  color: #c4b5fd;
  text-align: right;
  margin-top: 4px;
  padding-right: 2px;
}
.cdki-emoji-btn {
  width: 30px; height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(255,255,255,.6);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.cdki-emoji-btn:hover { color: #fff; background: rgba(255,255,255,.15); }

/* ── Slide-in panels ─────────────────────────────────────── */
.cdki-panel {
  position: absolute;
  top: 60px;
  right: 0;
  bottom: 0;
  width: 300px;
  background: #fff;
  border-left: 1px solid #e8eaf0;
  display: none;
  flex-direction: column;
  z-index: 20;
  box-shadow: -4px 0 16px rgba(0,0,0,.07);
}

/* ── Conversation item exit animation ────────────────────────────────────────
   Applied by JS (cdki-removing class) when a conversation is closed/reopened
   and leaves the current filter view. Slides left and collapses height.
   ─────────────────────────────────────────────────────────────────────────── */
@keyframes cdkiSlideOut {
  from { opacity: 1; transform: translateX(0);    max-height: 80px; padding-top: 10px; padding-bottom: 10px; }
  to   { opacity: 0; transform: translateX(-18px); max-height: 0;   padding-top: 0;   padding-bottom: 0;    margin: 0; border: 0; }
}
.cdki-conv-item.cdki-removing {
  animation: cdkiSlideOut 0.3s ease forwards;
  pointer-events: none;
  overflow: hidden;
}

/* ── FA icon patches ─────────────────────────────────────────────────────────
   Perfex ships a stripped FA6 CSS that sets content:"" for unused icons.
   These !important rules override those empty values so glyphs render.
   Font files are unstripped — all glyphs are present in the webfonts.
   ─────────────────────────────────────────────────────────────────────────── */
/* Regular-weight icons: override the font-weight v4-shims sets to 400 */
.fa.fa-check-square-o { font-weight: 900 !important; }
.fa.fa-sticky-note-o  { font-weight: 900 !important; }
.fa.fa-smile-o        { font-weight: 900 !important; }

/* Toolbar action buttons */
.fa.fa-tag:before            { content: "\f02b" !important; }
.fa.fa-ticket:before         { content: "\f145" !important; }
.fa.fa-check-square-o:before { content: "\f14a" !important; }
.fa.fa-sticky-note-o:before  { content: "\f249" !important; }
.fa.fa-exchange:before       { content: "\f362" !important; }

/* Compose bar */
.fa.fa-paperclip:before   { content: "\f0c6" !important; }
.fa.fa-bolt:before        { content: "\f0e7" !important; }
.fa.fa-smile-o:before     { content: "\f118" !important; }
.fa.fa-paper-plane:before { content: "\f1d8" !important; }

/* General UI icons */
.fa.fa-times-circle:before   { content: "\f057" !important; }
.fa.fa-times:before          { content: "\f00d" !important; }
.fa.fa-plus:before           { content: "\f067" !important; }
.fa.fa-search:before         { content: "\f002" !important; }
.fa.fa-cog:before            { content: "\f013" !important; }
.fa.fa-comments:before       { content: "\f086" !important; }
.fa.fa-circle-o-notch:before { content: "\f1ce" !important; }
.fa.fa-volume-up:before      { content: "\f028" !important; }
.fa.fa-volume-off:before     { content: "\f026" !important; }

.cdki-panel.open,
.cdki-panel[style*="display: flex"],
.cdki-panel[style*="display:flex"] {
  display: flex !important;
}

.cdki-panel-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f1f5;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  background: #fafafd;
}

.cdki-panel-close {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 16px;
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cdki-panel-close:hover { background: #f3f4f6; color: #374151; }

.cdki-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
}

/* ── Sidebar header multi-button wrapper ─────────────────────────────── */
.cdki-sidebar-hdr { justify-content: space-between; }
.cdki-sidebar-hdr-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Select toggle button ────────────────────────────────────────────── */
.cdki-select-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  border-radius: 7px;
  color: rgba(255,255,255,.55);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.cdki-select-btn:hover,
.cdki-select-btn.active { background: rgba(255,255,255,.15); color: #fff; }

/* ── Checkbox on conversation items ─────────────────────────────────── */
.cdki-conv-cb-wrap {
  display: none;
  align-items: center;
  justify-content: center;
  width: 0;
  overflow: hidden;
  flex-shrink: 0;
  transition: width .18s;
}
.cdki-conv-cb {
  width: 15px;
  height: 15px;
  accent-color: #6366f1;
  cursor: pointer;
}
.cdki-sidebar.select-mode .cdki-conv-cb-wrap {
  display: flex;
  width: 26px;
}
.cdki-sidebar.select-mode .cdki-conv-item { cursor: pointer; }
.cdki-sidebar.select-mode .cdki-conv-item:hover { background: #f5f5ff; }
.cdki-sidebar.select-mode .cdki-conv-item.selected { background: #eef2ff; }

/* ── Bulk action bar ─────────────────────────────────────────────────── */
.cdki-bulk-bar {
  background: #1e1b4b;
  border-top: 1px solid #3730a3;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.cdki-bulk-info {
  font-size: 12px;
  font-weight: 600;
  color: #c7d2fe;
  white-space: nowrap;
}
.cdki-bulk-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.cdki-bulk-btn {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: #6366f1;
  color: #fff;
  transition: background .15s;
  white-space: nowrap;
}
.cdki-bulk-btn:hover { background: #4f46e5; }
.cdki-bulk-cancel {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,.12);
  color: #c7d2fe;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background .15s;
  flex-shrink: 0;
}
.cdki-bulk-cancel:hover { background: rgba(255,255,255,.22); color: #fff; }
.cdki-bulk-sel {
  font-size: 11.5px;
  padding: 4px 6px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  background: rgba(255,255,255,.1);
  color: #e0e7ff;
  cursor: pointer;
  max-width: 110px;
}
.cdki-bulk-sel option { background: #1e1b4b; color: #e0e7ff; }

/* ── Search results header ───────────────────────────────────────────── */
.cdki-search-results-hdr {
  padding: 5px 12px;
  font-size: 11px;
  color: #6366f1;
  font-weight: 600;
  border-bottom: 1px solid #f1f1f5;
  background: #fafafd;
}

/* ── Keyboard shortcuts modal ────────────────────────────────────────────── */
.cdki-shortcuts-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cdki-shortcuts-box {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 380px;
  max-width: 95vw;
  overflow: hidden;
}
.cdki-shortcuts-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #1e1b4b;
  color: #e0e7ff;
  font-size: 13.5px;
  font-weight: 700;
}
.cdki-shortcuts-close {
  width: 28px; height: 28px;
  border: none; border-radius: 7px;
  background: rgba(255,255,255,.12);
  color: #c7d2fe;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cdki-shortcuts-close:hover { background: rgba(255,255,255,.22); color: #fff; }
.cdki-shortcuts-body { padding: 10px 18px 16px; }
.cdki-shortcuts-tbl { width: 100%; border-collapse: collapse; }
.cdki-shortcuts-tbl tr td {
  padding: 7px 6px;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.cdki-shortcuts-tbl tr:last-child td { border-bottom: none; }
.cdki-shortcuts-tbl td:first-child { white-space: nowrap; }
.cdki-shortcuts-tbl td:last-child { color: #6b7280; padding-left: 14px; }
kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-family: monospace;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  box-shadow: 0 1px 0 rgba(0,0,0,.12);
  color: #374151;
  line-height: 1.5;
}

/* ============================================================
   v1.1.0 — Admin Chat Mobile Responsive (Perfex admin panel)
   Targets .cdki-* classes used in manage.php inbox view.
   ============================================================ */
@media (max-width: 768px) {

  /* Full-height shell & allow drawer behaviour */
  .cdki-shell {
    height: calc(100vh - 56px);
    position: relative;
  }

  /* Sidebar becomes an off-canvas drawer; full width */
  .cdki-sidebar {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
    z-index: 40;
    transform: translateX(0);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow: 2px 0 16px rgba(0,0,0,.12);
  }
  /* When a conversation is active the shell gets .cdki-mobile-conv
     and slides the sidebar out. JS toggles this class. */
  .cdki-shell.cdki-mobile-conv .cdki-sidebar {
    transform: translateX(-100%);
  }
  .cdki-shell:not(.cdki-mobile-conv) .cdki-main .cdki-empty { display: flex; }
  .cdki-shell:not(.cdki-mobile-conv) .cdki-main { display: none; }
  .cdki-shell.cdki-mobile-conv .cdki-main { display: flex; }

  /* Back button shown only on mobile in main header */
  .cdki-mobile-back {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border: none; background: transparent;
    color: #475569; font-size: 18px;
    margin-right: 4px;
    border-radius: 8px;
    cursor: pointer;
  }
  .cdki-mobile-back:hover { background: #f1f5f9; }

  /* Main panel: full height, allow header to wrap */
  .cdki-main { min-width: 0; }

  /* Header: stack the action bar under the contact row, horizontal scroll */
  .cdki-header,
  .cdki-chat-header,
  .cdki-window-hdr {
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 6px;
    align-items: center;
  }
  .cdki-hdr-left {
    flex: 1 1 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    order: 1;
  }
  .cdki-hdr-left .cdki-contact {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }
  .cdki-contact-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
  .cdki-contact-sub {
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
  .cdki-ava { width: 34px; height: 34px; font-size: 13px; flex: 0 0 34px; }

  .cdki-hdr-actions {
    flex: 0 0 100%;
    order: 2;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .cdki-hdr-actions::-webkit-scrollbar { height: 3px; }
  .cdki-hdr-actions::-webkit-scrollbar-thumb { background: rgba(99,102,241,.3); border-radius: 3px; }
  .cdki-hdr-actions .cdki-action-btn,
  .cdki-hdr-actions .cdki-close-btn {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 12px;
  }
  .cdki-hdr-actions .cdki-close-btn {
    /* hide verbose label on mobile, keep icon */
    font-size: 0;
  }
  .cdki-hdr-actions .cdki-close-btn i { font-size: 14px; }
  .cdki-hdr-actions .cdki-assign-wrap select,
  .cdki-hdr-actions .cdki-priority-sel {
    max-width: 110px;
    font-size: 12px;
  }

  /* Messages area */
  .cdki-messages {
    padding: 12px 10px !important;
    gap: 6px;
  }
  /* Row hugs the bubble; cap at 85% of the messages column. */
  .cdki-msg-row {
    max-width: 85% !important;
    width: fit-content;
    min-width: 0;
  }
  .cdki-msg-row.out { margin-left: auto; }
  .cdki-msg-row.in  { margin-right: auto; }
  .cdki-bubble,
  .cdki-msg-bubble {
    max-width: 100% !important;
    width: fit-content;
    min-width: 0;
    font-size: 13.5px;
    overflow-wrap: anywhere;
    word-break: normal;       /* stop per-character wrapping for short words */
    white-space: pre-wrap;    /* preserve user line breaks but wrap at words */
  }

  /* Compose bar */
  .cdki-compose {
    padding: 8px 10px !important;
  }
  .cdki-compose-box {
    gap: 4px;
  }
  .cdki-compose-input,
  #cdkMessageInput {
    font-size: 14px; /* prevent iOS zoom */
    padding: 8px 12px !important;
  }
  .cdki-attach-lbl,
  .cdki-qr-toggle,
  .cdki-emoji-btn {
    width: 32px !important; height: 32px !important;
    font-size: 14px;
  }
  .cdki-send-btn {
    width: 36px !important; height: 36px !important;
  }
  .cdki-compose-hint { display: none; }

  /* Side panels (tags, notes, follow-up, details) — full screen overlays */
  .cdki-panel,
  #cdkNotesPanel, #cdkTagsPanel, #cdkFollowUpPanel, #cdkDetailsPanel,
  .cdk-notes-panel {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Quick replies: horizontal scroll */
  .cdki-quick-replies {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .cdki-quick-replies .cdki-qr {
    flex-shrink: 0;
    font-size: 11px;
  }

  /* Canned responses popup — full width */
  #cdkCannedPopup {
    width: 94vw !important;
    left: 3vw !important;
    right: 3vw !important;
    max-width: none !important;
  }

  /* Emoji picker */
  #cdkEmojiPicker {
    width: 94vw !important;
    max-width: 360px;
  }

  /* Staff/messaging page (DM) — same drawer pattern */
  .cdkm-shell {
    height: calc(100vh - 90px);
    position: relative;
  }
  .cdkm-sidebar {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    z-index: 30;
    transform: translateX(0);
    transition: transform .25s ease;
  }
  .cdkm-shell.cdkm-mobile-conv .cdkm-sidebar {
    transform: translateX(-100%);
  }
  .cdkm-shell:not(.cdkm-mobile-conv) .cdkm-main { display: none; }
  .cdkm-main { min-width: 0; }
  .cdkm-hdr { padding: 8px 10px; }
  .cdkm-compose,
  .cdkm-input-area { padding: 8px 10px; }
  .cdkm-input,
  .cdkm-compose textarea {
    font-size: 14px; /* prevent iOS zoom */
  }
}

/* Small phones */
@media (max-width: 420px) {
  .cdki-hdr-actions .cdki-action-btn {
    padding: 5px 8px;
  }
  .cdki-contact-name { font-size: 12.5px; }
  .cdki-ava { width: 32px; height: 32px; font-size: 13px; }
  .cdki-sidebar-hdr { padding: 10px 12px 8px; }
  .cdki-sidebar-title { font-size: 13px; }
}

/* Desktop — hide the mobile back button */
.cdki-mobile-back { display: none; }

/* ============================================================
   v1.1.2 — PWA / installed-app fixes
   When running inside the cdk_mobile or nexus PWA shell, the
   bottom navigation bar (60px + safe-area) overlaps the chat
   composer. Reserve room and tighten the admin chat header
   for small screens so things stop scrolling sideways.
   ============================================================ */
@media (display-mode: standalone), (max-width: 768px) {
  /* Reserve space for the PWA bottom nav (60px + iOS safe-area).
     This kicks in for true PWAs AND for any narrow viewport where
     the floating widget / on-screen keyboard would otherwise eat
     the composer. The value collapses to 0 on desktop. */
  :root {
    --cdk-pwa-nav-pad: calc(60px + env(safe-area-inset-bottom, 0px));
  }
}
@media not all and (display-mode: standalone) {
  :root { --cdk-pwa-nav-pad: 0px; }
}
@media (max-width: 768px) {
  /* Admin inbox shell: leave room for PWA nav */
  .cdki-shell {
    height: calc(100vh - 56px - var(--cdk-pwa-nav-pad, 0px));
  }
  /* Side panels (notes, tags, follow-up, details) must also stop
     above the bottom nav so action buttons aren't covered. */
  .cdki-panel,
  #cdkNotesPanel, #cdkTagsPanel, #cdkFollowUpPanel, #cdkDetailsPanel,
  .cdk-notes-panel {
    bottom: var(--cdk-pwa-nav-pad, 0px) !important;
  }
  /* DM/staff messaging shell */
  .cdkm-shell {
    height: calc(100vh - 90px - var(--cdk-pwa-nav-pad, 0px));
  }
  /* Cleaner header: drop the duplicate scrollbar by hiding the
     native one — it was visible above the action chips. */
  .cdki-hdr-actions { scrollbar-width: none; }
  .cdki-hdr-actions::-webkit-scrollbar { display: none; height: 0; }

  /* Stickier composer that always sits above the PWA nav */
  .cdki-compose {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 5;
  }

  /* Action bar on a single horizontal scroll row, but smaller
     so 3-4 chips are visible at once instead of 1-2. */
  .cdki-hdr-actions .cdki-action-btn,
  .cdki-hdr-actions .cdki-close-btn {
    padding: 5px 8px !important;
    font-size: 11.5px !important;
    line-height: 1.2;
  }
  .cdki-hdr-actions .cdki-action-btn .fa,
  .cdki-hdr-actions .cdki-close-btn .fa { font-size: 12px; }

  /* Hide the global floating chat widget bubble on the inbox page
     itself — it overlaps the composer. */
  body.cdk-chat-inbox-open #cdkChatWidget,
  body.cdk-chat-inbox-open .cdk-chat-widget-launcher { display: none !important; }
}

/* True-PWA only: extra polish */
@media (display-mode: standalone) {
  .cdki-shell {
    /* Use small-viewport units when supported so the URL bar / address
       bar collapse doesn't briefly chop the bottom of the composer. */
    height: calc(100svh - 56px - var(--cdk-pwa-nav-pad, 0px));
  }
  .cdkm-shell {
    height: calc(100svh - 90px - var(--cdk-pwa-nav-pad, 0px));
  }
}
