#gaiatri-crm-inbox-ux {
  box-sizing: border-box;
  width: min(1180px, calc(100% - 24px));
  margin: 22px auto 18px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #2b241b;
}

#gaiatri-crm-inbox-ux *,
#gaiatri-crm-inbox-ux *::before,
#gaiatri-crm-inbox-ux *::after {
  box-sizing: border-box;
}

.gcrmux-shell {
  background: #fffaf0;
  border: 1px solid rgba(166, 124, 55, .28);
  border-radius: 20px;
  box-shadow: 0 18px 42px rgba(68, 50, 24, .10);
  overflow: hidden;
}

.gcrmux-header {
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, #fff7df 0%, #f4ead3 100%);
  border-bottom: 1px solid rgba(166, 124, 55, .20);
}

.gcrmux-title {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 750;
  color: #3b2a13;
}

.gcrmux-subtitle {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #6d5b3d;
}

.gcrmux-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(166, 124, 55, .20);
  font-size: 12px;
  color: #6d5b3d;
  white-space: nowrap;
}

.gcrmux-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9b7a2d;
  display: inline-block;
}

.gcrmux-toolbar {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: #fffdf7;
  border-bottom: 1px solid rgba(166, 124, 55, .16);
}

.gcrmux-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gcrmux-filter {
  border: 1px solid rgba(166, 124, 55, .28);
  background: #fff;
  color: #5f4824;
  border-radius: 999px;
  padding: 8px 11px;
  line-height: 1;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.gcrmux-filter:hover {
  transform: translateY(-1px);
  border-color: rgba(166, 124, 55, .50);
}

.gcrmux-filter.is-active {
  background: #7c5f25;
  color: #fff;
  border-color: #7c5f25;
}

.gcrmux-search {
  display: flex;
  gap: 8px;
  align-items: center;
}

.gcrmux-search input {
  width: 220px;
  max-width: 100%;
  border: 1px solid rgba(166, 124, 55, .28);
  border-radius: 12px;
  padding: 9px 10px;
  background: #fff;
  color: #2b241b;
  font-size: 13px;
}

.gcrmux-refresh {
  border: 1px solid rgba(166, 124, 55, .28);
  background: #fff;
  border-radius: 12px;
  padding: 9px 11px;
  cursor: pointer;
  color: #5f4824;
  font-weight: 650;
}

.gcrmux-body {
  min-height: 420px;
  background: #fff;
}

.gcrmux-list {
  max-height: 660px;
  overflow: auto;
  background: #fffdf8;
}

.gcrmux-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 11px;
  padding: 14px 15px;
  border: 0;
  border-bottom: 1px solid rgba(166, 124, 55, .13);
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.gcrmux-row:hover,
.gcrmux-row.is-selected {
  background: #fff6df;
}

.gcrmux-chip {
  min-width: 38px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}

.gcrmux-chip--whatsapp {
  background: #e8f4ea;
  color: #1d7a41;
  border: 1px solid #c8e7d1;
}

.gcrmux-chip--instagram {
  background: #f7e7f2;
  color: #8a286c;
  border: 1px solid #edcae3;
}

.gcrmux-chip--facebook {
  background: #e6effb;
  color: #1d5e9e;
  border: 1px solid #c7dcef;
}

.gcrmux-chip--email,
.gcrmux-chip--default {
  background: #ece8df;
  color: #5c5141;
  border: 1px solid #ddd3bf;
}

.gcrmux-row-main {
  min-width: 0;
}

.gcrmux-row-top {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 4px;
}

.gcrmux-account {
  font-size: 12px;
  font-weight: 800;
  color: #6c501d;
}

.gcrmux-contact {
  font-size: 14px;
  font-weight: 750;
  color: #2f2415;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gcrmux-preview {
  font-size: 12.5px;
  line-height: 1.35;
  color: #655948;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gcrmux-time {
  font-size: 11px;
  color: #8a7b64;
  white-space: nowrap;
  padding-top: 4px;
}

.gcrmux-empty,
.gcrmux-error,
.gcrmux-loading {
  padding: 24px;
  color: #6d5b3d;
  font-size: 14px;
}

.gcrmux-error {
  color: #8a2a22;
  background: #fff3ef;
  border: 1px solid #f2c9c1;
  border-radius: 14px;
  margin: 16px;
}

/* Modal conversación */
body.gcrmux-modal-open {
  overflow: hidden !important;
}

.gcrmux-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999998;
  background: rgba(39, 29, 13, .48);
  display: none;
}

