/* ================================================================
   V41 — WHATSAPP EXACT CHAT LAYOUT & COMPOSER (PC & MOBILE)
   Matches 100% of user screenshot details:
   1. Left Navigation Rail (Top 6 icons, Bottom Starred, Settings, and Avatar at bottom)
   2. Sidebar Header & Windows Download Footer Bar
   3. Chat Header (Right 🔍 and ⋮ buttons)
   4. Single-Row Rounded Pill Chat Composer ([ + ] [ 🙂 ] [ Soạn tin nhắn... ] [ 🎤 / 🚀 ])
   5. WhatsApp Canvas Doodle Background & Date Badges
   ================================================================ */

/* --- 1. LEFT NAVIGATION RAIL EXACT LAYOUT --- */
@media (min-width: 768px) {
  .sidebar-icon {
    width: 64px !important;
    min-width: 64px !important;
    background: var(--wa-bg-header, #202c33) !important;
    border-right: 1px solid var(--wa-border, rgba(134, 150, 160, 0.15)) !important;
    padding: 10px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    z-index: 40 !important;
  }

  .sidebar-top {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .sidebar-bottom {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    padding-bottom: 6px !important;
  }

  /* Nav icons in rail */
  .sidebar-icon .nav-icon {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--wa-text-secondary, #8696a0) !important;
    background: transparent !important;
    transition: all 0.18s cubic-bezier(0.2, 0, 0, 1) !important;
    cursor: pointer !important;
    position: relative !important;
  }

  .sidebar-icon .nav-icon:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--wa-text-primary, #e9edef) !important;
    transform: scale(1.05) !important;
  }

  :root[data-theme="light"] .sidebar-icon .nav-icon:hover {
    background: rgba(0, 0, 0, 0.06) !important;
    color: #111b21 !important;
  }

  /* Active Chat capsule in rail (Screenshot) */
  .sidebar-icon .nav-icon.active {
    background: rgba(255, 255, 255, 0.14) !important;
    color: var(--wa-text-primary, #e9edef) !important;
    border-radius: 22px !important;
  }

  :root[data-theme="light"] .sidebar-icon .nav-icon.active {
    background: rgba(0, 0, 0, 0.09) !important;
    color: #111b21 !important;
  }

  /* Meta AI special gradient icon */
  .sidebar-icon .nav-icon.wa-meta-ai-btn {
    color: #c084fc !important;
  }
  .sidebar-icon .nav-icon.wa-meta-ai-btn:hover {
    color: #a855f7 !important;
    transform: rotate(25deg) scale(1.08) !important;
  }

  /* Avatar positioned at the very bottom (Screenshot) */
  .sidebar-icon #myAvatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #00a884, #008f6f) !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    border: 2px solid transparent !important;
    transition: transform 0.2s ease, border-color 0.2s ease !important;
  }

  .sidebar-icon #myAvatar:hover {
    transform: scale(1.08) !important;
    border-color: var(--wa-green, #00a884) !important;
  }
}

/* Mobile bottom nav adjustments */
@media (max-width: 767px) {
  .sidebar-icon {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-around !important;
  }
  .sidebar-icon .sidebar-top,
  .sidebar-icon .sidebar-bottom {
    display: contents !important;
  }
  .sidebar-icon #myAvatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
  }
}

/* --- 2. SIDEBAR DOWNLOAD FOR WINDOWS FOOTER (Screenshot) --- */
.wa-sidebar-download-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--wa-bg-panel, #111b21);
  border-top: 1px solid var(--wa-border, rgba(134, 150, 160, 0.12));
  color: var(--wa-text-primary, #e9edef);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease;
  flex-shrink: 0;
}

.wa-sidebar-download-bar:hover {
  background: rgba(255, 255, 255, 0.05);
}

:root[data-theme="light"] .wa-sidebar-download-bar:hover {
  background: rgba(0, 0, 0, 0.04);
}

.wa-download-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #25D366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* --- 3. CHAT HEADER RIGHT CLEAN BUTTONS (Screenshot) --- */
.chat-header-right {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.wa-header-action-btn {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--wa-text-secondary, #8696a0) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
}

.wa-header-action-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--wa-text-primary, #e9edef) !important;
}

:root[data-theme="light"] .wa-header-action-btn:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #111b21 !important;
}

