/* WhatsApp Web — chat compartilhado (admin, loja, motoboy) — verde neon / tema admin */
:root {
  --wa-neon: #39ff14;
  --wa-neon-soft: #00e676;
  --wa-accent: #00a884;
  --wa-accent-hover: #06cf9c;
  --wa-bg-dark: #0b141a;
  --wa-bg-panel: #111b21;
  --wa-bg-header: #202c33;
  --wa-text: #e9edef;
  --wa-text-muted: #8696a0;
  --wa-border: #2a3942;
  --wa-bubble-out: #005c4b;
  --wa-glow: 0 0 12px rgba(57, 255, 20, 0.25);
}

.wa-admin-chat,
.wa-panel-chat {
  display: flex;
  height: calc(100vh - 200px);
  min-height: 480px;
  max-height: 820px;
  background: var(--wa-bg-dark);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), var(--wa-glow);
  border: 1px solid rgba(0, 168, 132, 0.2);
}
.wa-panel-chat { margin-top: 8px; }
#waChatLojaRoot.wa-chat-admin-theme {
  background: #081217;
  border-color: rgba(0, 168, 132, 0.25);
}
#waChatLojaRoot.wa-chat-admin-theme .wa-main {
  background: #081217;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-chat-header {
  background: #111d29;
  border-bottom-color: #182229;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-hd-avatar,
#waChatLojaRoot.wa-chat-admin-theme .wa-contact-avatar {
  background: #1b2f3f;
  color: #e2e8f0;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-composer {
  background: #111d29;
  border-top-color: #182229;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-contact-list {
  background: #0f1a25;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-contact-item,
