/* WhatsApp inbox — ReservaAI admin-shell */
/* ===================== WhatsApp Web Pro (mensagens) ===================== */
.whats-pro-card {
  --whats-green: #25d366;
  --whats-green-deep: #128c7e;
  --whats-green-soft: #d9fdd3;
  --whats-bg: #efeae2;
  --whats-bubble-out: #d9fdd3;
  --whats-border: rgba(206, 217, 232, 0.65);
  --whats-text: #111b21;
  --whats-muted: #667781;
  --whats-row-active: #f0f2f5;
  --whats-row-hover: #f5f6f6;
  --whats-shadow: 0 1px 1px rgba(11, 20, 26, 0.06);
}

.whats-pro-shell {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) minmax(280px, 320px);
  gap: 0;
  height: 100%;
  width: 100%;
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
}

.whats-pro-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: #ffffff;
  border-right: 1px solid #e9edef;
}

.whats-pro-sidebar-head {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  background: #f0f2f5;
  border-bottom: 1px solid #e9edef;
}

.whats-pro-sidebar-head-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.whats-pro-tenant {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0 0.7rem;
  border: 1px solid #d8dbdf;
  border-radius: 10px;
  background: #ffffff;
  color: var(--whats-text);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
}

.whats-pro-tenant:focus {
  outline: none;
  border-color: var(--whats-green-deep);
  box-shadow: 0 0 0 3px rgba(18, 140, 126, 0.15);
}

.whats-pro-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(37, 211, 102, 0.12);
  color: #0a7f2e;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.whats-pro-live[data-tone="warn"] {
  background: rgba(202, 140, 58, 0.14);
  color: #8b5a13;
}

.whats-pro-live[data-tone="error"] {
  background: rgba(199, 78, 78, 0.12);
  color: #8f3131;
}

.whats-pro-live[data-tone="success"] {
  background: rgba(37, 211, 102, 0.14);
  color: #0a7f2e;
}

.whats-pro-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--whats-green);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.18);
}

.whats-pro-live[data-tone="warn"] .whats-pro-live-dot {
  background: #d59f4a;
  box-shadow: 0 0 0 3px rgba(213, 159, 74, 0.2);
}

.whats-pro-live[data-tone="error"] .whats-pro-live-dot {
  background: #c44;
  box-shadow: 0 0 0 3px rgba(204, 68, 68, 0.18);
}

.whats-pro-sidebar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.whats-pro-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #54656f;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.whats-pro-icon-btn:hover:not(:disabled) {
  background: rgba(11, 20, 26, 0.06);
  color: #111b21;
}

.whats-pro-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.whats-pro-icon-btn.is-active {
  background: rgba(37, 211, 102, 0.15);
  color: var(--whats-green-deep);
}

.whats-pro-icon-btn-primary {
  background: var(--whats-green);
  color: #ffffff;
}

.whats-pro-icon-btn-primary:hover:not(:disabled) {
  background: #1ebe5d;
  color: #ffffff;
}

.whats-pro-toggle-hint {
  margin: 0;
  padding: 0.5rem 0.95rem;
  color: var(--whats-muted);
  font-size: 0.74rem;
  background: #f7f9fb;
  border-bottom: 1px solid #e9edef;
}

.whats-pro-search-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid #e9edef;
  background: #ffffff;
}

.whats-pro-search-icon {
  position: absolute;
  left: 1.05rem;
  color: #667781;
  display: inline-flex;
  pointer-events: none;
}

.whats-pro-search {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0 0.85rem 0 2.1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f0f2f5;
  color: var(--whats-text);
  font: inherit;
  font-size: 0.85rem;
}

.whats-pro-search:focus {
  outline: none;
  border-color: rgba(18, 140, 126, 0.3);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(18, 140, 126, 0.1);
}

.whats-pro-search-filter {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.whats-pro-filters {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid #e9edef;
  background: #ffffff;
  overflow-x: auto;
  scrollbar-width: none;
}

.whats-pro-filters::-webkit-scrollbar {
  display: none;
}

.whats-pro-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.75rem;
  height: 28px;
  border: 1px solid #e0e3e7;
  border-radius: 999px;
  background: #ffffff;
  color: #54656f;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.whats-pro-filter:hover {
  background: #f7f9fb;
}

