/* ====================================================
   SLIDE-OVER CHAT DRAWER PANEL
   ==================================================== */
.chat-drawer-container {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100%;
  height: 100vh;
  background: rgba(10, 14, 23, 0.98);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 900;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
}

.chat-drawer-container.active {
  transform: translateX(0);
}

.chat-drawer-header {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
}

.chat-drawer-user-info h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.chat-drawer-close:hover {
  color: #fff !important;
}

.chat-drawer-body {
  flex: 1;
  padding: 1.2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.02) 0%, rgba(99, 102, 241, 0.01) 50%, rgba(0,0,0,0) 100%);
}

.chat-drawer-footer {
  padding: 1rem 1.2rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}


/* ====================================================
   WHATSAPP MESSAGE BUBBLES
   ==================================================== */
.chat-bubble-container {
  display: flex;
  width: 100%;
  margin-bottom: 0.3rem;
}

.chat-bubble-container.client {
  justify-content: flex-start;
}

.chat-bubble-container.me {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: 80%;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.chat-bubble-container.client .chat-bubble {
  background: #1f2937;
  border-top-left-radius: 2px;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.chat-bubble-container.me .chat-bubble {
  background: #054c44;
  border-top-right-radius: 2px;
  color: var(--text-secondary);
}

.chat-msg-text {
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: block;
  text-align: right;
  margin-top: 0.3rem;
  opacity: 0.8;
}

.chat-bubble-container.me .chat-bubble-time {
  color: #a7f3d0;
}


/* ====================================================
   BANK RECEIPTS & UPLOADED COMPROBANTES
   ==================================================== */
.chat-receipt-wrapper {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-receipt-thumb {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
  transition: transform 0.2s, filter 0.2s;
  display: block;
}

.chat-receipt-thumb:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

.chat-receipt-caption {
  font-size: 0.75rem;
  margin-top: 0.4rem;
  color: #fff;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Receipt amount badge ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â shown inside the chat bubble */
.receipt-amount-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.5rem;
  padding: 0.45rem 0.7rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--success-light);
  font-weight: 600;
}

.receipt-amount-badge i {
  color: var(--success);
  font-size: 0.85rem;
}

.receipt-amount-badge.receipt-amount-unknown {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--warning-light);
}

.receipt-amount-badge.receipt-amount-unknown i {
  color: var(--warning);
}

/* Accumulated total badge in recent leads list */
.lead-total-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 20px;
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--success-light);
  margin-top: 0.2rem;
}

/* Total column in database table */
.receipt-total-cell {
  font-weight: 700;
  color: var(--success-light);
  font-size: 0.85rem;
}

.data-table-compact th {
  padding: 0.5rem 0.7rem;
  font-size: 0.72rem;
}

.data-table-compact td {
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
}

.cell-date {
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.cell-phone {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.8rem;
  color: #d1d5db;
}

.cell-capi {
  text-align: center;
}

.text-muted-cell {
  color: var(--text-muted-darker);
}

.deposit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(5, 150, 105, 0.08));
  color: var(--success-light);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
  border: 1px solid rgba(16, 185, 129, 0.2);
  white-space: nowrap;
}


/* ====================================================
   RECEIPT LIGHTBOX OVERLAY
   ==================================================== */
.lightbox-container {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(15px);
  justify-content: center;
  align-items: center;
}

.lightbox-container.active {
  display: flex;
}

.lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox-container.active .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 36px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

#lightbox-caption {
  position: absolute;
  bottom: 20px;
  color: #ccc;
  font-size: 0.9rem;
}