#waChatLojaRoot.wa-chat-admin-theme .wa-contact-item.active {
  background: transparent;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-contact-item:hover {
  background: #15232f;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-filter-chip {
  background: #122131;
  color: #aebac1;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-filter-chip.active {
  background: linear-gradient(135deg, #00d166, #05a173);
  color: #040b10;
  box-shadow: 0 0 22px rgba(0, 209, 102, 0.2);
}
#waChatLojaRoot.wa-chat-admin-theme .wa-filter-chip:hover {
  background: #1a2a39;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-contact-list {
  background: #0f1a25;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-contact-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#waChatLojaRoot.wa-chat-admin-theme .wa-contact-item.active {
  background: #172b3a;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-contact-name {
  color: #f8fafc;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-contact-preview,
#waChatLojaRoot.wa-chat-admin-theme .wa-contact-time {
  color: #94a3b8;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-contact-badge {
  background: #00d166;
  color: #040b10;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-main-empty {
  color: #cbd5e1;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-composer textarea,
#waChatLojaRoot.wa-chat-admin-theme .wa-composer input[type="text"] {
  background: #121f2d !important;
  border: 1px solid #1b2937 !important;
  color: #e2e8f0 !important;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-icon-btn {
  background: transparent !important;
  color: #aebac1 !important;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-icon-btn:hover {
  background: #2a3942 !important;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-send-btn {
  background: linear-gradient(135deg, #00d166, #05a173) !important;
  color: #040b10 !important;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-send-btn:hover {
  background: #04825f !important;
}
#waChatLojaRoot.wa-chat-admin-theme .wa-messages {
  background-color: transparent !important;
}
#aba-chat.wa-chat-section .section-title-loja { margin-bottom: 12px; }
#screen-messages .wa-panel-chat {
  height: calc(100vh - 120px);
  max-height: none;
  border-radius: 0;
  box-shadow: none;
}
.wa-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #0b141a;
}
.wa-main-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #8696a0;
  text-align: center;
  padding: 40px;
  border-bottom: 6px solid var(--wa-accent);
}
.wa-main-empty h4 { color: #e9edef; font-weight: 300; font-size: 22px; margin: 0 0 12px; }
.wa-main-empty p { font-size: 14px; line-height: 1.5; max-width: 420px; }
.wa-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #202c33;
  border-bottom: 1px solid #2a3942;
  min-height: 60px;
}
.wa-chat-header .wa-hd-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #6b7c85;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
}
.wa-chat-header .wa-hd-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wa-chat-header .wa-hd-info { flex: 1; min-width: 0; }
.wa-chat-header .wa-hd-name { color: #e9edef; font-size: 16px; font-weight: 500; }
.wa-chat-header .wa-hd-sub { color: #8696a0; font-size: 13px; }
.wa-chat-header .wa-hd-actions { display: flex; gap: 4px; align-items: center; }
.wa-icon-btn {
  background: transparent;
  border: none;
  color: #aebac1;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wa-icon-btn:hover { background: #2a3942; }
.wa-messages,
.chat-mensagens.wa-messages,
#chatMensagensLoja.wa-messages,
#messages-list.wa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 6%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: #0b141a;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.wa-composer,
.chat-envio.wa-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 16px;
  background: #202c33;
  border-top: 1px solid #2a3942;
}
.wa-composer textarea,
.wa-composer input[type="text"] {
  flex: 1;
  background: #2a3942;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  color: #e9edef;
  font-size: 15px;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  font-family: inherit;
}
.wa-composer input[type="text"]::placeholder,
.wa-composer textarea::placeholder { color: #8696a0; }
.wa-send-btn {
  background: #00a884;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wa-send-btn:hover { background: #06cf9c; filter: none; }
.wa-sidebar {
  width: min(380px, 38vw);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #111b21;
  border-right: 1px solid #2a3942;
}
.wa-sidebar-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #202c33;
  color: #e9edef;
  font-size: 18px;
  font-weight: 500;
}
.wa-filters {
  display: flex;
  gap: 8px;
  padding: 8px 12px 10px;
  overflow-x: auto;
  flex-wrap: nowrap;
  background: #111b21;
  scrollbar-width: none;
}
.wa-filters::-webkit-scrollbar { display: none; }
.wa-filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: none;
  background: #202c33;
  color: #aebac1;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.wa-filter-chip:hover { background: #2a3942; }
.wa-filter-chip.active {
  background: #00a884;
  color: #111b21;
  box-shadow: none;
}
.wa-filter-chip .chip-count { margin-left: 4px; font-size: 11px; }

.wa-filters--meta {
  border-bottom: 1px solid rgba(42, 57, 66, 0.55);
}

.wa-filters--quick {
  padding: 10px 12px 12px;
  border-bottom: 1px solid rgba(42, 57, 66, 0.45);
}

.wa-quick-chips {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.wa-quick-chips::-webkit-scrollbar {
  display: none;
}

.wa-filter-chip--adm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border: 1px solid rgba(42, 57, 66, 0.9);
  background: linear-gradient(145deg, #1f2c34 0%, #182229 100%);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.wa-filter-chip--adm.active {
  border-color: rgba(16, 185, 129, 0.65);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25), 0 8px 20px rgba(0, 0, 0, 0.28);
}

.wa-chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  color: #e9edef;
  background: #2a3942;
}

.wa-chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wa-chip-avatar--adm {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-size: 12px;
}

.wa-store-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding-right: 4px;
}

.wa-store-chips::-webkit-scrollbar { display: none; }
.wa-store-chips.is-empty { display: none; }

.wa-store-chip {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 68px;
  padding: 6px 4px 4px;
  border: 1px solid rgba(42, 57, 66, 0.85);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(32, 44, 51, 0.95) 0%, rgba(17, 27, 33, 0.98) 100%);
  color: #aebac1;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.wa-store-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(134, 150, 160, 0.55);
}

.wa-store-chip.active {
  border-color: rgba(16, 185, 129, 0.75);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.28), 0 10px 22px rgba(0, 0, 0, 0.32);
  color: #e9edef;
}

.wa-store-chip--adm .wa-store-chip-avatar {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}

