.crm-workspace[data-crm-tab="inbox"] { min-width: 0; padding: 10px; }
.crm-workspace[data-crm-tab="inbox"] > .crm-header { display: none; }
.crm-workspace[data-crm-tab="inbox"] > .crm-nav { margin: 0 0 8px; padding: 0 0 8px; }
.crm-workspace .wa-web-inbox {
  container: wa-inbox / inline-size;
  width: 100%;
  min-width: 0;
  color: #111b21;
  font: 14px/1.35 system-ui, sans-serif;
}
.crm-workspace .wa-web-inbox .wa-chat-section { margin: 0; padding: 0 !important; border: 0; border-radius: 0; }
.crm-workspace .wa-web-inbox .wa-chat-window {
  display: grid;
  grid-template-columns: minmax(235px, 32%) minmax(0, 1fr);
  width: 100%; height: clamp(420px, 76dvh, 850px);
  min-height: 0; max-height: none; margin: 0;
  border: 1px solid #e9edef; border-radius: 0;
  background: #fff;
}
.wa-web-inbox .wa-chat-sidebar { min-height: 0; max-height: none; border: 0; border-right: 1px solid #e9edef; background: #fff; }
.wa-web-inbox .wa-chat-sidebar-title { border: 0; padding: 9px 16px 3px; align-items: center; }
.wa-web-inbox .wa-chat-sidebar-title strong { font-size: 25px; letter-spacing: -.5px; }
.wa-web-inbox .wa-icon-button {
  display: inline-grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px;
  padding: 0; border: 0; border-radius: 50%; background: transparent; color: #54656f; cursor: pointer;
}
.wa-web-inbox .wa-icon-button:hover { background: #e9edef; }
.wa-web-inbox .wa-chat-search { padding: 4px 12px 10px; }
.wa-web-inbox .wa-chat-search label {
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  border-radius: 9px; background: #f0f2f5; color: #54656f;
}
.wa-web-inbox .wa-chat-search input {
  flex: 1; width: 100%; min-width: 0; height: 38px; margin: 0; padding: 0;
  border: 0; box-shadow: none; background: transparent; color: #111b21; font-size: 16px;
}
.wa-web-inbox .wa-chat-contacts { min-height: 0; overscroll-behavior: contain; }
.wa-web-inbox .wa-chat-contact {
  min-height: 69px; gap: 12px; padding: 8px 12px; border: 0; box-shadow: none; color: #111b21;
}
.wa-web-inbox .wa-chat-contact:hover, .wa-web-inbox .wa-chat-contact.is-selected { background: #f0f2f5; }
.wa-web-inbox .wa-chat-avatar { flex-basis: 45px; width: 45px; height: 45px; background: #dfe5e7; color: #667781; }
.wa-web-inbox .wa-chat-preview {
  display: grid; flex: 1; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 3px 6px; padding: 6px 0;
}
.wa-web-inbox .wa-chat-preview strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.wa-web-inbox .wa-chat-preview > span { grid-column: 1 / -1; color: #54656f; font-size: 13px; }
.wa-web-inbox .wa-chat-preview small { color: #667781; opacity: 1; font-size: 10px; }
.crm-workspace .wa-web-inbox .wa-chat-main { display: flex; height: auto; min-height: 0; max-height: none; background: #f0f2f5; }
.wa-web-inbox .wa-chat-header {
  flex-wrap: nowrap; min-width: 0; padding: 9px 14px; gap: 9px;
  background: #f0f2f5; border: 0;
}
.wa-web-inbox .wa-chat-header strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-web-inbox .wa-chat-header .wa-chat-avatar { width: 39px; height: 39px; flex-basis: 39px; }
.wa-web-inbox .wa-chat-header .btn { flex: 0 0 auto; white-space: normal; max-width: 94px; color: #285448; }
.crm-workspace .wa-web-inbox .wa-chat-back { display: none; }
.wa-web-inbox .wa-chat-history {
  padding: 16px clamp(12px, 5cqw, 60px);
  gap: 6px; overscroll-behavior: contain;
  background: #efeae2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='126' height='112' viewBox='0 0 126 112' fill='none' stroke='%237f6d52' stroke-opacity='.12' stroke-width='1.2'%3E%3Cpath d='M11 17h27v16H24l-7 5v-5h-6zM65 74l20-9-7 20-4-8zM98 13l3 6 6 3-6 3-3 6-3-6-6-3 6-3zM17 86c-8-6-7-12-2-12 2 0 4 1 5 3 1-2 3-3 5-3 6 0 6 6-2 12l-3 2z'/%3E%3Ccircle cx='53' cy='43' r='3'/%3E%3Ccircle cx='107' cy='62' r='8'/%3E%3Cpath d='M103 63q4 5 8 0M41 102l5-3 4 4 5-3M114 101l3 3 4-5'/%3E%3C/svg%3E") repeat;
}
.wa-web-inbox .wa-chat-date { align-self: center; margin: 8px 0; padding: 5px 10px; border-radius: 7px; background: #fff; color: #54656f; font-size: 12px; }
.wa-web-inbox .wa-chat-bubble { max-width: min(88%, 640px); padding: 6px 9px 4px; border-radius: 8px; color: #111b21; }
.wa-web-inbox .wa-chat-incoming { background: #fff; border-top-left-radius: 2px; }
.wa-web-inbox .wa-chat-outgoing { background: #d9fdd3; border-top-right-radius: 2px; }
.wa-web-inbox .wa-chat-bubble p { margin: 0; font-size: 14px; line-height: 1.4; }
.wa-web-inbox .wa-chat-bubble small { text-align: right; color: #54656f; opacity: 1; }
.wa-web-inbox .wa-chat-compose { align-items: center; border: 0; background: #f0f2f5; padding: 8px 10px; }
.wa-web-inbox .wa-chat-compose textarea {
  width: 100%; min-height: 42px; padding: 10px 13px; resize: none; border: 0;
  border-radius: 8px; background: #fff; color: #111b21; font-size: 16px;
}
.wa-web-inbox .wa-chat-compose-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.wa-web-inbox .wa-send-button { color: #fff; background: #008069; }
.wa-web-inbox .wa-send-button:hover { background: #006e5c; }
.wa-web-inbox .wa-send-button:disabled { opacity: .48; cursor: default; }
.wa-web-inbox .wa-chat-compose [role="alert"]:empty { display: none; }
.wa-web-inbox .wa-chat-welcome strong { display: block; font-size: 25px; font-weight: 500; }
.wa-web-inbox .wa-chat-welcome p { color: #54656f; }
.wa-web-inbox .wa-welcome-icon {
  display: grid; place-items: center; width: 78px; height: 78px;
  margin: 0 auto 18px; border-radius: 50%; background: #d9fdd3; color: #008069;
}

@container wa-inbox (max-width: 640px) {
  .crm-workspace .wa-web-inbox .wa-chat-window {
    grid-template-columns: minmax(0, 1fr);
    height: clamp(320px, 68dvh, 720px);
  }
  .crm-workspace .wa-web-inbox .wa-chat-sidebar { border: 0; }
  .crm-workspace .wa-web-inbox .wa-chat-main,
  .crm-workspace .wa-web-inbox.wa-mobile-chat-open .wa-chat-sidebar { display: none; }
  .crm-workspace .wa-web-inbox.wa-mobile-chat-open .wa-chat-main { display: flex; height: auto; max-height: none; }
  .crm-workspace .wa-web-inbox .wa-chat-back { display: inline-grid; }
  .wa-web-inbox .wa-chat-header { padding-inline: 5px 10px; }
}

.wa-web-inbox .wa-chat-compose { grid-template-columns: auto minmax(0,1fr) auto; }
.wa-web-inbox #wa-chat-file[hidden] { display: none !important; }
.wa-web-inbox .wa-file-preview { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; min-width: 0; background: #fff; border-radius: 8px; padding-inline: 10px 4px; }
.wa-web-inbox .wa-file-preview span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-web-inbox .wa-chat-media { display: block; max-width: min(100%,340px); border-radius: 5px; }
.wa-web-inbox .wa-chat-media img { display: block; max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 5px; }
.wa-web-inbox .wa-chat-document { display: block; padding: 9px; background: #f0f2f5; border-radius: 6px; color: #005c4b; overflow-wrap: anywhere; }
.wa-web-inbox .wa-chat-older { flex: 0 0 auto; align-self: center; display: block; margin: 8px auto; padding: 7px 12px; border: 0; border-radius: 18px; background: #fff; color: #006b58; cursor: pointer; }

.wa-web-inbox .wa-playback { max-width: 100%; display: grid; gap: 5px; }
.wa-web-inbox .wa-playback video { width: min(100%,340px); max-height: 300px; background: #111b21; }
.wa-web-inbox .wa-playback audio { width: min(100%,280px); height: 48px; }
.wa-web-inbox .wa-playback .wa-playback-error { text-align: left; color: #a32a22; }
.wa-web-inbox .wa-playback-error[hidden] { display: none !important; }
.wa-web-inbox .wa-playback-download { color: #006b58; font-size: 11px; justify-self: start; }

html:has(.wa-fullscreen),body:has(.wa-fullscreen) { overflow: hidden !important; }
.wa-fullscreen {
  position: fixed; inset: 0; z-index: 10000;
  box-sizing: border-box; width: 100%; height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow: hidden; background: #f0f2f5;
}
.wa-fullscreen .wa-web-inbox, .wa-fullscreen .wa-chat-section, .wa-fullscreen #wa-inbox { width: 100%; height: 100%; min-width: 0; margin: 0; padding: 0 !important; }
.wa-fullscreen .wa-web-inbox { container: wa-inbox / inline-size; color: #111b21; font: 14px/1.35 system-ui,sans-serif; }
.wa-fullscreen .wa-web-inbox .wa-chat-window {
  display: grid; grid-template-columns: minmax(260px,31%) minmax(0,1fr);
  height: 100%; min-height: 0; max-height: none;
  width: 100%; margin: 0; border: 0; border-radius: 0;
}
.wa-fullscreen .wa-chat-main { display: flex; height: auto; min-height: 0; max-height: none; background: #f0f2f5; }
.wa-fullscreen .wa-chat-header { padding-right: 64px; flex-wrap: nowrap; }
.wa-fullscreen .wa-chat-back { display: none; }
.wa-fullscreen .wa-fullscreen-close {
  display: grid; place-items: center; position: absolute; z-index: 2;
  right: max(10px,env(safe-area-inset-right)); top: max(8px,env(safe-area-inset-top));
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff; color: #25363d; text-decoration: none;
  box-shadow: 0 1px 6px #0002; font: 32px/1 system-ui,sans-serif;
}
.wa-fullscreen .wa-fullscreen-close:hover { background: #e4e9ec; }
.wa-fullscreen .wa-inbox-loading { padding: 22px; }
@container wa-inbox (max-width: 640px) {
  .wa-fullscreen .wa-web-inbox .wa-chat-window { grid-template-columns: minmax(0,1fr); }
  .wa-fullscreen .wa-chat-sidebar { border: 0; max-height: none; }
  .wa-fullscreen .wa-chat-sidebar-title { padding-right: 62px; }
  .wa-fullscreen .wa-chat-main,
  .wa-fullscreen .wa-mobile-chat-open .wa-chat-sidebar { display: none; }
  .wa-fullscreen .wa-mobile-chat-open .wa-chat-main { display: flex; height: auto; max-height: none; }
  .wa-fullscreen .wa-chat-back { display: inline-grid; }
}

.wa-web-inbox .wa-chat-bubble { position: relative; padding-right: 26px; }
.wa-message-menu { position: absolute; right: 3px; top: 1px; z-index: 3; }
.wa-message-menu summary { cursor: pointer; padding: 2px 5px; list-style: none; color: #54656f; }
.wa-message-menu summary::-webkit-details-marker { display: none; }
.wa-message-menu > div { position: absolute; right: 0; top: 22px; display: grid; width: 175px; padding: 5px; background: #fff; border-radius: 8px; box-shadow: 0 3px 15px #0003; }
.wa-message-menu button { text-align: left; border: 0; background: #fff; color: #25363d; padding: 10px; cursor: pointer; }
.wa-message-menu button:hover { background: #f0f2f5; }
body:has(.wa-fullscreen) #modal-root .modal-backdrop { z-index: 20000; }


/* Indicador de avance para altas masivas de WhatsApp */
.crm-batch-progress{margin-top:14px;padding:15px 16px;border:1px solid #78b9d4;border-radius:14px;background:linear-gradient(135deg,#effaff 0%,#f7fcff 58%,#edf8ff 100%);box-shadow:0 10px 24px rgba(22,97,132,.10);color:#07324b}
.crm-batch-progress__head{display:flex;align-items:center;gap:10px}
.crm-batch-progress__head>div{display:grid;gap:2px;flex:1}
.crm-batch-progress__head b{font-size:14px;line-height:1.25}
.crm-batch-progress__head small,.crm-batch-progress__meta{font-size:12px;color:#416579;line-height:1.35}
.crm-batch-progress__head strong{font-size:20px;line-height:1;color:#06779d;white-space:nowrap}
.crm-batch-progress__spinner{width:19px;height:19px;box-sizing:border-box;border:3px solid #a8d9e8;border-top-color:#0782a9;border-radius:50%;animation:crm-batch-spin .8s linear infinite}
.crm-batch-progress__track{height:11px;margin:13px 0 9px;overflow:hidden;border-radius:999px;background:#d6eaf3;box-shadow:inset 0 1px 2px rgba(2,53,79,.15)}
.crm-batch-progress__fill{display:block;height:100%;min-width:12px;border-radius:inherit;background:linear-gradient(90deg,#0486aa,#00b6b5,#50d9bf);transform-origin:left;animation:crm-batch-grow .85s cubic-bezier(.2,.8,.2,1) both;position:relative;overflow:hidden}
.crm-batch-progress__fill:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.68),transparent);transform:translateX(-120%);animation:crm-batch-shimmer 1.5s ease-in-out infinite}
.crm-batch-progress__meta{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.crm-batch-progress__meta span:last-child{font-weight:600;color:#16708f}
@keyframes crm-batch-spin{to{transform:rotate(360deg)}}
@keyframes crm-batch-grow{from{transform:scaleX(0);opacity:.55}to{transform:scaleX(1);opacity:1}}
@keyframes crm-batch-shimmer{to{transform:translateX(120%)}}
@media (prefers-reduced-motion:reduce){.crm-batch-progress__spinner,.crm-batch-progress__fill,.crm-batch-progress__fill:after{animation:none}}
