#view-whatsapp { padding: 0 !important; }
#whatsapp-inbox-root { --wa-ink:#111b21; --wa-muted:#667781; --wa-line:#e9edef; --wa-green:#00a884; --wa-soft:#e7fce3; --wa-panel:#f0f2f5; --wa-chat-bg:#efeae2; min-height:calc(100vh - 150px); color:var(--wa-ink); font-family:Inter,system-ui,sans-serif; }
.wa-inbox { max-width:1540px; margin:0 auto; padding:22px 24px 30px; }
.wa-page-head { display:flex; align-items:center; justify-content:space-between; gap:24px; margin-bottom:18px; }
.wa-page-head h1 { margin:3px 0 2px; font-size:clamp(1.7rem,3vw,2.35rem); letter-spacing:-.04em; }
.wa-page-head p { margin:0; color:var(--wa-muted); }
.wa-eyebrow { color:#718684; font-size:.68rem; font-weight:900; letter-spacing:.18em; }
.wa-page-actions,.wa-primary,.wa-secure { display:flex; align-items:center; gap:9px; }
.wa-primary { border:0; border-radius:13px; padding:11px 16px; background:var(--wa-green); color:#fff; font:inherit; font-weight:800; cursor:pointer; box-shadow:0 9px 22px rgba(13,117,106,.2); }
.wa-primary:hover { filter:brightness(.96); transform:translateY(-1px); }
.wa-primary .material-symbols-outlined { font-size:19px; }
.wa-secure { color:#37736d; font-size:.78rem; font-weight:800; }
.wa-secure .material-symbols-outlined { font-size:18px; }
.wa-sections { display:flex; gap:6px; margin-bottom:12px; }
.wa-sections button { display:flex; align-items:center; gap:7px; border:0; border-radius:12px; padding:9px 13px; background:transparent; color:#718684; font:inherit; font-weight:800; cursor:pointer; }
.wa-sections button.active { background:#e5f4f0; color:#08675f; }
.wa-sections .material-symbols-outlined { font-size:19px; }
.wa-workspace { display:grid; grid-template-columns:minmax(310px,370px) minmax(0,1fr) minmax(250px,285px); min-height:500px; height:clamp(560px,calc(100dvh - 210px),880px); border:1px solid var(--wa-line); border-radius:16px; overflow:hidden; background:#fff; box-shadow:0 12px 40px rgba(17,27,33,.12); }
.wa-workspace.is-scheduled { height:auto; min-height:0; overflow:visible; }
.wa-workspace.is-scheduled>.wa-scheduled { min-height:660px; overflow:visible; }
.wa-sidebar { display:flex; flex-direction:column; min-width:0; border-right:1px solid var(--wa-line); background:#fff; }
.wa-search { display:flex; align-items:center; gap:8px; margin:18px 16px 10px; padding:10px 12px; border:1px solid var(--wa-line); border-radius:13px; background:#fff; }
.wa-search .material-symbols-outlined { color:#879b99; font-size:20px; }
.wa-search input { width:100%; border:0; outline:0; background:transparent; color:var(--wa-ink); font:inherit; }
.wa-filter-row { display:flex; justify-content:space-between; align-items:center; padding:8px 18px 11px; font-size:.8rem; }
.wa-filter-row button { display:grid; place-items:center; width:32px; height:32px; border:0; border-radius:10px; background:transparent; color:#708684; cursor:pointer; }
.wa-filter-row button:hover { background:#edf5f3; }
.wa-filter-row .material-symbols-outlined { font-size:18px; }
.wa-filter-tabs { display:flex; gap:5px; overflow:auto; padding:0 14px 11px; scrollbar-width:none; }
.wa-filter-tabs::-webkit-scrollbar { display:none; }
.wa-filter-tabs button { flex:0 0 auto; border:0; border-radius:999px; padding:6px 9px; background:transparent; color:#718684; font:inherit; font-size:.68rem; font-weight:800; cursor:pointer; }
.wa-filter-tabs button.active { background:#e1f2ee; color:#08675f; }
.wa-conversation-list { overflow:auto; padding:0 9px 12px; }
.wa-conversation { display:flex; width:100%; gap:12px; align-items:center; padding:11px 10px; border:0; border-radius:0; background:transparent; color:inherit; text-align:left; cursor:pointer; }
.wa-conversation:hover { background:#f5f6f6; }
.wa-conversation.active { background:#f0f2f5; }
.wa-avatar { flex:0 0 auto; display:grid; place-items:center; width:46px; height:46px; border-radius:50%; background:#b97859; color:#fff; font-size:.82rem; font-weight:900; }
.wa-avatar.has-photo { overflow:hidden; background:#e8f1ef; }
.wa-avatar img,.wa-patient-avatar img { width:100%; height:100%; object-fit:cover; }
.wa-conversation:nth-child(3n+2) .wa-avatar { background:#4e7c81; }
.wa-conversation:nth-child(3n+3) .wa-avatar { background:#7d6ba3; }
.wa-conversation-copy { min-width:0; flex:1; }
.wa-conversation-top,.wa-conversation-bottom { display:flex; justify-content:space-between; gap:8px; min-width:0; }
.wa-conversation-top strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.88rem; }
.wa-pin { margin-right:4px; color:#0d756a; font-size:14px!important; vertical-align:-2px; }
.wa-conversation-top time { color:#8a9b99; font-size:.69rem; }
.wa-conversation-bottom { margin-top:4px; align-items:center; color:#7b8f8d; font-size:.76rem; }
.wa-conversation-bottom>span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wa-conversation-bottom b { display:grid; place-items:center; min-width:20px; height:20px; padding:0 5px; border-radius:10px; background:#19a974; color:#fff; font-size:.66rem; }
.wa-status-dot { flex:0 0 auto; width:8px; height:8px; border-radius:50%; background:#f0a629; }
.wa-status-dot.resolved { background:#7b8b89; }
.wa-list-empty,.wa-empty-chat,.wa-scheduled-empty { display:grid; place-items:center; align-content:center; min-height:220px; padding:28px; text-align:center; color:#819492; }
.wa-list-empty .material-symbols-outlined,.wa-empty-chat .material-symbols-outlined,.wa-scheduled-empty .material-symbols-outlined { font-size:44px; color:#9cbab5; }
.wa-list-empty p,.wa-empty-chat p,.wa-scheduled-empty p { margin:5px 0 0; }
.wa-list-empty button { margin-top:10px; border:0; border-radius:10px; padding:8px 12px; background:#e5f4f0; color:#08675f; font-weight:800; cursor:pointer; }
.wa-chat-panel { position:relative; display:grid; grid-template-rows:auto minmax(0,1fr) auto; min-width:0; min-height:0; height:100%; max-height:100%; overflow:hidden; background-color:var(--wa-chat-bg); background-image:radial-gradient(circle at 20% 30%,rgba(17,27,33,.035) 0 1.2px,transparent 1.6px),radial-gradient(circle at 70% 65%,rgba(17,27,33,.025) 0 1px,transparent 1.5px); background-size:28px 28px,36px 36px; }
.wa-chat-panel>.wa-empty-chat { grid-row:1/-1; }
.wa-empty-chat h3 { margin:12px 0 0; color:#315451; }
.wa-chat-head { display:flex; align-items:center; gap:12px; padding:10px 16px; border-bottom:1px solid #d8dcde; background:rgba(240,242,245,.97); backdrop-filter:blur(12px); }
.wa-chat-head>div { min-width:0; }
.wa-chat-head strong,.wa-chat-head small { display:block; }
.wa-chat-head small { margin-top:2px; color:#829492; font-size:.74rem; }
.wa-window-status { display:inline-flex; align-items:center; gap:5px; margin-left:auto; padding:6px 9px; border-radius:16px; font-size:.68rem; font-weight:800; white-space:nowrap; }
.wa-window-status .material-symbols-outlined { font-size:16px; }
.wa-window-status.open { color:#176b5e; background:#e5f7f1; }
.wa-window-status.closed { color:#8b6505; background:#fff3d9; }
.wa-window-status+.wa-patient-link { margin-left:0; }
.wa-patient-link { display:flex; align-items:center; gap:5px; margin-left:auto; height:36px; padding:0 10px; border:1px solid #cbdcd9; border-radius:10px; background:#fff; color:#55716e; font:inherit; font-size:.7rem; font-weight:800; cursor:pointer; }
.wa-patient-link.linked { border-color:#a9dcc0; background:#effbf4; color:#246d3f; }
.wa-patient-link .material-symbols-outlined { font-size:18px; }
.wa-chat-tools { display:flex; align-items:center; gap:8px; }
.wa-chat-tools select,.wa-chat-tools button { height:36px; border:1px solid var(--wa-line); border-radius:10px; background:#fff; color:#496663; font:inherit; font-size:.72rem; font-weight:800; }
.wa-chat-tools select { padding:0 28px 0 10px; }
.wa-chat-tools button { display:flex; align-items:center; gap:5px; padding:0 10px; cursor:pointer; }
.wa-chat-tools button:hover { background:#edf7f4; }
.wa-chat-tools .material-symbols-outlined { font-size:18px; }
.wa-messages { display:flex; flex-direction:column; gap:7px; min-height:0; overflow:auto; overscroll-behavior:contain; padding:22px clamp(18px,4vw,52px); }
.wa-message { position:relative; max-width:min(76%,650px); padding:7px 34px 6px 9px; border-radius:8px; box-shadow:0 1px 1px rgba(11,20,26,.13); transition:box-shadow .2s,transform .2s; }
.wa-message.highlight { transform:scale(1.015); box-shadow:0 0 0 3px rgba(13,117,106,.25),0 6px 18px rgba(25,66,62,.14); }
.wa-message-menu { position:absolute; top:4px; right:5px; display:grid; place-items:center; width:27px; height:27px; border:0; border-radius:50%; background:transparent; color:#718684; cursor:pointer; opacity:.35; }
.wa-message:hover .wa-message-menu,.wa-message-menu:focus-visible { opacity:1; background:rgba(255,255,255,.6); }
.wa-message-menu .material-symbols-outlined { font-size:18px; }
.wa-reply-quote { display:block; width:100%; margin:0 0 7px; padding:7px 9px; overflow:hidden; border:0; border-left:3px solid #159b89; border-radius:7px; background:rgba(255,255,255,.55); color:#365a56; text-align:left; cursor:pointer; }
.wa-reply-quote strong,.wa-reply-quote span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wa-reply-quote strong { color:#0d756a; font-size:.68rem; }
.wa-reply-quote span { margin-top:2px; font-size:.7rem; }
.wa-message p { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.45; }
.wa-open-media { display:flex; align-items:center; gap:6px; margin-top:8px; padding:7px 9px; border:1px solid rgba(13,117,106,.2); border-radius:9px; background:rgba(255,255,255,.55); color:#176c63; font:inherit; font-size:.72rem; font-weight:800; cursor:pointer; }
.wa-open-media .material-symbols-outlined { font-size:17px; }
.wa-inline-media { display:grid; place-items:center; min-width:190px; min-height:90px; margin-top:8px; overflow:hidden; border-radius:11px; background:rgba(255,255,255,.45); color:#6b827f; }
.wa-inline-media>span { animation:wa-spin 1s linear infinite; }
.wa-inline-media img,.wa-inline-media video { display:block; width:min(100%,420px); max-height:340px; object-fit:contain; background:#0d1d1b; }
.wa-inline-media audio { width:min(100%,340px); margin:8px; }
.wa-inline-media small { padding:8px; }
@keyframes wa-spin { to { transform:rotate(360deg); } }
.wa-message small { display:block; margin-top:4px; color:#7d918e; font-size:.65rem; text-align:right; }
.wa-delivery { display:inline-block; margin-left:4px; color:#667781; font-weight:900; letter-spacing:-2px; }
.wa-delivery.read { color:#53bdeb; }.wa-delivery.failed { display:inline-grid; place-items:center; width:13px; height:13px; border-radius:50%; background:#e53935; color:#fff; letter-spacing:0; }
.wa-message.inbound { align-self:flex-start; border-top-left-radius:2px; background:#fff; }
.wa-message.outbound { align-self:flex-end; border-top-right-radius:2px; background:#d9fdd3; }
.wa-no-messages { margin:auto; padding:8px 13px; border-radius:20px; background:rgba(255,255,255,.8); color:#829492; font-size:.78rem; }
.wa-composer { position:sticky; bottom:0; z-index:4; display:flex; flex:0 0 auto; flex-wrap:wrap; gap:7px; align-items:center; min-height:62px; padding:9px 12px; border-top:1px solid #d8dcde; background:var(--wa-panel); box-shadow:none; }
.wa-replying { order:-1; display:flex; align-items:center; gap:9px; width:100%; min-width:0; padding:8px 10px; border-left:4px solid #0d8275; border-radius:9px; background:#eef8f5; box-sizing:border-box; color:#315652; }
.wa-replying>span { color:#0d8275; }
.wa-replying>div { min-width:0; flex:1; }
.wa-replying strong,.wa-replying small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wa-replying strong { font-size:.72rem; }.wa-replying small { margin-top:2px; color:#718684; font-size:.68rem; }
.wa-replying>button { width:30px!important; height:30px!important; background:transparent!important; color:#607774; }
.wa-composer textarea { flex:1; min-height:42px; max-height:130px; resize:none; overflow-y:auto; border:0; border-radius:9px; padding:10px 12px; outline:0; background:#fff; color:var(--wa-ink); font:inherit; text-transform:none!important; letter-spacing:normal; caret-color:var(--wa-green); }
.wa-composer textarea:focus { border:0; box-shadow:none; }
.wa-composer button { display:grid; place-items:center; width:42px; height:42px; border:0; border-radius:50%; cursor:pointer; }
.wa-composer .wa-send { background:var(--wa-green); color:#fff; }
.wa-composer .wa-attach,.wa-composer .wa-emoji,.wa-composer .wa-mic { background:transparent; color:#54656f; }
.wa-composer .wa-attach:hover,.wa-composer .wa-emoji:hover,.wa-composer .wa-mic:hover { background:#e1e5e7; }
.wa-composer .wa-send { display:none; }
.wa-composer.has-text .wa-send { display:grid; }
.wa-composer.has-text .wa-mic { display:none; }
.wa-composer button:disabled { opacity:.55; cursor:wait; }

.wa-attachment-menu,.wa-emoji-menu { position:absolute; left:48px; bottom:64px; z-index:12; padding:8px; border:1px solid #e2e7e9; border-radius:14px; background:#fff; box-shadow:0 8px 28px rgba(11,20,26,.2); }
.wa-attachment-menu[hidden],.wa-emoji-menu[hidden] { display:none!important; }
.wa-attachment-menu { display:grid; gap:3px; min-width:210px; }
.wa-attachment-menu button { display:flex; align-items:center; gap:11px; width:100%; height:auto; padding:8px 10px; border-radius:9px; background:#fff; color:#26353d; font:inherit; font-size:.82rem; font-weight:650; text-align:left; }
.wa-attachment-menu button:hover { background:#f5f6f6; }
.wa-attachment-menu i { display:grid; place-items:center; width:36px; height:36px; border-radius:50%; color:#fff; font-style:normal; }
.wa-attachment-menu i.media { background:#007bfc; }.wa-attachment-menu i.document { background:#7f66ff; }.wa-attachment-menu i.audio { background:#ff6b57; }.wa-attachment-menu i.sticker { background:#00a884; }
.wa-attachment-menu .material-symbols-outlined { font-size:20px; }
.wa-emoji-menu { left:12px; display:grid; grid-template-columns:repeat(6,36px); gap:3px; }
.wa-emoji-menu button { width:36px; height:36px; border-radius:8px; background:transparent; font-size:20px; }
.wa-emoji-menu button:hover { background:#f0f2f5; }
.wa-recording { order:5; display:flex; flex:1; align-items:center; gap:10px; min-height:42px; padding:0 4px 0 14px; border-radius:9px; background:#fff; color:#54656f; }
.wa-recording[hidden] { display:none!important; }
.wa-recording-dot { width:9px; height:9px; border-radius:50%; background:#e53935; animation:wa-recording-pulse 1s infinite; }
.wa-recording strong { color:#e53935; font-variant-numeric:tabular-nums; }
.wa-recording>span:nth-of-type(2) { flex:1; font-size:.78rem; }
.wa-recording button { flex:0 0 auto; background:transparent; color:#60737c; }
.wa-recording .wa-recording-send { background:var(--wa-green); color:#fff; }
.wa-composer.is-recording>.wa-emoji,.wa-composer.is-recording>.wa-attach,.wa-composer.is-recording>textarea,.wa-composer.is-recording>.wa-send,.wa-composer.is-recording>.wa-mic { display:none; }
@keyframes wa-recording-pulse { 50% { opacity:.35; transform:scale(.8); } }

.wa-inline-media.is-sticker { min-width:0; min-height:0; margin:0; background:transparent; overflow:visible; }
.wa-inline-media .wa-sticker { width:160px; max-width:100%; max-height:160px; object-fit:contain; background:transparent; }
.wa-workspace>.wa-scheduled { grid-column:1/-1; width:100%; min-width:0; box-sizing:border-box; }
.wa-context-panel { min-width:0; overflow:auto; border-left:1px solid var(--wa-line); background:#fbfdfc; }
.wa-context-empty { display:grid; place-items:center; align-content:center; height:100%; padding:26px; color:#809390; text-align:center; }
.wa-context-empty span { font-size:42px; color:#a1bbb7; }
.wa-profile-card { display:grid; justify-items:center; padding:25px 18px 20px; text-align:center; background:linear-gradient(180deg,#edf8f5 0,#fbfdfc 100%); }
.wa-profile-avatar { display:grid; place-items:center; width:76px; height:76px; overflow:hidden; border-radius:24px; background:linear-gradient(135deg,#0d756a,#6aa99f); color:#fff; font-size:1.2rem; font-weight:900; box-shadow:0 10px 25px rgba(13,117,106,.18); }
.wa-profile-avatar img { width:100%; height:100%; object-fit:cover; }
.wa-profile-card h3 { margin:12px 0 2px; font-size:1rem; }
.wa-profile-card p { margin:0; color:#748986; font-size:.76rem; }
.wa-profile-badge { display:flex; align-items:center; gap:5px; margin-top:10px; padding:5px 9px; border-radius:999px; background:#f2f4f4; color:#74817f; font-size:.64rem; font-weight:800; }
.wa-profile-badge.linked { background:#e2f6ea; color:#277044; }
.wa-profile-badge .material-symbols-outlined { font-size:15px; }
.wa-context-section { padding:18px; border-top:1px solid var(--wa-line); }
.wa-context-section>small { color:#718684; font-size:.63rem; font-weight:900; letter-spacing:.13em; }
.wa-context-section>p { color:#758986; font-size:.75rem; line-height:1.45; }
.wa-context-section dl { margin:10px 0; }
.wa-context-section dl div { display:flex; justify-content:space-between; gap:8px; padding:6px 0; font-size:.72rem; }
.wa-context-section dt { color:#80918f; }
.wa-context-section dd { max-width:145px; margin:0; overflow:hidden; color:#294d49; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.wa-context-action { display:flex; align-items:center; justify-content:center; gap:6px; width:100%; margin-top:12px; padding:9px; border:1px solid #b8d8d2; border-radius:11px; background:#eef8f5; color:#0b6e64; font:inherit; font-size:.72rem; font-weight:800; cursor:pointer; }
.wa-context-action .material-symbols-outlined { font-size:18px; }
.wa-next-appointment { display:flex; gap:9px; margin-top:10px; padding:10px; border-radius:12px; background:#f0f6ff; color:#315a82; }
.wa-next-appointment>span { font-size:21px; }
.wa-next-appointment strong { font-size:.72rem; }
.wa-next-appointment p { margin:3px 0 0; font-size:.68rem; }
.wa-context-link { margin-top:8px; border:0; background:transparent; color:#0d756a; font:inherit; font-size:.7rem; font-weight:800; cursor:pointer; }
.wa-scheduled { min-height:600px; border:1px solid var(--wa-line); border-radius:23px; overflow:hidden; background:#fff; box-shadow:0 18px 55px rgba(25,66,62,.08); }
.wa-scheduled-head { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:26px 30px; border-bottom:1px solid var(--wa-line); }
.wa-scheduled-head>div:first-child { min-width:0; }
.wa-scheduled-head small { color:#718684; font-weight:900; letter-spacing:.14em; }
.wa-scheduled-head h2 { margin:4px 0; }
.wa-scheduled-head p { margin:0; color:#718684; }
.wa-scheduled-actions { display:flex; flex:0 0 auto; gap:9px; align-items:center; }
.wa-schedule-how { margin:18px 20px 0; padding:15px 17px; border:1px solid #bfe7dc; border-radius:17px; background:linear-gradient(135deg,#edfbf6,#f8fffc); display:flex; align-items:center; gap:12px; }
.wa-schedule-how>.material-symbols-outlined { width:42px; height:42px; border-radius:13px; display:grid; place-items:center; background:#d9f5e9; color:#087b68; }
.wa-schedule-how>div { flex:1; }.wa-schedule-how strong { display:block; color:#174c45; }.wa-schedule-how p { margin:3px 0 0; color:#65817d; font-size:.75rem; }
.wa-schedule-how button { min-height:38px; padding:0 13px; border:0; border-radius:11px; background:#087f6d; color:white; font-weight:800; cursor:pointer; }
.wa-secondary { display:inline-flex; align-items:center; gap:7px; border:1px solid #b9d7d2; border-radius:12px; padding:10px 13px; background:#fff; color:#0d756a; font-weight:800; cursor:pointer; }
.wa-secondary .material-symbols-outlined { font-size:19px; }
.wa-scheduled-list { padding:16px; }
.wa-template-summary { display:flex; align-items:center; gap:12px; margin:16px 16px 0; padding:13px 15px; border-radius:14px; background:#fff7df; color:#8a6200; }
.wa-template-summary.ready { background:#e9f8ef; color:#246d3f; }
.wa-template-summary>span { font-size:27px; }
.wa-template-summary strong,.wa-template-summary small { display:block; }
.wa-template-summary small { margin-top:2px; opacity:.8; }
.wa-template-catalog { display:flex; flex-wrap:wrap; gap:8px; padding:12px 16px 0; }
.wa-template-catalog>span { min-width:180px; padding:9px 11px; border:1px solid #e5ecea; border-radius:11px; background:#fafcfc; }
.wa-template-catalog strong,.wa-template-catalog small { display:block; }
.wa-template-catalog small { margin-top:2px; color:#718684; font-size:.66rem; }
.wa-template-catalog>span.status-approved { border-color:#a9dcc0; background:#effbf4; }
.wa-template-catalog>span.status-pending { border-color:#f2d58b; background:#fff9e8; }
.wa-automation-panel { margin:18px 16px 6px; padding:18px; border:1px solid #dcebe8; border-radius:18px; background:#f8fcfb; }
.wa-automation-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:14px; }
.wa-automation-head h3,.wa-scheduled-subtitle h3 { margin:3px 0; }
.wa-automation-head p { margin:0; color:#718684; }
.wa-automation-head>span { flex:0 0 auto; padding:7px 11px; border-radius:18px; background:#dff5ed; color:#176b5e; font-weight:800; font-size:.75rem; }
.wa-automation-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; }
.wa-automation-card { padding:14px; border:1px solid #e0ebe9; border-radius:14px; background:#fff; }
.wa-automation-title { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:10px; }
.wa-automation-title strong,.wa-automation-title small { display:block; }
.wa-automation-title small { margin-top:3px; color:#80918f; font-size:.66rem; }
.wa-automation-card>label { display:block; margin-top:9px; color:#617573; font-size:.72rem; font-weight:800; }
.wa-automation-card select,.wa-automation-card input[type="number"] { width:100%; box-sizing:border-box; margin-top:5px; padding:9px 10px; border:1px solid #d8e4e2; border-radius:9px; background:#fff; color:#173c38; }
.wa-automation-card>button { width:100%; justify-content:center; margin-top:11px; padding:9px 12px; }
.wa-switch { position:relative; flex:0 0 auto; width:42px; height:24px; }
.wa-switch input { position:absolute; opacity:0; }
.wa-switch span { display:block; width:42px; height:24px; border-radius:15px; background:#cbd5d3; cursor:pointer; transition:.2s; }
.wa-switch span::after { content:""; display:block; width:18px; height:18px; margin:3px; border-radius:50%; background:#fff; box-shadow:0 1px 4px rgba(0,0,0,.2); transition:.2s; }
.wa-switch input:checked+span { background:#0d8275; }
.wa-switch input:checked+span::after { transform:translateX(18px); }
.wa-scheduled-subtitle { display:flex; align-items:center; justify-content:space-between; padding:20px 20px 0; }
.wa-scheduled-subtitle small { color:#718684; font-weight:900; letter-spacing:.13em; }
.wa-automation-events { padding-bottom:4px; }
.wa-scheduled-empty.compact { min-height:150px; }
.wa-template-form { display:grid; gap:9px; text-align:left; }
.wa-template-form label { display:grid; gap:3px; color:#3e5552; font-size:.78rem; font-weight:800; }
.wa-template-form .swal2-input,.wa-template-form .swal2-select,.wa-template-form .swal2-textarea { width:100%; margin:0; box-sizing:border-box; }
.wa-template-form-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.wa-template-form>small { color:#718684; }
.wa-schedule-form { display:grid; gap:11px; text-align:left; }
.wa-schedule-form>label,#wa-sch-variables label { display:grid; gap:4px; color:#3e5552; font-size:.78rem; font-weight:800; }
.wa-schedule-form .swal2-input,.wa-schedule-form .swal2-select { width:100%; margin:0; box-sizing:border-box; }
#wa-sch-variables { display:grid; gap:8px; }
#wa-sch-variables>p,#wa-sch-variables>small { margin:0; color:#718684; }
.wa-schedule-steps { display:grid; grid-template-columns:repeat(3,1fr); gap:7px; }
.wa-schedule-steps span { padding:9px 7px; border-radius:11px; background:#f0f5f4; color:#647b78; text-align:center; font-size:.68rem; font-weight:800; }
.wa-schedule-steps b { display:inline-grid; place-items:center; width:21px; height:21px; margin-right:4px; border-radius:50%; background:#d8e7e4; }
.wa-schedule-steps span.active { background:#e4f7f1; color:#087563; }.wa-schedule-steps span.active b { background:#0a806d; color:#fff; }
.wa-schedule-two { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.wa-sch-selected { min-height:58px; padding:9px 11px; border:1px solid #d5e6e2; border-radius:13px; background:#f8fcfb; display:flex; align-items:center; gap:9px; }
.wa-sch-selected>.material-symbols-outlined { color:#0b806d; }.wa-sch-selected>div { flex:1; }.wa-sch-selected strong,.wa-sch-selected small { display:block; }.wa-sch-selected small { margin-top:2px; color:#718684; }.wa-sch-selected button { border:0; background:transparent; color:#087563; font-weight:800; cursor:pointer; }
.wa-sch-patient-results { max-height:190px; overflow:auto; display:grid; gap:4px; }.wa-sch-patient-results>button { width:100%; padding:8px; border:1px solid #e1ece9; border-radius:12px; background:#fff; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:9px; text-align:left; cursor:pointer; }.wa-sch-patient-results .wa-patient-avatar { width:35px; height:35px; }.wa-sch-patient-results strong,.wa-sch-patient-results small { display:block; }.wa-sch-patient-results small { margin-top:2px; color:#78908d; }.wa-sch-patient-results>small { padding:9px; color:#718684; text-align:center; }
.wa-template-preview>small { display:block; margin-bottom:6px; color:#087563; font-weight:900; text-transform:uppercase; letter-spacing:.08em; font-size:.58rem; }
.wa-schedule-quick { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; }.wa-schedule-quick button { min-height:35px; padding:5px; border:1px solid #cfe3df; border-radius:10px; background:#f8fcfb; color:#3c6660; cursor:pointer; font-size:.65rem; font-weight:800; }.wa-schedule-quick button.active { border-color:#0b806d; background:#e3f7f0; color:#086c5c; }
.wa-schedule-note { margin:0; padding:10px; border-radius:11px; background:#edf8f5; color:#52736e; display:flex; gap:7px; align-items:flex-start; font-size:.65rem; line-height:1.4; }.wa-schedule-note .material-symbols-outlined { color:#0b806d; font-size:18px; }
.wa-schedule-chat { color:#356e66!important; }
.wa-template-preview { padding:12px 14px; border-radius:12px; background:#e7f6ef; color:#285952; white-space:pre-wrap; overflow-wrap:anywhere; font-size:.82rem; }
.wa-campaigns { margin:16px; border:1px solid #dcebe8; border-radius:18px; background:#f8fcfb; overflow:hidden; }
.wa-campaigns .wa-scheduled-subtitle { padding:16px 18px 8px; }
.wa-campaign-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:10px; padding:10px 14px 16px; }
.wa-campaign-grid article { display:grid; grid-template-columns:42px 1fr auto; gap:11px; align-items:center; padding:13px; border:1px solid #deebe8; border-radius:13px; background:#fff; cursor:pointer; transition:border-color .18s,transform .18s,box-shadow .18s; }
.wa-campaign-grid article:hover,.wa-campaign-grid article:focus-visible { border-color:#84bdb4; transform:translateY(-1px); box-shadow:0 8px 24px rgba(25,66,62,.09); outline:0; }
.wa-campaign-grid article>span { display:grid; place-items:center; width:42px; height:42px; border-radius:13px; background:#e2f4ef; color:#0d756a; }
.wa-campaign-grid strong,.wa-campaign-grid small { display:block; }
.wa-campaign-grid small { margin-top:3px; color:#718684; font-size:.68rem; }
.wa-campaign-grid p { margin:5px 0 0; color:#496663; font-size:.7rem; }
.wa-campaign-grid em { display:block; margin-top:5px; color:#0d756a; font-size:.68rem; font-style:normal; font-weight:900; }
.wa-campaign-grid article>b { display:grid; place-items:center; min-width:34px; height:34px; border-radius:17px; background:#0d756a; color:#fff; font-size:.75rem; }
.wa-campaign-responses { display:grid; gap:8px; max-height:460px; overflow:auto; text-align:left; }
.wa-campaign-responses article { display:grid; grid-template-columns:38px 1fr; gap:10px; align-items:start; padding:12px; border:1px solid #deebe8; border-radius:12px; background:#f8fcfb; }
.wa-campaign-responses article>span { display:grid; place-items:center; width:38px; height:38px; border-radius:11px; background:#e2f4ef; color:#0d756a; }
.wa-campaign-responses strong,.wa-campaign-responses small { display:block; }
.wa-campaign-responses small { margin-top:2px; color:#718684; font-size:.72rem; }
.wa-campaign-responses p { margin:6px 0 0; color:#294b47; white-space:pre-wrap; overflow-wrap:anywhere; }
.wa-bulk-form { display:grid; gap:12px; text-align:left; }
.wa-bulk-form>label,.wa-bulk-top>label,.wa-bulk-variables label { display:grid; gap:4px; color:#3e5552; font-size:.76rem; font-weight:800; }
.wa-bulk-form .swal2-input,.wa-bulk-form .swal2-select { width:100%; margin:0; box-sizing:border-box; }
.wa-bulk-top { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.wa-bulk-variables { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.wa-bulk-variables .wa-template-preview,.wa-bulk-variables>small { grid-column:1/-1; }
.wa-bulk-picker-head { display:flex; align-items:center; gap:10px; }
.wa-bulk-picker-head .wa-patient-search { flex:1; }
.wa-bulk-picker-head>b { flex:0 0 auto; color:#0d756a; font-size:.74rem; }
.wa-bulk-selected { display:flex; gap:6px; min-height:28px; overflow-x:auto; padding:2px; }
.wa-bulk-selected button { flex:0 0 auto; border:1px solid #b9d7d2; border-radius:15px; padding:5px 9px; background:#eef8f5; color:#176b5e; font-size:.68rem; font-weight:800; cursor:pointer; }
.wa-bulk-selected small { color:#718684; }
.wa-bulk-consent { display:flex!important; grid-template-columns:none!important; align-items:flex-start; gap:8px!important; padding:11px; border-radius:11px; background:#fff8e5; color:#705400!important; }
.wa-bulk-consent input { margin-top:2px; }
.wa-notes-dialog { display:grid; gap:12px; text-align:left; }
.wa-notes-history { display:grid; gap:8px; max-height:280px; overflow:auto; }
.wa-note-item { padding:11px 13px; border:1px solid #e4ecea; border-radius:12px; background:#f8fbfa; }
.wa-note-item p { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.wa-note-item small,.wa-notes-dialog>small { display:block; margin-top:5px; color:#718684; }
.wa-notes-dialog label { color:#3e5552; font-size:.78rem; font-weight:800; }
.wa-notes-dialog .swal2-textarea { width:100%; margin:6px 0 0; box-sizing:border-box; }
.wa-action-sheet { display:grid; gap:7px; text-align:left; }
.wa-action-sheet button { display:flex; align-items:center; gap:11px; width:100%; padding:12px 13px; border:1px solid #dce8e6; border-radius:12px; background:#f8fbfa; color:#294d49; font:inherit; font-weight:750; cursor:pointer; }
.wa-action-sheet button:hover { border-color:#91c6bd; background:#eef8f5; }
.wa-action-sheet button.danger { border-color:#f0c8cc; background:#fff6f7; color:#a52e3a; }
.wa-action-sheet .material-symbols-outlined { font-size:20px; }
.wa-bot-config textarea,.wa-template-form input,.wa-template-form textarea,.wa-schedule-form input,.wa-bulk-form input,.wa-bulk-form textarea,.wa-notes-dialog textarea { text-transform:none!important; letter-spacing:normal; caret-color:var(--wa-green); user-select:text; -webkit-user-select:text; }
.wa-notes-empty { margin:0; padding:22px; text-align:center; color:#819492; }
.wa-link-help { margin:0 0 12px; color:#718684; font-size:.85rem; }
.wa-patient-picker { display:grid; gap:11px; text-align:left; }
.wa-patient-search { display:flex; align-items:center; gap:8px; padding:11px 13px; border:1px solid #bdd7d2; border-radius:13px; background:#fff; box-shadow:0 0 0 3px rgba(13,117,106,.06); }
.wa-patient-search span { color:#66827e; }
.wa-patient-search input { flex:1; min-width:0; border:0; outline:0; background:transparent; font:inherit; }
.wa-patient-results { display:grid; gap:6px; max-height:390px; overflow:auto; padding:2px; }
.wa-patient-load-status { display:flex; align-items:center; gap:5px; color:#718684; font-size:.68rem; }
.wa-patient-load-status .material-symbols-outlined { font-size:15px; }
.wa-patient-result { display:flex; align-items:center; gap:11px; width:100%; padding:10px 12px; border:1px solid #e0eae8; border-radius:13px; background:#fff; color:#214542; text-align:left; cursor:pointer; }
.wa-patient-result:hover,.wa-patient-result.selected { border-color:#62aa9f; background:#eef9f6; }
.wa-patient-avatar { flex:0 0 auto; display:grid; place-items:center; width:40px; height:40px; overflow:hidden; border-radius:12px; background:#dcefeb; color:#176c63; font-size:.72rem; font-weight:900; }
.wa-patient-result>span:nth-child(2) { flex:1; min-width:0; }
.wa-patient-result strong,.wa-patient-result small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wa-patient-result small { margin-top:3px; color:#788d8a; font-size:.7rem; }
.wa-patient-result>i { color:#7ba39d; font-style:normal; }
.wa-patient-no-results { display:grid; justify-items:center; gap:4px; padding:30px 16px; color:#7a8f8c; text-align:center; }
.wa-patient-no-results>span { font-size:38px; color:#9cbab5; }
.wa-file-dialog { display:grid; justify-items:center; gap:7px; }
.wa-file-dialog>span { font-size:44px; color:#0d756a; }
.wa-file-dialog>small { color:#718684; }
.wa-file-dialog .swal2-textarea { width:100%; box-sizing:border-box; }
.wa-scheduled-list article { display:flex; align-items:center; gap:14px; padding:15px; border-bottom:1px solid #edf2f1; }
.wa-scheduled-list article>.material-symbols-outlined { display:grid; place-items:center; width:42px; height:42px; border-radius:13px; background:#edf7f4; color:#0d756a; }
.wa-scheduled-list article div { flex:1; }
.wa-scheduled-list article strong,.wa-scheduled-list article small { display:block; }
.wa-scheduled-list article small { margin-top:3px; color:#7b8f8d; }
.wa-scheduled-list article em { display:block; margin-top:5px; color:#b42318; font-size:.7rem; font-style:normal; }
.wa-scheduled-list article>b { padding:6px 10px; border-radius:20px; background:#fff3d9; color:#9c6a00; font-size:.7rem; }
.wa-scheduled-list article>b.status-sent,.wa-scheduled-list article>b.status-delivered,.wa-scheduled-list article>b.status-read { background:#e5f7eb; color:#267342; }
.wa-scheduled-list article>b.status-failed { background:#fee4e2; color:#b42318; }
.wa-scheduled-list article>b.status-cancelled { background:#edf0f2; color:#667085; }
.wa-scheduled-list article>b.status-waiting_template { background:#fff3d9; color:#8b6505; }
.wa-mobile-back { display:none; }
.wa-workspace.is-bot { display:block; height:auto; min-height:660px; overflow:visible; }
.wa-bot-panel { min-height:660px; border-radius:23px; background:#fff; overflow:hidden; }
.wa-bot-head { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:26px 30px; border-bottom:1px solid var(--wa-line); background:linear-gradient(135deg,#f8fcfb,#eff9f6); }
.wa-bot-head small,.wa-bot-requests-head small { color:#718684; font-size:.68rem; font-weight:900; letter-spacing:.14em; }
.wa-bot-head h2 { margin:4px 0; }
.wa-bot-head p { margin:0; color:#718684; }
.wa-bot-master { display:flex; align-items:center; gap:9px; padding:9px 12px; border-radius:16px; background:#fff; box-shadow:0 6px 18px rgba(25,66,62,.1); }
.wa-bot-master input { position:absolute; opacity:0; }
.wa-bot-master span { width:42px; height:24px; border-radius:14px; background:#cbd5d3; cursor:pointer; }
.wa-bot-master span::after { content:""; display:block; width:18px; height:18px; margin:3px; border-radius:50%; background:#fff; box-shadow:0 1px 4px rgba(0,0,0,.2); transition:.2s; }
.wa-bot-master input:checked+span { background:#0d8275; }
.wa-bot-master input:checked+span::after { transform:translateX(18px); }
.wa-bot-master b { font-size:.76rem; }
.wa-bot-layout { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr); gap:20px; padding:22px; }
.wa-bot-config { display:grid; gap:14px; }
.wa-bot-config>label { display:grid; gap:6px; color:#496663; font-size:.76rem; font-weight:850; }
.wa-bot-config textarea { box-sizing:border-box; width:100%; min-height:82px; resize:vertical; padding:12px 13px; border:1px solid #d8e6e3; border-radius:12px; color:#173b3a; font:inherit; font-weight:500; }
.wa-ai-settings { display:grid; gap:10px; padding:15px; border:1px solid #cde4df; border-radius:15px; background:linear-gradient(135deg,#edf9f6,#f8fbff); }
.wa-ai-settings>div { display:flex; align-items:center; gap:10px; }
.wa-ai-settings>div>span { display:grid; place-items:center; width:38px; height:38px; border-radius:12px; background:#0d8275; color:#fff; }
.wa-ai-settings strong,.wa-ai-settings small { display:block; }
.wa-ai-settings small { margin-top:2px; color:#718684; }
.wa-ai-settings label { display:grid; gap:5px; color:#496663; font-size:.76rem; font-weight:850; }
.wa-ai-settings select { width:100%; padding:10px 12px; border:1px solid #bdd8d3; border-radius:10px; background:#fff; color:#173b3a; font:inherit; }
.wa-ai-settings p { margin:0; color:#496663; font-size:.72rem; line-height:1.45; }
.wa-bot-config textarea:focus { outline:0; border-color:#6bb5aa; box-shadow:0 0 0 3px rgba(13,117,106,.1); }
.wa-bot-config-actions { display:flex; gap:9px; flex-wrap:wrap; }
.wa-ai-test-result { text-align:left; }
.wa-ai-test-result p { padding:13px; border-radius:12px; background:#eef9f6; color:#214844; white-space:pre-wrap; }
.wa-ai-test-result small { color:#718684; }
.wa-bot-flow { display:flex; align-items:center; gap:10px; overflow:auto; padding:14px; border:1px solid #dcebe8; border-radius:15px; background:#f8fcfb; }
.wa-bot-flow>strong { flex:0 0 auto; }
.wa-bot-flow div { display:flex; align-items:center; gap:7px; flex:0 0 auto; color:#496663; font-size:.73rem; font-weight:800; }
.wa-bot-flow div span { display:grid; place-items:center; width:25px; height:25px; border-radius:9px; background:#0d8275; color:#fff; }
.wa-bot-flow i { flex:0 0 20px; height:1px; background:#bdd6d1; }
.wa-bot-requests { min-width:0; border:1px solid #e0ebe9; border-radius:16px; overflow:hidden; align-self:start; }
.wa-bot-requests-head { display:flex; justify-content:space-between; align-items:center; padding:16px; background:#f8fbfa; }
.wa-bot-requests-head h3 { margin:3px 0 0; }
.wa-bot-requests-head>b { display:grid; place-items:center; min-width:30px; height:30px; border-radius:15px; background:#0d8275; color:#fff; }
.wa-bot-request-list { max-height:650px; overflow:auto; }
.wa-bot-request-list article { display:grid; grid-template-columns:38px 1fr auto; gap:10px; align-items:center; padding:13px 14px; border-top:1px solid #edf2f1; }
.wa-bot-request-list article>span { display:grid; place-items:center; width:38px; height:38px; border-radius:12px; background:#e8f5f2; color:#0d756a; }
.wa-bot-request-list strong,.wa-bot-request-list small { display:block; }
.wa-bot-request-list small { margin-top:3px; color:#7c8f8d; font-size:.66rem; }
.wa-bot-request-list p { margin:5px 0 0; color:#496663; font-size:.72rem; }
.wa-bot-request-list blockquote { margin:8px 0 5px; padding:9px 11px; border-left:3px solid #36a795; border-radius:0 9px 9px 0; background:#eef9f6; color:#214844; font-size:.75rem; line-height:1.45; }
.wa-bot-request-list button { border:0; border-radius:9px; padding:7px 9px; background:#e1f3ed; color:#096b61; font-weight:850; cursor:pointer; }
.wa-request-actions { display:grid; gap:6px; justify-items:stretch; }
.wa-bot-request-list .wa-request-actions button.muted { background:#f0f3f3; color:#667a77; }
.wa-bot-request-list article.resolved { opacity:.62; }
.wa-bot-request-list article>b { color:#718684; font-size:.68rem; }
.wa-cancel-scheduled { display:grid; place-items:center; width:31px; height:31px; border:0; border-radius:9px; background:#f4f6f6; color:#607774; cursor:pointer; }
.wa-cancel-scheduled span { font-size:18px; }
@media(max-width:1180px){.wa-workspace{grid-template-columns:minmax(270px,330px) minmax(0,1fr)}.wa-context-panel{display:none}.wa-bot-layout{grid-template-columns:1fr}}
@media(max-width:800px){#view-whatsapp{overflow:visible!important}.wa-inbox{padding:10px 8px 22px}.wa-page-head{align-items:flex-start;margin-bottom:12px}.wa-page-head h1{font-size:1.65rem}.wa-page-head p{font-size:.8rem}.wa-secure{display:none}.wa-sections{position:sticky;top:0;z-index:20;padding:5px;border-radius:13px;background:rgba(248,252,251,.96);backdrop-filter:blur(10px);overflow-x:auto}.wa-sections button{flex:1;justify-content:center;white-space:nowrap}.wa-workspace{display:block;height:calc(100dvh - 205px);min-height:540px;border-radius:17px;overflow:hidden}.wa-sidebar{height:100%;max-height:none;border:0}.wa-chat-panel{display:none;height:100%;min-height:0}.wa-workspace.mobile-chat-open .wa-sidebar{display:none}.wa-workspace.mobile-chat-open .wa-chat-panel{display:grid}.wa-mobile-back{display:grid;place-items:center;flex:0 0 auto;width:36px;height:36px;border:0;border-radius:10px;background:#edf6f4;color:#325d58}.wa-chat-head{gap:8px;padding:10px}.wa-chat-head .wa-avatar{width:36px;height:36px;border-radius:11px}.wa-window-status{font-size:0;padding:6px}.wa-window-status .material-symbols-outlined{font-size:18px}.wa-page-actions .wa-primary{font-size:0;width:44px;padding:11px;justify-content:center}.wa-page-actions .wa-primary .material-symbols-outlined{font-size:21px}.wa-message{max-width:88%}.wa-patient-link span:last-child,.wa-chat-tools button span:last-child{display:none}.wa-patient-link{margin-left:auto;padding:0 8px}.wa-chat-tools{margin-left:0}.wa-chat-tools select{max-width:92px;padding-left:7px}.wa-composer{min-height:62px;padding:9px;gap:7px}.wa-composer button{width:42px;height:42px}.wa-messages{padding:16px 12px}.wa-workspace.is-scheduled,.wa-workspace.is-bot{height:auto;overflow:visible}.wa-scheduled,.wa-bot-panel{min-height:0;border-radius:17px}.wa-scheduled-head,.wa-automation-head,.wa-bot-head{padding:18px;align-items:flex-start;flex-direction:column}.wa-automation-head{padding:0}.wa-scheduled-actions{width:100%;flex-wrap:wrap}.wa-scheduled-actions button{flex:1;justify-content:center}.wa-template-catalog{display:grid;grid-template-columns:1fr}.wa-template-catalog>span{min-width:0}.wa-automation-panel{margin:14px 10px;padding:12px}.wa-automation-grid{grid-template-columns:1fr}.wa-scheduled-list article{align-items:flex-start;flex-wrap:wrap}.wa-scheduled-list article div{min-width:180px}.wa-template-form-row,.wa-bulk-top,.wa-bulk-variables{grid-template-columns:1fr}.wa-bulk-picker-head{align-items:stretch;flex-direction:column}.wa-bulk-picker-head>b{align-self:flex-start}.wa-campaigns{margin:12px 10px}.wa-campaign-grid{grid-template-columns:1fr}.wa-bot-layout{display:block;padding:12px}.wa-bot-config-actions>*{flex:1;justify-content:center}.wa-bot-flow{margin-bottom:12px}.wa-bot-requests{margin-top:16px}.wa-bot-request-list{max-height:none}.wa-bot-master{align-self:flex-end}.wa-bot-request-list article{grid-template-columns:38px 1fr}.wa-bot-request-list article .wa-request-actions,.wa-bot-request-list article>b{grid-column:2;justify-self:start}}
@media(max-width:800px){.wa-workspace:not(.is-scheduled):not(.is-bot){height:calc(100dvh - 185px);min-height:420px}.wa-composer textarea,.wa-bot-config textarea{font-size:16px!important;text-transform:none!important}}
@media(max-width:800px){.wa-attachment-menu{left:48px;bottom:60px}.wa-emoji-menu{left:8px;right:8px;bottom:60px;grid-template-columns:repeat(6,1fr)}.wa-recording>span:nth-of-type(2){display:none}}
[data-theme="dark"] #whatsapp-inbox-root { --wa-ink:#e5f1ef; --wa-muted:#9db0ad; --wa-line:#304b48; }
[data-theme="dark"] .wa-workspace,[data-theme="dark"] .wa-sidebar,[data-theme="dark"] .wa-scheduled,[data-theme="dark"] .wa-search,[data-theme="dark"] .wa-chat-head,[data-theme="dark"] .wa-composer { background:#172826; }
[data-theme="dark"] .wa-context-panel { background:#172826; }
[data-theme="dark"] .wa-chat-panel { background-color:#10201e; }
[data-theme="dark"] .wa-conversation:hover { background:#203a36; }
[data-theme="dark"] .wa-conversation.active { background:#244b45; }
[data-theme="dark"] .wa-message.inbound { background:#253b38; }
[data-theme="dark"] .wa-message.outbound { background:#175c50; }
[data-theme="dark"] .wa-chat-tools select,[data-theme="dark"] .wa-chat-tools button,[data-theme="dark"] .wa-note-item { background:#203a36; color:#dfece9; }
[data-theme="dark"] .wa-patient-link { background:#203a36; color:#dfece9; }
.wa-nav-unread {
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    margin-left: auto;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #16a34a;
    color: #fff;
    font-size: .68rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 3px 10px rgba(22, 163, 74, .3);
}

.wa-nav-unread[hidden] { display: none !important; }

.wa-heads-up-container {
    position: fixed;
    z-index: 100000;
    top: 18px;
    right: 18px;
    width: min(390px, calc(100vw - 28px));
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.wa-heads-up {
    pointer-events: auto;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 34px;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(16, 185, 129, .22);
    border-radius: 20px;
    background: rgba(255, 255, 255, .97);
    color: #123c35;
    box-shadow: 0 20px 55px rgba(15, 60, 51, .22), 0 4px 14px rgba(15, 60, 51, .1);
    backdrop-filter: blur(18px);
    animation: wa-heads-up-in .28s ease-out;
}

@keyframes wa-heads-up-in {
    from { opacity: 0; transform: translateY(-12px) scale(.97); }
    to { opacity: 1; transform: none; }
}

.wa-heads-up-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #25d366;
    color: #fff;
    box-shadow: 0 7px 18px rgba(37, 211, 102, .24);
}

.wa-heads-up-icon img {
    display: block;
    width: 27px;
    height: 27px;
    object-fit: contain;
}

.wa-heads-up-copy { min-width: 0; }
.wa-heads-up-copy small { display: block; color: #5f7f79; font-size: .61rem; font-weight: 900; letter-spacing: .1em; }
.wa-heads-up-copy strong { display: block; margin-top: 2px; font-size: .94rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-heads-up-copy p { margin: 4px 0 0; color: #496660; font-size: .82rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wa-heads-up-close { width: 32px; height: 32px; border: 0; border-radius: 10px; background: #eff7f4; color: #55736d; cursor: pointer; }
.wa-heads-up-close .material-symbols-outlined { font-size: 1.1rem; }
.wa-heads-up-actions { grid-column: 2 / 4; display: flex; justify-content: flex-end; gap: 8px; }
.wa-heads-up-actions button { border: 1px solid #b9d8d0; border-radius: 10px; padding: 7px 12px; background: #fff; color: #176b5b; font-weight: 800; cursor: pointer; }
.wa-heads-up-actions button.primary { border-color: #0b8b76; background: #0b8b76; color: #fff; }
.wa-heads-up-reply { display: none; grid-column: 1 / 4; grid-template-columns: minmax(0, 1fr) 42px; gap: 8px; padding-top: 4px; }
.wa-heads-up.is-replying .wa-heads-up-actions { display: none; }
.wa-heads-up.is-replying .wa-heads-up-reply { display: grid; }
.wa-heads-up-reply input { min-width: 0; height: 42px; border: 1px solid #add7ce; border-radius: 12px; padding: 0 13px; outline: none; font: inherit; }
.wa-heads-up-reply input:focus { border-color: #0b8b76; box-shadow: 0 0 0 3px rgba(11, 139, 118, .12); }
.wa-heads-up-reply button { border: 0; border-radius: 12px; background: #0b8b76; color: #fff; cursor: pointer; }

@media (max-width: 640px) {
    .wa-heads-up-container { top: auto; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
    .wa-heads-up { border-radius: 18px; padding: 12px; }
}

/* WhatsApp workspace v2 — la bandeja se comporta como una aplicación, no como una página larga. */
#view-whatsapp.tab-view {
    max-width:none;
    height:calc(100dvh - var(--main-nav-min-height, 82px) - 20px);
    min-height:560px;
    padding:0 10px 10px!important;
    overflow:hidden;
}
#whatsapp-inbox-root { height:100%; min-height:0; }
.wa-inbox {
    display:grid;
    grid-template-rows:58px minmax(0,1fr);
    width:100%;
    height:100%;
    max-width:none;
    margin:0;
    padding:0;
    overflow:hidden;
}
.wa-page-head {
    display:grid;
    grid-template-columns:minmax(215px,1fr) auto minmax(215px,1fr);
    align-items:center;
    gap:14px;
    min-width:0;
    margin:0;
    padding:6px 10px;
    border:1px solid var(--wa-line);
    border-bottom:0;
    border-radius:16px 16px 0 0;
    background:rgba(255,255,255,.96);
}
.wa-app-identity { display:flex; align-items:center; gap:10px; min-width:0; }
.wa-app-logo { display:grid; place-items:center; flex:0 0 auto; width:38px; height:38px; border-radius:50%; background:#00a884; color:#fff; }
.wa-app-logo .material-symbols-outlined { font-size:21px; }
.wa-app-identity>div { min-width:0; }
.wa-page-head h1 { margin:0; font-size:1rem; line-height:1.08; letter-spacing:-.02em; }
.wa-page-head p { margin:2px 0 0; overflow:hidden; color:#71817f; font-size:.64rem; line-height:1.15; text-overflow:ellipsis; white-space:nowrap; }
.wa-eyebrow { display:block; margin-bottom:1px; font-size:.52rem; letter-spacing:.13em; }
.wa-sections { justify-self:center; display:flex; gap:3px; margin:0; padding:3px; border-radius:12px; background:#f0f2f5; }
.wa-sections button { min-height:38px; padding:7px 12px; border-radius:10px; font-size:.75rem; }
.wa-sections button.active { background:#fff; color:#087a6e; box-shadow:0 1px 4px rgba(11,20,26,.11); }
.wa-page-actions { justify-self:end; min-width:0; }
.wa-secure { gap:6px; color:#4f6f6b; font-size:.68rem; }
.wa-secure i { width:8px; height:8px; border-radius:50%; background:#20c778; box-shadow:0 0 0 4px rgba(32,199,120,.12); }
.wa-page-actions .wa-primary { min-height:38px; padding:8px 12px; border-radius:11px; box-shadow:none; font-size:.72rem; }
.wa-workspace,
.wa-workspace.is-scheduled,
.wa-workspace.is-bot {
    position:relative;
    display:grid;
    grid-template-columns:minmax(290px,340px) minmax(0,1fr);
    width:100%;
    height:100%;
    min-height:0;
    max-height:none;
    border-radius:0 0 16px 16px;
    box-shadow:0 12px 34px rgba(17,27,33,.12);
}
.wa-workspace.is-scheduled,.wa-workspace.is-bot { display:block; overflow:auto; }
.wa-workspace.is-scheduled>.wa-scheduled,.wa-workspace.is-bot>.wa-bot-panel { min-height:100%; border:0; border-radius:0; box-shadow:none; }
.wa-sidebar { min-height:0; }
.wa-search { margin:10px 11px 7px; padding:8px 11px; border:0; border-radius:10px; background:#f0f2f5; }
.wa-search input { font-size:.8rem; }
.wa-filter-row { padding:6px 14px 7px; }
.wa-filter-tabs { padding:0 10px 8px; }
.wa-conversation-list { min-height:0; padding:0 0 8px; }
.wa-conversation { min-height:64px; padding:9px 12px; border-bottom:1px solid #f0f2f5; }
.wa-conversation.active { background:#e9edef; }
.wa-chat-panel {
    background-color:#efeae2;
    background-image:linear-gradient(rgba(239,234,226,.9),rgba(239,234,226,.9)),url('../img/whatsapp-optical-pattern.svg');
    background-repeat:repeat;
    background-size:auto,240px 240px;
}
.wa-chat-head { min-height:60px; box-sizing:border-box; padding:8px 13px; background:#f0f2f5; }
.wa-chat-head .wa-avatar { width:40px; height:40px; }
.wa-chat-head>div:nth-of-type(1) { flex:1; }
.wa-chat-head>div:nth-of-type(1)>strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.85rem; }
.wa-chat-head>div:nth-of-type(1)>small { font-size:.64rem; }
.wa-window-status { margin-left:0; }
.wa-patient-link { margin-left:0; }
.wa-chat-tools { margin-left:0; }
.wa-messages { padding:18px clamp(24px,6vw,84px); scrollbar-width:thin; }
.wa-message { max-width:min(72%,680px); padding:7px 30px 6px 9px; font-size:.82rem; }
.wa-message p { font-size:.82rem; line-height:1.4; }
.wa-message small { font-size:.6rem; }
.wa-composer { min-height:58px; padding:8px 11px; background:#f0f2f5; }
.wa-composer textarea { min-height:40px; padding:9px 12px; border-radius:10px; font-size:.82rem; line-height:1.35; }
.wa-composer button { width:40px; height:40px; }

/* La ficha clínica se abre bajo demanda y deja el chat amplio por defecto. */
.wa-context-panel { display:none; position:relative; min-width:0; }
.wa-workspace.context-open { grid-template-columns:minmax(280px,320px) minmax(0,1fr) minmax(260px,300px); }
.wa-workspace.context-open .wa-context-panel { display:block; }
.wa-context-close { position:absolute; top:10px; right:10px; z-index:3; display:grid; place-items:center; width:34px; height:34px; border:0; border-radius:50%; background:rgba(255,255,255,.85); color:#526966; cursor:pointer; }
.wa-context-close:hover { background:#fff; }
.wa-profile-card { padding-top:38px; }

/* Nota de voz con controles coherentes con la bandeja. */
.wa-inline-media:has(.wa-audio-card) { display:block; min-width:280px; min-height:0; margin:2px 0 0; overflow:visible; background:transparent; }
.wa-audio-card { display:grid; grid-template-columns:42px minmax(160px,1fr) 28px; align-items:center; gap:9px; width:min(330px,100%); min-height:58px; }
.wa-audio-card audio { display:none; }
.wa-audio-toggle { display:grid; place-items:center; width:40px; height:40px; border:0; border-radius:50%; background:transparent; color:#54656f; cursor:pointer; }
.wa-audio-toggle:hover { background:rgba(255,255,255,.55); }
.wa-audio-toggle .material-symbols-outlined { font-size:29px; }
.wa-audio-copy { min-width:0; }
.wa-audio-wave { display:flex; align-items:center; gap:2px; height:40px; overflow:hidden; }
.wa-audio-wave i { display:block; flex:1 1 2px; min-width:2px; max-width:3px; border-radius:3px; background:#b1bdba; transition:background .1s; }
.wa-audio-wave i.played { background:#00a884; }
.wa-audio-time { display:block; margin-top:-5px; color:#738784; font-size:.6rem; }
.wa-audio-mic { color:#00a884; font-size:20px; }
.wa-document-card { display:grid; grid-template-columns:38px minmax(0,1fr) 28px; align-items:center; gap:9px; width:min(360px,100%); margin:1px 0 3px; padding:10px; border:0; border-radius:8px; background:rgba(255,255,255,.62); color:#263b39; text-align:left; cursor:pointer; }
.wa-document-card>span:first-child { display:grid; place-items:center; width:38px; height:42px; border-radius:7px; background:#e83b54; color:#fff; }
.wa-document-card>span:nth-child(2) { min-width:0; }
.wa-document-card strong,.wa-document-card small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; }
.wa-document-card strong { font-size:.76rem; }
.wa-document-card small { margin-top:3px; color:#71817f; font-size:.59rem; }
.wa-document-card>span:last-child { color:#607572; font-size:19px; }

@media(max-width:1180px) {
    .wa-page-head { grid-template-columns:minmax(190px,1fr) auto auto; }
    .wa-workspace.context-open { grid-template-columns:minmax(270px,310px) minmax(0,1fr); }
    .wa-workspace.context-open .wa-context-panel { position:absolute; z-index:30; inset:0 0 0 auto; display:block; width:min(330px,92vw); box-shadow:-12px 0 30px rgba(11,20,26,.18); }
    .wa-patient-link span:last-child,.wa-chat-tools button span:last-child { display:none; }
    .wa-patient-link,.wa-chat-tools button { width:36px; padding:0; justify-content:center; }
}

@media(max-width:800px) {
    #view-whatsapp.tab-view { height:calc(100dvh - var(--main-nav-min-height, 72px) - 10px); min-height:420px; padding:0!important; overflow:hidden!important; }
    .wa-inbox { grid-template-rows:auto minmax(0,1fr); }
    .wa-page-head { grid-template-columns:minmax(0,1fr) auto; gap:6px; padding:5px 7px; border-radius:0; }
    .wa-app-logo { width:34px; height:34px; }
    .wa-page-head h1 { font-size:.92rem; }
    .wa-page-head p,.wa-eyebrow,.wa-secure { display:none; }
    .wa-sections { grid-column:1/-1; grid-row:2; justify-self:stretch; order:3; }
    .wa-sections button { flex:1; min-height:34px; padding:6px; font-size:.7rem; }
    .wa-sections .material-symbols-outlined { font-size:17px; }
    .wa-page-actions .wa-primary { width:38px; min-height:38px; padding:0; justify-content:center; font-size:0; }
    .wa-workspace,.wa-workspace:not(.is-scheduled):not(.is-bot),.wa-workspace.is-scheduled,.wa-workspace.is-bot { height:100%; min-height:0; border:0; border-radius:0; box-shadow:none; }
    .wa-workspace.is-scheduled,.wa-workspace.is-bot { overflow:auto; }
    .wa-sidebar,.wa-chat-panel { height:100%; }
    .wa-search { margin:8px 10px 5px; }
    .wa-filter-row { padding-top:4px; }
    .wa-conversation { min-height:68px; }
    .wa-chat-head { min-height:56px; padding:7px 8px; gap:6px; }
    .wa-chat-head>div:nth-of-type(1)>small { display:none; }
    .wa-window-status,.wa-patient-link { display:none; }
    .wa-chat-tools { margin-left:auto; gap:5px; }
    .wa-chat-tools select { max-width:86px; height:34px; font-size:.66rem; }
    .wa-chat-tools button { width:34px; height:34px; }
    .wa-chat-tools button[data-wa-action="notes"] { display:none; }
    .wa-messages { padding:13px 9px; }
    .wa-message { max-width:88%; font-size:.8rem; }
    .wa-message p { font-size:.8rem; }
    .wa-composer { min-height:56px; padding:7px; gap:4px; padding-bottom:max(7px,env(safe-area-inset-bottom)); }
    .wa-composer .wa-emoji { display:none; }
    .wa-composer textarea { min-height:40px; font-size:16px!important; }
    .wa-composer button { width:40px; height:40px; }
    .wa-inline-media:has(.wa-audio-card) { min-width:min(250px,75vw); }
    .wa-audio-card { grid-template-columns:38px minmax(130px,1fr) 24px; gap:6px; }
    .wa-workspace.context-open .wa-context-panel { inset:0; width:100%; }
    .wa-profile-card { padding-top:48px; }
    .wa-schedule-how { margin:12px 10px; align-items:flex-start; flex-wrap:wrap; }
    .wa-schedule-how button { width:100%; }
    .wa-schedule-two { grid-template-columns:1fr; }
    .wa-schedule-quick { grid-template-columns:1fr 1fr; }
    .wa-schedule-steps span { font-size:.6rem; }
    .wa-schedule-steps b { display:none; }
}

@media(max-width:420px) {
    .wa-chat-tools select { display:none; }
    .wa-message { max-width:92%; }
    .wa-filter-tabs button { padding:6px 8px; }
    .wa-sections button { font-size:.66rem; }
}