.whats-pro-filter.is-active {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(18, 140, 126, 0.35);
  color: var(--whats-green-deep);
}

.whats-pro-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #e9edef;
  color: #4a5a64;
  font-size: 0.66rem;
  font-weight: 700;
}

.whats-pro-filter.is-active .whats-pro-filter-count {
  background: var(--whats-green);
  color: #ffffff;
}

.whats-pro-sync {
  margin: 0;
  padding: 0.45rem 0.95rem;
  font-size: 0.74rem;
  color: var(--whats-muted);
  background: #f7f9fb;
  border-bottom: 1px solid #e9edef;
}

.whats-pro-sync[data-tone="success"] {
  color: #0a7f2e;
  background: rgba(37, 211, 102, 0.08);
}

.whats-pro-sync[data-tone="error"] {
  color: #8f3131;
  background: rgba(199, 78, 78, 0.08);
}

.whats-pro-chat-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #ffffff;
  padding: 0.15rem 0;
}

.whats-pro-chat-list::-webkit-scrollbar {
  width: 6px;
}

.whats-pro-chat-list::-webkit-scrollbar-thumb {
  background: rgba(17, 27, 33, 0.18);
  border-radius: 999px;
}

.whats-pro-chat-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--whats-muted);
  font-size: 0.85rem;
}

.whats-pro-chat-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: none;
  border-bottom: 1px solid #f0f2f5;
  background: transparent;
  color: var(--whats-text);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.whats-pro-chat-item:hover {
  background: var(--whats-row-hover);
}

.whats-pro-chat-item.is-active {
  background: var(--whats-row-active);
}

.whats-pro-chat-item.is-active::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--whats-green);
}

.whats-pro-chat-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}

.whats-pro-chat-avatar.is-online::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--whats-green);
  box-shadow: 0 0 0 2px #ffffff;
}

.whats-pro-chat-copy {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.whats-pro-chat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  min-width: 0;
}

.whats-pro-chat-row strong {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--whats-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.whats-pro-chat-time {
  flex: 0 0 auto;
  color: var(--whats-muted);
  font-size: 0.7rem;
  font-weight: 500;
}

.whats-pro-chat-item.has-unread .whats-pro-chat-time {
  color: var(--whats-green-deep);
  font-weight: 700;
}

.whats-pro-chat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-width: 0;
}

.whats-pro-chat-preview {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  min-width: 0;
  flex: 1 1 auto;
  color: var(--whats-muted);
  font-size: 0.8rem;
}

.whats-pro-chat-preview > span:last-child {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.whats-pro-chat-preview-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: #8696a0;
}

.whats-pro-chat-preview-icon.is-read {
  color: #53bdeb;
}

.whats-pro-chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  color: var(--whats-green-deep);
  font-style: italic;
  font-weight: 600;
}

.whats-pro-chat-typing-dots {
  display: inline-flex;
  gap: 2px;
}

.whats-pro-chat-typing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--whats-green-deep);
  animation: whatsTyping 1s infinite ease-in-out;
}

.whats-pro-chat-typing-dots span:nth-child(2) {
  animation-delay: 0.18s;
}

.whats-pro-chat-typing-dots span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes whatsTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-2px); opacity: 1; }
}

.whats-pro-chat-end {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
}

.whats-pro-chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--whats-green);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
}

.whats-pro-chat-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(37, 211, 102, 0.14);
  color: var(--whats-green-deep);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Center thread */
.whats-pro-thread {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320' viewBox='0 0 320 320'><g fill='%23d2cdc1' opacity='0.55'><circle cx='28' cy='44' r='2'/><circle cx='96' cy='80' r='1.4'/><circle cx='160' cy='30' r='1.8'/><circle cx='244' cy='52' r='1.4'/><circle cx='292' cy='110' r='2'/><circle cx='52' cy='148' r='1.6'/><circle cx='124' cy='186' r='1.4'/><circle cx='196' cy='150' r='2'/><circle cx='264' cy='210' r='1.5'/><circle cx='32' cy='240' r='1.8'/><circle cx='112' cy='268' r='2'/><circle cx='184' cy='250' r='1.4'/><circle cx='248' cy='292' r='1.8'/><path d='M62 90 q4 -3 8 0 t8 0' stroke='%23c5beb1' stroke-width='1.2' fill='none' opacity='0.6'/><path d='M212 220 q4 -3 8 0 t8 0' stroke='%23c5beb1' stroke-width='1.2' fill='none' opacity='0.6'/></g></svg>") center / 320px 320px repeat,
    var(--whats-bg);
}