.wa-store-chip-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.wa-store-chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wa-store-chip-label {
  max-width: 100%;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-store-chip-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #10b981;
  color: #052e1f;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.wa-store-chip-count {
  position: absolute;
  top: 4px;
  left: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.wa-contact-list { flex: 1; overflow-y: auto; background: #111b21; }
.wa-contact-item,
.wa-contact-list article.wa-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(42, 57, 66, 0.5);
}
.wa-contact-item:hover,
.wa-contact-list article.wa-contact-item:hover { background: #202c33; }
.wa-contact-item.active,
.wa-contact-list article.wa-contact-item.active { background: #2a3942; }
.wa-contact-item { position: relative; }
.wa-contact-delete {
  flex-shrink: 0;
  margin-left: auto;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  font-size: 14px;
}
.wa-contact-delete:hover {
  background: rgba(239, 68, 68, 0.28);
  color: #ef4444;
}
.wa-icon-btn.wa-btn-delete-hist {
  color: #f87171;
}
.wa-icon-btn.wa-btn-delete-hist:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}
.wa-icon-btn.wa-btn-close-conv {
  color: #fbbf24;
}
.wa-icon-btn.wa-btn-close-conv:hover {
  background: rgba(251, 191, 36, 0.16);
  color: #fcd34d;
}
.wa-contact-avatar {
  width: 49px;
  height: 49px;
  border-radius: 50%;
  background: #6b7c85;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  overflow: hidden;
}
.wa-contact-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wa-contact-body { flex: 1; min-width: 0; }
.wa-contact-top { display: flex; justify-content: space-between; gap: 8px; }
.wa-contact-name {
  color: #e9edef;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-contact-time { color: #8696a0; font-size: 12px; flex-shrink: 0; }
.wa-contact-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.wa-contact-preview {
  color: #8696a0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.wa-contact-badge {
  background: var(--wa-neon-soft);
  color: #111b21;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.wa-list-empty { padding: 32px 16px; text-align: center; color: #8696a0; font-size: 14px; }
.wa-encerrado-aviso {
  padding: 12px 16px;
  background: #182229;
  color: #8696a0;
  font-size: 13px;
  text-align: center;
  border-top: 1px solid #2a3942;
}
.wa-messages .msg-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 2px; width: 100%; }
.wa-messages .msg-row.mine,
.wa-messages .msg-row.admin { flex-direction: row-reverse; justify-content: flex-start; margin-left: auto; max-width: 100%; }
.wa-messages .msg-row:not(.mine):not(.admin) { margin-right: auto; max-width: 100%; }
.wa-messages .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #6b7c85;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  flex: 0 0 32px;
  font-size: 12px;
  overflow: hidden;
}
.wa-messages .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.wa-messages .bubble,
.wa-messages .msg {
  position: relative;
  max-width: min(420px, 78%);
  padding: 6px 8px 7px;
  border-radius: 7.5px;
  word-break: break-word;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  font-size: 14.2px;
  line-height: 19px;
}
.wa-messages .bubble.out,
.wa-messages .msg.motoboy,
.wa-messages .msg.loja { background: #005c4b; color: #e9edef; border-top-right-radius: 0; }
.wa-messages .bubble.in,
.wa-messages .msg.admin,
.wa-messages .msg.other { background: #202c33; color: #e9edef; border-top-left-radius: 0; }
.wa-messages .bubble-meta {
  float: right;
  margin: 4px 0 -2px 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: bottom;
  position: relative;
  top: 4px;
}
.wa-messages .msg-time { font-size: 11px; color: rgba(255, 255, 255, 0.55); line-height: 1; }
.wa-messages .msg-ticks { font-size: 14px; color: rgba(255, 255, 255, 0.45); line-height: 1; letter-spacing: -3px; }
.wa-messages .msg-ticks.read { color: #53bdeb; }
.wa-messages .wa-text-content { white-space: pre-wrap; word-break: break-word; }
#screen-messages.screen.active { padding: 0; background: #0b141a; }
#screen-messages .messages-content { padding: 0; height: 100%; }

/* Badge no menu / nav — vermelho para chamar atenção */
.wa-nav-chat-badge,
#chatBadge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff3b30;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.55);
  border: 1.5px solid rgba(0, 0, 0, 0.35);
  z-index: 5;
  pointer-events: none;
}
.loja-sidebar nav button,
#screen-messages ~ .bottom-nav .nav-item,
#side-menu a[data-page="chat"] { position: relative; }

/* Mídia nas mensagens */
.wa-media-wrap { margin: 4px 0; max-width: 100%; }
.wa-media-thumb { max-width: min(320px, 100%); border-radius: 8px; display: block; cursor: pointer; }
.wa-media-wrap video, .wa-media-wrap audio { max-width: min(360px, 100%); border-radius: 8px; }
.wa-media-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.wa-media-btn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--wa-accent);
  background: transparent;
  color: var(--wa-neon-soft);
  cursor: pointer;
}
.wa-media-btn:hover { background: rgba(0, 168, 132, 0.15); }

/* Lightbox */
.wa-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99990;
  align-items: center;
  justify-content: center;
}
.wa-lightbox.open { display: flex; }
.wa-lightbox-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.92); }
.wa-lightbox-body {
  position: relative;
  z-index: 1;
  max-width: 96vw;
  max-height: 90vh;
}
.wa-lightbox-body img,
.wa-lightbox-body video { max-width: 96vw; max-height: 90vh; object-fit: contain; }
.wa-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--wa-bg-header);
  color: var(--wa-text);
  font-size: 28px;
  cursor: pointer;
}

