/* Rich AI chat widgets � shared with member-chat-widget */
.monee-inbox-rich-scope .kb-chat-msg--bot { align-self: flex-start; width: fit-content; max-width: 100%; background: transparent; border: none; border-radius: 0; padding: 0; box-shadow: none; }
.monee-inbox-rich-scope .kb-chat-msg-text { display: inline-block; width: fit-content; max-width: 100%; padding: 8px 12px; background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 14px 14px 14px 4px; line-height: 1.45; }
.kb-chat-msg--typing {
  opacity: 0.75;
  font-style: italic;
}

.kb-chat-msg-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.kb-chat-msg-rich button,
.kb-chat-msg-rich a.kb-chat-download-btn {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  align-self: flex-start;
}

.kb-chat-msg-text {
  white-space: normal;
}

.kb-chat-link {
  color: #c2185b;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(194, 24, 91, 0.35);
  text-underline-offset: 2px;
}

.kb-chat-link:hover {
  color: #880e4f;
  text-decoration-color: #c2185b;
}

.kb-chat-msg-rich {
  margin-top: 2px;
}

.kb-chat-rate-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kb-chat-rate-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #f0d9e2;
  background: #fff;
}

.kb-chat-rate-card--deposit {
  border-top: 3px solid #c2185b;
}

.kb-chat-rate-card--loan {
  border-top: 3px solid #7b1fa2;
}

.kb-chat-rate-card-head {
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #5d3348;
  background: linear-gradient(180deg, #fdf6f8 0%, #fff 100%);
  border-bottom: 1px solid #f5e6ec;
}

.kb-chat-rate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.kb-chat-rate-table th,
.kb-chat-rate-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid #f5eef2;
}

.kb-chat-rate-table th {
  font-weight: 600;
  color: #880e4f;
  background: #fdf6f8;
}

.kb-chat-rate-table td:last-child,
.kb-chat-rate-table th:last-child {
  text-align: right;
  white-space: nowrap;
  font-weight: 600;
  color: #c2185b;
}

.kb-chat-rate-table tr:last-child td {
  border-bottom: none;
}

.kb-chat-rate-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fce4ec;
  color: #c2185b;
  font-size: 0.65rem;
  font-weight: 600;
  vertical-align: middle;
}

.kb-chat-downloads {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.kb-chat-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: auto;
  align-self: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #f0d9e2;
  background: linear-gradient(180deg, #fff 0%, #fdf6f8 100%);
  color: #5d3348;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.kb-chat-download-btn.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.kb-chat-download-btn:hover {
  background: #fce4ec;
  border-color: #f48fb1;
  transform: translateY(-1px);
}

.kb-chat-download-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #880e4f 0%, #c2185b 100%);
  color: #fff;
  flex-shrink: 0;
}

.kb-chat-holiday-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #f0d9e2;
  background: #fff;
  border-top: 3px solid #7b1fa2;
}

.kb-chat-holiday-head {
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #5d3348;
  background: linear-gradient(180deg, #f9f4fb 0%, #fff 100%);
  border-bottom: 1px solid #f0e6f3;
}

.kb-chat-holiday-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.kb-chat-holiday-table th,
.kb-chat-holiday-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid #f5eef2;
  vertical-align: top;
}

.kb-chat-holiday-table th {
  font-weight: 600;
  color: #880e4f;
  background: #fdf6f8;
}

.kb-chat-holiday-table tr:last-child td {
  border-bottom: none;
}

.kb-chat-holiday-note {
  white-space: nowrap;
  color: #9e8a92;
  font-size: 0.72rem;
}

.kb-chat-holiday-note--open {
  color: #2e7d32;
  font-weight: 600;
}

.kb-chat-holiday-empty {
  text-align: center;
  color: #9e8a92;
  font-style: italic;
}

.kb-chat-holiday-foot {
  padding: 7px 12px;
  font-size: 0.72rem;
  color: #9e8a92;
  background: #fdf6f8;
  border-top: 1px solid #f5eef2;
}