.whats-pro-thread-empty[hidden],
.whats-pro-thread-content[hidden],
.whats-pro-debug[hidden],
.whats-pro-thread-error[hidden],
.whats-pro-crm[hidden] {
  display: none !important;
}

.whats-pro-thread-empty {
  display: grid;
  place-items: center;
  text-align: center;
  height: 100%;
  flex: 1 1 auto;
  padding: 2rem;
  background: var(--whats-bg);
  color: #54656f;
}

.whats-pro-thread-empty-icon {
  display: inline-flex;
  width: 96px;
  height: 96px;
  margin: 0 auto 1rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ffffff;
  color: var(--whats-green);
  box-shadow: 0 4px 14px rgba(11, 20, 26, 0.05);
}

.whats-pro-thread-empty strong {
  display: block;
  font-size: 1.05rem;
  color: var(--whats-text);
  margin-bottom: 0.45rem;
}

.whats-pro-thread-empty p {
  margin: 0 auto;
  max-width: 32ch;
  font-size: 0.86rem;
  line-height: 1.55;
}

.whats-pro-thread-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
}

.whats-pro-thread-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  background: #f0f2f5;
  border-bottom: 1px solid #e9edef;
  min-height: 56px;
  flex: 0 0 auto;
}

.whats-pro-thread-back {
  display: none;
}

.whats-pro-thread-id {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 1 1 auto;
  min-width: 0;
}

.whats-pro-thread-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.82rem;
  flex: 0 0 auto;
}

.whats-pro-thread-avatar.is-online::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--whats-green);
  box-shadow: 0 0 0 2px #f0f2f5;
}