.gcrmux-modal-backdrop.is-open {
  display: block;
}

.gcrmux-modal {
  position: fixed;
  z-index: 999999;
  inset: 24px;
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  margin: auto;
  background: #fffaf0;
  border: 1px solid rgba(166, 124, 55, .35);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(35, 25, 12, .34);
  display: none;
  overflow: hidden;
}

.gcrmux-modal.is-open {
  display: flex;
  flex-direction: column;
}

.gcrmux-modal-header {
  flex: 0 0 auto;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  background: linear-gradient(135deg, #fff7df 0%, #f2e4c4 100%);
  border-bottom: 1px solid rgba(166, 124, 55, .24);
}

.gcrmux-modal-titlewrap {
  min-width: 0;
}

.gcrmux-modal-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  color: #332412;
  font-weight: 800;
}

.gcrmux-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.gcrmux-modal-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(166, 124, 55, .20);
  color: #604719;
  font-size: 12px;
  font-weight: 650;
}

.gcrmux-modal-close {
  border: 1px solid rgba(166, 124, 55, .32);
  background: #fffaf0;
  color: #5c3d13;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  font-weight: 800;
}

.gcrmux-modal-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(230, 189, 63, .08), transparent 36%),
    #fffdf8;
}

.gcrmux-thread-loading,
.gcrmux-thread-empty,
.gcrmux-thread-error {
  padding: 18px;
  border-radius: 14px;
  background: #fff;
  color: #6d5b3d;
  border: 1px solid rgba(166, 124, 55, .16);
}

.gcrmux-thread-error {
  color: #8a2a22;
  background: #fff3ef;
  border-color: #f2c9c1;
}

.gcrmux-msg {
  display: flex;
  margin: 9px 0;
}

.gcrmux-msg--in {
  justify-content: flex-start;
}

.gcrmux-msg--out {
  justify-content: flex-end;
}

.gcrmux-bubble {
  max-width: min(72%, 620px);
  border-radius: 18px;
  padding: 10px 12px 8px;
  border: 1px solid rgba(166, 124, 55, .16);
  box-shadow: 0 6px 18px rgba(68, 50, 24, .06);
}

.gcrmux-msg--in .gcrmux-bubble {
  background: #fff;
  color: #302417;
  border-top-left-radius: 5px;
}

.gcrmux-msg--out .gcrmux-bubble {
  background: #eaf4e8;
  color: #1d3f28;
  border-color: #c8e7d1;
  border-top-right-radius: 5px;
}

.gcrmux-msg-content {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.42;
}

.gcrmux-msg-meta {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  font-size: 10.5px;
  color: #86745a;
}

.gcrmux-msg--out .gcrmux-msg-meta {
  color: #55705b;
}

.gcrmux-modal-footer {
  flex: 0 0 auto;
  padding: 10px 14px;
  background: #fffaf0;
  border-top: 1px solid rgba(166, 124, 55, .22);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
}

.gcrmux-modal-hint {
  font-size: 12px;
  color: #6d5b3d;
}

@media (max-width: 860px) {
  #gaiatri-crm-inbox-ux {
    width: calc(100% - 14px);
    margin-top: 12px;
  }

  .gcrmux-header {
    flex-direction: column;
  }

  .gcrmux-toolbar {
    grid-template-columns: 1fr;
  }

  .gcrmux-search {
    width: 100%;
  }

  .gcrmux-search input {
    width: 100%;
  }

  .gcrmux-list {
    max-height: 70dvh;
  }

  .gcrmux-row {
    grid-template-columns: auto 1fr;
  }

  .gcrmux-time {
    grid-column: 2;
    padding-top: 0;
  }

  .gcrmux-modal {
    inset: 0;
    width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .gcrmux-modal-header {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .gcrmux-bubble {
    max-width: 88%;
  }

  .gcrmux-modal-thread {
    padding: 12px;
  }
}
