/* ============================================================
   CENTRAL WHATSAPP — Dashboard
   Usa os tokens já definidos em central.css (:root):
   --bg-black, --glass-green, --neon-green, --text-white, --border-glass
   ============================================================ */

#meu-perfil.wa-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: radial-gradient(circle at top, #0a1a10 0%, var(--bg-black) 65%);
    overflow-y: auto;
    padding: 24px 20px 60px;
    box-sizing: border-box;
}

.wa-dashboard {
    max-width: 1320px;
    margin: 0 auto;
}

/* ---------- HEADER ---------- */
.wa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.wa-back {
    background: none;
    border: none;
    color: var(--neon-green);
    cursor: pointer;
    font-size: 0.85rem;
    order: 1;
}

.wa-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    order: 2;
    flex: 1;
    justify-content: center;
}

.wa-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(57, 255, 20, 0.5));
}

.wa-title {
    color: var(--neon-green);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
    margin: 0;
}

.wa-connection-pill {
    order: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--glass-green);
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.wa-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffcc00;
    box-shadow: 0 0 8px #ffcc00;
    flex-shrink: 0;
}

.wa-dot.online { background: var(--neon-green); box-shadow: 0 0 8px var(--neon-green); }
.wa-dot.offline { background: #ff3131; box-shadow: 0 0 8px #ff3131; }

.wa-status-text { font-weight: bold; color: #ffcc00; }
.wa-status-text.valor-sucesso { color: var(--neon-green); }
.wa-status-text.valor-pendente { color: #ffcc00; }

/* ---------- SELETOR DE COMÉRCIO ---------- */
.wa-comercio-picker {
    background: var(--glass-green);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 16px;
}

.wa-comercio-picker label {
    display: block;
    font-size: 0.72rem;
    color: var(--neon-green);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.wa-comercio-picker select {
    width: 100%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: 1px solid var(--neon-green);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

.wa-comercio-hint {
    margin: 8px 0 0;
    font-size: 0.7rem;
    line-height: 1.4;
}

/* ---------- GRID ---------- */
.wa-grid {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.wa-col-left, .wa-col-main, .wa-col-right {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ---------- CARD BASE ---------- */
.wa-card {
    background: var(--glass-green);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 18px;
}

.wa-card-title {
    color: var(--neon-green);
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0 0 12px;
    text-align: center;
}

.wa-muted { color: #888; font-size: 0.8rem; }
.wa-empty { color: #666; text-align: center; font-size: 0.75rem; padding: 12px 0; }

/* ---------- QR / CONEXÃO ---------- */
.wa-qr-area {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 1px dashed var(--border-glass);
    border-radius: 14px;
    margin-bottom: 14px;
    padding: 16px;
    text-align: center;
}

.wa-qr-area img { width: 100%; max-width: 220px; border-radius: 10px; border: 5px solid #fff; }

.wa-btn-row { display: flex; gap: 10px; }
.wa-btn-row button { flex: 1; }
.wa-btn-block { width: 100%; margin-top: 10px; }

/* ---------- STAT RINGS ---------- */
.wa-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.wa-stat-card {
    background: var(--glass-green);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.wa-stat-ring {
    --pct: 0;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--neon-green) calc(var(--pct) * 1%), rgba(255,255,255,0.08) 0);
    position: relative;
}

.wa-stat-ring::before {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: var(--bg-black);
}

.wa-stat-ring span {
    position: relative;
    z-index: 1;
    color: var(--neon-green);
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 0 0 8px rgba(57,255,20,0.4);
}

.wa-stat-label {
    font-size: 0.68rem;
    color: #aaa;
    text-align: center;
    letter-spacing: 0.3px;
}

/* ---------- CÉREBRO ---------- */
.wa-textarea {
    width: 100%;
    height: 80px;
    background: rgba(0,0,0,0.4);
    color: #fff;
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 10px;
    font-family: 'Inter', sans-serif;
    resize: vertical;
    box-sizing: border-box;
}

.wa-list-scroll {
    margin-top: 14px;
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

/* ---------- GRÁFICO DE ATIVIDADE ---------- */
.wa-chart-area {
    position: relative;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wa-chart-area canvas {
    width: 100%;
    height: 160px;
    display: none;
}

.wa-chart-area.has-data canvas { display: block; }
.wa-chart-area.has-data .wa-chart-empty { display: none; }

/* ---------- CONTATOS ---------- */
.wa-contacts-list {
    max-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wa-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    transition: 0.2s;
}

.wa-contact-item:hover, .wa-contact-item.active {
    background: rgba(57,255,20,0.1);
    border-color: var(--border-glass);
}

.wa-contact-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(57,255,20,0.15);
    color: var(--neon-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.wa-contact-info { flex: 1; min-width: 0; }
.wa-contact-name { font-size: 0.82rem; color: #eee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-contact-preview { font-size: 0.7rem; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- MONITOR ---------- */
.wa-ia-status {
    text-align: center;
    margin-bottom: 10px;
    font-size: 0.72rem;
    color: var(--neon-green);
    letter-spacing: 1px;
}

.wa-monitor-logs {
    height: 190px;
    background: rgba(0,0,0,0.5);
    border-radius: 10px;
    padding: 10px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.78rem;
    color: var(--neon-green);
    border: 1px solid var(--border-glass);
    margin-top: 10px;
}

.wa-human-reply {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    border-top: 1px solid var(--border-glass);
    padding-top: 10px;
}

.wa-human-reply input {
    flex: 1;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--neon-green);
    color: #fff;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}

.wa-human-reply button {
    background: var(--neon-green);
    color: #000;
    border: none;
    padding: 0 16px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

/* ---------- ABAS MOBILE ---------- */
.wa-mobile-tabs {
    display: none;
    gap: 8px;
    margin-bottom: 16px;
}

.wa-mobile-tabs button {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    color: #ccc;
    padding: 10px 6px;
    border-radius: 10px;
    font-size: 0.72rem;
    cursor: pointer;
}

.wa-mobile-tabs button.active {
    background: var(--neon-green);
    color: #000;
    font-weight: bold;
    border-color: var(--neon-green);
}

/* ---------- RESPONSIVO ---------- */
@media (max-width: 980px) {
    .wa-grid {
        grid-template-columns: 1fr;
    }

    .wa-mobile-tabs { display: flex; }

    .wa-col-left, .wa-col-main, .wa-col-right {
        display: none;
    }

    .wa-col-left.wa-tab-active,
    .wa-col-main.wa-tab-active,
    .wa-col-right.wa-tab-active {
        display: flex;
    }
}

@media (max-width: 480px) {
    #meu-perfil.wa-overlay { padding: 16px 12px 50px; }
    .wa-brand { order: 1; width: 100%; justify-content: flex-start; }
    .wa-back { order: 2; }
    .wa-connection-pill { order: 3; width: 100%; justify-content: center; }
}