.whats-pro-thread-id-copy {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.whats-pro-thread-id-copy strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--whats-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.whats-pro-thread-meta {
  font-size: 0.75rem;
  color: var(--whats-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.whats-pro-thread-tags {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.whats-pro-thread-status {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  height: 24px;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: rgba(37, 211, 102, 0.14);
  color: var(--whats-green-deep);
  font-size: 0.72rem;
  font-weight: 700;
}

.whats-pro-thread-status[data-tone="warn"] {
  background: rgba(202, 140, 58, 0.18);
  color: #8b5a13;
}

.whats-pro-thread-status[data-tone="error"] {
  background: rgba(199, 78, 78, 0.16);
  color: #8f3131;
}

.whats-pro-thread-window {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  height: 24px;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.whats-pro-thread-window svg {
  flex: 0 0 auto;
}

.whats-pro-thread-window[data-tone="open"] {
  background: rgba(37, 211, 102, 0.14);
  color: var(--whats-green-deep);
}

.whats-pro-thread-window[data-tone="closing"] {
  background: rgba(202, 140, 58, 0.18);
  color: #8b5a13;
}

.whats-pro-thread-window[data-tone="closed"] {
  background: rgba(199, 78, 78, 0.14);
  color: #8f3131;
}

.whats-pro-window-warning {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  background: linear-gradient(180deg, rgba(199, 78, 78, 0.06), rgba(199, 78, 78, 0.12));
  border-top: 1px solid rgba(199, 78, 78, 0.2);
  flex: 0 0 auto;
}

.whats-pro-window-warning[data-tone="closing"] {
  background: linear-gradient(180deg, rgba(202, 140, 58, 0.08), rgba(202, 140, 58, 0.14));
  border-top-color: rgba(202, 140, 58, 0.24);
}

.whats-pro-window-warning[hidden] {
  display: none !important;
}

.whats-pro-window-warning-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(199, 78, 78, 0.14);
  color: #8f3131;
}

.whats-pro-window-warning[data-tone="closing"] .whats-pro-window-warning-icon {
  background: rgba(202, 140, 58, 0.18);
  color: #8b5a13;
}

.whats-pro-window-warning-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.whats-pro-window-warning-copy strong {
  display: block;
  font-size: 0.82rem;
  color: #8f3131;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.whats-pro-window-warning[data-tone="closing"] .whats-pro-window-warning-copy strong {
  color: #8b5a13;
}

.whats-pro-window-warning-copy p {
  margin: 0.05rem 0 0;
  font-size: 0.74rem;
  color: #6f7e88;
  line-height: 1.4;
}

.whats-pro-window-template-btn {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 0.85rem;
  border: 1px solid rgba(199, 78, 78, 0.4);
  border-radius: 999px;
  background: #ffffff;
  color: #8f3131;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.whats-pro-window-template-btn:hover {
  background: rgba(199, 78, 78, 0.08);
}

.whats-pro-window-warning[data-tone="closing"] .whats-pro-window-template-btn {
  border-color: rgba(202, 140, 58, 0.45);
  color: #8b5a13;
}

.whats-pro-window-warning[data-tone="closing"] .whats-pro-window-template-btn:hover {
  background: rgba(202, 140, 58, 0.1);
}

.whats-pro-composer.is-locked {
  opacity: 0.85;
}

.whats-pro-composer.is-locked .whats-pro-composer-input {
  background: #e9edef;
  color: #8696a0;
  cursor: not-allowed;
}

.whats-pro-composer.is-locked .whats-pro-composer-input::placeholder {
  color: #8696a0;
}

.whats-pro-composer.is-locked .whats-pro-composer-icon,
.whats-pro-composer.is-locked .whats-pro-composer-send {
  opacity: 0.45;
  pointer-events: none;
}

.whats-pro-chat-window {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0 0.32rem;
  height: 16px;
  border-radius: 999px;
}

.whats-pro-chat-window svg {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
}

.whats-pro-chat-window[data-tone="closing"] {
  background: rgba(202, 140, 58, 0.16);
  color: #8b5a13;
}

.whats-pro-chat-window[data-tone="closed"] {
  background: rgba(199, 78, 78, 0.14);
  color: #8f3131;
}

.whats-pro-crm-window-state {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.whats-pro-crm-window-state[data-tone="open"] {
  color: var(--whats-green-deep);
}

.whats-pro-crm-window-state[data-tone="closing"] {
  color: #8b5a13;
}

.whats-pro-crm-window-state[data-tone="closed"] {
  color: #8f3131;
}

.whats-pro-thread-actions {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex: 0 0 auto;
}

.whats-pro-debug {
  margin: 0.5rem 0.85rem 0;
  padding: 0.45rem 0.7rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px dashed rgba(17, 27, 33, 0.18);
  border-radius: 10px;
  color: #4a5a64;
  font-size: 0.72rem;
  line-height: 1.45;
}

.whats-pro-messages {
  position: relative;
  overflow: auto;
  padding: 0.85rem 6.5%;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-height: 0;
  flex: 1 1 auto;
}

.whats-pro-messages::before {
  content: "";
  display: block;
  flex: 1 1 auto;
  min-height: 0;
}

.whats-pro-messages::-webkit-scrollbar {
  width: 6px;
}

.whats-pro-messages::-webkit-scrollbar-thumb {
  background: rgba(17, 27, 33, 0.2);
  border-radius: 999px;
}

.whats-pro-day-separator {
  display: inline-flex;
  align-self: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #54656f;
  font-size: 0.72rem;
  font-weight: 600;
  box-shadow: var(--whats-shadow);
  margin: 0.4rem auto 0.55rem;
}

.whats-pro-bubble-row {
  display: flex;
  width: 100%;
  margin: 0;
}

.whats-pro-bubble-row.is-outbound {
  justify-content: flex-end;
}

.whats-pro-bubble-row.is-inbound {
  justify-content: flex-start;
  position: relative;
}

.whats-pro-bubble {
  position: relative;
  max-width: min(70%, 540px);
  padding: 0.4rem 0.7rem 0.5rem;
  border-radius: 8px;
  box-shadow: var(--whats-shadow);
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--whats-text);
}

.whats-pro-bubble-row.is-inbound .whats-pro-bubble {
  background: #ffffff;
  border-top-left-radius: 0;
}

.whats-pro-bubble-row.is-outbound .whats-pro-bubble {
  background: var(--whats-bubble-out);
  border-top-right-radius: 0;
}

.whats-pro-bubble-author {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--whats-green-deep);
  margin-bottom: 0.15rem;
}

.whats-pro-bubble-row.is-inbound .whats-pro-bubble-author {
  color: #6a3ad1;
}

.whats-pro-bubble-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

.whats-pro-bubble-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.18rem;
  color: var(--whats-muted);
  font-size: 0.66rem;
}

.whats-pro-bubble-row.is-outbound .whats-pro-bubble-foot {
  color: #6b8a78;
}

.whats-pro-bubble-foot svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: #8696a0;
}

.whats-pro-bubble-foot.is-read svg {
  color: #53bdeb;
}

.whats-pro-thread-error {
  margin: 0 0.85rem 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(199, 78, 78, 0.1);
  border: 1px solid rgba(199, 78, 78, 0.2);
  color: #8f3131;
  font-size: 0.82rem;
}

.whats-pro-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem 0.55rem;
  background: rgba(255, 255, 255, 0.6);
  border-top: 1px solid #e6e9eb;
  backdrop-filter: blur(2px);
  flex: 0 0 auto;
}

