.sidebar-nav a[href="/message-inbox/whatsapp"] .icon {
  background: linear-gradient(135deg, #25d366, #128c7e);
}
.sidebar-nav a[href="/message-inbox/whatsapp"] .icon::before {
  content: "W";
  font-size: 12px;
}
.sidebar-count {
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #25d366;
  color: #062e23;
  font-size: 10px;
  font-weight: 800;
}
.sidebar-nav a.active .sidebar-count {
  background: #fff;
  color: #087660;
}

.wa-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.wa-page-head h2 { margin: 0; font-size: 24px; }
.wa-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wa-workspace {
  height: calc(100vh - 150px);
  min-height: 580px;
  display: grid;
  grid-template-columns: minmax(290px, 34%) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.wa-conversations {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #fff;
}
.wa-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 12px;
  background: #f4f7f8;
  border-bottom: 1px solid var(--border);
}
.wa-search input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font: inherit;
}
.wa-search button,
.wa-send-button {
  border: 0;
  border-radius: 6px;
  background: #128c7e;
  color: #fff;
  padding: 0 15px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.wa-search button:hover,
.wa-send-button:hover { background: #087660; }
.wa-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--border);
}
.wa-tabs a {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 3px solid transparent;
}
.wa-tabs a.active { color: #087660; border-bottom-color: #25d366; }
.wa-tabs a span {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #25d366;
  color: #063f32;
  font-size: 10px;
}
.wa-chat-list {
  min-height: 0;
  height: 0;
  flex: 1 1 auto;
  overflow-y: scroll;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.wa-chat-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text);
  border-bottom: 1px solid #edf0f2;
}
.wa-chat-row:hover { background: #f4f8f7; color: var(--text); }
.wa-chat-row.active { background: #e7f5f1; box-shadow: inset 3px 0 #25d366; }
.wa-avatar {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  border-radius: 50%;
  background: #d7e3e7;
  color: #31525b;
  font-weight: 800;
  font-size: 16px;
}
.wa-avatar.large { width: 44px; height: 44px; }
.wa-chat-summary { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wa-chat-name {
  overflow: hidden;
  color: #15272d;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wa-chat-preview {
  overflow: hidden;
  color: #6a7d83;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wa-chat-meta { align-self: stretch; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.wa-chat-meta time { color: #829095; font-size: 10px; white-space: nowrap; }
.wa-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #25d366;
  color: #073c31;
  font-size: 10px;
  font-weight: 800;
}
.wa-empty-list { padding: 28px 18px; color: var(--text-muted); text-align: center; }
.wa-chat-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #efeae2; }
.wa-chat-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-bottom: 1px solid #d7d7d7;
  background: #f0f2f5;
}
.wa-chat-header > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.wa-chat-header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-chat-header span { color: var(--text-muted); font-size: 12px; }
.wa-messages {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
  padding: 18px clamp(14px, 5vw, 70px);
  background-color: #efeae2;
}
.wa-bubble {
  width: fit-content;
  max-width: min(76%, 720px);
  padding: 8px 10px 6px;
  border-radius: 7px;
  box-shadow: 0 1px 1px rgba(0,0,0,.09);
  background: #fff;
}
.wa-bubble.inbound { align-self: flex-start; border-top-left-radius: 2px; }
.wa-bubble.outbound { align-self: flex-end; border-top-right-radius: 2px; background: #d9fdd3; }
.wa-template-name { margin-bottom: 3px; color: #087660; font-size: 10px; font-weight: 800; }
.wa-message-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.wa-bubble footer { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; color: #718078; font-size: 9px; }
.wa-attachment { display: inline-block; margin-top: 7px; font-weight: 700; }
.wa-no-messages { margin: auto; padding: 8px 12px; border-radius: 6px; background: rgba(255,255,255,.8); color: var(--text-muted); }
.wa-reply {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
  padding: 10px 12px;
  border-top: 1px solid #ddd;
  background: #f0f2f5;
}
.wa-reply textarea {
  width: 100%;
  min-height: 42px;
  max-height: 120px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
  line-height: 1.4;
}
.wa-reply textarea:focus { outline: 2px solid rgba(18,140,126,.25); }
.wa-send-button { height: 42px; }
.wa-select-chat { align-self: center; justify-self: center; padding: 30px; color: #5c6f73; text-align: center; }
.wa-select-chat h3 { margin: 12px 0 4px; color: #294148; }
.wa-select-chat p { margin: 0; }
.wa-logo-mark {
  width: 62px;
  height: 62px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #25d366;
  color: #063f32;
  font-size: 18px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .wa-page-head { align-items: stretch; flex-direction: column; }
  .wa-workspace { height: auto; min-height: 0; grid-template-columns: 1fr; overflow: visible; }
  .wa-conversations { height: 390px; border-right: 0; border-bottom: 1px solid var(--border); }
  .wa-chat-panel { min-height: 620px; }
  .wa-messages { max-height: 500px; padding: 16px 12px; }
  .wa-bubble { max-width: 88%; }
}

@media (max-width: 560px) {
  .wa-head-actions .btn { flex: 1; text-align: center; }
  .wa-workspace { border-radius: 0; margin: 0 -12px; }
  .wa-chat-header { padding: 9px 10px; }
  .wa-chat-header .btn { padding: 6px 8px; font-size: 11px; }
}