/* Encaminhar */
.wa-forward-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99991;
  background: rgba(0, 0, 0, 0.65);
  align-items: flex-end;
  justify-content: center;
}
.wa-forward-modal.open { display: flex; }
.wa-forward-panel {
  width: 100%;
  max-width: 420px;
  max-height: 70vh;
  background: var(--wa-bg-panel);
  border-radius: 16px 16px 0 0;
  padding: 16px;
  border-top: 2px solid var(--wa-accent);
}
.wa-forward-panel header { color: var(--wa-text); font-size: 16px; margin-bottom: 12px; }
.wa-forward-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.wa-forward-item {
  text-align: left;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--wa-bg-header);
  color: var(--wa-text);
  cursor: pointer;
}
.wa-forward-item:hover { background: #2a3942; }
.wa-forward-cancel {
  margin-top: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--wa-border);
  border-radius: 8px;
  background: transparent;
  color: var(--wa-text-muted);
  cursor: pointer;
}

/* ——— Mobile responsivo ——— */
@media (max-width: 768px) {
  .wa-admin-chat,
  .wa-panel-chat {
    height: calc(100dvh - 100px);
    min-height: 0;
    max-height: none;
    border-radius: 0;
  }
  #screen-messages .wa-panel-chat {
    height: 100%;
  }
  .wa-sidebar {
    width: 100%;
    max-width: none;
    border-right: none;
  }
  .wa-mobile-ready .wa-main {
    display: none;
    width: 100%;
  }
  .wa-mobile-ready.wa-mobile-show-chat .wa-sidebar {
    display: none;
  }
  .wa-mobile-ready.wa-mobile-show-chat .wa-main {
    display: flex;
  }
  .wa-btn-back { display: flex !important; }
  .wa-messages,
  #chatMensagensLoja.wa-messages,
  #messages-list.wa-messages {
    padding: 12px 10px;
  }
  .wa-messages .msg { max-width: 88%; }
  .wa-composer { padding: 8px 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .wa-sidebar-hd { font-size: 16px; padding: 12px; }
  .wa-contact-avatar { width: 44px; height: 44px; }
  #aba-chat.wa-chat-section .section-title-loja { padding: 0 8px; }
  .wa-forward-panel { max-width: 100%; border-radius: 16px 16px 0 0; }
}

@media (min-width: 769px) {
  .wa-btn-back { display: none !important; }
}

/* ——— Admin: apresentação em tela cheia ——— */
body.admin-chat-ativo #page-modulo,
body.admin-chat-ativo .page-content,
body.admin-chat-ativo .main-content {
  background: #0b141a !important;
}

.wa-admin-chat-shell {
  padding: 0;
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: stretch;
  background: #0b141a;
}

