/* ============================================
   PÁGINA WHATSAPP (avisos)
   ============================================ */
.wa-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1rem; align-items: start; }
.wa-layout .wa-wide { grid-column: 1 / -1; }
@media (max-width: 1000px) { .wa-layout { grid-template-columns: 1fr; } }

.wa-help { font-size: 0.8rem; line-height: 1.55; color: var(--text-secondary); margin: 0 0 0.9rem; }
.wa-help code { padding: 0.05rem 0.4rem; border-radius: 6px; background: rgba(255,255,255,0.07); font-size: 0.75rem; }

.wa-status-row { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 1rem; }
.wa-status {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  color: var(--text-secondary); background: rgba(255,255,255,0.06); border: 1px solid var(--border);
}
.wa-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.wa-status.is-on  { color: #4ade80; background: rgba(34,197,94,0.1);  border-color: rgba(34,197,94,0.3); }
.wa-status.is-off { color: #f87171; background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.3); }

.wa-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.8rem; }

.wa-tabs { display: inline-flex; gap: 0.25rem; padding: 0.25rem; margin-bottom: 0.9rem; border: 1px solid var(--border); border-radius: 999px; background: rgba(255,255,255,0.03); }
.wa-tab { border: 0; background: transparent; color: var(--text-secondary); font: inherit; font-size: 0.8rem; font-weight: 600; padding: 0.35rem 1rem; border-radius: 999px; cursor: pointer; }
.wa-tab.active { background: rgba(59,130,246,0.18); color: #93c5fd; }
.wa-clients.hidden, .wa-help.hidden { display: none; }
.wa-clients { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.wa-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 1.4fr) 84px; align-items: center; gap: 0.8rem; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--border); }
.wa-row:last-child { border-bottom: 0; }
.wa-row.has-sender { grid-template-columns: minmax(110px, 1fr) minmax(0, 1.3fr) 130px 70px; }
.wa-sender { width: 100%; padding: 0.4rem 0.5rem; font-size: 0.78rem; }
.wa-sender-select { max-width: 150px; }
.wa-sender-select.hidden { display: none; }
@media (max-width: 800px) { .wa-row.has-sender { grid-template-columns: 1fr; } }
.wa-row-name { font-weight: 600; font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-row-select { width: 100%; padding: 0.4rem 0.6rem; font-size: 0.82rem; }
.wa-row-state { font-size: 0.72rem; color: var(--text-muted); text-align: right; }
.wa-row-state.is-ok { color: #4ade80; } .wa-row-state.is-err { color: #f87171; }
.wa-empty { padding: 1.4rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
@media (max-width: 600px) { .wa-row { grid-template-columns: 1fr; gap: 0.35rem; } .wa-row-state { text-align: left; } }

/* Abas principais da página */
.wa-main-tabs { display: flex; gap: 0.3rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); overflow-x: auto; }
.wa-mtab { border: 0; background: transparent; color: var(--text-secondary); font: inherit; font-size: 0.86rem; font-weight: 600; padding: 0.7rem 1.1rem; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.wa-mtab i { margin-right: 0.4rem; opacity: 0.8; }
.wa-mtab:hover { color: var(--text-primary); }
.wa-mtab.active { color: #93c5fd; border-bottom-color: #3b82f6; }
.wa-panel.hidden { display: none; }
.view-actions .wa-status { margin-right: 0.2rem; }

/* Prévia estilo WhatsApp */
.wa-chat { margin-top: 0.6rem; padding: 0.9rem; border-radius: var(--radius-sm); background: #0b141a; background-image: radial-gradient(rgba(255,255,255,0.035) 1px, transparent 1px); background-size: 14px 14px; border: 1px solid var(--border); }
.wa-bubble { position: relative; max-width: 440px; margin-left: auto; padding: 0.5rem 0.65rem 0.35rem; border-radius: 10px 10px 2px 10px; background: #005c4b; color: #e9edef; font-size: 0.86rem; line-height: 1.45; word-break: break-word; }
.wa-bubble strong { font-weight: 700; }
.wa-link { color: #53bdeb; text-decoration: underline; }
.wa-time { display: block; text-align: right; font-size: 0.66rem; color: rgba(233,237,239,0.6); margin-top: 0.2rem; }
.wa-time i { color: #53bdeb; margin-left: 0.15rem; }
.wa-empty-prev { color: rgba(233,237,239,0.45); font-size: 0.8rem; }

/* Lista de números (estilo contatos) */
.wa-contacts { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.wa-contact { display: flex; align-items: center; gap: 0.85rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); }
.wa-contact:last-child { border-bottom: 0; }
.wa-contact:hover { background: rgba(255,255,255,0.025); }
.wa-contact-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wa-contact-text strong { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-contact-text span { font-size: 0.78rem; color: var(--text-secondary); }
.wa-contact-actions { display: flex; gap: 0.35rem; }
.wa-avatar { flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; color: #fff; letter-spacing: 0.02em; }
.wa-contact-card { display: flex; align-items: center; gap: 0.85rem; padding: 0.8rem 0.9rem; margin-bottom: 1rem; border-radius: var(--radius-sm); background: #0b141a; border: 1px solid var(--border); }
.wa-contact-card-text { display: flex; flex-direction: column; }
.wa-contact-card-text span { font-size: 0.8rem; color: rgba(233,237,239,0.6); }

/* Campos do agendamento */
.wa-chips { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.wa-chip { border: 1px solid var(--border); background: rgba(255,255,255,0.05); color: var(--text-primary); font: inherit; font-size: 0.75rem; padding: 0.15rem 0.6rem; border-radius: 999px; cursor: pointer; }
.wa-chip:hover { background: rgba(59,130,246,0.18); border-color: rgba(59,130,246,0.4); }
.wa-sched-task { color: #93c5fd; font-size: 0.75rem; }
.wa-sched-task i { margin-right: 0.25rem; }

.wa-sched-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.wa-sched { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border); }
.wa-sched-main { flex: 1; }
.wa-sched:last-child { border-bottom: 0; }
.wa-sched.is-paused { opacity: 0.55; }
.wa-sched-main { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; font-size: 0.8rem; color: var(--text-secondary); }
.wa-sched-main strong { color: var(--text-primary); font-size: 0.88rem; }
.wa-sched-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
.wa-sched-meta { font-size: 0.72rem; color: var(--text-muted); }
.wa-sched-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }
@media (max-width: 600px) { .wa-sched { flex-direction: column; } .wa-sched-msg { white-space: normal; } }

.wa-test { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; padding-top: 0.9rem; border-top: 1px dashed var(--border); }
.wa-test select { flex: 1; min-width: 180px; }