.kb-chat-payment-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kb-chat-payment-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #f0d9e2;
  background: #fff;
  border-top: 3px solid #2e7d32;
}

.kb-chat-payment-head {
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1b5e20;
  background: linear-gradient(180deg, #f1f8f4 0%, #fff 100%);
  border-bottom: 1px solid #e8f5e9;
}

.kb-chat-payment-banks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.kb-chat-payment-bank {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e8ecf2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(26, 54, 93, 0.04);
}

.kb-chat-payment-bank-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(145deg, #c2185b 0%, #9a1450 100%);
  color: #fff;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.kb-chat-payment-bank-icon--logo {
  background: #fff;
  border: 1px solid #e8ecf2;
  padding: 3px;
  overflow: hidden;
}

.kb-chat-payment-bank-icon--logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 7px;
}

.kb-chat-payment-bank-fallback {
  line-height: 1;
}

.kb-chat-payment-bank-name {
  margin: 0 0 2px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #880e4f;
}

.kb-chat-payment-bank-acct {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.kb-chat-payment-bank-num {
  font-size: 0.82rem;
  font-weight: 700;
  color: #2e7d32;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.kb-chat-payment-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: none;
  background: rgba(194, 24, 91, 0.08);
  color: #c2185b;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.kb-chat-payment-copy:hover {
  background: rgba(194, 24, 91, 0.14);
}

.kb-chat-payment-copy.is-copied {
  background: rgba(34, 150, 90, 0.15);
  color: #1a6b42;
}

.kb-chat-payment-foot {
  padding: 7px 12px;
  font-size: 0.72rem;
  color: #9e8a92;
  background: #f1f8f4;
  border-top: 1px solid #e8f5e9;
}

.kb-chat-staff-wrap {
  margin-top: 2px;
}

.kb-chat-staff-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kb-chat-staff-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #f0d9e2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 8px rgba(136, 14, 79, 0.05);
}