body.admin-chat-ativo .wa-admin-chat-shell {
  min-height: calc(100vh - 56px);
}

.wa-admin-chat-shell .wa-admin-chat {
  flex: 1;
  width: 100%;
  height: calc(100vh - 56px);
  min-height: 520px;
  max-height: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.wa-sidebar-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
}

.wa-sidebar-title .fa-comments {
  color: #00a884;
  font-size: 17px;
}

.wa-search-icon.fa-search {
  font-size: 14px;
}

.wa-contact-list {
  scrollbar-width: thin;
  scrollbar-color: #2a3942 #111b21;
}

.wa-contact-list::-webkit-scrollbar {
  width: 6px;
}

.wa-contact-list::-webkit-scrollbar-track {
  background: #111b21;
}

.wa-contact-list::-webkit-scrollbar-thumb {
  background: #2a3942;
  border-radius: 999px;
}

.wa-messages {
  scrollbar-width: thin;
  scrollbar-color: #2a3942 #0b141a;
}

.wa-messages::-webkit-scrollbar {
  width: 6px;
}

.wa-messages::-webkit-scrollbar-thumb {
  background: #2a3942;
  border-radius: 999px;
}

.wa-contact-type-badge {
  display: inline-flex;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wa-contact-type-loja {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

.wa-contact-type-motoboy {
  background: rgba(0, 168, 132, 0.18);
  color: #6ee7b7;
}

.wa-contact-item {
  position: relative;
  transition: background 0.15s ease;
}

.wa-contact-item.active {
  box-shadow: inset 3px 0 0 #00a884;
}

.wa-empty-brand {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 168, 132, 0.2), rgba(57, 255, 20, 0.08));
  border: 1px solid rgba(0, 168, 132, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  box-shadow: 0 0 40px rgba(0, 168, 132, 0.12);
}

.wa-empty-brand .fa-comments {
  font-size: 36px;
  color: #00a884;
}

.wa-main-empty h4 {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.wa-main-empty p {
  color: #8696a0;
  line-height: 1.6;
}

.wa-main-empty p strong {
  color: #aebac1;
  font-weight: 700;
}

.wa-send-btn .fa-paper-plane {
  font-size: 16px;
  margin-left: 1px;
}

.wa-icon-btn .fa {
  font-size: 16px;
}

@media (max-width: 768px) {
  .wa-admin-chat-shell {
    min-height: calc(100dvh - 56px);
  }

  .wa-admin-chat-shell .wa-admin-chat {
    height: calc(100dvh - 56px);
    min-height: 0;
  }
}

/* ============================================================
   Motoboy app — WhatsApp Web dark (sem neon do painel)
   ============================================================ */
#screen-messages.screen.active {
  padding: 0 !important;
  background: #0b141a !important;
  min-height: 0;
}

#screen-messages .wa-motoboy-chat,
#screen-messages .wa-panel-chat {
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #0b141a !important;
}

#screen-messages .wa-sidebar,
#screen-messages .wa-main {
  background: #111b21;
}

#screen-messages .wa-main {
  background: #0b141a;
  min-height: 0;
  overflow: hidden;
}

#screen-messages .wa-chat-header,
#screen-messages .wa-encerrado-aviso,
#screen-messages .wa-recording-bar {
  flex-shrink: 0;
}

#screen-messages #messages-list.wa-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#screen-messages #chat-input-area-motoboy.chat-input-area,
#screen-messages .wa-composer {
  position: relative !important;
  flex-shrink: 0;
  z-index: 4;
  background: #1a242b !important;
  border-top: 1px solid rgba(16, 185, 129, 0.18) !important;
  padding: 8px 10px 10px !important;
  gap: 6px !important;
  flex-direction: row !important;
  align-items: center !important;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.28);
}

#screen-messages #chat-input-area-motoboy .wa-composer-tools {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

#screen-messages #chat-input-area-motoboy .wa-composer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