/* Chat header dropdown menu */
.wa-chat-options-menu {
  position: absolute;
  top: 54px;
  right: 14px;
  min-width: 200px;
  background: var(--wa-bg-header, #202c33);
  border: 1px solid var(--wa-border, rgba(134, 150, 160, 0.2));
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  padding: 6px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  animation: waMenuIn 0.15s ease-out;
}

.wa-chat-options-menu.show {
  display: flex;
}

/* Expandable in-chat search bar */
.wa-expandable-search-bar {
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--wa-bg-header, #202c33);
  padding: 8px 16px;
  display: none;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--wa-border, rgba(134, 150, 160, 0.15));
  z-index: 35;
  animation: waSlideDown 0.2s ease-out;
}

.wa-expandable-search-bar.show {
  display: flex;
}

@keyframes waSlideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* --- 4. CHAT COMPOSER: SINGLE-ROW ROUNDED PILL (Screenshot) --- */
.chat-input-zone.wa-chat-input-zone {
  padding: 8px 16px 12px !important;
  background: var(--wa-bg-header, #202c33) !important;
  border-top: 1px solid var(--wa-border, rgba(134, 150, 160, 0.12)) !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  position: relative !important;
  z-index: 30 !important;
}

:root[data-theme="light"] .chat-input-zone.wa-chat-input-zone {
  background: #f0f2f5 !important;
}

.wa-composer-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

/* Plus + and Emoji 🙂 buttons */
.wa-composer-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--wa-text-secondary, #8696a0);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  padding: 0;
}