.kb-chat-staff-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #f8bbd0;
  background: linear-gradient(145deg, #fce4ec 0%, #f8bbd0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kb-chat-staff-photo.kb-chat-staff-photo--fallback,
.kb-chat-staff-photo:empty {
  font-size: 1.1rem;
  font-weight: 700;
  color: #880e4f;
}

.kb-chat-staff-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.kb-chat-staff-initial {
  font-size: 1.1rem;
  font-weight: 700;
  color: #880e4f;
}

.kb-chat-staff-name {
  margin: 0 0 2px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #880e4f;
  line-height: 1.3;
}

.kb-chat-staff-role {
  margin: 0 0 2px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #5c6bc0;
}

.kb-chat-staff-dept {
  display: none;
}

.kb-chat-staff-contact {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kb-chat-staff-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  font-size: 0.74rem;
}

.kb-chat-staff-label {
  color: #9e8a92;
  min-width: 88px;
}

.kb-chat-staff-value {
  color: #2e2e2e;
  font-weight: 600;
}

/* Rich chat tables: force readable text on light card surfaces (admin + dark hosts) */
.monee-inbox-rich-scope table th,
.monee-inbox-rich-scope table td,
.monee-inbox-rich-scope .kb-chat-rate-table th,
.monee-inbox-rich-scope .kb-chat-rate-table td,
.monee-inbox-rich-scope .kb-chat-holiday-table th,
.monee-inbox-rich-scope .kb-chat-holiday-table td {
  color: #2e2e2e !important;
}

.monee-inbox-rich-scope .kb-chat-rate-table th,
.monee-inbox-rich-scope .kb-chat-holiday-table th {
  color: #880e4f !important;
}

body:not(.theme-light) .monee-inbox-rich-scope table th,
body:not(.theme-light) .monee-inbox-rich-scope table td,
body:not(.theme-light) .monee-inbox-rich-scope .kb-chat-rate-table th,
body:not(.theme-light) .monee-inbox-rich-scope .kb-chat-rate-table td,
body:not(.theme-light) .monee-inbox-rich-scope .kb-chat-holiday-table th,
body:not(.theme-light) .monee-inbox-rich-scope .kb-chat-holiday-table td {
  color: var(--text, #e8eaed) !important;
  border-color: var(--border, rgba(255, 255, 255, 0.08)) !important;
}

body:not(.theme-light) .monee-inbox-rich-scope .kb-chat-rate-card,
body:not(.theme-light) .monee-inbox-rich-scope .kb-chat-holiday-wrap,
body:not(.theme-light) .monee-inbox-rich-scope .kb-chat-payment-wrap,
body:not(.theme-light) .monee-inbox-rich-scope .kb-chat-staff-card {
  background: var(--bg-card, #14171f);
  border-color: var(--border, rgba(255, 255, 255, 0.08));
  color: var(--text, #e8eaed);
}

body:not(.theme-light) .monee-inbox-rich-scope .kb-chat-rate-card-head,
body:not(.theme-light) .monee-inbox-rich-scope .kb-chat-holiday-head,
body:not(.theme-light) .monee-inbox-rich-scope .kb-chat-payment-head,
body:not(.theme-light) .monee-inbox-rich-scope .kb-chat-staff-head {
  background: var(--bg-card-hover, #1a1e28);
  color: var(--text, #e8eaed);
}

body:not(.theme-light) .monee-inbox-rich-scope .kb-chat-rate-table th,
body:not(.theme-light) .monee-inbox-rich-scope .kb-chat-holiday-table th {
  background: var(--bg-card-hover, #1a1e28) !important;
  color: var(--text, #e8eaed) !important;
}

.monee-msg-image-wrap {
  display: block;
}

.monee-msg-image {
  display: block;
  max-width: min(240px, 100%);
  max-height: 240px;
  border-radius: 10px;
  object-fit: cover;
}

.monee-allow-images-card {
  margin-top: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 55%, #fff 100%);
  border: 1px solid #bbf7d0;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.08);
}

.monee-allow-images-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.monee-allow-images-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.monee-allow-images-switch {
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.18s;
  margin-top: 2px;
}

.monee-allow-images-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transition: transform 0.18s;
}

.monee-allow-images-toggle input:checked + .monee-allow-images-switch {
  background: #10b981;
}

.monee-allow-images-toggle input:checked + .monee-allow-images-switch::after {
  transform: translateX(18px);
}

.monee-allow-images-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.monee-allow-images-title {
  font-weight: 700;
  color: #065f46;
  font-size: 0.86rem;
  line-height: 1.35;
}

.monee-allow-images-title i {
  margin-right: 0.35rem;
  color: #059669;
}

.monee-allow-images-hint {
  margin: 0;
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.4;
}

.monee-allow-images-toggle--prominent {
  font-weight: 600;
  color: #065f46;
}

.monee-allow-images-row {
  margin-top: 0.5rem;
}

.monee-staff-image-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #059669;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.monee-staff-image-btn:hover:not(:disabled) {
  background: #ecfdf5;
  border-color: #6ee7b7;
}

.monee-staff-image-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.monee-staff-compose-dropzone.is-dragover {
  border: 2px dashed rgba(16, 185, 129, 0.65);
  background: rgba(16, 185, 129, 0.08);
}

.monee-chat-image-open {
  display: block;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  border-radius: 10px;
  overflow: hidden;
  line-height: 0;
}

.monee-chat-image-open:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

.monee-chat-image-open:hover .monee-msg-image {
  transform: scale(1.02);
}

.monee-chat-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.monee-chat-lightbox[hidden] {
  display: none !important;
}

.monee-chat-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
}

.monee-chat-lightbox-frame {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
}

.monee-chat-lightbox-img {
  display: block;
  max-width: min(96vw, 1200px);
  max-height: min(92vh, 900px);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  object-fit: contain;
  background: #fff;
}

.monee-chat-lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

body.monee-chat-lightbox-open {
  overflow: hidden;
}