#screen-messages #chat-input-area-motoboy input,
#screen-messages .wa-composer input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  background: #2a3942 !important;
  border: none !important;
  border-radius: 8px !important;
  color: #e9edef !important;
  padding: 10px 12px !important;
  font-size: 15px !important;
  min-height: 44px !important;
  box-sizing: border-box;
}

#screen-messages #chat-input-area-motoboy input:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

#screen-messages #chat-input-area-motoboy .wa-composer-row .wa-send-btn,
#screen-messages .wa-composer .wa-send-btn {
  background: #00a884 !important;
  color: #fff !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-weight: normal !important;
}

#screen-messages #chat-input-area-motoboy .wa-icon-btn,
#screen-messages .wa-composer .wa-icon-btn {
  background: transparent !important;
  color: #8696a0 !important;
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  border-radius: 50% !important;
}

#screen-messages .messages-list:not(.wa-messages) {
  gap: 0 !important;
}

#screen-messages .message-item {
  display: none !important;
}

#screen-messages #messages-list.wa-messages {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  padding: 12px 5% 16px !important;
  flex: 1 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

#screen-messages .wa-contact-badge {
  background: #25d366;
  color: #111b21;
}

#screen-messages .wa-filter-chip.active {
  background: #10b981 !important;
  color: #052e1f !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28) !important;
}

#screen-messages .wa-filter-chip--adm.active {
  background: linear-gradient(145deg, #10b981 0%, #059669 100%) !important;
  color: #fff !important;
}

#screen-messages .wa-sidebar-hd {
  background: linear-gradient(180deg, #132029 0%, #111b21 100%);
  border-bottom: 1px solid rgba(16, 185, 129, 0.12);
}

#screen-messages .wa-main-empty .wa-empty-brand {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  font-size: 28px;
}

#screen-messages .wa-chat-header {
  background: linear-gradient(180deg, #1a2830 0%, #202c33 100%) !important;
  border-bottom: 1px solid rgba(16, 185, 129, 0.14);
}

#screen-messages #chat-input-area-motoboy .wa-send-btn,
#screen-messages .wa-composer .wa-send-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

#screen-messages .wa-btn-back {
  display: none;
}

#screen-messages .wa-recording-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #182229;
  border-top: 1px solid #2a3942;
  color: #e9edef;
  font-size: 14px;
}

#screen-messages .wa-rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
  animation: waRecPulse 1s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes waRecPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.92); }
}

#screen-messages .wa-rec-cancel {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #8696a0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

#screen-messages #btnAudioMotoboy.is-recording {
  color: #ef4444 !important;
  animation: waRecPulse 1s ease-in-out infinite;
}

#screen-messages .wa-contact-list:has(.wa-list-empty) {
  min-height: 0;
  padding-top: 4px;
}

#screen-messages .wa-list-empty {
  padding: 16px 14px;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 768px) {
  #screen-messages .wa-motoboy-chat,
  #screen-messages .wa-panel-chat {
    height: 100% !important;
  }

  #screen-messages .wa-btn-back {
    display: inline-flex !important;
  }
}

/* ——— Loja: popup flutuante (painel) ——— */
#aba-chat .wa-quick-chips {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

#aba-chat .wa-quick-chips::-webkit-scrollbar {
  display: none;
}

#aba-chat #waChatLojaRoot .wa-main {
  min-height: 0;
  overflow: hidden;
}

#aba-chat #chatMensagensLoja.wa-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#aba-chat #chatEnvioLoja.wa-composer,
#aba-chat #waChatLojaRoot .wa-chat-header,
#aba-chat #waChatLojaRoot .wa-encerrado-aviso {
  flex-shrink: 0;
}

#aba-chat.wa-chat-section {
  border-radius: 18px !important;
  border: 1px solid rgba(16, 185, 129, 0.28) !important;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 40px rgba(16, 185, 129, 0.16) !important;
  overflow: hidden !important;
  background: linear-gradient(165deg, #081217 0%, #0c161c 100%) !important;
}

#aba-chat .wa-filter-chip.active,
#aba-chat #waChatLojaRoot.wa-chat-admin-theme .wa-filter-chip.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #052e1f !important;
}