.whats-pro-quick[hidden] {
  display: none !important;
}

.whats-pro-quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 30px;
  padding: 0 0.7rem;
  border: 1px solid rgba(18, 140, 126, 0.25);
  border-radius: 999px;
  background: #ffffff;
  color: var(--whats-green-deep);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(11, 20, 26, 0.04);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.whats-pro-quick-pill:hover {
  background: rgba(37, 211, 102, 0.1);
  color: #0d6e63;
}

.whats-pro-composer {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.85rem 0.7rem;
  background: #f0f2f5;
  border-top: 1px solid #e9edef;
  flex: 0 0 auto;
  position: relative;
}

.whats-pro-composer.is-locked .whats-pro-composer-icon,
.whats-pro-composer.is-locked .whats-pro-composer-send {
  opacity: 0.45;
  pointer-events: none;
}

.whats-pro-composer-icon {
  width: 38px;
  height: 38px;
  color: #54656f;
  background: transparent;
}

.whats-pro-composer-icon:hover:not(:disabled) {
  background: rgba(11, 20, 26, 0.06);
  color: var(--whats-text);
}

.whats-pro-composer-input {
  width: 100%;
  height: 40px;
  padding: 0 0.95rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #ffffff;
  color: var(--whats-text);
  font: inherit;
  font-size: 0.92rem;
  box-shadow: 0 1px 1px rgba(11, 20, 26, 0.05);
}

.whats-pro-composer-input:focus {
  outline: none;
  border-color: rgba(18, 140, 126, 0.3);
  box-shadow: 0 0 0 3px rgba(18, 140, 126, 0.12);
}

.whats-pro-composer-send {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 40px;
  padding: 0 0.95rem;
  border: none;
  border-radius: 999px;
  background: var(--whats-green-deep);
  color: #ffffff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(18, 140, 126, 0.3);
  transition: background 0.15s ease, transform 0.1s ease;
}

.whats-pro-composer-send:hover:not(:disabled) {
  background: #0e766c;
}

.whats-pro-composer-send:active:not(:disabled) {
  transform: scale(0.98);
}

.whats-pro-composer-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.whats-pro-composer-send svg {
  width: 16px;
  height: 16px;
}

.whats-pro-composer-icon.is-recording {
  color: #d64545;
  animation: whats-pro-pulse 1.2s ease-in-out infinite;
}

@keyframes whats-pro-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.whats-pro-emoji-panel {
  position: absolute;
  left: 0.85rem;
  bottom: calc(100% + 0.35rem);
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
  width: min(280px, calc(100% - 1.7rem));
  padding: 0.55rem;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e9edef;
  box-shadow: 0 8px 24px rgba(11, 20, 26, 0.12);
}

.whats-pro-emoji-panel[hidden] {
  display: none;
}

.whats-pro-emoji-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 1.15rem;
  cursor: pointer;
}

.whats-pro-emoji-btn:hover {
  background: rgba(11, 20, 26, 0.06);
}