.wa-composer-btn:hover {
  color: var(--wa-text-primary, #e9edef);
  transform: scale(1.08);
}

:root[data-theme="light"] .wa-composer-btn:hover {
  color: #111b21;
}

/* Rounded Pill Text Input Container (Screenshot) */
.wa-composer-input-wrap {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  background: var(--wa-bg-input, #2a3942);
  border-radius: 24px;
  display: flex;
  align-items: center;
  padding: 4px 16px;
  box-sizing: border-box;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

:root[data-theme="light"] .wa-composer-input-wrap {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.wa-composer-input-wrap:focus-within {
  box-shadow: 0 0 0 1px rgba(0, 168, 132, 0.3);
}

.wa-composer-input {
  width: 100% !important;
  min-height: 24px !important;
  max-height: 90px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--wa-text-primary, #e9edef) !important;
  font-size: 15px !important;
  font-family: inherit !important;
  line-height: 22px !important;
  resize: none !important;
  outline: none !important;
  padding: 4px 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

:root[data-theme="light"] .wa-composer-input {
  color: #111b21 !important;
}

.wa-composer-input::placeholder {
  color: var(--wa-text-secondary, #8696a0) !important;
  font-size: 15px !important;
}

/* Action button: Mic 🎤 / Send 🚀 */
.wa-composer-action-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--wa-text-secondary, #8696a0);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  padding: 0;
}

.wa-composer-action-btn:hover {
  color: var(--wa-green, #00a884);
  transform: scale(1.08);
}

.wa-composer-action-btn.has-text {
  background: var(--wa-green, #00a884) !important;
  color: #111b21 !important;
}

.wa-composer-action-btn.has-text:hover {
  filter: brightness(1.08);
}

/* --- 5. ATTACHMENT POPUP DRAWER (Screenshot) --- */
.wa-attach-drawer {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 4px;
  background: var(--wa-bg-header, #202c33);
  border: 1px solid var(--wa-border, rgba(134, 150, 160, 0.2));
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  z-index: 1000;
  animation: waDrawerIn 0.2s cubic-bezier(0.2, 0, 0, 1);
}

:root[data-theme="light"] .wa-attach-drawer {
  background: #ffffff;
  border-color: rgba(11, 20, 26, 0.1);
}

.wa-attach-drawer.show {
  display: flex;
}

@keyframes waDrawerIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wa-attach-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
  color: var(--wa-text-primary, #e9edef);
  font-size: 14px;
  font-weight: 500;
}

:root[data-theme="light"] .wa-attach-item {
  color: #111b21;
}

.wa-attach-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="light"] .wa-attach-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.wa-attach-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-attach-doc { background: #5f66cd; }
.wa-attach-media { background: #007bfc; }
.wa-attach-camera { background: #d3396d; }
.wa-attach-contact { background: #009de2; }

/* --- 6. CHAT CANVAS DOODLE PATTERN & MESSAGE DETAILS --- */
.chat-window,
#chatWindow,
.chat-main,
.chat-main-container {
  background-color: var(--wa-bg-deep, #0b141a) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360' viewBox='0 0 360 360' fill='none' stroke='%23ffffff' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round' opacity='0.05'%3E%3Cpath d='M30 40h24v20H30z' rx='4'/%3E%3Cpath d='M54 48c4 0 7 2 7 6s-3 6-7 6'/%3E%3Ccircle cx='120' cy='60' r='14'/%3E%3Cpath d='M115 57a5 5 0 0 0 10 0'/%3E%3Cpath d='M116 53h.01M124 53h.01'/%3E%3Cpath d='M190 40l15 15-15 15-15-15z'/%3E%3Cpath d='M260 35c-8 0-14 6-14 14 0 10 14 20 14 20s14-10 14-20c0-8-6-14-14-14z'/%3E%3Crect x='310' y='40' width='22' height='34' rx='4'/%3E%3Ccircle cx='321' cy='67' r='2'/%3E%3Cpath d='M40 130a16 16 0 0 1 32 0v12H40z'/%3E%3Cpath d='M35 142h42v4H35z'/%3E%3Cpath d='M130 125l20-10v26l-20 10z'/%3E%3Cpath d='M210 120a16 16 0 1 0 0 32 16 16 0 0 0 0-32zm0 6v10l6 3'/%3E%3Cpath d='M290 120h30v20h-20l-10 8z'/%3E%3Cpath d='M35 210l12-12 12 12-12 12z'/%3E%3Ccircle cx='120' cy='220' r='12'/%3E%3Cpath d='M108 220a12 12 0 0 1 24 0'/%3E%3Crect x='190' y='205' width='36' height='24' rx='5'/%3E%3Ccircle cx='208' cy='217' r='6'/%3E%3Ccircle cx='220' cy='210' r='1.5'/%3E%3Cpath d='M280 200c0-6 5-10 11-10s11 4 11 10c0 8-11 16-11 16s-11-8-11-16z'/%3E%3Cpath d='M40 290h26a6 6 0 0 1 6 6v12a6 6 0 0 1-6 6H40z'/%3E%3Ccircle cx='130' cy='300' r='16'/%3E%3Cpath d='M124 296h.01M136 296h.01M123 306s3 4 7 4 7-4 7-4'/%3E%3Crect x='200' y='285' width='28' height='36' rx='3'/%3E%3Cline x1='205' y1='295' x2='223' y2='295'/%3E%3Cline x1='205' y1='303' x2='223' y2='303'/%3E%3Cline x1='205' y1='311' x2='217' y2='311'/%3E%3Cpath d='M290 290l24 12-24 12 6-12z'/%3E%3C/svg%3E") !important;
  background-repeat: repeat !important;
  background-size: 360px 360px !important;
  position: relative;
}

:root[data-theme="light"] .chat-window,
:root[data-theme="light"] #chatWindow,
:root[data-theme="light"] .chat-main,
:root[data-theme="light"] .chat-main-container {
  background-color: #efeae2 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360' viewBox='0 0 360 360' fill='none' stroke='%23000000' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round' opacity='0.06'%3E%3Cpath d='M30 40h24v20H30z' rx='4'/%3E%3Cpath d='M54 48c4 0 7 2 7 6s-3 6-7 6'/%3E%3Ccircle cx='120' cy='60' r='14'/%3E%3Cpath d='M115 57a5 5 0 0 0 10 0'/%3E%3Cpath d='M116 53h.01M124 53h.01'/%3E%3Cpath d='M190 40l15 15-15 15-15-15z'/%3E%3Cpath d='M260 35c-8 0-14 6-14 14 0 10 14 20 14 20s14-10 14-20c0-8-6-14-14-14z'/%3E%3Crect x='310' y='40' width='22' height='34' rx='4'/%3E%3Ccircle cx='321' cy='67' r='2'/%3E%3Cpath d='M40 130a16 16 0 0 1 32 0v12H40z'/%3E%3Cpath d='M35 142h42v4H35z'/%3E%3Cpath d='M130 125l20-10v26l-20 10z'/%3E%3Cpath d='M210 120a16 16 0 1 0 0 32 16 16 0 0 0 0-32zm0 6v10l6 3'/%3E%3Cpath d='M290 120h30v20h-20l-10 8z'/%3E%3Cpath d='M35 210l12-12 12 12-12 12z'/%3E%3Ccircle cx='120' cy='220' r='12'/%3E%3Cpath d='M108 220a12 12 0 0 1 24 0'/%3E%3Crect x='190' y='205' width='36' height='24' rx='5'/%3E%3Ccircle cx='208' cy='217' r='6'/%3E%3Ccircle cx='220' cy='210' r='1.5'/%3E%3Cpath d='M280 200c0-6 5-10 11-10s11 4 11 10c0 8-11 16-11 16s-11-8-11-16z'/%3E%3Cpath d='M40 290h26a6 6 0 0 1 6 6v12a6 6 0 0 1-6 6H40z'/%3E%3Ccircle cx='130' cy='300' r='16'/%3E%3Cpath d='M124 296h.01M136 296h.01M123 306s3 4 7 4 7-4 7-4'/%3E%3Crect x='200' y='285' width='28' height='36' rx='3'/%3E%3Cline x1='205' y1='295' x2='223' y2='295'/%3E%3Cline x1='205' y1='303' x2='223' y2='303'/%3E%3Cline x1='205' y1='311' x2='217' y2='311'/%3E%3Cpath d='M290 290l24 12-24 12 6-12z'/%3E%3C/svg%3E") !important;
  background-repeat: repeat !important;
  background-size: 360px 360px !important;
}

/* Date Divider Pill (Screenshot) */
.wa-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0 8px;
  width: 100%;
}

.wa-date-pill {
  background: var(--wa-bg-header, #202c33);
  color: var(--wa-text-secondary, #8696a0);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  text-transform: capitalize;
}

:root[data-theme="light"] .wa-date-pill {
  background: #ffffff;
  color: #54656f;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Security Key Notification Pill (Screenshot) */
.wa-security-notice {
  background: rgba(32, 44, 51, 0.95);
  border: 1px solid rgba(134, 150, 160, 0.15);
  border-radius: 10px;
  padding: 8px 14px;
  max-width: 520px;
  margin: 10px auto;
  font-size: 12px;
  line-height: 1.45;
  color: var(--wa-text-secondary, #8696a0);
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

:root[data-theme="light"] .wa-security-notice {
  background: #fff9e6;
  border-color: #ffe082;
  color: #54656f;
}

.wa-security-notice a {
  color: var(--wa-green, #00a884);
  text-decoration: none;
  font-weight: 500;
}

.wa-security-notice a:hover {
  text-decoration: underline;
}

/* Message Bubble Double Blue/Green Checks (Screenshot) */
.wa-double-check {
  display: inline-flex;
  align-items: center;
  margin-left: 3px;
  color: var(--wa-blue-tick, #53bdeb);
}

/* Hide old Zalo-specific toolbar completely */
.zalo-toolbar {
  display: none !important;
}

.zalo-input-area {
  display: none !important;
}

/* --- 7. STRICT WHATSAPP HEADER RIGHT (PC & MOBILE) --- */
.chat-header-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

/* Eradicate the old 'i' circle button in favor of WhatsApp 3-dots */
.chat-header-right #rightToggleBtn,
.chat-header-right .collapse-circle-btn {
  display: none !important;
}

/* Eradicate the old permanent search wrapper */
.chat-header-right .msg-search-wrapper {
  display: none !important;
}

.wa-header-action-btn {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  border-radius: 50% !important;
  background: transparent !important;
  border: 0 !important;
  color: var(--wa-text-secondary, #8696a0) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1) !important;
}

:root[data-theme="light"] .wa-header-action-btn {
  color: #54656f !important;
}

.wa-header-action-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--wa-text-primary, #e9edef) !important;
}

:root[data-theme="light"] .wa-header-action-btn:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #111b21 !important;
}

/* --- 8. AUTHENTIC WHATSAPP SIDEBAR SEARCH & FILTER PILLS --- */
.search-container,
.chat-search-wrap {
  padding: 8px 12px !important;
  background: var(--wa-bg-sidebar, #111b21) !important;
  border-bottom: 1px solid var(--wa-border, rgba(134, 150, 160, 0.15)) !important;
}

:root[data-theme="light"] .search-container,
:root[data-theme="light"] .chat-search-wrap {
  background: #ffffff !important;
  border-bottom-color: rgba(11, 20, 26, 0.08) !important;
}

/* Rounded search input */
.search-box,
#filterSearch {
  border-radius: 8px !important;
  background: var(--wa-bg-input, #202c33) !important;
  border: 1px solid transparent !important;
  color: var(--wa-text-primary, #e9edef) !important;
  height: 36px !important;
  padding: 0 12px 0 36px !important;
  font-size: 14px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  transition: background 0.2s ease, border-color 0.2s ease !important;
}

:root[data-theme="light"] .search-box,
:root[data-theme="light"] #filterSearch {
  background: #f0f2f5 !important;
  color: #111b21 !important;
}

/* Hide green '+' button in search bar */
.add-group-btn-inline,
.search-wrap .add-btn,
.search-container .add-btn {
  display: none !important;
}

/* Authentic WhatsApp filter pills below search: All, Unread, Groups */
.filter-tabs,
.chat-filter-pills {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px 14px 10px !important;
  background: var(--wa-bg-sidebar, #111b21) !important;
}

:root[data-theme="light"] .filter-tabs,
:root[data-theme="light"] .chat-filter-pills {
  background: #ffffff !important;
}

.filter-tab,
.filter-pill,
#allTabBtn,
#unreadTabBtn {
  border-radius: 999px !important;
  padding: 5px 14px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border: none !important;
  background: var(--wa-bg-input, #202c33) !important;
  color: var(--wa-text-secondary, #8696a0) !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

:root[data-theme="light"] .filter-tab,
:root[data-theme="light"] .filter-pill,
:root[data-theme="light"] #allTabBtn,
:root[data-theme="light"] #unreadTabBtn {
  background: #f0f2f5 !important;
  color: #54656f !important;
}

.filter-tab.active,
.filter-pill.active,
#allTabBtn.active,
#unreadTabBtn.active {
  background: #005c4b !important;
  color: #25d366 !important;
  font-weight: 600 !important;
}

:root[data-theme="light"] .filter-tab.active,
:root[data-theme="light"] .filter-pill.active,
:root[data-theme="light"] #allTabBtn.active,
:root[data-theme="light"] #unreadTabBtn.active {
  background: #d9fdd3 !important;
  color: #008069 !important;
  font-weight: 600 !important;
}

/* --- 9. AUTHENTIC WHATSAPP COMPOSER OVERRIDES --- */
.chat-input-zone,
.wa-chat-input-zone {
  display: flex !important;
  align-items: center !important;
  background: var(--wa-bg-header, #202c33) !important;
  padding: 6px 16px !important;
  min-height: 62px !important;
  box-sizing: border-box !important;
  border-top: 1px solid var(--wa-border, rgba(134, 150, 160, 0.15)) !important;
  z-index: 30 !important;
}

:root[data-theme="light"] .chat-input-zone,
:root[data-theme="light"] .wa-chat-input-zone {
  background: #f0f2f5 !important;
  border-top-color: rgba(11, 20, 26, 0.08) !important;
}

.wa-composer-bar {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  gap: 10px !important;
  position: relative !important;
}

.wa-composer-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--wa-text-secondary, #8696a0) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  transition: all 0.15s ease !important;
}

:root[data-theme="light"] .wa-composer-btn {
  color: #54656f !important;
}

.wa-composer-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--wa-text-primary, #e9edef) !important;
}

:root[data-theme="light"] .wa-composer-btn:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #111b21 !important;
}

.wa-composer-input-wrap {
  flex: 1 1 auto !important;
  background: #ffffff !important;
  border-radius: 8px !important;
  padding: 6px 14px !important;
  min-height: 42px !important;
  max-height: 120px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .wa-composer-input-wrap {
  background: #2a3942 !important;
}

.wa-composer-input {
  width: 100% !important;
  min-height: 22px !important;
  max-height: 90px !important;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  font-size: 15px !important;
  color: #111b21 !important;
  resize: none !important;
  padding: 2px 0 !important;
  line-height: 20px !important;
  font-family: inherit !important;
}

:root[data-theme="dark"] .wa-composer-input {
  color: #e9edef !important;
}

.wa-composer-input::placeholder {
  color: #8696a0 !important;
  font-size: 15px !important;
}

:root[data-theme="light"] .wa-composer-input::placeholder {
  color: #667781 !important;
}

.wa-composer-action-btn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  border-radius: 50% !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--wa-text-secondary, #8696a0) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1) !important;
}

:root[data-theme="light"] .wa-composer-action-btn {
  color: #54656f !important;
}

.wa-composer-action-btn:hover {
  color: #00a884 !important;
  transform: scale(1.08) !important;
}

.wa-composer-action-btn.has-text {
  background: #00a884 !important;
  color: #ffffff !important;
}