#aba-chat .wa-contact-item.active,
#aba-chat .wa-contact-list article.wa-contact-item.active {
  background: rgba(16, 185, 129, 0.12) !important;
  border-left: 3px solid #10b981;
}

#aba-chat .wa-composer .wa-send-btn,
#aba-chat #chat-input-area-loja .wa-send-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

#aba-chat .wa-admin-chat.wa-panel-chat {
  margin-top: 0;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

#aba-chat #waChatLojaRoot .wa-loja-sidebar-hd {
  background: linear-gradient(180deg, #152535 0%, #111d29 100%);
  border-bottom: 1px solid rgba(0, 209, 102, 0.14);
  padding: 11px 12px;
  min-height: 50px;
}

#aba-chat #waChatLojaRoot .wa-sidebar-title {
  font-size: 15px;
  font-weight: 600;
  color: #f1f5f9;
  gap: 8px;
}

#aba-chat #waChatLojaRoot .wa-sidebar-title .fa-comments {
  color: #00d166;
  font-size: 15px;
}

#aba-chat #waChatLojaRoot .wa-sidebar-hd-actions {
  display: flex;
  gap: 2px;
  align-items: center;
}

#aba-chat #waChatLojaRoot .wa-sidebar-hd .wa-icon-btn {
  width: 36px;
  height: 36px;
  font-size: 15px;
}

#aba-chat #waChatLojaRoot .wa-btn-close-chat {
  color: #fca5a5 !important;
}

#aba-chat #waChatLojaRoot .wa-btn-close-chat:hover {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #f87171 !important;
}

#aba-chat #waChatLojaRoot .wa-filters {
  padding: 8px 10px 10px;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

#aba-chat #waChatLojaRoot .wa-filter-chip {
  font-size: 12px;
  padding: 6px 12px;
}

#aba-chat #waChatLojaRoot .wa-contact-item.active {
  box-shadow: inset 3px 0 0 #00d166;
}

#aba-chat #waChatLojaRoot .wa-contact-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

#aba-chat #waChatLojaRoot .wa-main-empty {
  padding: 20px 16px;
  border-bottom: none;
}

#aba-chat #waChatLojaRoot .wa-main-empty .wa-empty-brand {
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
}

#aba-chat #waChatLojaRoot .wa-main-empty .wa-empty-brand .fa-comments {
  font-size: 24px;
}

#aba-chat #waChatLojaRoot .wa-main-empty h4 {
  font-size: 20px;
  margin-bottom: 8px;
}

#aba-chat #waChatLojaRoot .wa-main-empty p {
  font-size: 13px;
  max-width: 280px;
}

#aba-chat #waChatLojaRoot .chat-mensagens.wa-messages,
#aba-chat #waChatLojaRoot #chatMensagensLoja {
  background-color: #081217 !important;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 12px 10px !important;
}

#aba-chat #waChatLojaRoot .msg.loja {
  background: linear-gradient(135deg, #00d166 0%, #05a173 100%) !important;
  color: #031108 !important;
  box-shadow: 0 2px 10px rgba(0, 209, 102, 0.22);
}

#aba-chat #waChatLojaRoot .msg.loja::after {
  background: linear-gradient(180deg, #00d166, #05a173) !important;
}

#aba-chat #waChatLojaRoot .msg.admin,
#aba-chat #waChatLojaRoot .msg.motoboy {
  background: #1c2d3a !important;
  color: #e8eef3 !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

#aba-chat #waChatLojaRoot .msg.admin::after,
#aba-chat #waChatLojaRoot .msg.motoboy::after {
  background: #1c2d3a !important;
}

#aba-chat #waChatLojaRoot .msg.loja .msg-time {
  color: rgba(3, 17, 8, 0.55) !important;
}

#aba-chat #waChatLojaRoot .msg.admin .msg-time,
#aba-chat #waChatLojaRoot .msg.motoboy .msg-time {
  color: rgba(255, 255, 255, 0.42) !important;
}

#aba-chat #waChatLojaRoot .msg-row.mine {
  flex-direction: row-reverse;
  justify-content: flex-start;
  margin-left: auto;
}

