a{
    color:midnightblue !important;
}
.chat-box {
  height: 60vh;
  overflow: auto;
  background: #f8fafc;
}

/* Message container */
.msg {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
}

.msg.me {
  align-items: flex-end;
}

/* ============================= */
/* New chat design with avatar   */
/* ============================= */
.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.5rem 1rem;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-bubble {
  border-radius: 10px;
  padding: 8px 12px;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-bubble .name {
  font-weight: 600;
  margin-bottom: 2px;
  font-size: 0.9rem;
}

.chat-bubble .body {
  font-size: 0.95rem;
  line-height: 1.4;
}

.chat-bubble .time {
  font-size: 0.75rem;
  margin-top: 4px;
  color: #6c757d;
  text-align: right;
}

/* Side-specific colors */
.msg.me .chat-row {
  flex-direction: row-reverse;
}

.msg.me .chat-avatar {
  background: #0d6efd;
}

.msg.me .chat-bubble {
  background: #0d6efd;
  color: #fff;
}

.msg.me .chat-bubble .time {
  color: rgba(255,255,255,0.7);
}

.msg:not(.me) .chat-bubble {
  background: #e9ecef;
  color: #000;
}

/* ============================= */
/* System & typing indicators    */
/* ============================= */

/* System messages still use old bubble */
.msg.system {
  text-align: center;
  margin-bottom: 10px;
  margin-left: 10px;
}
.msg.system .bubble {
  display: inline-block;
  font-size: 0.9rem;
  color: #555;
  background: #f1f1f1;
  border-radius: 8px;
  padding: 6px 10px;
}

/* Timestamp (used outside bubble if needed) */
.timestamp {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 2px;
  text-align: right;
  white-space: nowrap;
}
.msg.me .timestamp {
  color: rgba(0, 0, 0, 0.6);
}
.msg:not(.me) .timestamp {
  color: rgba(0, 0, 0, 0.6);
  text-align: left;
  margin-right: auto;
}

/* Typing indicator */
.typing {
  min-height: 1.5rem;
  color: #6c757d;
  font-style: italic;
}

/* Guest info header */
.guest-info {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin: 0 0 2px 0;
}

/* Media attachments */
.chat-media {
  margin-top: 5px;
  border-radius: 6px;
  max-width: 200px;
  display: block;
}

/* ============================= */
/* Ticket list (mobile polish)   */
/* ============================= */
@media (max-width: 576.98px) {
  #ticketsList .ticket-item .subject {
    font-size: 0.95rem;
    line-height: 1.35;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    word-break: break-word;
    overflow-wrap: anywhere;
    flex: 1 1 auto;
    min-width: 0;
  }

  #ticketsList .ticket-item .d-flex.align-items-center.justify-content-between.gap-2 {
    min-width: 0;
  }

  #ticketsList .meta-line {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