.whats-pro-attach-preview,
.whats-pro-audio-preview {
  display: grid;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  background: #f7f8fa;
  border-top: 1px solid #e9edef;
}

.whats-pro-attach-preview[hidden],
.whats-pro-audio-preview[hidden] {
  display: none;
}

.whats-pro-attach-preview-main,
.whats-pro-audio-preview-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.whats-pro-attach-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e9edef;
}

.whats-pro-attach-file-icon {
  font-size: 1.6rem;
}

.whats-pro-attach-meta {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.whats-pro-attach-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whats-pro-attach-meta span {
  color: #667781;
  font-size: 0.82rem;
}

.whats-pro-attach-caption {
  display: grid;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: #54656f;
}

.whats-pro-attach-caption input {
  height: 36px;
  padding: 0 0.75rem;
  border: 1px solid #e9edef;
  border-radius: 8px;
  font: inherit;
}

.whats-pro-attach-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.whats-pro-attach-btn {
  height: 34px;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid #d1d7db;
  background: #ffffff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.whats-pro-attach-btn.is-primary {
  border-color: transparent;
  background: var(--whats-green-deep);
  color: #ffffff;
}

.whats-pro-attach-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.whats-pro-audio-preview-label {
  color: #54656f;
  font-size: 0.88rem;
}

.whats-pro-audio-preview-main audio {
  width: min(100%, 320px);
}

.whats-pro-bubble-media {
  margin-top: 0.15rem;
  border-radius: 8px;
  overflow: hidden;
}

.whats-pro-media-image,
.whats-pro-media-video {
  display: block;
  max-width: min(280px, 100%);
  max-height: 220px;
  border-radius: 8px;
}

.whats-pro-media-audio {
  width: min(100%, 260px);
}

.whats-pro-media-loading {
  display: block;
  font-size: 0.82rem;
  color: #667781;
}

.whats-pro-bubble-contact {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: rgba(11, 20, 26, 0.04);
}

.whats-pro-bubble-contact strong {
  display: block;
}

.whats-pro-bubble-contact span {
  display: block;
  font-size: 0.82rem;
  color: #667781;
}

.whats-pro-bubble-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.whats-pro-reaction-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(11, 20, 26, 0.08);
  font-size: 0.9rem;
}

.whats-pro-react-bar {
  display: flex;
  gap: 0.15rem;
  align-self: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.whats-pro-bubble-row.is-inbound:hover .whats-pro-react-bar,
.whats-pro-bubble-row.is-inbound:focus-within .whats-pro-react-bar {
  opacity: 1;
  pointer-events: auto;
}

.whats-pro-react-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(11, 20, 26, 0.12);
  cursor: pointer;
  font-size: 0.95rem;
}

.whats-pro-react-btn:hover {
  transform: scale(1.08);
}

.whats-pro-contact-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(11, 20, 26, 0.45);
}

.whats-pro-contact-modal-backdrop[hidden] {
  display: none;
}

.whats-pro-contact-modal {
  width: min(420px, 100%);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 16px 48px rgba(11, 20, 26, 0.2);
  overflow: hidden;
}

.whats-pro-contact-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e9edef;
}

.whats-pro-contact-form {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.whats-pro-contact-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #54656f;
}

.whats-pro-contact-form input,
.whats-pro-contact-form select {
  height: 38px;
  padding: 0 0.75rem;
  border: 1px solid #e9edef;
  border-radius: 8px;
  font: inherit;
  color: var(--whats-text);
}

/* Right CRM */
.whats-pro-crm {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  background: #ffffff;
  border-left: 1px solid #e9edef;
}

.whats-pro-crm[hidden] {
  display: none;
}

.whats-pro-crm-head {
  display: grid;
  gap: 0.4rem;
  padding: 1rem 1rem 0.85rem;
  text-align: center;
  background: linear-gradient(180deg, #f7faf9, #ffffff);
  border-bottom: 1px solid #e9edef;
}

.whats-pro-crm-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0.35rem auto 0.25rem;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}

.whats-pro-crm-head strong {
  display: block;
  font-size: 1rem;
  color: var(--whats-text);
}

.whats-pro-crm-head span {
  font-size: 0.78rem;
  color: var(--whats-muted);
}

.whats-pro-crm-section {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #f0f2f5;
}