#aba-chat #waChatLojaRoot .msg-row:not(.mine) {
  margin-right: auto;
}

#aba-chat #waChatLojaRoot .msg.loja {
  border-top-right-radius: 0;
  border-top-left-radius: 7.5px;
}

#aba-chat #waChatLojaRoot .msg.motoboy,
#aba-chat #waChatLojaRoot .msg.admin {
  border-top-left-radius: 0;
  border-top-right-radius: 7.5px;
}

#aba-chat #waChatLojaRoot .wa-composer textarea {
  font-size: 14px !important;
  min-height: 40px !important;
  padding: 10px 12px !important;
}

#aba-chat #waChatLojaRoot .wa-send-btn {
  width: 40px;
  height: 40px;
}

#aba-chat #waChatLojaRoot .wa-encerrado-aviso {
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
  border-top: 1px solid rgba(251, 191, 36, 0.2);
  font-size: 12px;
  padding: 10px 14px;
  text-align: center;
}

#aba-chat #waChatLojaRoot .wa-btn-back {
  display: inline-flex !important;
  flex-shrink: 0;
}

#aba-chat .wa-admin-chat.wa-mobile-show-chat .wa-chat-header {
  padding-left: 8px;
}

/* Painel loja: chat fixo no canto inferior (wa-chat.css carrega por último) */
body.loja-painel #btnAbaChat.loja-chat-fab {
  position: fixed !important;
  top: auto !important;
  right: auto !important;
  bottom: calc(20px + env(safe-area-inset-bottom)) !important;
  left: calc(var(--loja-sidebar-w, 0px) + 16px) !important;
  margin: 0 !important;
  z-index: 10001 !important;
  pointer-events: auto !important;
}

body.loja-painel.loja-aba-pedidos #btnAbaChat.loja-chat-fab,
body.loja-painel.loja-aba-pedidos-central #btnAbaChat.loja-chat-fab {
  display: flex !important;
}

body.loja-painel #aba-chat.wa-chat-section {
  position: fixed !important;
  top: auto !important;
  right: auto !important;
  bottom: calc(20px + env(safe-area-inset-bottom)) !important;
  left: calc(var(--loja-sidebar-w, 0px) + 16px) !important;
  margin: 0 !important;
  z-index: 10002 !important;
}

body.loja-painel #aba-chat.wa-chat-section.is-motoboy-chat-modal {
  position: fixed !important;
  inset: 0 !important;
  display: grid !important;
  place-items: center !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: 100vh !important;
  box-sizing: border-box !important;
  padding: 18px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(15, 23, 42, .62) !important;
  box-shadow: none !important;
}

body.loja-painel #aba-chat.wa-chat-section.is-motoboy-chat-modal #waChatLojaRoot {
  width: min(820px, calc(100vw - 36px)) !important;
  height: min(680px, calc(100vh - 36px)) !important;
  max-height: calc(100dvh - 36px) !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .35) !important;
  overflow: hidden !important;
}

body.loja-painel #aba-chat.wa-chat-section.is-motoboy-chat-modal #waChatLojaRoot .wa-sidebar {
  display: none !important;
}

body.loja-painel #aba-chat.wa-chat-section.is-motoboy-chat-modal #waChatLojaRoot .wa-main {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  border-radius: 16px !important;
}

body.loja-painel #aba-chat.wa-chat-section.is-motoboy-chat-modal #btnWaLojaBack {
  display: none !important;
}

body.loja-painel #aba-chat.wa-chat-section.is-motoboy-chat-modal #btnWaLojaMotoboyModalClose {
  display: inline-flex !important;
}

@media (max-width: 600px) {
  body.loja-painel #aba-chat.wa-chat-section.is-motoboy-chat-modal {
    padding: 10px !important;
  }

  body.loja-painel #aba-chat.wa-chat-section.is-motoboy-chat-modal #waChatLojaRoot {
    width: calc(100vw - 20px) !important;
    height: calc(100vh - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    border-radius: 14px !important;
  }
}
