:root {
    --whd-bg: #111b21;
    --whd-panel: #202c33;
    --whd-panel-2: #2a3942;
    --whd-green: #25D366;
    --whd-green-dark: #128C7E;
    --whd-text: #e9edef;
    --whd-text-muted: #8696a0;
    --whd-border: #2f3b43;
}

* { box-sizing: border-box; }

body.app-body, body.login-body {
    background: var(--whd-bg);
    color: var(--whd-text);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- LOGIN ---------- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-card {
    background: var(--whd-panel);
    border: 1px solid var(--whd-border);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,.4);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand i { font-size: 42px; color: var(--whd-green); }
.login-brand h1 { font-size: 22px; margin-top: 8px; }
.login-brand p { color: var(--whd-text-muted); font-size: 14px; }
.login-form .form-control {
    background: var(--whd-panel-2);
    border: 1px solid var(--whd-border);
    color: var(--whd-text);
}
.login-form .form-control:focus {
    background: var(--whd-panel-2);
    color: var(--whd-text);
    border-color: var(--whd-green);
    box-shadow: 0 0 0 .2rem rgba(37,211,102,.25);
}
.login-form label { color: var(--whd-text-muted); font-size: 13px; }
.btn-success { background: var(--whd-green); border-color: var(--whd-green); font-weight: 600; }
.btn-success:hover { background: var(--whd-green-dark); border-color: var(--whd-green-dark); }
.link-light-muted { color: var(--whd-text-muted); font-size: 13px; text-decoration: none; }
.link-light-muted:hover { color: var(--whd-green); }

/* ---------- APP SHELL ---------- */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    width: 260px;
    background: var(--whd-panel);
    border-right: 1px solid var(--whd-border);
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--whd-border);
    font-weight: 600;
}
.sidebar-brand i { color: var(--whd-green); font-size: 20px; }

.sidebar-nav { flex: 1; padding: 12px; overflow-y: auto; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--whd-text-muted);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 2px;
}
.nav-item:hover, .nav-item.active {
    background: var(--whd-panel-2);
    color: var(--whd-text);
}
.nav-item i { width: 18px; text-align: center; }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--whd-border);
}
.avatar-circle {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--whd-green-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.sidebar-user-info { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar-user-info small { color: var(--whd-text-muted); text-transform: capitalize; }
.btn-logout {
    background: none; border: none; color: var(--whd-text-muted);
    font-size: 16px; cursor: pointer;
}
.btn-logout:hover { color: #ef4444; }

.app-main { flex: 1; padding: 28px; overflow-y: auto; }

.page-header h1 { font-size: 22px; margin-bottom: 4px; }

.stat-card {
    background: var(--whd-panel);
    border: 1px solid var(--whd-border);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-card i { font-size: 26px; color: var(--whd-green); }
.stat-value { display: block; font-size: 22px; font-weight: 700; }
.stat-label { display: block; font-size: 13px; color: var(--whd-text-muted); }
.whd-atendimento { display: flex; height: calc(100vh - 56px); margin: -28px; }
.whd-conversas { width: 320px; border-right: 1px solid var(--whd-border); display: flex; flex-direction: column; }
.whd-conversas-header { padding: 12px; border-bottom: 1px solid var(--whd-border); }
.whd-conversas-lista { flex: 1; overflow-y: auto; }
.whd-conversa-item { display: flex; gap: 10px; padding: 12px; text-decoration: none; color: var(--whd-text); border-bottom: 1px solid var(--whd-border); }
.whd-conversa-item:hover, .whd-conversa-item.active { background: var(--whd-panel-2); }
.whd-conversa-info { flex: 1; min-width: 0; }
.whd-conversa-topo { display: flex; justify-content: space-between; align-items: center; }
.whd-conversa-preview { display: flex; justify-content: space-between; align-items: center; color: var(--whd-text-muted); font-size: 13px; }
.whd-badge-nao-lidas { background: var(--whd-green); color: #062f22; border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 700; }

.whd-chat { flex: 1; display: flex; flex-direction: column; background: #0b141a; }
.whd-chat-vazio { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--whd-text-muted); }
.whd-chat-vazio i { font-size: 48px; margin-bottom: 12px; color: var(--whd-green-dark); }

.whd-chat-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--whd-panel); border-bottom: 1px solid var(--whd-border); }

.whd-chat-mensagens { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.whd-msg { display: flex; }
.whd-msg-enviada { justify-content: flex-end; }
.whd-msg-bolha { max-width: 60%; padding: 8px 12px; border-radius: 8px; background: var(--whd-panel-2); position: relative; }
.whd-msg-enviada .whd-msg-bolha { background: #005c4b; }
.whd-msg-hora { font-size: 10px; color: var(--whd-text-muted); text-align: right; margin-top: 4px; }

.whd-chat-input { display: flex; gap: 8px; padding: 12px; background: var(--whd-panel); border-top: 1px solid var(--whd-border); position: relative; }
.whd-chat-input .form-control { background: var(--whd-panel-2); border: 1px solid var(--whd-border); color: var(--whd-text); }

.whd-sugestoes-respostas {
    position: absolute;
    bottom: 100%;
    left: 12px;
    right: 12px;
    background: var(--whd-panel-2);
    border: 1px solid var(--whd-border);
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 6px;
}
.whd-sugestao-item { padding: 8px 12px; cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--whd-border); }
.whd-sugestao-item:hover { background: var(--whd-panel); }
.whd-sugestao-item:last-child { border-bottom: none; }