.whats-pro-crm-section:last-child {
  border-bottom: none;
}

.whats-pro-crm-section h4 {
  margin: 0 0 0.55rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5b6b76;
}

.whats-pro-crm-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.whats-pro-crm-kpis article {
  padding: 0.55rem 0.65rem;
  border: 1px solid #eef0f2;
  border-radius: 12px;
  background: #fbfcfd;
}

.whats-pro-crm-kpis article span {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6f7e88;
}

.whats-pro-crm-kpis article strong {
  display: block;
  margin-top: 0.18rem;
  font-size: 0.92rem;
  color: var(--whats-text);
}

.whats-pro-crm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.whats-pro-crm-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 0.6rem;
  border-radius: 999px;
  background: #f0f2f5;
  color: #4a5a64;
  font-size: 0.72rem;
  font-weight: 700;
}

.whats-pro-crm-tag-green {
  background: rgba(37, 211, 102, 0.14);
  color: var(--whats-green-deep);
}

.whats-pro-crm-tag-blue {
  background: rgba(83, 189, 235, 0.16);
  color: #196e8c;
}

.whats-pro-crm-notes {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #fbfcfd;
  border: 1px dashed #e0e3e7;
  color: var(--whats-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.whats-pro-crm-actions {
  display: grid;
  gap: 0.4rem;
}

.whats-pro-crm-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #e0e3e7;
  border-radius: 12px;
  background: #ffffff;
  color: #1f3f79;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.whats-pro-crm-action:hover {
  background: #f7f9fb;
  border-color: rgba(18, 140, 126, 0.3);
  color: var(--whats-green-deep);
}

.whats-pro-crm-action svg {
  color: var(--whats-green-deep);
}

@media (max-width: 1180px) {
  .whats-pro-shell {
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  }
  .whats-pro-crm {
    display: none;
  }
}

@media (max-width: 820px) {
  .admin-page[data-admin-panel-active="bot-whatsapp"] .admin-panel[data-admin-panel="bot-whatsapp"] {
    min-height: calc(100vh - 72px);
    max-height: calc(100vh - 72px);
    height: calc(100vh - 72px);
  }
  .whats-pro-shell {
    grid-template-columns: 1fr;
  }
  .whats-pro-shell.is-thread-open .whats-pro-sidebar {
    display: none;
  }
  .whats-pro-shell:not(.is-thread-open) .whats-pro-thread {
    display: none;
  }
  .whats-pro-thread-back {
    display: inline-flex;
  }
  .whats-pro-thread-empty {
    display: none;
  }
}
/* Engage Solar — painel Conversas */
body[data-es-panel-active="conversas"] .es-header { display: none; }
body[data-es-panel-active="conversas"] .es-main { display: flex; flex-direction: column; min-height: 100vh; }
body[data-es-panel-active="conversas"] .es-content {
  margin-top: 0;
  padding: 0.75rem 1rem 1rem;
  border-radius: 1.15rem 1.15rem 0 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.es-panel--conversas {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.es-panel--conversas .whats-pro-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 5.5rem);
  max-height: calc(100vh - 5.5rem);
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(206, 217, 232, 0.85);
  background: #f0f2f5;
  box-shadow: 0 18px 36px rgba(36, 65, 121, 0.08);
}
.es-panel--conversas .whats-pro-shell { flex: 1; min-height: 0; }
@media (max-width: 820px) {
  body[data-es-panel-active="conversas"] .es-panel--conversas .whats-pro-card {
    height: calc(100vh - 4.5rem);
    max-height: calc(100vh - 4.5rem);
  }
  body[data-es-panel-active="conversas"] .whats-pro-shell {
    grid-template-columns: 1fr;
  }
  body[data-es-panel-active="conversas"] .whats-pro-shell.is-thread-open .whats-pro-sidebar {
    display: none;
  }
  body[data-es-panel-active="conversas"] .whats-pro-shell:not(.is-thread-open) .whats-pro-thread {
    display: none;
  }
  body[data-es-panel-active="conversas"] .whats-pro-thread-back {
    display: inline-flex;
  }
  body[data-es-panel-active="conversas"] .whats-pro-thread-empty {
    display: none;
  }
}
