/* ==========================================================================
   BANNER DE AVISO (PERFIL INCOMPLETO)
   ========================================================================== */
.warning-banner {
    background-color: #fffbeb; /* Amarelo bem claro */
    color: #92400e; /* Laranja escuro */
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid #fde68a; /* Borda amarela */
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
}
.warning-banner p {
    margin: 0;
    flex-grow: 1;
}
.warning-banner a {
    color: #92400e;
    font-weight: 700;
    text-decoration: underline;
}
/* ==========================================================================
   1. VARIÁVEIS E FONTES GLOBAIS
   ========================================================================== */
@import url('01-variables.css');
:root {
}
/* ==========================================================================
   2. ESTRUTURA DO LAYOUT (DASHBOARD)
   ========================================================================== */
html {
    overflow-x: clip; /* Impede rolagem horizontal sem quebrar o sticky */
    font-size: 70%; /* A pedido: Reduz globalmente elementos e textos baseados em rem (~30%) */
    overscroll-behavior-y: none; /* Bloqueia o 'arrastar para atualizar' (pull-to-refresh) nativo no mobile */
}

body.pagina-dashboard {
    font-family: var(--font-principal) !important; /* Força a fonte Inter */
    background-color: var(--cinza-fundo) !important;
    zoom: 0.88; /* Zoom out de 12% para todo o ecossistema logado */
    background-image: var(--ruido-global) !important;
    background-attachment: fixed !important;
    background-repeat: repeat !important;
    margin: 0;
    padding: 0;
    height: calc(100vh / 0.88); /* FIX: Altura fixa para o layout app-like */
    color: var(--cinza-texto);
    width: 100%;
    max-width: 100%;
    overflow: hidden !important; /* FIX: Trava o scroll no body, passando a responsabilidade para .dashboard-main */
    position: relative;
    overscroll-behavior-y: none; /* Reforça o bloqueio do pull-to-refresh */
}

/* Correção para Modais (Garante que fiquem escondidos e sobrepostos) */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100vh / 0.88);
    background: rgba(0, 0, 0, 0.5);
    display: none; /* Oculto por padrão */
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Muito acima de tudo */
    backdrop-filter: blur(3px);
}

/* Garante que quando tiver a classe flex, ele apareça */
.custom-modal-overlay[style*="display: flex"] {
    display: flex !important;
    animation: modalFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.custom-modal-box {
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
    max-height: 90vh; /* Garante que o modal nunca seja maior que a tela */
    overflow-y: auto; /* Adiciona barra de rolagem interna automaticamente se necessário */
}

.custom-modal-overlay[style*="display: flex"] .custom-modal-box {
    animation: modalContentPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalFadeIn {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to { opacity: 1; backdrop-filter: blur(3px); }
}

@keyframes modalContentPop {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.dashboard-container { 
    display: flex; 
    height: 100%; /* FIX: Ocupa a altura total do body */
    width: 100%;
}

.dashboard-header-actions {
    display: flex;
    align-items: center; /* Alinha verticalmente com o título */
    gap: 10px;
    margin-bottom: 0; /* Remove a margem que estava desalinhando */
}

/* Área Principal de Conteúdo */
/* Conteúdo principal flexível que preenche o espaço restante */
.dashboard-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: transparent !important;
    overflow-y: auto !important; /* FIX: Torna esta a área de scroll principal */
    overflow-x: clip;
    position: relative;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch; /* Rolagem suave no iOS */
    margin-left: 0; /* Removido o !important para permitir sobreposição pelo media query */
    width: 100%;
    overscroll-behavior-y: contain; /* FIX: Impede que o scroll "vaze" para o body */
}

/* ==========================================================================
   FIX GLOBAL: STICKY CARDS NO DASHBOARD
   Garante que painéis laterais fiquem fixos ao rolar (Ex: Calculadora).
   ========================================================================== */
.dashboard-sticky-card {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 20px !important;
    align-self: flex-start !important;
    height: max-content !important;
    z-index: 90;
}

/* Ajuste para quando o chat mobile estiver aberto */
body.chat-mobile-open {
    overflow: hidden; /* Trava o scroll do body */
}

/* Centraliza o conteúdo (Banner e Widgets) horizontalmente */
#main-content {
    width: 100%;
    max-width: 1200px; /* Alargado para suportar o novo layout moderno */
    margin: 0 auto;
    display: block; /* Deixa o layout moderno gerenciar as colunas e espaçamentos */
    transform: none !important; /* FIX: Impede que o JS do zoom quebre o 'position: sticky' dos cards flutuantes */
}

/* Títulos Gerais */
h1, h2, h3, h4 { font-family: var(--font-titulos); color: var(--verde-escuro); font-weight: 500; }

/* ==========================================================================
   3. NAVEGAÇÃO SUPERIOR (TOP NAV)
   ========================================================================== */
.dashboard-top-nav {
    background-color: var(--verde-escuro);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.top-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 70px;
}
.top-nav-left { display: flex; align-items: center; gap: 40px; }
.top-nav-logo { height: 28px; cursor: pointer; transition: transform 0.2s; }
.top-nav-logo:hover { transform: scale(1.05); }

.top-menu ul { display: flex; gap: 25px; list-style: none; margin: 0; padding: 0; height: 100%; align-items: center; }
.top-menu a { 
    color: #adb5bd; text-decoration: none; font-weight: 600; font-size: 0.95rem; 
    transition: color 0.2s; padding: 24px 0; border-bottom: 3px solid transparent; display: block;
}
.top-menu li.active a, .top-menu a:hover { color: white; border-bottom-color: var(--cor-Yelo); }

.top-nav-right { display: flex; align-items: center; }
.user-profile-nav { display: flex; align-items: center; gap: 15px; }
#psi-sidebar-photo { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--cor-Yelo); object-fit: cover; }
.user-nav-info { display: flex; flex-direction: column; }
#psi-sidebar-name { font-weight: bold; font-size: 0.9rem; font-family: var(--verde-escuro); line-height: 1; margin-bottom: 3px; color: #14532d;}
#psi-sidebar-level { font-size: 0.75rem; color: #a7f3d0; font-weight: bold; line-height: 1; }
.nav-actions { display: flex; gap: 5px; margin-left: 10px; border-left: 1px solid rgba(255,255,255,0.2); padding-left: 15px; }
.nav-actions button { background: none; border: none; font-size: 1.2rem; cursor: pointer; opacity: 0.7; transition: opacity 0.2s; color: white;}
.nav-actions button:hover { opacity: 1; }

@media (max-width: 992px) {
    .desktop-only { display: none !important; }
}
/* =================
   ========================================================================== */
.form-secao {
    background-color: var(--branco-puro);
    padding: 20px; /* Reduzido de 30px */
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 20px; /* Reduzido de 30px */
}

.form-secao h2 {
    font-family: var(--font-titulos);
    margin-bottom: 15px; /* Reduzido de 25px */
    border-bottom: 1px solid var(--cinza-borda);
    padding-bottom: 10px; /* Reduzido de 15px */
}

/* Grids */
.form-grid-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.form-grid-credenciais { display: flex; flex-wrap: wrap; gap: 15px; align-items: flex-end; }

/* Inputs */
.form-group { margin-bottom: 15px; position: relative; }
.form-group:focus-within { z-index: 100; } /* Garante que dropdowns se sobreponham aos inputs de baixo */
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 13px; } /* Reduzido de 8px e 14px */
.form-group input, .form-group textarea, .form-group select, .filtro-select {
    width: 100%; padding: 8px 12px; /* Reduzido de 11px */
    border: 1px solid #ced4da; border-radius: 8px;
    font-family: var(--font-principal); font-size: 14px; /* Reduzido de 16px */
    background-color: #f8f9fa; box-sizing: border-box;
}
textarea#bio {
    min-height: 80px; /* Reduzido de 120px */
    text-align: justify;
    white-space: pre-wrap;
    line-height: 1.5; /* Reduzido de 1.6 */
    padding: 10px 12px; /* Reduzido de 15px */
}

/* Validação */
.form-group input.input-error { border-color: var(--coral-quente); }
.form-error-message { color: var(--coral-quente); font-size: 13px; margin-top: 5px; }

#form-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

/* Botões de Formulário */
.btn { padding: 10px 24px; border-radius: 25px; font-weight: 700; border: none; cursor: pointer; transition: transform 0.2s; display: inline-block; }
.btn { padding: 10px 24px; border-radius: 25px; font-weight: 700; border: 2px solid transparent; cursor: pointer; transition: transform 0.2s; display: inline-block; text-align: center; box-sizing: border-box; }
.btn-principal, .btn-rapido, .btn-primario { background-color: var(--verde-escuro); color: var(--branco-puro); }
.btn-secundario { background-color: transparent; border: 2px solid var(--verde-escuro); color: var(--verde-escuro); }
.btn:hover { transform: scale(1.03); }
.form-acoes { display: flex; justify-content: flex-end; margin-top: 20px; }

/* ==========================================================================
   5. COMPONENTES ESPECÍFICOS (UPLOAD, MULTISELECT, WIDGETS)
   ========================================================================== */

/* Upload */
.form-group-upload .upload-label {
    display: block; padding: 40px 20px;
    border: 2px dashed var(--cinza-borda); border-radius: 8px;
    text-align: center; cursor: pointer; transition: all 0.2s;
}
.form-group-upload .upload-label:hover { background-color: var(--cinza-fundo); border-color: var(--verde-escuro); }
.form-group-upload input[type="file"] { display: none; }

/* Widget Verificação */
#verification-widget {
    display: flex; flex-direction: column; gap: 8px; padding: 20px;
    border-left-width: 5px; border-left-style: solid; margin-bottom: 30px;
}
#verification-widget.status-pending { background-color: #fffbeb; border-left-color: #f59e0b; color: #b45309; }
#verification-widget.status-verified { background-color: #f0fdf4; border-left-color: #16a34a; color: #14532d; }

/* ==========================================================================
   MULTISELECT CUSTOMIZADO (MODERNO & ESTILO Yelo)
   ========================================================================== */

/* 1. O Campo de Input (Display) */
.multiselect-tag .multiselect-display {
    border: 1px solid #d1d5db; /* Cinza suave */
    border-radius: 12px; /* Bordas mais arredondadas */
    padding: 8px 10px; /* Reduzido de 10px 12px */
    min-height: 42px; /* Reduzido de 50px */
    cursor: pointer;
    background-color: #ffffff;
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* Espaço entre as tags */
    transition: all 0.2s ease;
    position: relative;
}

/* Efeito de Foco (Quando aberto ou hover) */
.multiselect-tag:hover .multiselect-display,
.multiselect-tag.open .multiselect-display {
    border-color: var(--verde-escuro);
    box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.1); /* Glow suave verde */
}

/* Seta indicativa (Opcional, para mostrar que é clicável) */
.multiselect-tag .multiselect-display::after {
    content: '▼';
    font-size: 0.7rem;
    color: #9ca3af;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* 2. As Etiquetas (Tags) - Estilo Pílula */
.multiselect-display .tag {
    background-color: var(--cor-Yelo); /* Amarelo da marca */
    color: var(--verde-escuro); /* Texto verde para contraste */
    padding: 3px 14px;
    border-radius: 15px; /* Formato Pílula */
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.1s ease;
    z-index: 2; /* Fica acima da seta */
}

.multiselect-display .tag:hover {
    transform: scale(1.02);
}

/* Botão de Remover (x) dentro da tag */
.multiselect-display .tag .remove-tag {
    background: rgba(27, 67, 50, 0.1); /* Usando a cor verde com transparência */
    border: none;
    color: var(--verde-escuro);
    /* MUDANÇA AQUI: Tamanho reduzido de 18px para 15px */
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* MUDANÇA AQUI: Ícone 'x' menor */
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
    margin-left: 2px; /* Um tiquinho de margem extra */
}

.multiselect-display .tag .remove-tag:hover {
    background: var(--verde-escuro); /* Fica verde sólido no hover */
    color: var(--cor-Yelo); /* O 'x' vira amarelo */
}

/* 3. O Menu Dropdown (Lista de Opções) */
.multiselect-tag .multiselect-options {
    display: none;
    position: absolute;
    top: 105%; /* Um pouco abaixo do input */
    left: 0;
    background-color: #ffffff;
    border: 1px solid #f3f4f6;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    z-index: 20;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); /* Sombra flutuante elegante */
    padding: 5px; /* Espaço interno para as opções não colarem na borda */
    animation: popInDropdown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top center;
}

.multiselect-tag.open .multiselect-options {
    display: block;
}

/* Item da Lista */
.multiselect-options .option {
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 8px; /* Itens arredondados */
    color: #4b5563;
    font-weight: 500;
    transition: background 0.1s;
    margin-bottom: 2px;
}

/* Hover no Item */
.multiselect-options .option:hover {
    background-color: #f0fdf4; /* Verde menta bem clarinho */
    color: var(--verde-escuro);
}

/* Item Selecionado */
.multiselect-options .option.selected {
    background-color: var(--verde-escuro);
    color: #ffffff;
}

/* Barra de rolagem do dropdown (Estilo Mac/Moderno) */
.multiselect-options::-webkit-scrollbar {
    width: 6px;
}
.multiselect-options::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

/* Animação suave de entrada */
@keyframes popInDropdown {
    from { opacity: 0; transform: translateY(-10px) scaleY(0.95); }
    to { opacity: 1; transform: translateY(0) scaleY(1); }
}

/* ==========================================================================
   6. CAIXA DE ENTRADA E PLANOS
   ========================================================================== */
/* Inbox */
.inbox-container {
    display: flex; height: calc((100vh / 0.88) - 150px);
    background: var(--branco-puro); border-radius: 16px;
    overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.inbox-sidebar { width: 35%; max-width: 350px; border-right: 1px solid #e9ecef; overflow-y: auto; }
.inbox-content { flex-grow: 1; padding: 25px; overflow-y: auto; }
.message-item { padding: 15px; border-bottom: 1px solid #e9ecef; cursor: pointer; }
.message-item.active { background-color: #e9f5ff; }
.message-item.unread .message-subject { font-weight: bold; }

/* KPIs e Planos */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding: 10px 0 30px 0; }

.kpi-card { 
    background: #fff; 
    padding: 20px; 
    border-radius: 16px; 
    border: 1px solid rgba(0,0,0,0.04); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}
.kpi-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.08); }

.kpi-card h3 { font-family: var(--font-principal); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: #888; margin-top: 0; margin-bottom: 10px; font-weight: 600; }

.kpi-card .kpi-value { 
    font-family: var(--font-titulos); 
    font-size: 2.2rem; 
    font-weight: 700; 
    color: var(--verde-escuro); 
    line-height: 1;
}

.plan-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; padding: 20px 0; }
.plano-card { flex: 1 1 280px; max-width: 300px; background: #fff; border: 2px solid var(--cinza-borda); padding: 24px; border-radius: 16px; display: flex; flex-direction: column; position: relative; }
.plano-card--ativo { border-color: var(--verde-escuro); transform: scale(1.03); }

.plano-card.promo-ativa {
    border: 2px solid #16a34a;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
}

/* ==========================================================================
   7. Q&A COMUNIDADE (REFINADO PARA CHAT)
   ========================================================================== */
.qna-card-psi { background: #fff; padding: 25px; border-radius: 16px; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid #e9ecef; transition: transform 0.2s, box-shadow 0.2s; }
.qna-card-psi:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.06); }
.qna-question-title { font-size: 1.3rem; margin-bottom: 5px; color: var(--verde-escuro); font-family: var(--font-titulos); }
.qna-question-author { font-size: 0.85rem; color: #888; display: block; margin-bottom: 15px; }

/* Mantido para compatibilidade se houver lugares não migrados */
.qna-card-body { background: #f8f9fa; padding: 15px 20px; border-radius: 12px; font-size: 0.95rem; color: #444; line-height: 1.6; border-left: 4px solid var(--cor-Yelo); }

/* Novos estilos de Conversação (Balões) */
.qna-conversation-thread {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin: 20px 0 !important;
    width: 100%;
}
.qna-bubble {
    padding: 14px 18px !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    position: relative !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
    word-break: break-word !important;
}
.qna-bubble-question {
    background-color: #ffffff !important;
    border: 1px solid #e9ecef !important;
    color: #333 !important;
    align-self: flex-start !important;
    border-radius: 16px 16px 16px 4px !important; /* Estilo WhatsApp (cauda esquerda) */
    max-width: 85% !important;
}
.qna-bubble-answer {
    background-color: #e8f5e9 !important; /* Verde claro Yelo */
    border: 1px solid #c8e6c9 !important;
    color: #111 !important;
    align-self: flex-end !important;
    border-radius: 16px 16px 4px 16px !important; /* Estilo WhatsApp (cauda direita) */
    max-width: 85% !important;
}
.qna-bubble-answer strong {
    display: block !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 6px !important;
    color: #128C7E !important; /* Verde escuro clássico do zap */
    opacity: 0.9 !important;
}

.qna-card-actions { margin-top: 15px; display: flex; align-items: center; justify-content: space-between; }

/* Botão Responder (Ajuste solicitado: Pequeno e à esquerda) */
.btn-responder {
    width: auto !important;
    display: inline-block !important;
    padding: 8px 20px !important;
    font-size: 0.9rem !important;
    margin-top: 0;
    background-color: var(--verde-escuro);
    color: #fff;
    border-radius: 50px;
    transition: all 0.2s ease;
}
.btn-responder:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(27, 67, 50, 0.2);
}

/* Ajustes Mobile Q&A */
@media (max-width: 768px) {
    .qna-card-psi {
        padding: 18px;
        border-radius: 12px;
    }
    .qna-question-title {
        font-size: 1.15rem;
        line-height: 1.3;
    }
    .qna-bubble {
        padding: 12px 15px !important;
        font-size: 0.95rem !important;
        max-width: 92% !important;
    }
    .qna-bubble-answer {
        margin-left: auto !important;
    }
    .qna-bubble-question {
        margin-right: auto !important;
    }
}

/* Paginação do Fórum/Q&A */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
}
.pagination-btn {
    background-color: var(--branco-puro);
    border: 1px solid var(--cinza-borda);
    color: var(--verde-escuro);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}
.pagination-btn:hover:not(:disabled) {
    background-color: #f0fdf4;
    border-color: var(--verde-escuro);
}
.pagination-btn.active {
    background-color: var(--verde-escuro);
    color: var(--branco-puro);
    border-color: var(--verde-escuro);
}
.pagination-btn:disabled {
    background-color: #f1f3f5;
    color: #adb5bd;
    cursor: not-allowed;
    border-color: #e9ecef;
}

/* Modal Q&A */
#qna-answer-modal textarea { width: 100%; min-height: 150px; border: 1px solid #ced4da; padding: 10px; }
#qna-answer-modal .modal-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
#qna-answer-modal .btn { width: 100%; justify-content: center; }

/* ==========================================================================
   BOTTOM NAVIGATION (MOBILE)
   ========================================================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    /* Forçamos o formato com !important para ignorar o CSS antigo que pode estar em cache */
    bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 40px) !important;
    max-width: 400px !important;
    background-color: rgba(255, 255, 255, 0.90) !important;
    backdrop-filter: blur(12px) !important;
    border-radius: 50px !important; /* Formato de Pílula */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    z-index: 9999 !important; /* Garante que a pílula flutue sobre outros elementos fixos */
    justify-content: space-around;
    align-items: center;
    padding: 8px 16px !important;
    /* Adicionado para o Smart Scroll: Animação suave de entrada/saída */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.bottom-nav-wave {
    position: absolute;
    bottom: 100%; /* Fica exatamente acima da barra */
    left: 0;
    width: 100%;
    height: 25px; /* Altura da onda */
    overflow: hidden;
    line-height: 0;
    pointer-events: none;
    display: none; /* Ocultamos a onda pois a barra agora é uma pílula flutuante */
}

.bottom-nav-wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 100%;
    fill: #ffffff;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    font-size: 0.65rem; /* Ajustado para caber mais itens sem esmagar */
    gap: 2px;
    transition: all 0.3s ease;
    flex: 1; /* Dinâmico: 4, 5 ou 6 itens dividirão o espaço igual! */
    min-width: 0; /* Impede o vazamento */
    padding: 6px 0;
    border-radius: 20px;
    overflow: hidden;
}

.bottom-nav-item span {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 15px;
    opacity: 1;
    transform: scale(1);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis; /* Adiciona "..." se o nome for gigante */
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 2px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.bottom-nav-item.active {
    color: var(--verde-escuro);
    font-weight: 600;
    background-color: #f0fdf4;
}

.bottom-nav-item.active svg {
    transform: translateY(-2px);
}

/* ==========================================================================
   FAB (FLOATING ACTION BUTTON)
   ========================================================================== */
.fab-container {
    position: fixed;
    bottom: calc(var(--mobile-bottom-h, 80px) + 30px) !important; /* Acima da nova bottom nav em pílula com respiro dinâmico */
    left: 20px; /* Movido para a esquerda conforme solicitado */
    right: auto;
    z-index: 10000;
    display: none !important; /* Oculto no Desktop */
    flex-direction: column;
    align-items: flex-start; /* Alinha opções à esquerda */
    gap: 10px;
    pointer-events: none; /* Permite clicar através da área vazia */
}

.fab-main {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--verde-escuro);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(27, 67, 50, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    pointer-events: auto; /* Reativa cliques no botão */
    touch-action: none; /* Impede scroll apenas ao arrastar o botão */
}
.fab-main:active { transform: scale(0.95); }
.fab-main.active { transform: rotate(45deg); background-color: #333; }

.fab-options {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Alinha opções à esquerda */
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto; /* Reativa cliques nas opções */
}
.fab-options.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-option {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
}
.fab-option span {
    background: white;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: #333;
}
.fab-icon-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 1.2rem;
}

/* ==========================================================================
   ACCOUNT MENU (BOTTOM SHEET)
   ========================================================================== */
.account-sheet-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: calc(100vh / 0.88);
    background: rgba(0,0,0,0.5); z-index: 10001;
    opacity: 0; visibility: hidden; transition: all 0.3s;
}
.account-sheet-overlay.active { opacity: 1; visibility: visible; }

.account-sheet {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 0; /* Remove padding do container para o header encostar */
}
.account-sheet.active { transform: translateY(0); }

.sheet-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0; /* Garante que o header não encolha */
}
.sheet-content {
    padding: 20px;
    overflow-y: auto; /* Scroll apenas no conteúdo */
}
.sheet-header h3 { margin: 0; font-family: var(--font-titulos); color: var(--verde-escuro); }
.close-sheet { background: none; border: none; font-size: 1.5rem; cursor: pointer; }

.sheet-section { margin-bottom: 25px; }
.sheet-section h4 { font-size: 0.8rem; text-transform: uppercase; color: #999; margin-bottom: 10px; letter-spacing: 1px; }
.sheet-link {
    display: block; padding: 12px 0;
    color: #333; text-decoration: none; font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
}
.sheet-link.logout { color: #d32f2f; border: none; background: none; width: 100%; text-align: left; cursor: pointer; }

/* ==========================================================================
   8. RESPONSIVIDADE MOBILE
   ========================================================================== */
@media (max-width: 992px) {
    /* --- BACKDROP (FUNDO ESCURO PARA FOCO) --- */
    .sidebar-backdrop {
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: calc(100vh / 0.88);
        background-color: rgba(27, 67, 50, 0.5); /* Verde escuro com transparência */
        backdrop-filter: blur(2px);
        z-index: 99999; /* ACIMA do chat (99990) */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0s 0.3s;
    }
    .sidebar-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.3s ease;
    }

    /* --- SIDEBAR (MENU LATERAL) --- */
    .dashboard-sidebar {
    width: 250px; background-color: var(--verde-escuro); color: white; display: flex; flex-direction: column; padding: 25px; box-shadow: 5px 0px 15px rgba(0,0,0,0.1); z-index: 10;
    background-image: var(--ruido-claro) !important;
    background-attachment: fixed !important;
    background-repeat: repeat !important;
    }

    /* --- BOTÃO HAMBÚRGUER (ANIMADO) --- */
    .menu-toggle {
        display: flex; flex-direction: column; 
        justify-content: center; /* Centraliza verticalmente */
        align-items: center;     /* Centraliza horizontalmente */
        gap: 5px;                /* Espaçamento das barras */
        width: 45px; height: 45px; 
        padding: 0;              /* Remove padding extra */
        position: fixed; top: 20px; left: 20px;
        z-index: 100001 !important; /* Camada mais alta, acima da sidebar */
        background-color: var(--verde-escuro); /* Cor padrão (fechado) */
        border: none;
        border-radius: 50%; box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* Sombra suave */
        cursor: pointer;
        transition: background-color 0.3s ease; /* Transição suave da cor de fundo */
    }
    .menu-toggle span { display: block; width: 22px; height: 2px; background-color: #fff; border-radius: 2px; transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease; transform-origin: center; }
    /* Estado Ativo (Aberto) */
    .menu-toggle.is-active {
        background-color: #fff; /* Fundo branco quando aberto */
    }
    .menu-toggle.is-active span {
        background-color: var(--verde-escuro); /* Barras verdes quando aberto */
    }
    .menu-toggle.is-active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.is-active span:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* Esconde o botão hambúrguer do topo, pois agora temos o "Menu" embaixo */
    .menu-toggle { display: none !important; }

    /* Mostra a Bottom Nav */
    body .mobile-bottom-nav { 
        display: flex !important; 
    }

    /* Trigger de Menu (Texto - Mobile) */
    .menu-text-trigger {
        font-family: var(--font-titulos);
        font-weight: 800;
        color: #1B4332;
        font-size: 1rem;
        letter-spacing: 1px;
        cursor: pointer;
    }

    /* Oculta o botão de menu desktop no mobile */
    #desktop-menu-trigger {
        display: none !important;
    }

    /* Mostra o FAB no Mobile */
    .fab-container { display: flex !important; }

    /* --- CONTEÚDO PRINCIPAL --- */
    /* Ajuste de padding para não ficar escondido atrás da bottom nav */
    .dashboard-main { 
        width: 100%; 
        /* Padding inferior dinâmico para garantir que o conteúdo tenha o mesmo 'respiro' acima da bottom nav em todas as páginas */
        padding: calc(var(--mobile-header-h, 70px) + 20px) 20px calc(var(--mobile-bottom-h, 80px) + 50px) 20px;
        margin-left: 0 !important; /* Remove a margem no mobile */
    }

    /* Empilha os campos do formulário de perfil no mobile para melhor UX */
    .profile-section .form-row {
        flex-direction: column;
        gap: 0; /* Remove o espaçamento lateral */
    }
    .profile-section .form-row .form-group {
        margin-bottom: 20px; /* Adiciona espaçamento vertical entre os campos */
    }
    
    /* --- INBOX APP-LIKE (MOBILE) --- */
    .inbox-container { 
        flex-direction: column; 
        height: calc((100dvh / 0.88) - 220px) !important; /* Ajuste para novo espaçamento */
        min-height: 0 !important;
    }
    .inbox-sidebar { width: 100%; max-width: none; height: 100%; overflow-y: auto; display: flex; flex-direction: column; }
    .inbox-content { display: none; height: 100%; overflow-y: auto; }
    
    .inbox-container.mostrando-conteudo .inbox-sidebar { display: none; }
    .inbox-container.mostrando-conteudo .inbox-content { display: block; }
    .btn-voltar-inbox { display: block; margin-bottom: 15px; }
    
    /* Mantém área de toque confortável no mobile */
    .sidebar-nav li a { padding: 12px 15px; gap: 12px; }
}
@media (min-width: 993px) { .menu-toggle { display: none; } .btn-voltar-inbox { display: none; } .mobile-menu-trigger { display: none !important; } }
/* ==========================================================================
   PÁGINA: ASSINATURA E PAGAMENTOS (RESTAURAÇÃO DO LAYOUT)
   ========================================================================== */

/* 1. Cabeçalho Verde (Igual Visão Geral) */
.main-header {
    background-color: var(--verde-escuro);
    color: var(--branco-puro);
    padding: 20px 25px; /* Reduzido de 25px 30px */
    border-radius: 16px;
    margin-bottom: 25px; /* Reduzido de 40px */
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.main-header h1 { 
    font-family: var(--font-titulos); /* Garante a fonte New Kansas */
    color: var(--branco-puro); /* Força branco no fundo verde */
    margin: 0 0 10px 0; 
}
.subtitulo-header {
    color: #ffffff !important;
    font-size: 1.1rem;
    margin: 0;
}

/* 2. Card de Plano Atual (Topo) */
.plano-atual-card {
    background-color: var(--branco-puro);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 40px;
    border-left: 6px solid var(--cor-Yelo); /* Detalhe amarelo */
    display: flex;
    justify-content: space-between; /* Separa texto dos links */
    align-items: center;
    flex-wrap: wrap; /* Permite quebrar no mobile */
    gap: 20px;
}

.plano-info h3 { 
    font-size: 0.9rem; text-transform: uppercase; color: var(--cinza-texto-claro); margin: 0 0 5px 0; letter-spacing: 1px;
}
.plano-nome { 
    font-family: var(--font-titulos); font-size: 2rem; color: var(--verde-escuro); margin: 0; 
}
.plano-preco { font-weight: bold; color: var(--cinza-texto); margin: 5px 0; }
.plano-data { font-size: 0.9rem; color: var(--cinza-texto-claro); margin: 0; }

.plano-acoes { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.plano-acoes a { color: var(--verde-escuro); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.plano-acoes a:hover { text-decoration: underline; }

/* 3. Grid de Planos (Lado a Lado) */
.planos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Cria colunas automáticas */
    gap: 30px;
    align-items: start; /* Alinha cards pelo topo */
}

/* Card Individual */
.plano-card {
    background-color: var(--branco-puro);
    border: 1px solid var(--cinza-borda);
    border-radius: 16px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}
.plano-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

/* Destaque do Plano Ativo */
.plano-card--ativo { border: 2px solid var(--verde-escuro); transform: scale(1.02); }
.plano-card--ativo:hover { transform: scale(1.02) translateY(-5px); }

.selo-plano-atual {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background-color: var(--verde-escuro); color: var(--branco-puro);
    padding: 5px 15px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; text-transform: uppercase;
}
.main-header p {
    font-size: 1.4rem; /* Tamanho de subtítulo, para combinar com o h1 */
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85); /* Levemente mais opaco para leitura */
    margin: 0;
}
/* Conteúdo do Card */
.plano-card h2 { text-align: center; margin-top: 10px; }
.plano-card .preco { 
    font-family: var(--font-titulos); /* ADICIONADO */
    text-align: center; 
    font-size: 2.5rem; 
    font-weight: 700; 
    color: var(--verde-escuro); 
    margin: 15px 0; 
}
.plano-card .preco span { font-size: 1rem; color: var(--cinza-texto-claro); font-weight: 400; }

.beneficios-lista { list-style: none; padding: 0; margin: 20px 0; }
.beneficios-lista li {
    padding: 10px 0; border-bottom: 1px solid #f0f0f0; color: var(--cinza-texto); display: flex; gap: 10px;
}
.beneficios-lista li::before { content: "✓"; color: var(--verde-escuro); font-weight: bold; }

/* Botões dos Planos */
.plano-cta button { width: 100%; padding: 12px; border-radius: 25px; font-weight: 700; cursor: pointer; border: none; transition: all 0.2s; }

.btn-mudar-plano { background: transparent; border: 2px solid var(--verde-escuro) !important; color: var(--verde-escuro); }
.btn-mudar-plano:hover { background: rgba(27, 67, 50, 0.05); }

.btn-upgrade { background: var(--verde-escuro) !important; color: var(--branco-puro); }
.btn-upgrade:hover { background: #143d2e !important; }

button[disabled] { background: #e9ecef !important; color: #adb5bd; cursor: not-allowed; border: none; }

/* Responsividade Mobile para Assinatura */
@media (max-width: 768px) {
    .plano-atual-card { flex-direction: column; align-items: flex-start; }
    .plano-acoes { align-items: flex-start; margin-top: 15px; }
    .plano-card--ativo { transform: none; }
}
/* ==========================================================================
   AJUSTES FINAIS: CAIXA DE ENTRADA
   ========================================================================== */

/* 1. Ajuste do Cabeçalho Verde (Flexbox para alinhar botão) */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Permite quebrar no mobile */
    gap: 20px;
}

/* Botão do Cabeçalho (Estilo Transparente/Branco) */
.btn-header-action {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--branco-puro);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 10px 20px;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.btn-header-action:hover {
    background-color: var(--branco-puro);
    color: var(--verde-escuro);
}

/* 2. Ajuste da Largura da Lista de Mensagens */
.inbox-container {
    /* Garante altura fixa para ter rolagem interna */
    height: calc((100vh / 0.88) - 240px); 
    min-height: 500px;
}

.inbox-sidebar {
    width: 320px; /* Largura fixa confortável */
    flex-shrink: 0; /* Impede que a lista seja esmagada */
    background-color: #fcfcfc;
}

/* Item da Lista */
.message-item {
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}
.message-item.active {
    background-color: #e8f5e9; /* Verde bem claro */
    border-left: 4px solid var(--verde-escuro);
}

/* 3. Conteúdo da Mensagem */
.inbox-content {
    padding: 40px; /* Mais espaço para leitura */
    background-color: var(--branco-puro);
}

.message-header h2 {
    margin-top: 0;
    font-size: 1.8rem;
    color: var(--verde-escuro);
    line-height: 1.3;
}

.meta-info {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    font-size: 0.9rem;
    color: #777;
}

.meta-badge {
    background-color: var(--cor-Yelo);
    color: var(--verde-escuro);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.message-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #444;
}

/* Ajuste para Mobile */
@media (max-width: 768px) {
    .main-header { flex-direction: column; align-items: flex-start; }
    .btn-header-action { width: 100%; }
    .inbox-container { height: auto; min-height: auto; }
}
/* ==========================================================================
   AJUSTES FINAIS: PÁGINA MEU PERFIL
   ========================================================================== */

/* 1. Botões de Ação (Alterar/Salvar) */
.form-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end; /* Alinha à direita */
    gap: 15px;
}

/* Força o botão a ter tamanho normal, não 100% */
#perfil-form .btn, 
#password-form .btn {
    width: auto; 
    min-width: 180px; /* Tamanho mínimo elegante */
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 50px; /* Estilo Pílula */
}

/* 2. Botão de Excluir Conta */
#btn-excluir-conta {
    background: transparent;
    border: none;
    color: #d32f2f;
    padding: 0;
    text-decoration: underline;
    font-weight: 600;
    margin-top: 10px;
    display: inline-block;
}
#btn-excluir-conta:hover {
    color: #b71c1c; /* Vermelho mais escuro */
}

/* 3. Ajuste de Espaçamento entre Widgets */
.widget {
    background-color: var(--branco-puro);
    padding: 25px; /* Reduzido de 40px */
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 25px; /* Reduzido de 40px */
}
.widget h3 {
    margin-top: 0;
    margin-bottom: 15px; /* Reduzido de 25px */
    border-bottom: 1px solid #eee;
    padding-bottom: 10px; /* Reduzido de 15px */
    font-size: 1.3rem; /* Reduzido de 1.5rem */
    color: var(--verde-escuro);
}
/* ==========================================================================
   PÁGINA DE EXCLUSÃO DE CONTA (OFFBOARDING)
   ========================================================================== */

/* Grid de Estatísticas */
.exit-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.exit-stat-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s;
}
.exit-stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--verde-escuro);
}

.stat-icon { font-size: 24px; margin-bottom: 10px; }
.stat-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--verde-escuro);
    margin-bottom: 5px;
}
.stat-label { font-size: 13px; color: var(--cinza-texto); line-height: 1.4; }

/* Estrelas de Avaliação (Reutilizando lógica, mas com estilo específico) */
.rating-exit-stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end; /* Alinha à esquerda */
    gap: 10px;
    width: fit-content;
}
.rating-exit-stars input { display: none; }
.rating-exit-stars label {
    font-size: 30px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}
.rating-exit-stars input:checked ~ label,
.rating-exit-stars label:hover,
.rating-exit-stars label:hover ~ label {
    color: #FFC107; /* Amarelo */
}

/* Botão Final de Exclusão */
.btn-perigo-final {
    background-color: #E63946;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-perigo-final:hover {
    background-color: #c9303c;
}

/* --- ESTADO DESABILITADO DO MULTISELECT --- */
.multiselect-tag.disabled {
    opacity: 0.7;
    pointer-events: none; /* Garante que o clique não funciona */
}

.multiselect-tag.disabled .multiselect-display {
    background-color: #e9ecef; /* Cinza padrão de input disabled */
    color: #6c757d;
    cursor: not-allowed;
    border-color: #ced4da;
}

.multiselect-tag.disabled .multiselect-display::after {
    display: none; /* Esconde a setinha quando bloqueado */
}

/* ==========================================================================
   CORREÇÃO VISUAL: ASSINATURA E PAGAMENTOS
   (Cole isso no final do arquivo psi_dashboard.css)
   ========================================================================== */

/* Container Limitador para Desktop (Melhor Leitura) */
.assinatura-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding-bottom: 60px;
}

/* 1. O Banner do Plano Atual (Caixa Branca com Borda Verde) */
#card-resumo-assinatura {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;       /* Borda cinza suave */
    border-left: 6px solid #1B4332;  /* Borda grossa verde na esquerda */
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    
    /* Organização interna (Texto na esquerda, Preço na direita) */
    display: flex; 
    justify-content: space-between;
    align-items: center;
    
    /* Sombra elegante */
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* Responsividade do Banner (Para celular) */
@media (max-width: 768px) {
    #card-resumo-assinatura {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    #card-resumo-assinatura .info-lado-direito {
        align-self: flex-start;
        text-align: left;
    }
    #banner-renovacao {
        text-align: left !important; /* Força alinhamento à esquerda no mobile */
    }
}

/* 2. Área de Cancelamento (Zona de Perigo no rodapé) */
#area-cancelamento {
    margin-top: 60px;
    padding: 30px;
    background-color: #fff5f5; /* Fundo vermelho bem claro */
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
}

#btn-cancelar-assinatura {
    background: none;
    border: none;
    color: #d32f2f; /* Vermelho alerta */
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    transition: color 0.2s;
}

#btn-cancelar-assinatura:hover {
    color: #b71c1c; /* Vermelho mais escuro ao passar o mouse */
}

/* ==========================================================================
   CORREÇÃO FINAL: VISUAL DO CARD DE ASSINATURA
   ========================================================================== */

/* 1. Nome do Plano (Correção de cor e fonte) */
#banner-nome-plano, .nome-plano-banner {
    color: #1B4332 !important;        /* Força Verde Escuro (estava branco invisível) */
    font-family: var(--font-titulos) !important;
    font-size: 2.2rem !important;
    font-weight: 700;
    margin-bottom: 10px;
}

/* 2. Pílula "Ativo" (Estilo Badge Verde Claro) */
.status-badge {
    background-color: #E0F2F1 !important; /* Fundo Verde Menta */
    color: #1B4332 !important;            /* Texto Verde Escuro */
    border: 1px solid #B2DFDB;
    border-radius: 50px !important;       /* Borda bem redonda (Pílula) */
    padding: 6px 16px !important;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto !important;               /* Garante que ajusta ao texto */
}

/* 3. Centralizar Link de Cancelamento */
#area-cancelamento {
    text-align: center !important;
    border: 1px solid #fed7d7;
}

#btn-cancelar-assinatura {
    color: #d32f2f;
    text-decoration: underline;
    font-size: 0.9rem;
    cursor: pointer;
    background: none;
    border: none;
    display: inline-block;                /* Necessário para centralizar corretamente */
}

@keyframes slideInToast {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- ADICIONE ISSO NO FINAL DO ARQUIVO PARA ARRUMAR A COMUNIDADE --- */

/* Loader (Rodinha girando) */
.loader-wrapper { display: flex; justify-content: center; padding: 40px; }
.loader-spinner {
    width: 40px; height: 40px;
    border: 4px solid #f3f3f3; border-top: 4px solid var(--verde-escuro);
    border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Estilos Específicos do Modal da Comunidade (compatível com seu HTML atual) */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: calc(100vh / 0.88);
    background: rgba(0, 0, 0, 0.5);
    display: none; /* Controlado pelo JS */
    justify-content: center; align-items: center;
    z-index: 10000; backdrop-filter: blur(3px);
}
/* Regra para garantir que o JS consiga mostrar o modal */
.modal-overlay[style*="display: flex"] { display: flex !important; }

.modal-content {
    background: #fff; padding: 30px; border-radius: 16px;
    width: 90%; max-width: 600px; position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    max-height: 90vh; /* Garante que o modal nunca seja maior que a tela */
    overflow-y: auto; /* Adiciona barra de rolagem interna automaticamente se necessário */
}
.modal-close {
    position: absolute; top: 15px; right: 20px;
    background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #999;
}
.modal-header h2 { margin-top: 0; font-size: 1.5rem; font-family: var(--font-titulos); color: var(--verde-escuro); }

.modal-body textarea {
    width: 100%; height: 150px; padding: 12px;
    border: 1px solid #ced4da; border-radius: 8px; resize: vertical;
    font-family: var(--font-principal);
}
.char-counter-modal { text-align: right; font-size: 0.8rem; color: #666; margin-top: 5px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
/* INPUT COM PREFIXO (Redes Sociais) */
.input-prefix-group {
    display: flex;
    align-items: center;
    border: 1px solid #ced4da;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.input-prefix-group .prefix {
    background-color: #e9ecef;
    color: #555;
    padding: 11px 15px;
    font-size: 0.9rem;
    font-weight: 500;
    border-right: 1px solid #ced4da;
    white-space: nowrap;
}

.input-prefix-group input {
    border: none !important; /* Remove a borda do input interno */
    border-radius: 0 !important;
    background-color: transparent !important;
    flex-grow: 1;
}

.input-prefix-group input:focus {
    outline: none;
}

/* Foco no grupo inteiro quando o input é focado */
.input-prefix-group:focus-within {
    border-color: var(--verde-escuro);
    box-shadow: 0 0 0 2px rgba(27, 67, 50, 0.1);
}

/* ==========================================================================
   MODERN INBOX (CAIXA DE ENTRADA)
   ========================================================================== */

/* Container Principal */
.inbox-container {
    display: flex;
    height: calc((100vh / 0.88) - 130px); /* Altura otimizada para Desktop App-like */
    min-height: 500px;
    background-color: var(--branco-puro);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border: 1px solid var(--cinza-borda);
    overflow: hidden;
}

/* --- SIDEBAR (Lista de Mensagens) --- */
.inbox-sidebar {
    width: 320px;
    border-right: 1px solid var(--cinza-borda);
    background-color: #fcfcfc;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-search {
    padding: 15px;
    border-bottom: 1px solid var(--cinza-borda);
}

.message-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

.message-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    position: relative;
}

.message-item:hover {
    background-color: #f1f3f5;
}

/* Item Ativo (Selecionado) */
.message-item.active {
    background-color: #fff;
    border-left: 4px solid var(--verde-escuro);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Avatar (Bolinha com iniciais) */
.sender-avatar {
    width: 35px; height: 35px;
    background-color: var(--verde-escuro);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: bold;
    flex-shrink: 0;
}

.message-info {
    flex-grow: 1;
    min-width: 0; /* Garante que o texto corte com ellipsis */
}

.message-top {
    display: flex; justify-content: space-between;
    margin-bottom: 4px;
}

.sender-name { font-weight: 600; font-size: 0.9rem; color: #333; }
.message-time { font-size: 0.75rem; color: #888; }

.message-subject {
    font-size: 0.9rem; color: #333;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 4px;
}

/* Estilo para Não Lido */
.message-item.unread .message-subject { font-weight: 700; }
.message-item.unread .sender-name { color: var(--verde-escuro); }
.message-item.unread::after {
    content: ''; position: absolute; right: 15px; top: 50%;
    width: 8px; height: 8px; background-color: var(--cor-Yelo);
    border-radius: 50%;
}

.message-preview {
    font-size: 0.8rem; color: #888;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}


/* --- CONTEÚDO (Leitura) --- */
.inbox-content {
    flex-grow: 1;
    padding: 0;
    background-color: var(--branco-puro);
    overflow: hidden; /* Scroll movido para o wrapper interno */
    display: flex;
    flex-direction: column;
}

.email-wrapper {
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
}

.email-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    border-bottom: 1px solid var(--cinza-borda);
    padding-bottom: 20px; margin-bottom: 30px;
}

.email-meta { display: flex; gap: 15px; align-items: center; }
.sender-avatar-large {
    width: 48px; height: 48px;
    background-color: var(--verde-escuro); color: white;
    border-radius: 50%; font-size: 1.2rem; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
}

.email-meta-text h2 {
    font-family: var(--font-titulos);
    font-size: 1.5rem; color: var(--verde-escuro);
    margin: 0 0 5px 0;
}
.email-meta-text p { font-size: 0.9rem; color: #666; margin: 0; }

.email-body { font-size: 1rem; line-height: 1.7; color: #444; }
.email-body p { margin-bottom: 15px; }

/* Caixa de Destaque no Email */
.highlight-box {
    background-color: #f0fdf4;
    border-left: 4px solid var(--verde-escuro);
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    font-size: 0.95rem;
}

.btn-link {
    color: var(--verde-escuro);
    font-weight: bold;
    text-decoration: none;
    border-bottom: 2px solid var(--cor-Yelo);
    padding-bottom: 2px;
    transition: all 0.2s;
}
.btn-link:hover { background-color: var(--cor-Yelo); color: var(--verde-escuro); }

/* Botão do Header (Branco/Transparente) */
.btn-outline-light {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-outline-light:hover {
    background: white;
    color: var(--verde-escuro);
}

/* Responsividade */
@media (max-width: 768px) {
    .inbox-container { flex-direction: column; height: auto; }
    .inbox-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #eee; height: 300px; }
    .email-wrapper { padding: 20px; }
    .email-meta { flex-direction: column; align-items: flex-start; }
    .email-header { flex-direction: column; gap: 15px; }
}
/* ==========================================================================
   ESTILOS DA PÁGINA DE EXCLUSÃO (OFFBOARDING) - RECUPERADOS
   ========================================================================== */

/* Estilo do Card Branco (Widget) */
.widget {
    background-color: var(--branco-puro);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.widget h3 {
    margin-top: 0;
    color: var(--verde-escuro);
    font-family: var(--font-titulos);
}

/* Grid de Estatísticas (Os 4 quadrados) */
.exit-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.exit-stat-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s;
}

.exit-stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--verde-escuro);
}

.stat-icon { 
    font-size: 24px; 
    margin-bottom: 10px; 
    display: block; 
}

.stat-value {
    font-family: var(--font-titulos); /* Destaque numérico em New Kansas */
    font-size: 28px;
    font-weight: 700;
    color: var(--verde-escuro);
    margin-bottom: 5px;
    display: block;
}

.stat-label { 
    font-size: 13px; 
    color: #666; 
    line-height: 1.4; 
    display: block;
}

/* Estrelas de Avaliação (Específicas desta página) */
.rating-exit-stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end; /* Alinha à esquerda */
    gap: 5px;
}

.rating-exit-stars input { 
    display: none; 
}

.rating-exit-stars label {
    font-size: 30px;
    color: #e0e0e0;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

/* Efeito de Hover e Seleção (Amarelo) */
.rating-exit-stars input:checked ~ label,
.rating-exit-stars label:hover,
.rating-exit-stars label:hover ~ label {
    color: #FFC107; 
}

/* Botão de Confirmação (Vermelho) */
.btn-perigo-final {
    background-color: #E63946;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-perigo-final:hover {
    background-color: #c9303c;
}

/* Media query for desktop */
@media (min-width: 992px) {
    .exit-stats-grid {
        grid-template-columns: repeat(3, 1fr); /* Start with 3 columns for medium desktops */
        gap: 25px; /* Slightly less gap for 3 columns */
    }

    .exit-stat-card {
        padding: 25px; /* Adjust padding for 3 columns */
    }

    .stat-icon {
        font-size: 28px; /* Adjust icon size */
    }

    .stat-value {
        font-size: 32px; /* Adjust value size */
    }

    .stat-label {
        font-size: 13px; /* Adjust label size */
    }
}

@media (min-width: 1200px) { /* New breakpoint for larger desktops */
    .exit-stats-grid {
        grid-template-columns: repeat(4, 1fr); /* Go to 4 columns for large desktops */
        gap: 30px; /* More space between cards on larger desktop */
    }

    .exit-stat-card {
        padding: 30px; /* More padding for larger cards on larger desktop */
    }

    .stat-icon {
        font-size: 32px; /* Larger icons */
    }

    .stat-value {
        font-size: 36px; /* Larger values */
    }

    .stat-label {
        font-size: 14px; /* Slightly larger labels */
    }
}

/* Media query for desktop */
@media (min-width: 992px) {
    .exit-stats-grid {
        grid-template-columns: repeat(4, 1fr); /* Fixed 4 columns for desktop */
        gap: 30px; /* More space between cards on desktop */
    }

    .exit-stat-card {
        padding: 30px; /* More padding for larger cards on desktop */
    }

    .stat-icon {
        font-size: 32px; /* Larger icons */
    }

    .stat-value {
        font-size: 36px; /* Larger values */
    }

    .stat-label {
        font-size: 14px; /* Slightly larger labels */
    }
}
/* ==========================================================================
   9. FEATURE GATING (BLOQUEIO PREMIUM DE RECURSOS)
   ========================================================================== */

/* Container relativo para posicionar o cadeado por cima */
.premium-feature-container {
    position: relative;
    overflow: visible !important; /* MVP: Liberado - Permite conteúdo fluir */
    height: auto !important;      /* MVP: Liberado - Altura automática */
}

/* O conteúdo que será borrado (Cards de métricas) */
.premium-blur {
    filter: none !important;         /* MVP: Liberado - Remove o desfoque */
    opacity: 1 !important;           /* MVP: Liberado - Opacidade total */
    pointer-events: auto !important; /* MVP: Liberado - Permite cliques */
    user-select: auto !important;    /* MVP: Liberado - Permite seleção */
    transition: all 0.3s ease;
}

/* A camada do cadeado e botão de ação */
.premium-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none !important; /* MVP: Liberado - Esconde o cadeado */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: rgba(255, 255, 255, 0.85); /* Fundo mais sólido para leitura */
    backdrop-filter: blur(8px); /* Efeito de vidro fosco moderno */
    padding: 15px;
    text-align: center;
    border-radius: 12px; /* Segue o arredondamento do card */
}

/* Círculo do Ícone do Cadeado */
.lock-icon-circle {
    width: 40px;
    height: 40px;
    background: var(--cor-Yelo); /* Amarelo para chamar atenção */
    color: var(--verde-escuro);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    box-shadow: 0 5px 15px rgba(255, 238, 140, 0.5); /* Glow amarelo */
    font-size: 1rem;
}

.lock-icon-circle svg {
    width: 18px;
    height: 18px;
}

/* Texto Explicativo (ex: "Veja quem salvou...") */
.premium-text {
    font-family: var(--font-principal);
    font-size: 0.9rem;
    color: var(--verde-escuro);
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
    max-width: 90%;
}

/* Botão "Liberar Acesso" */
.btn-unlock-feature {
    background: var(--verde-escuro);
    border: none;
    color: #fff;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-family: var(--font-principal);
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(27, 67, 50, 0.3);
}

.btn-unlock-feature:hover {
    background: #143d2e;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(27, 67, 50, 0.4);
}

/* ==========================================================================
   11. BADGES DE GAMIFICAÇÃO (SIDEBAR)
   ========================================================================== */

#sidebar-badges-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; /* Tamanho menor para a sidebar */
    height: 28px;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: help; /* Muda o cursor para indicar que tem tooltip */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Borda sutil no fundo escuro */
}
.badge-item:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

/* Cores dos Níveis */
.badge-bronze { background: linear-gradient(135deg, #d9a77a, #cd7f32); color: white; }
.badge-prata { background: linear-gradient(135deg, #e0e0e0, #b0b0b0); color: #424242; }
.badge-ouro {
    background: linear-gradient(135deg, #ffeb3b, #fbc02d);
    color: #424242;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* Badges Especiais (Booleanas) */
.badge-autentico {
    background: #ffffff;
    color: var(--verde-escuro);
}
.badge-pioneiro {
    background: linear-gradient(135deg, #ce93d8, #ab47bc);
    color: white;
}

.badge-icon { font-size: 16px; line-height: 1; }

/* ==========================================================================
   12. BADGES DE AUTOR (FÓRUM)
   ========================================================================== */

.author-badges, .author-badges-full {
    display: inline-flex;
    gap: 4px;
    vertical-align: middle;
    margin-left: 6px; /* Espaço após o nome do autor */
}
.author-badge-icon {
    font-size: 14px;
    line-height: 1;
    cursor: default;
}
.author-badges-full .author-badge-icon {
    font-size: 16px;
}

/* Badge de Nível de Autoridade (Texto) */
.author-level-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: #555;
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
}

/* ==========================================================================
   14. INPUT DE COMENTÁRIO (CÁPSULA AUTO-RESIZE)
   ========================================================================== */

.comment-input-capsule {
    width: 100%;
    padding: 12px 20px;
    border-radius: 24px; /* Formato de cápsula */
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    font-size: 0.95rem;
    font-family: var(--font-principal);
    line-height: 1.4;
    resize: none; /* Desabilita o redimensionamento manual */
    overflow-y: hidden; /* Esconde a barra de rolagem até ser necessário */
    min-height: 48px; /* Altura inicial fina */
    box-sizing: border-box;
    transition: height 0.15s ease-out;
}
.comment-input-capsule:focus {
    outline: none;
    border-color: var(--verde-escuro);
    box-shadow: 0 0 0 2px rgba(27, 67, 50, 0.1);
}

/* ==========================================================================
   15. WIDGET DE SUGESTÕES DE TEMAS (BLOG)
   ========================================================================== */

.sugestoes-temas-widget {
    background: #fffbeb; /* Amarelo bem claro */
    border: 1px solid #fde68a; /* Borda amarela */
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 40px;
}

.sugestoes-temas-widget h3 {
    margin-top: 0;
    color: #b45309; /* Laranja escuro */
    font-family: var(--font-titulos);
}

.sugestoes-temas-widget p {
    color: #92400e; /* Laranja mais escuro */
    font-size: 0.95rem;
    margin-top: 5px;
    margin-bottom: 0;
}

.sugestoes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.sugestao-item {
    background: rgba(255, 255, 255, 0.6);
    padding: 15px;
    border-radius: 10px;
    font-weight: 600;
    color: #92400e;
    border: 1px solid #fde68a;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sugestao-item:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-color: #f59e0b;
}

/* Skeleton loader for suggestions */
.sugestao-item-skeleton {
    background-color: #fef3c7;
    border-radius: 10px;
    height: 54px; /* Mesma altura do item preenchido */
    animation: pulse 1.5s infinite ease-in-out;
}

/* ==========================================================================
   13. GAMIFICATION (JORNADA & VISÃO GERAL)
   ========================================================================== */

.gamification-panel {
    background: #f9fafb;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    font-family: 'Mulish', sans-serif;
}

/* Aviso de Prioridade na Jornada */
.gamification-panel::after {
    content: "💡 Quanto mais alta a pontuação, maior a prioridade no momento do match.";
    display: block;
    margin-top: 20px;
    padding: 12px;
    background-color: #fffbeb;
    color: #b45309;
    font-size: 0.9rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #fde68a;
    font-weight: 600;
}

.gamification-panel-overview {
    background: var(--branco-puro);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    font-family: 'Mulish', sans-serif;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
}

.gami-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.gami-title { font-size: 1.2rem; font-weight: 700; color: #1f2937; margin: 0; }
.gami-level-badge {
    background: #e8f5e9;
    color: #1B4332;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Barra de Progresso de XP */
.xp-bar-wrapper {
    width: 100%; 
    background-color: #e5e7eb; 
    border-radius: 12px;
    height: 16px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.gamification-panel-overview .xp-bar-wrapper {
    cursor: pointer;
}

.xp-bar-fill {
    height: 100%; 
    width: 0%; 
    border-radius: 12px; 
    transition: width 1s cubic-bezier(0.25, 1, 0.5, 1);
    background-color: #1B4332;
    background-image: repeating-linear-gradient( -45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.15) 10px, rgba(255, 255, 255, 0.15) 20px );
    background-size: 28.28px 28.28px;
    animation: xp-bar-stripes 1s linear infinite;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.4), 0 0 4px rgba(255,255,255,0.3) inset;
}
.xp-labels {
    display: flex; justify-content: space-between; font-size: 0.8rem; color: #6b7280;
    margin-top: 8px; font-weight: 600;
}

/* Grid de Badges (Página Jornada) */
.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.badge-card { background: #ffffff; border-radius: 12px; padding: 20px; border: 1px solid #e5e7eb; transition: all 0.2s; cursor: help; }
.badge-card.locked { opacity: 0.6; background-color: #f9fafb; }
.badge-header { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.badge-icon-img { font-size: 2.2rem; line-height: 1; }
.badge-info { flex-grow: 1; }
.badge-name { font-size: 1rem; font-weight: 700; color: #1f2937; display: block; }
.badge-status { font-size: 0.8rem; color: #6b7280; font-weight: 600; }
.badge-progress-container { margin-top: 10px; }
.badge-progress-bar-wrapper { height: 6px; background-color: #e5e7eb; border-radius: 6px; overflow: hidden; }
.badge-progress-bar { height: 100%; width: 0%; border-radius: 6px; transition: width 0.5s ease-out; }
.badge-progress-text { font-size: 0.75rem; color: #6b7280; margin-top: 5px; text-align: right; }
.badge-bronze .badge-progress-bar { background-color: #cd7f32; }
.badge-prata .badge-progress-bar { background-color: #c0c0c0; }
.badge-ouro .badge-progress-bar { background-color: #ffd700; }
.badge-card.unlocked.bronze { border-left: 4px solid #cd7f32; }
.badge-card.unlocked.prata { border-left: 4px solid #c0c0c0; }
.badge-card.unlocked.ouro { border-left: 4px solid #ffd700; }
.badge-card.unlocked.unico { border-left: 4px solid #1B4332; }

@keyframes xp-bar-stripes {
    from { background-position: 28.28px 0; }
    to { background-position: 0 0; }
}

/* --- CORREÇÃO: FONTE DO PREÇO NO BANNER DE ASSINATURA --- */
#banner-preco {
    font-family: var(--font-titulos) !important;
    font-weight: 500; /* Ajuste fino para a fonte não ficar pesada demais */
    letter-spacing: 0.5px;
}

/* ==========================================================================
   16. MOBILE TOOLTIP (PARA BADGES)
   ========================================================================== */

.mobile-badge-tooltip {
    position: fixed;
    background-color: #1f2937; /* Cinza escuro, quase preto */
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    max-width: 250px;
    z-index: 10001; /* Acima de tudo */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: fadeIn 0.15s ease-out;
    pointer-events: none; /* Para não interferir com outros cliques */
    text-align: center;
}

/* Setinha do tooltip */
.mobile-badge-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0; 
    height: 0; 
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
}

.mobile-badge-tooltip.bottom::after {
    top: -6px; /* Aponta para cima */
    border-bottom: 6px solid #1f2937;
}

.mobile-badge-tooltip.top::after {
    bottom: -6px; /* Aponta para baixo */
    border-top: 6px solid #1f2937;
}
/* ==========================================================================
   CSS EXTRA: LAYOUT DO PERFIL PÚBLICO (Recuperação)
   Cole isso no final do arquivo css/psi_dashboard.css
   ========================================================================== */

/* 1. Container Principal do Perfil */
.profile-page-main {
    padding: 40px 0 80px 0;
    background-color: transparent;
    min-height: calc(80vh / 0.88);
    width: 100% !important;
    max-width: 100% !important;
}

.profile-page-main .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}
.profile-page-main.container,
.profile-page-main .container,
.profile-page-wrapper {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
    text-align: left !important;
}

/* 2. O GRID (Divide: Esquerda=Bio/Foto | Direita=Preço) */
.profile-header-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 2 partes para Bio, 1 parte para Preço */
    gap: 40px;
    align-items: start;
    margin-bottom: 40px;
}

/* 3. Coluna da Esquerda (Foto e Bio) */
.profile-info {
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border: 1px solid #e9ecef;
    text-align: center; /* Centraliza foto e nome inicialmente */
}

/* Foto Redonda Grande */
.profile-photo-wrapper {
    width: 180px;
    height: 180px;
    margin: 0 auto 20px auto;
    border-radius: 50%;
    padding: 5px;
    border: 2px dashed var(--verde-escuro); /* Charme visual */
}

.profile-photo-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Títulos e Textos */
.profile-info h1 {
    font-family: var(--font-titulos);
    font-size: 2.2rem;
    color: var(--verde-escuro);
    margin: 10px 0 5px 0;
}

.profile-info .crp {
    color: #666;
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 20px;
    display: inline-block;
    background: #f0fdf4;
    padding: 5px 15px;
    border-radius: 20px;
    color: var(--verde-escuro);
}

/* Texto da Bio (Alinhado à esquerda para leitura) */
.profile-bio-hero {
    margin-top: 30px;
    text-align: justify;
    text-justify: inter-word;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

#psi-bio-text {
    text-align: justify;
    text-justify: inter-word;
}

/* 4. Coluna da Direita (Card de Valor/Preço) */
.conversion-card-wrapper {
    position: sticky; /* Faz o card acompanhar a rolagem */
    top: 20px;
}

.conversion-card {
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(27, 67, 50, 0.08); /* Sombra mais forte p/ destaque */
    border: 1px solid #e9ecef;
    text-align: center;
}

.conversion-card h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 5px;
    font-family: var(--font-principal);
}

.conversion-card .price {
    font-family: var(--font-titulos);
    font-size: 2.5rem;
    color: var(--verde-escuro);
    font-weight: 700;
    margin: 5px 0 20px 0;
}

/* Botão Agendar (WhatsApp) */
#btn-agendar-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--verde-escuro) !important; /* Era verde zap, agora é Yelo */
    color: white;
    width: 100%;
    padding: 15px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.1rem;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-sizing: border-box; /* Garante que padding não estoure */
}

#btn-agendar-whatsapp:hover {
    transform: translateY(-3px);
    background-color: #143d2e !important; /* Um pouco mais escuro no hover */
    box-shadow: 0 5px 15px rgba(27, 67, 50, 0.3);
}

damente a/* Estado: Bloqueado (Trial Excedido) */
#btn-agendar-whatsapp.bloqueado {
    background-color: #e0e0e0 !important;
    color: #888 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
}

/* 5. Abas (Detalhes e Avaliações) */
.profile-body-tabs {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border: 1px solid #e9ecef;
    overflow: hidden;
    margin-top: 20px;
}

.tabs-nav {
    display: flex;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.tab-link {
    flex: 1;
    padding: 20px;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-link:hover { background: #eee; }

.tab-link.active {
    color: var(--verde-escuro);
    border-bottom-color: var(--verde-escuro);
    background: #fff;
}

.tab-content {
    display: none;
    padding: 40px;
}
.tab-content.active { display: block; animation: fadeIn 0.3s; }

/* 6. Tags de Especialidade (Pílulas) */
.practices-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.practice-tag {
    background-color: var(--cor-Yelo); /* Amarelo */
    color: var(--verde-escuro);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* 7. Responsividade Mobile */
@media (max-width: 768px) {
    .profile-header-grid {
        grid-template-columns: 1fr; /* Vira uma coluna só */
        gap: 20px;
    }
    
    .profile-info { padding: 25px; }
    
    .conversion-card-wrapper {
        position: static; /* Remove sticky no mobile */
        order: -1; /* Joga o preço para cima (opcional) ou deixe normal */
    }
}

/* ==========================================================================
   ATUALIZAÇÕES DO PERFIL PÚBLICO (New Kansas + Estrelas)
   ========================================================================== */

/* 1. Tipografia das Abas (New Kansas) */
.tab-link {
    font-family: var(--font-titulos) !important; /* Força a fonte */
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* 2. Título "Sobre Mim" */
.titulo-bio {
    font-family: var(--font-titulos);
    color: var(--verde-escuro);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    text-align: center;
    font-size: 1.4rem;
}

/* 3. Redes Sociais (Botões Redondos) */
.social-links-profile {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.icon-social {
    width: 44px; /* Pouquinho maior para o SVG caber bem */
    height: 44px;
    background-color: #f0fdf4;
    color: var(--verde-escuro);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s;
    /* Removemos bordas antigas para ficar mais limpo */
}
.icon-social svg {
    width: 20px;
    height: 20px;
    fill: currentColor; /* Pega a cor do texto (verde ou branco no hover) */
}

.icon-social:hover {
    background-color: var(--verde-escuro);
    color: #fff;
    transform: translateY(-3px);
}

/* 4. Estrelas no Topo (Abaixo do CRP) */
.hero-stars-container {
    color: #FFC107; /* Amarelo ouro */
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}
.hero-rating-text {
    color: #666;
    font-size: 0.85rem;
    font-weight: normal;
    font-family: var(--font-principal);
}

/* 5. Formulário de Avaliação (Input de Estrelas) */
.review-form-box {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.review-form-box h4 { margin-top: 0; font-family: var(--font-titulos); }

.review-form-box textarea {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    font-family: var(--font-principal);
    margin-top: 10px;
}

/* Sistema de Estrelas Interativo (CSS Only) */
.star-rating-input {
    display: flex;
    flex-direction: row-reverse; /* Inverte para o hover funcionar da esq p/ dir visualmente */
    justify-content: center; /* Centraliza as estrelas */
    gap: 8px; /* Mais espaço entre elas */
    
}

.star-rating-input input { display: none; }

.star-rating-input label {
    font-size: 2.8rem; /* Estrelas bem maiores e fáceis de tocar */
    color: #e4e5e9; /* Cinza mais suave e elegante */
    cursor: pointer;
    transition: color 0.2s;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Efeito elástico (bouncy) */
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Sombra base sutil */
    
}

/* Hover e Checked: Pinta as estrelas de amarelo */
.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
    color: #FFC107;
    transform: scale(1.15); /* As estrelas pulam ao serem focadas */
    text-shadow: 0 4px 15px rgba(255, 193, 7, 0.35); /* Brilho amarelo espalhado */
}

/* --- TAG DE OFERTA (Topo do Card) --- */
.tag-oferta-topo {
    position: absolute;
    top: -16px; /* Centraliza exatamente na linha da borda superior */
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); /* Gradiente Vermelho */
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
    white-space: nowrap;
    z-index: 5;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- PREÇO COM DESCONTO (Estilo Novo) --- */
.preco-desconto {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
}

.preco-antigo {
    font-size: 1.2rem;
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
}

.preco-novo {
    font-family: var(--font-titulos);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--verde-escuro);
    white-space: nowrap;
}

.preco-desconto span:last-of-type {
    font-size: 1rem;
    color: #888;
}

/* --- ESTILOS MODERNOS DO PERFIL (psi_meu_perfil.html) --- */

.profile-section {
    margin-bottom: 25px; /* Reduzido de 40px */
    padding-bottom: 15px; /* Reduzido de 20px */
    border-bottom: 1px dashed #e0e0e0;
}

.profile-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Limite visual para o campo de valor (3 dígitos) */
#valor_sessao_numero {
    max-width: 150px;
}

.section-title {
    font-family: var(--font-principal);
    font-size: 0.95rem; /* Reduzido de 1rem */
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--verde-escuro);
    margin-bottom: 15px; /* Reduzido de 20px */
    font-weight: 700;
    opacity: 0.8;
}

.form-row {
    display: flex;
    gap: 15px; /* Reduzido de 20px */
    flex-wrap: wrap;
    margin-bottom: 15px; /* Reduzido de 20px */
}

/* Remove margem interna para que o gap do .form-row controle tudo perfeitamente */
.form-row .form-group {
    margin-bottom: 0;
    flex: 1; /* Força os campos a dividirem a linha (ex: Nome/Email/Whatsapp lado a lado) */
    min-width: 200px; /* Se a tela for pequena, eles quebram para a linha de baixo */
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px; /* Reduzido de 20px */
}

.highlight-box {
    background-color: #f0fdf4; /* Verde bem claro */
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
}

/* --- INDICADOR DE MODO DE FORMULÁRIO (Visualização / Edição) --- */
.mode-indicator-view, .mode-indicator-edit {
    font-size: 0.85rem;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.mode-indicator-view {
    background: #f0f2f5;
    color: #555;
}
.mode-indicator-edit {
    background: #fffbeb; /* Amarelo claro */
    color: #b45309; /* Laranja escuro */
}
.mode-indicator-edit #form-mode-icon { color: #f59e0b; }

/* --- ANIMAÇÃO DE CARREGAMENTO (SKELETON/SHIMMER) --- */

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* A classe que transforma o texto em uma barra cinza */
.skeleton-text {
    color: transparent !important; /* Esconde o texto original */
    background-color: #e9ecef; /* Cor do placeholder (cinza claro) */
    border-radius: 4px;
    user-select: none;
    cursor: progress;
    min-height: 1em; /* Garante que o elemento tenha alguma altura mesmo se estiver vazio */
}

/* A classe que ativa a animação no card */
.is-loading {
    position: relative;
    overflow: hidden;
}

/* O pseudo-elemento que cria o brilho deslizante */
.is-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.5s infinite;
}
.mode-indicator-edit #form-mode-icon { color: #f59e0b; }
}

/* Animação para o FAB */
@keyframes pulse-fab {
    0% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 30px rgba(255, 238, 140, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    }
}

/* ==========================================================================
   10. FÓRUM DA COMUNIDADE
   ========================================================================== */

/* Botão Flutuante (FAB) */
#forum-fab {
    display: none !important; /* Oculto: Substituído pelo input moderno */
}

/* --- MODERN CREATE POST PROMPT (FÓRUM) --- */
.modern-create-prompt {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #fff;
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    margin-bottom: 25px;
    cursor: text;
    transition: all 0.2s ease;
}

.modern-create-prompt:hover {
    border-color: var(--verde-escuro);
    box-shadow: 0 4px 15px rgba(27, 67, 50, 0.08);
}

.prompt-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--cinza-fundo);
}

.prompt-fake-input {
    flex-grow: 1;
    color: #888;
    font-size: 1rem;
    background: #f8f9fa;
    padding: 12px 20px;
    border-radius: 25px;
    transition: background 0.2s, color 0.2s;
    user-select: none;
}

.modern-create-prompt:hover .prompt-fake-input {
    background: #f0fdf4;
    color: var(--verde-escuro);
}

.prompt-btn {
    background-color: var(--verde-escuro);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-family: var(--font-principal);
    cursor: pointer;
    transition: transform 0.2s;
}

.modern-create-prompt:hover .prompt-btn {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .modern-create-prompt {
        padding: 12px 15px;
        gap: 10px;
    }
    .prompt-avatar {
        width: 35px;
        height: 35px;
    }
    .prompt-fake-input {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
    .prompt-btn {
        display: none; /* Esconde o botão no mobile para dar mais espaço ao texto */
    }
}

/* Abas de Filtro do Fórum */
.forum-tabs .tab-item {
    cursor: pointer;
    padding: 5px 10px;
    border-bottom: 2px solid transparent;
    color: #666;
    font-weight: 500;
    transition: all 0.2s;
}
.forum-tabs .tab-item:hover {
    color: var(--verde-escuro);
}
.forum-tabs .tab-item.active {
    color: var(--verde-escuro);
    font-weight: 700;
    border-bottom-color: var(--verde-escuro);
}

/* Card de Post no Feed */
/* --- ESTÉTICA REDDIT (APP-LIKE) --- */
.reddit-style-card {
    background: #fff;
    border: 1px solid #edeff1;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: border-color 0.2s;
    display: flex;
    flex-direction: column;
}
.reddit-style-card:hover {
    border-color: #878a8c;
}

.reddit-card-header {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.85rem; color: #787c7e; margin-bottom: 8px;
    flex-wrap: wrap;
}
.post-author-avatar {
    width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
}
.post-category { font-weight: 700; color: var(--verde-escuro); }
.post-author { font-weight: 500; color: #1c1c1c; }
.meta-separator { color: #ccc; font-size: 0.7rem; }

.reddit-card-body .post-title {
    font-size: 1.15rem; font-weight: 700; color: #1c1c1c; margin: 0 0 6px 0;
    word-break: break-word;
}
.reddit-card-body .post-snippet {
    font-size: 0.95rem; color: #4a4a4a; margin: 0; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    word-break: break-word;
}

.reddit-card-footer {
    display: flex; justify-content: space-between; align-items: center; margin-top: 12px;
}

.reddit-action-bar { display: flex; gap: 8px; }
.reddit-pill {
    display: inline-flex; align-items: center; gap: 6px;
    background-color: #f1f3f5; color: #495057;
    padding: 6px 12px; border-radius: 20px;
    font-weight: 600; font-size: 0.85rem;
    border: none; cursor: pointer; transition: background 0.2s;
}
.reddit-pill:hover { background-color: #e2e6ea; }
.reddit-pill svg { width: 16px; height: 16px; }

.support-btn.supported.reddit-pill {
    color: var(--coral-quente); background-color: #fff5f5;
}
.support-btn.supported.reddit-pill svg {
    fill: var(--coral-quente); stroke: var(--coral-quente);
}

.post-actions-right { display: flex; gap: 4px; align-items: center; }
.icon-btn-small {
    background: transparent; border: none; padding: 6px; border-radius: 50%;
    color: #878a8c; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.icon-btn-small:hover { background: #f1f3f5; color: #1c1c1c; }

/* View de Post Completo (App Header) */
.reddit-app-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid #edeff1;
    position: sticky; top: 0; background: var(--cinza-fundo); z-index: 100;
}
.app-back-btn {
    background: none; border: none; color: #1c1c1c; cursor: pointer;
    display: flex; align-items: center; justify-content: center; padding: 5px;
}
.app-header-title { font-weight: 700; font-size: 1.1rem; color: #1c1c1c; }

/* View de Post Completo */
/* Seção de Comentários */
.reddit-comment {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 15px;
}
.comment-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.comment-avatar { width: 28px !important; height: 28px !important; border-radius: 50%; }
.comment-author-line { font-size: 0.9rem; font-weight: 600; color: #1c1c1c; }
.comment-time { font-size: 0.8rem; color: #787c7e; }

.comment-body-wrapper {
    margin-left: 36px; /* Alinha com o texto, deixando avatar para trás */
}
.comment-body {
    margin: 0 !important; font-size: 0.95rem; color: #1c1c1c; line-height: 1.5; word-break: break-word;
}
.comment-actions {
    display: flex; gap: 8px; margin-top: 6px; align-items: center;
}

/* Disclaimer Box for Case Discussions */
.forum-disclaimer-box {
    background-color: #fffbeb; /* Amarelo bem claro */
    border-left: 4px solid #f59e0b; /* Borda amarela/laranja */
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #92400e; /* Laranja escuro para o texto */
    line-height: 1.5;
    transition: all 0.3s ease;
}
.forum-disclaimer-box.hidden {
    display: none;
}

/* Layout da página de post com sidebar */
.forum-post-layout {
    display: grid;
    grid-template-columns: 1fr 320px; /* Conteúdo principal e sidebar */
    gap: 40px;
    align-items: flex-start;
}

.forum-post-sidebar .widget {
    position: sticky;
    top: 20px; /* Fica fixo ao rolar a página */
}

/* Itens na sidebar de relacionados */
.related-post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}
.related-post-item:last-child { border-bottom: none; }
.related-post-item:hover .related-post-title { color: var(--verde-escuro); }

.related-post-category { font-size: 0.75rem; font-weight: 700; color: var(--verde-escuro); display: block; margin-bottom: 5px; }
.related-post-title { font-size: 0.95rem; font-weight: 600; color: #333; margin: 0; line-height: 1.4; transition: color 0.2s; }
.related-post-meta { text-align: right; flex-shrink: 0; margin-left: 15px; font-size: 0.8rem; color: #666; }
.related-post-meta span { display: block; }

/* Responsividade */
@media (max-width: 992px) {
    .forum-post-layout { grid-template-columns: 1fr; } /* Empilha as colunas */
    .forum-post-sidebar .widget { position: static; } /* Remove o sticky */
}

/* Caixa de Diretrizes do Fórum */
.forum-guidelines-box {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background-color: #f0fdf4; /* Verde bem claro */
    border: 1px solid #bbf7d0;
    border-left: 5px solid var(--verde-escuro);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}
.guidelines-icon {
    font-size: 2rem;
}
.guidelines-content strong {
    color: var(--verde-escuro);
    font-family: var(--font-titulos);
}

/* Controles do Fórum (Busca e Abas) */
.forum-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.forum-search-bar {
    flex-grow: 1;
    max-width: 400px;
    position: relative;
}

#forum-search-input {
    width: 100%;
    padding: 10px 15px 10px 40px; /* Espaço para o ícone */
    border-radius: 25px; /* Formato pílula */
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    font-size: 0.95rem;
}
.forum-search-bar::before {
    content: '🔍';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* --- TomSelect do Modal do Fórum --- */
#forum-create-modal .ts-wrapper { padding: 0 !important; border: none !important; background: transparent !important; box-shadow: none !important; min-height: auto !important; }
#forum-create-modal .ts-control {
    width: 100% !important;
    padding: 10px 14px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 10px !important;
    font-size: 0.95rem !important;
    background-color: #f9fafb !important;
    font-family: var(--font-principal) !important;
    color: #333 !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
    display: flex; align-items: center;
}
#forum-create-modal .ts-wrapper.focus .ts-control {
    border-color: var(--verde-escuro) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.1) !important;
}
#forum-create-modal .ts-control::after {
    content: '▼'; font-size: 0.7rem; position: absolute; right: 15px; color: #333; pointer-events: none; transition: transform 0.3s;
}
#forum-create-modal .ts-wrapper.dropdown-active .ts-control::after { transform: rotate(180deg); }

/* Menu de Opções aberto do TomSelect (Fórum) */
.ts-dropdown.custom-ts-dropdown {
    position: absolute;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-top: 5px;
    z-index: 10005; /* Acima do modal */
    overflow: hidden;
    font-family: var(--font-principal);
}
.ts-dropdown.custom-ts-dropdown .ts-dropdown-content {
    max-height: 250px;
    overflow-y: auto;
    padding: 8px;
}
.ts-dropdown.custom-ts-dropdown .option {
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 8px;
    color: #4b5563;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 2px;
}
.ts-dropdown.custom-ts-dropdown .option:hover,
.ts-dropdown.custom-ts-dropdown .option.active {
    background-color: #f0fdf4; /* Verde claro Yelo */
    color: var(--verde-escuro);
}
.ts-dropdown.custom-ts-dropdown .option.selected {
    background-color: var(--verde-escuro);
    color: #ffffff;
}

/* ==========================================================================
   CORREÇÕES MOBILE ESPECÍFICAS DO FÓRUM
   ========================================================================== */
@media (max-width: 768px) {
    .welcome-header,
    .main-header {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    /* Garante que a sidebar do post ocupe a largura total no mobile */
    .forum-post-sidebar {
        width: 100%;
    }

    /* 2. Ajuste da View de Post Completo (Evita "dança" lateral) */
    .forum-post-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
        max-width: 100%; /* Impede vazamento do grid */
    }

    /* Garante que o conteúdo principal do post não estoure */
    .forum-post-main {
        min-width: 0;
        width: 100%;
    }

    .forum-post-main .widget {
        padding: 20px; /* Reduz padding interno */
    }

    .full-post-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Garante que os ícones de comentário não quebrem linha no mobile */
    .comment-actions {
        flex-wrap: nowrap;
    }

    /* Ajuste do cabeçalho do post no mobile: Remove categoria e evita quebra no autor */
    .category-wrapper {
        display: none;
    }
    .author-wrapper {
        white-space: nowrap;
    }
}
/* ==========================================================================
   AJUSTE MOBILE: CHAT DIRETO (TIPO WHATSAPP)
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Esconde totalmente a lista de contatos (Sidebar do Chat) */
    .chat-list-panel, 
    .inbox-sidebar {
        display: none !important;
    }

    /* 2. O Painel de Chat vira uma camada fixa sobre tudo (App Mode) */
    .chat-view-panel {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: calc(var(--mobile-bottom-h, 80px) + 20px) !important; /* Respiro dinâmico para o chat não colar no menu */
        width: auto !important;
        height: auto !important;
        z-index: 99990; /* Alto, mas abaixo da Sidebar (100000) */
        background-color: #efe7dd;
        display: flex !important;
        flex-direction: column;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        overflow: hidden !important; /* Impede rolagem da página inteira */
        
        /* CORREÇÃO: Garante visibilidade imediata */
        transform: none !important;
        visibility: visible !important;
    }

    /* 3. Garante que a tela de "Bem-vindo" suma e o Chat apareça */
    #chat-welcome-screen {
        display: none !important;
    }

    .active-chat-wrapper, #active-chat-screen {
        display: flex !important;
        flex-direction: column;
        height: 100%;
        width: 100%;
        overflow: hidden; /* Impede rolagem externa */
    }

    /* 4. Ajustes do Header do Chat no Mobile */
    .chat-panel-header {
        flex: 0 0 auto; /* Altura fixa, não encolhe */
        background-color: #ffffff; /* Fundo Claro */
        color: #1B4332; /* Texto Verde */
        padding: 10px 15px;
        padding-top: max(10px, env(safe-area-inset-top)); /* Respeita o notch do iPhone */
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        border-bottom: 1px solid #f0f0f0;
        display: flex;
        align-items: center;
    }
    /* Ajuste da Foto no Mobile para alinhar com botão */
    .chat-panel-header .avatar {
        width: 36px !important; /* Mesmo tamanho visual do botão */
        height: 36px !important;
        margin-left: 15px; /* Distancia um pouco do botão voltar */
        margin-right: 10px;
    }
    .chat-panel-header h4 { color: #1B4332; margin: 0; font-size: 1rem; }
    .chat-panel-header span { color: #666; font-size: 0.8rem; }
    
    /* Botões do Header (Apenas Voltar) */
    #btn-voltar-mobile {
        display: flex !important;
        margin-right: 10px;
        color: #1B4332; /* Ícones Verdes */
        background: none;
        border: none;
        padding: 5px;
        cursor: pointer;
    }

    /* 5. Área de Mensagens */
    .messages-thread {
        flex: 1 1 auto; /* Ocupa todo o espaço restante */
        overflow-y: auto; /* ÚNICA área que rola */
        min-height: 0; /* Crítico para o flexbox funcionar no scroll */
        background-color: #e5ddd5; /* Cor clássica de fundo de chat */
        padding-bottom: 10px;
        overscroll-behavior: contain; /* Evita que o scroll afete a página pai */
    }

    /* 6. Barra de Input (Limpa, sem anexos) */
    .message-input-bar {
        flex: 0 0 auto; /* Altura fixa */
        position: relative; /* Flexbox já posiciona no fundo */
        padding: 10px;
        padding-bottom: max(10px, env(safe-area-inset-bottom)); /* Respeita a barra home do iPhone */
        background: #f0f0f0;
        gap: 8px;
        z-index: 100;
    }

    #psi-reply-input {
        background: #ffffff;
        border-radius: 20px;
        padding: 10px 15px;
        height: 40px; /* Altura fixa confortável */
        box-sizing: border-box;
        font-size: 16px !important; /* CRÍTICO: Impede zoom automático no iOS */
    }

    .btn-send {
        width: 40px; height: 40px;
        background-color: #1B4332;
        flex-shrink: 0; /* Impede que o botão amasse */
    }
}
/* ==========================================================================
   17. NESTED THREADING (REDDIT STYLE) & MOBILE INPUT
   ========================================================================== */

/* Linha Guia (Thread Line) */
.comment-replies-container {
    margin-left: 14px !important; /* Metade do avatar */
    padding-left: 20px !important; 
    border-left: 2px solid #edeff1 !important; 
    display: flex;
    flex-direction: column;
    margin-top: 10px !important;
}

/* Hover na linha guia para destaque visual */
.comment-replies-container:hover {
    border-left-color: var(--verde-escuro) !important;
}

/* Ajuste de espaçamento interno do conteúdo do comentário */
.comment-header, .comment-body, .comment-actions {
    margin-bottom: 6px;
}

/* Ajuste Mobile-First (Crítico) */
@media (max-width: 768px) {
    /* Hierarquia compacta no mobile */
    .comment-replies-container {
        margin-left: 8px !important; /* Mínimo possível */
        padding-left: 8px !important;
        border-left-width: 2px;
    }
}

/* ==========================================================================
   18. THREAD INTERATIVA (COLAPSAR)
   ========================================================================== */

.comment-replies-container.thread-line-interactive {
    position: relative;
}
/* Pseudo-elemento para aumentar a área de clique da linha */
.comment-replies-container.thread-line-interactive::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 15px; cursor: pointer; z-index: 5;
}
.comment-replies-container.thread-line-interactive:hover {
    border-left-color: #1B4332; /* Verde destaque ao passar o mouse */
}

/* Estilo padrão para o formulário de resposta inline */
#reply-form-dynamic {
    margin-top: 15px;
    margin-bottom: 15px;
}

/* ==========================================================================
   BLOQUEIO DE CONTA (PAGAMENTO PENDENTE / PERFIL INATIVO)
   ========================================================================== */

/* Aplique a classe .blocked-view no container .dashboard-main quando o usuário não pagar */
.dashboard-main.blocked-view {
    position: relative;
    overflow: hidden !important; /* Impede rolagem do conteúdo borrado */
}

/* Borra todo o conteúdo exceto o overlay */
.dashboard-main.blocked-view > *:not(.dashboard-lock-overlay) {
    filter: blur(8px);
    pointer-events: none;
    opacity: 0.4;
    user-select: none;
}

/* O Overlay que fica por cima de tudo */
.dashboard-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000; /* Acima do conteúdo borrado */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.4); /* Fundo semi-transparente */
    backdrop-filter: blur(2px); /* Blur extra no overlay */
}

/* O Card de Aviso */
.lock-message-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    text-align: center;
    max-width: 450px;
    width: 90%;
    border: 1px solid rgba(0,0,0,0.05);
    animation: slideUpFade 0.4s ease-out;
}

.lock-icon-large {
    width: 70px;
    height: 70px;
    background-color: #fffbeb; /* Amarelo claro */
    color: #f59e0b; /* Laranja/Amarelo */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px auto;
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.15);
}

.lock-message-card h2 {
    font-family: var(--font-titulos);
    color: var(--verde-escuro);
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.lock-message-card p {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   GESTÃO DE PACIENTES E AGENDA
   ========================================================================== */

.patient-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px; /* Reduzido para caber mais na tela */
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 20px; /* Mais orgânico */
    margin-bottom: 10px; /* Reduzido */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.patient-card:hover {
    transform: translateY(-3px);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.patient-avatar {
    width: 42px; /* Levemente menor */
    height: 42px;
    background-color: #f0fdf4; /* Verde bem claro e suave */
    color: var(--verde-escuro);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.patient-info { flex-grow: 1; min-width: 0; /* Permite truncar texto (ellipsis) se necessário */ }
.patient-info h4 { margin: 0; font-size: 0.95rem; color: #333; }
.patient-info span { font-size: 0.8rem; color: #888; }

.patient-status { font-size: 1.2rem; cursor: help; }

.btn-icon-sm {
    background: none; border: none; cursor: pointer; font-size: 1rem; padding: 5px; opacity: 0.6; transition: opacity 0.2s;
}
.btn-icon-sm:hover { opacity: 1; }

.empty-state-patients {
    text-align: center; padding: 30px; color: #999; font-style: italic; background: #f9f9f9; border-radius: 8px;
}

/* OVERRIDES FULLCALENDAR (Yelo Theme) */
.fc-button-primary {
    background-color: var(--verde-escuro) !important;
    border-color: var(--verde-escuro) !important;
}
.fc-button-primary:hover { background-color: #143d2e !important; }
.fc-button-active { background-color: #0d2e21 !important; }
.fc-daygrid-day.fc-day-today { background-color: #f0fdf4 !important; } /* Dia atual verde claro */
.fc-event { border: none; border-radius: 4px; padding: 2px; font-size: 0.85rem; }

/* ==========================================================================
   NOVOS ESTILOS: GESTÃO FINANCEIRA E ABAS
   ========================================================================== */

/* Navegação por Abas Simples */
.tabs-nav-simple {
    display: flex;
    gap: 25px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 25px;
}
.tab-btn-simple {
    background: none;
    border: none;
    padding: 12px 5px;
    font-size: 1rem;
    color: #888;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    transition: all 0.2s;
    font-family: var(--font-titulos);
}
.tab-btn-simple:hover { color: var(--verde-escuro); }
.tab-btn-simple.active {
    color: var(--verde-escuro);
    border-bottom-color: var(--verde-escuro);
    font-weight: 700;
}

/* Cards Financeiros */
.financial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.fin-card {
    background: #fff;
    padding: 25px;
    border-radius: 20px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: transform 0.2s;
}
.fin-card:hover { transform: translateY(-3px); }
.fin-card h4 { margin: 0 0 10px 0; font-size: 0.9rem; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }
.fin-value { font-size: 1.8rem; font-weight: 700; color: #333; font-family: var(--font-titulos); }
.fin-value.positive { color: var(--verde-escuro); }
.fin-value.negative { color: #d32f2f; }
.fin-value.neutral { color: #f59e0b; }

/* Tabela de Transações */
.fin-table-container {
    background: #fff; border-radius: 16px; padding: 20px; border: 1px solid #f0f0f0;
}
.fin-table { width: 100%; border-collapse: collapse; }
.fin-table th { text-align: left; padding: 15px; color: #666; font-size: 0.85rem; border-bottom: 1px solid #eee; font-weight: 600; }
.fin-table td { padding: 15px; border-bottom: 1px solid #f9f9f9; font-size: 0.95rem; color: #444; }
.fin-table tr:last-child td { border-bottom: none; }
.fin-type-in { color: var(--verde-escuro); font-weight: 600; background: #e8f5e9; padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; }
.fin-type-out { color: #d32f2f; font-weight: 600; background: #ffebee; padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; }
.fin-date { color: #888; font-size: 0.85rem; }

/* Estilo do Botão de Fechar Modal (Global) */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f5f5f5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    z-index: 10;
}
.modal-close-btn:hover {
    background: #e0e0e0;
    color: #333;
    transform: rotate(90deg);
}

/* ==========================================================================
   TOOLTIPS FINANCEIROS (Info Icons)
   ========================================================================== */
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.card-header-row h4 {
    margin: 0;
    line-height: 1.3;
}
.info-tooltip {
    cursor: help;
    color: #9ca3af;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 10px;
    position: relative;
}
.info-tooltip:hover, .info-tooltip:focus {
    color: var(--verde-escuro);
    border-color: var(--verde-escuro);
    background-color: #f0fdf4;
    outline: none;
}

/* Tooltip Box */
.info-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background-color: #1f2937;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    width: 180px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-weight: 500;
    line-height: 1.4;
}

/* Seta do Tooltip */
.info-tooltip::before {
    content: '';
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    margin-bottom: -11px;
}

@keyframes fadeInUpCard {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUpCard 0.5s ease-out forwards;
    opacity: 0;
}

.info-tooltip:hover::after, .info-tooltip:focus::after,
.info-tooltip:hover::before, .info-tooltip:focus::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Ajuste Mobile (Evita vazar da tela) */
@media (max-width: 768px) {
    .info-tooltip::after {
        width: 160px;
        left: auto;
        right: -10px;
        transform: translateY(5px);
    }
    .info-tooltip::before {
        left: auto;
        right: 5px;
        transform: translateY(5px);
    }
    .info-tooltip:hover::after, .info-tooltip:focus::after,
    .info-tooltip:hover::before, .info-tooltip:focus::before {
        transform: translateY(0);
    }
}

/* ==========================================================================
   ESTILOS ESPECÍFICOS DA PÁGINA DE PACIENTES (MIGRADO)
   ========================================================================== */

/* Layout Grid */
.patients-layout-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile First */
    gap: 20px;
    height: auto;
    padding-bottom: 20px;
}

@media (min-width: 992px) {
    .patients-layout-grid { 
        grid-template-columns: 450px 1fr; 
        gap: 25px;
        height: calc((100vh / 0.88) - 100px);
        min-height: 850px;
        padding-bottom: 0;
    }
    
    /* Widget ajustado para desktop */
    .patients-layout-grid .widget { 
        height: 100%; 
        display: flex; 
        flex-direction: column; 
        overflow: hidden; 
    }

    .patient-list-container {
        max-height: none; 
        flex-grow: 1;     
        overflow-y: auto;
    }
    
    #calendar-wrapper {
        flex-grow: 1;
        overflow: hidden; /* FullCalendar gerencia o scroll no desktop para sticky header */
        height: 100% !important; /* FIX: Garante que o calendário ocupe a altura */
        min-height: 0 !important; /* FIX: Evita que o flex item expanda infinitamente */
        position: relative; /* FIX: Para posicionamento do loader */
        display: flex; /* FIX: Garante comportamento de container flexível */
        flex-direction: column;
    }
}

/* Ajuste do Modal de Paciente */
#modal-patient .custom-modal-box {
    max-width: 800px;
}

/* Botões de Status */
.btn-status { transition: all 0.2s; font-weight: 600; font-size: 0.9rem; }
.btn-status:hover { transform: translateY(-2px); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* Card de Paciente */
.patient-card {
    cursor: pointer;
    user-select: none;
}

/* Legenda do Calendário */
.calendar-legend {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #666;
    flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.available { background-color: #fff; border: 2px solid #1B4332; }
.dot.busy { background-color: #e0e0e0; }

/* Header dos Widgets */
.widget-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}
.widget-title {
    margin: 0;
    font-size: 1.1rem;
    color: #1B4332;
    font-weight: 700;
}
.badge-count {
    background-color: #e8f5e9;
    color: #1B4332;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 800;
}

/* ==========================================================================
   FULLCALENDAR - IMPLEMENTAÇÃO LIMPA (V2)
   ========================================================================== */

/* 1. Botões do Calendário */
.fc .fc-button-primary {
    background-color: #1B4332 !important;
    border-color: #1B4332 !important;
    box-shadow: none !important;
}
.fc .fc-button-primary:hover { background-color: #143d2e !important; }
.fc .fc-button-active { background-color: #0d2e21 !important; }

/* 2. Reset de Tabela (CRUCIAL PARA ALINHAMENTO) */
/* Remove paddings globais que causam o desalinhamento entre horas e grade */
.fc table {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    font-size: 1em;
}
.fc td, .fc th {
    padding: 0 !important;
    vertical-align: top !important;
}

/* 3. Estilo da Grade */
.fc-theme-standard td, .fc-theme-standard th { border-color: #f0f0f0; }

/* 4. Estilo dos Eventos */
.fc-event {
    border: none !important;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    padding: 2px 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* 5. Cabeçalho da Tabela */
.fc-col-header-cell { background-color: #f9fafb; padding: 10px 0 !important; }
.fc-col-header-cell-cushion { color: #555; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.5px; }

/* Estilo do Card Assistente */
.assistant-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #e6fffa 100%);
    border: 1px solid #bbf7d0;
    border-radius: 16px;
    padding: 20px;
    transition: transform 0.2s;
}
.assistant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 67, 50, 0.05);
}
.assistant-icon {
    font-size: 1.8rem;
    background: #fff;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Toggle Switch */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin-left: 10px;
}
.switch-toggle input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .slider { background-color: #1B4332; }
input:checked + .slider:before { transform: translateX(20px); }

/* --- MOBILE ADJUSTMENTS (Pacientes) --- */
@media (max-width: 768px) {
    .patients-layout-grid { width: 100%; margin: 0; }

    /* Empilhar campos dos modais no mobile */
    #modal-patient .form-row,
    #modal-appointment .form-row {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    #modal-patient .form-row .form-group,
    #modal-appointment .form-row .form-group {
        width: 100%;
        flex: none !important;
    }

    /* Calendário Mobile (Day View & Header) */
    .fc .fc-toolbar {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 15px !important;
    }
    
    /* Título em linha separada (Topo) */
    .fc .fc-toolbar-chunk:nth-child(2) {
        width: 100%;
        order: -1; /* Joga para o topo */
        text-align: center;
        display: flex;
        justify-content: center;
        margin-bottom: 5px;
    }
    .fc .fc-toolbar-title {
        font-size: 1.2rem !important;
    }

    /* Controles em linha separada (Abaixo) */
    .fc .fc-toolbar-chunk:nth-child(1) {
        order: 2;
        width: 50%;
        display: flex;
        justify-content: flex-start;
    }
    .fc .fc-toolbar-chunk:nth-child(3) {
        order: 3;
        width: 50%;
        display: flex;
        justify-content: flex-end;
    }
    
    /* Ajuste de botões para caberem */
    .fc .fc-button {
        padding: 6px 10px !important;
        font-size: 0.8rem !important;
    }
}

/* ==========================================================================
   CONTROLES DE ZOOM (VISÃO GERAL)
   ========================================================================== */
.zoom-controls-minimal {
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    position: relative;
}

.btn-zoom-min {
    background: transparent;
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    padding: 0;
    line-height: 1;
}

.btn-zoom-min:hover {
    background: rgba(255, 255, 255, 0.2);
}

#zoom-level-display {
    font-size: 0.75rem;
    color: #fff;
    min-width: 36px;
    text-align: center;
    font-weight: 600;
    font-family: var(--font-principal);
    user-select: none;
}

.btn-zoom-reset svg {
    width: 12px;
    height: 12px;
    stroke-width: 2;
}

/* Zoom Controls Light Theme override (Global) */
.zoom-controls-minimal.light-theme {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.zoom-controls-minimal.light-theme .btn-zoom-min {
    color: #555;
}
.zoom-controls-minimal.light-theme .btn-zoom-min:hover {
    background-color: #f0f0f0;
    color: #1B4332;
}
.zoom-controls-minimal.light-theme #zoom-level-display {
    color: #333;
}

/* Ajustes Responsivos */
@media (max-width: 768px) {
    /* --- PACIENTES --- */
    .patient-controls-row {
        flex-direction: row;
        align-items: center !important;
        gap: 10px;
        flex-wrap: wrap;
    }
    .patient-controls-row .search-wrapper {
        flex: 1;
        width: auto !important;
    }
    .patient-controls-row .custom-select-wrapper {
        width: 100% !important;
        order: 3;
    }
    .patient-controls-row .custom-select-trigger {
        width: 100%;
        box-sizing: border-box;
    }

    /* Transforma botão desktop em botão (+) redondo ao lado da busca */
    .header-action-desktop { 
        display: flex !important;
        width: 38px !important; height: 38px !important; min-width: 38px !important;
        border-radius: 50% !important; padding: 0 !important;
        justify-content: center; align-items: center;
        font-size: 0 !important; /* Esconde texto */
        background-color: var(--verde-escuro); color: white;
    }
    .header-action-desktop::after { content: '+'; font-size: 1.4rem; font-weight: 300; line-height: 1; }
    .header-action-desktop svg { display: none; }

    /* Remove o botão FAB antigo */
    #btn-add-patient-mobile { display: none !important; }

    /* --- AUMENTAR CONTROLES DE ZOOM (MOBILE) --- */
    .zoom-controls-minimal {
        padding: 4px 10px; /* Mais área de toque */
    }
    .btn-zoom-min {
        width: 22px; height: 22px; /* Aumentado de 12px */
        font-size: 0.8rem;
    }
    #zoom-level-display {
        font-size: 0.7rem;
        min-width: 35px;
    }
    .btn-zoom-reset svg {
        width: 12px; height: 12px;
    }

    /* --- FINANCEIRO --- */

/* ==========================================================================
   CORREÇÃO: CARD DE CONVERSÃO MOBILE (PUBLIC PROFILE)
   ========================================================================== */

/* 1. Estilo do Card Moderno (Solicitado) */
.conversion-card-modern {
    background: #ffffff;
    padding: 25px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.conversion-card-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
}

.conversion-card-modern .price-display {
    font-family: var(--font-titulos);
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--verde-escuro);
    margin: 10px 0 0 0;
    line-height: 1;
}

.conversion-card-modern .price-suffix {
    font-size: 0.9rem;
    color: #999;
    font-weight: 500;
}

.conversion-card-modern .info-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.conversion-card-modern .info-row:last-child { margin-bottom: 0; }

.conversion-card-modern .info-row svg {
    color: var(--verde-escuro);
    opacity: 0.8;
    flex-shrink: 0;
}

/* Badges de Confiança (Rodapé do Card) */
.trust-badges-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}

.trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: #aaa;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.trust-item svg { width: 18px; height: 18px; opacity: 0.5; }

/* Botão Pulsante */
.btn-pulse {
    animation: pulse-shadow 2s infinite;
}
@keyframes pulse-shadow {
    0% { box-shadow: 0 0 0 0 rgba(27, 67, 50, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(27, 67, 50, 0); }
    100% { box-shadow: 0 0 0 0 rgba(27, 67, 50, 0); }
}

/* 2. Ajuste de Layout Mobile (Padding Extra) */
@media (max-width: 768px) {
    /* Aumenta o padding inferior da página para o card não ficar escondido atrás da nav */
    .profile-page-main {
        padding-bottom: 100px !important;
    }

    /* Garante que o wrapper do card tenha espaço */
    .conversion-card-wrapper {
        margin-bottom: 20px;
    }
    
    /* Ajuste fino para o card no mobile */
    .conversion-card-modern {
        padding: 20px;
        border-radius: 20px;
    }

    /* AJUSTE: Reduz o espaçamento entre ícones sociais e tags no perfil público mobile */
    .profile-action-icons {
        padding-bottom: 10px; /* Reduzido de 15px */
    }
    .profile-tags-container {
        margin-top: 10px; /* Reduzido de 25px */
    }
}

/* ==========================================================================
   PÁGINA DE MÉTRICAS & MERCADO (psi_analytics.html)
   ========================================================================== */

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 coluna no mobile */
    gap: 30px;
    margin-top: 20px;
}

@media (min-width: 992px) {
    .analytics-grid {
        grid-template-columns: 1fr 1fr; /* 2 colunas no desktop */
    }
}

.widget .widget-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin-top: -15px;
    margin-bottom: 25px;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

.analysis-text {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #555;
    border-left: 4px solid var(--cor-Yelo);
}

    .finance-controls-row {
        flex-direction: column;
        align-items: stretch !important;
        gap: 15px !important;
    }
    .finance-controls-row > div {
        width: 100%;
        display: flex;
        gap: 10px;
    }
    .finance-controls-row button { flex: 1; justify-content: center; }
    .finance-controls-row select { width: 100% !important; }
    
    .fin-charts-row {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   ESTILIZAÇÃO DE FORMULÁRIOS EM MODAIS (YELO AESTHETIC)
   ========================================================================== */
.custom-modal-box input[type="text"],
.custom-modal-box input[type="number"],
.custom-modal-box input[type="email"],
.custom-modal-box input[type="tel"],
.custom-modal-box input[type="date"],
.custom-modal-box input[type="time"],
.custom-modal-box select,
.custom-modal-box textarea {
    width: 100% !important;
    padding: 12px 15px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 12px !important;
    background-color: #f9fafb !important;
    font-family: var(--font-principal, sans-serif) !important;
    font-size: 1rem !important;
    color: #333 !important;
    transition: all 0.3s ease !important;
    outline: none !important;
    box-sizing: border-box !important;
    accent-color: var(--verde-escuro) !important; /* Cor do calendário nativo */
}

.custom-modal-box input:focus,
.custom-modal-box select:focus,
.custom-modal-box textarea:focus {
    border-color: var(--verde-escuro) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.1) !important;
}

/* Select Customizado (Remove seta padrão e adiciona SVG Yelo) */
.custom-modal-box select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231B4332' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    padding-right: 40px !important;
}

/* FORÇA O SELECT NATIVO APENAS NO MOBILE: Garante o picker nativo no Mobile e plugin no Desktop */
@media (max-width: 992px) {
    #modal-appointment select,
    .custom-modal-box select.native-yelo-select {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        cursor: pointer !important;
    }

    /* Esconde qualquer plugin de terceiros (TomSelect/Select2) no modal de agendamento no Mobile */
    #modal-appointment .ts-wrapper,
    #modal-appointment .select2-container,
    #modal-appointment .custom-select-wrapper {
        display: none !important;
    }
}

/* Ícones de Data/Hora (Ajuste de cor para Verde Yelo) */
.custom-modal-box input[type="date"]::-webkit-calendar-picker-indicator,
.custom-modal-box input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(21%) sepia(13%) saturate(2366%) hue-rotate(108deg) brightness(96%) contrast(93%);
    opacity: 0.7;
    transition: opacity 0.2s;
}
.custom-modal-box input[type="date"]::-webkit-calendar-picker-indicator:hover,
.custom-modal-box input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* --- CORREÇÃO: REMOVER ESPAÇO VAZIO NO FINAL (RODAPÉ) --- */
/* Oculta o rodapé e a onda decorativa no dashboard para evitar rolagem desnecessária */
.pagina-dashboard .rodape-principal,
.pagina-dashboard .wave-divider-footer {
    display: none !important;
}

/* Ajuste fino do padding inferior do conteúdo principal */
.dashboard-main {
    padding-bottom: 20px !important;
}

/* ==========================================================================
   BANNER FLUTUANTE DE RESTRIÇÃO (MODO VISUALIZAÇÃO)
   ========================================================================== */
.restriction-floating-banner {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937; /* Cinza escuro */
    color: #fff;
    padding: 15px 25px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    z-index: 10000; /* Acima de tudo */
    font-family: var(--font-principal);
    animation: slideUpBanner 0.4s ease-out;
    max-width: 90%;
    width: fit-content;
    border: 1px solid rgba(255,255,255,0.1);
}

.restriction-floating-banner span {
    font-weight: 500;
    font-size: 0.95rem;
}

.restriction-floating-banner button {
    background-color: var(--cor-Yelo);
    color: var(--verde-escuro);
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: transform 0.2s;
}

@keyframes slideUpBanner {
    from { transform: translate(-50%, 40px) scale(0.95); opacity: 0; }
    to { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

/* Ajuste Mobile (Mais compacto e posicionado acima da nav) */
@media (max-width: 768px) {
    .restriction-floating-banner {
        bottom: calc(var(--mobile-bottom-h, 80px) + 30px) !important; /* Respiro dinâmico padrão acima da navegação */
        padding: 10px 15px;
        width: 90%; /* Ocupa largura para não quebrar texto */
        border-radius: 12px; /* Menos arredondado */
        justify-content: space-between;
        font-size: 0.8rem;
    }

    .restriction-floating-banner span {
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .restriction-floating-banner button {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   NOVO LAYOUT DASHBOARD (APP-LIKE & FOCADO EM AÇÃO)
   ========================================================================== */

/* --- ESTRUTURA DO GRID PRINCIPAL --- */
.modern-dashboard-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 0 40px 0;
}

.modern-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 992px) {
    .modern-dashboard-grid {
        grid-template-columns: 2fr 1.1fr; /* Coluna Esquerda Maior, Direita Menor */
        align-items: start;
    }
}

.dashboard-column-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-column-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- 1. HERO BLOCK (Resultado & Benchmark) --- */
.modern-hero-card {
    background: linear-gradient(135deg, var(--verde-escuro) 0%, #2A5A40 100%);
    border-radius: 24px;
    padding: 22px; /* Reduzido em 30% */
    color: var(--branco-puro);
    box-shadow: 0 12px 35px rgba(27, 67, 50, 0.12);
    position: relative;
    overflow: hidden;
}

.modern-hero-card::after {
    content: '';
    position: absolute;
    top: -50px; right: -50px; width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.modern-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 700px;
    flex-grow: 1;
}

.hero-content h1, .hero-content h2 {
    margin: 0;
    font-family: var(--font-titulos);
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    line-height: 1.2;
    color: var(--branco-puro);
}

.hero-content p {
    margin: 0;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

.modern-hero-title {
    margin: 0 0 8px 0;
    font-family: var(--font-titulos);
    font-size: 2rem;
    line-height: 1.2;
}

.modern-hero-subtitle {
    margin: 0;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.85);
}

.modern-hero-metrics {
    display: flex;
    gap: 40px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.hero-metric-item {
    display: flex;
    flex-direction: column;
}

.hero-metric-value {
    font-family: var(--font-titulos);
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--cor-Yelo);
    line-height: 1;
    margin-bottom: 6px;
}

.hero-metric-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.hero-benchmark-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    margin-top: 10px;
    color: #d1fae5;
}

.modern-hero-cta {
    background-color: var(--cor-Yelo);
    color: var(--verde-escuro);
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    box-shadow: 0 4px 15px rgba(255, 238, 140, 0.2);
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.modern-hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 238, 140, 0.4);
    background-color: #fff4b3;
}

/* --- 2. CHECKLIST DE AÇÕES (Guiado) --- */
.modern-checklist-card {
    background: var(--branco-puro);
    border-radius: 24px;
    padding: 22px;
    border: 1px solid var(--cinza-borda);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checklist-title {
    margin: 0;
    font-family: var(--font-titulos);
    font-size: 1.4rem;
    color: var(--verde-escuro);
}

.checklist-progress-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--verde-escuro);
    background: #f0fdf4;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #bbf7d0;
}

.checklist-progress-track {
    height: 8px;
    background: #f1f3f5;
    border-radius: 4px;
    margin-bottom: 24px;
    overflow: hidden;
}

.checklist-progress-fill {
    height: 100%;
    background: var(--verde-escuro);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.modern-action-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modern-action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid #f1f3f5;
    background: #f8f9fa;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.modern-action-item:hover {
    background: var(--branco-puro);
    border-color: var(--verde-escuro);
    box-shadow: 0 4px 15px rgba(27, 67, 50, 0.08);
    transform: translateX(4px);
}

.modern-action-item.completed {
    opacity: 0.6;
    background: transparent;
    border-color: transparent;
}

.modern-action-item.completed:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
    cursor: default;
}

.action-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #adb5bd;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    color: transparent;
}

.modern-action-item:hover .action-checkbox {
    border-color: var(--verde-escuro);
}

.modern-action-item.completed .action-checkbox {
    background: var(--verde-escuro);
    border-color: var(--verde-escuro);
    color: white;
}

.action-content {
    flex-grow: 1;
}

.action-title {
    margin: 0 0 4px 0;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.modern-action-item.completed .action-title {
    text-decoration: line-through;
    color: #888;
}

.action-impact {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #059669;
    background: #d1fae5;
    padding: 2px 8px;
    border-radius: 6px;
}

/* --- 3. BLOCO DE PACIENTES (Valor Principal) --- */
.modern-patients-card {
    background: var(--branco-puro);
    border-radius: 24px;
    padding: 22px;
    border: 1px solid var(--cinza-borda);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.card-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card-title-modern {
    margin: 0;
    font-family: var(--font-titulos);
    font-size: 1.4rem;
    color: var(--verde-escuro);
    display: flex;
    align-items: center;
    gap: 10px;
}

.patients-metrics-group {
    display: flex;
    background: #f8f9fa;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    gap: 20px;
    align-items: center;
}

.p-metric {
    flex: 1;
    text-align: center;
    position: relative;
}

.p-metric:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 15%;
    height: 70%;
    width: 1px;
    background: #e9ecef;
}

.p-metric-val {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--verde-escuro);
    line-height: 1;
    margin-bottom: 6px;
    font-family: var(--font-titulos);
}

.p-metric-label {
    font-size: 0.85rem;
    color: var(--cinza-texto);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-primary-action {
    width: fit-content;
    margin-left: auto; /* Empurra o botão totalmente para a direita */
    margin-right: 0;
    background: var(--verde-escuro);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 16px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: var(--font-principal);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary-action:hover {
    background: #143d2e;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(27, 67, 50, 0.2);
}

/* --- 4. BLOCO DE COMUNIDADE (Engajamento) --- */
.modern-community-card {
    background: var(--branco-puro);
    border-radius: 24px;
    padding: 22px;
    border: 1px solid var(--cinza-borda);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.community-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.c-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    background: #f8f9fa;
    padding: 16px;
    border-radius: 16px;
}

.c-stat-icon {
    width: 28px;
    height: 28px;
    background: #f0fdf4;
    color: var(--verde-escuro);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.c-stat-info {
    display: flex;
    flex-direction: column;
}

.c-stat-val {
    font-weight: 700;
    color: var(--verde-escuro);
    font-size: 1.2rem;
    line-height: 1;
    margin-bottom: 2px;
}

.c-stat-label {
    font-size: 0.85rem;
    color: var(--cinza-texto);
}

.smart-empty-state {
    background: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 16px;
    padding: 22px 16px;
    text-align: center;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-state-icon {
    font-size: 2.5rem;
    color: #adb5bd;
}

.empty-state-text {
    margin: 0;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
}

.btn-secondary-action {
    background: transparent;
    color: var(--verde-escuro);
    border: 2px solid var(--verde-escuro);
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-principal);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary-action:hover {
    background: #f0fdf4;
}

/* --- 6. BLOCO DE NOTIFICAÇÕES E LEMBRETES --- */
.modern-notifications-card {
    background: #f8f9fa;
    border-radius: 24px;
    padding: 22px;
    border: 1px solid var(--cinza-borda);
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    border-radius: 12px;
    background: var(--branco-puro);
    border: 1px solid #e9ecef;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.notification-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.notification-content p { margin: 0; font-size: 0.9rem; color: #555; line-height: 1.5; }
.notification-content p strong { color: var(--verde-escuro); }
.notification-time { font-size: 0.75rem; color: #999; margin-top: 4px; display: block; }

/* Variações de Cor/Ícone */
.notification-item.type-interaction .notification-icon { background: #e0f2f1; color: #00796b; }
.notification-item.type-reminder .notification-icon { background: #fffbeb; color: #b45309; }

/* --- 5. BLOCO DE GESTÃO (Visão Discreta) --- */
.modern-management-card {
    background: #f8f9fa;
    border-radius: 24px;
    padding: 20px;
    border: 1px solid var(--cinza-borda);
}

.management-header {
    margin-bottom: 20px;
    color: #555;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.management-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.management-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--branco-puro);
    padding: 11px;
    border-radius: 16px;
    border: 1px solid #e9ecef;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.management-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    border-color: #dee2e6;
}

.m-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.m-item-icon {
    color: #888;
    font-size: 1.2rem;
}

.m-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.m-item-value {
    font-weight: 700;
    color: var(--verde-escuro);
    background: #e8f5e9;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
}

/* --- SIDEBAR MODERNA (APP-LIKE) --- */
.modern-sidebar-container {
    width: 220px; /* Reduzido de 280px para ficar mais compacta */
    background: #fcfcfc; /* Fundo mais claro, quase branco */
    border-right: 1px solid #f0f0f0; /* Borda mais sutil */
    display: flex;
    flex-direction: column;
    height: calc(100vh / 0.88);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    padding: 12px; /* Padding interno geral */
    box-sizing: border-box;

}

.sidebar-profile-modern {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px; /* Espaço menor */
    margin-bottom: 10px;
}

.sp-avatar-wrapper {
    position: relative;
    width: 100px; /* Foto maior, o dobro do tamanho original */
    height: 100px;
    margin-bottom: 10px;
    border-radius: 50%; /* Garante que a área clicável seja exatamente o círculo */
    overflow: hidden;   /* Corta os cantos quadrados e transparentes invisíveis */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer; /* Garante que o cursor de clique apareça */
    z-index: 10; /* Eleva o elemento para evitar bloqueios de clique */
}

.sp-avatar-wrapper:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Indicador visual 'Trocar' elegante ao passar o mouse */
.sp-avatar-wrapper::after {
    content: '📷 Trocar';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35%;
    background-color: rgba(27, 67, 50, 0.75); /* Fundo verde escuro translúcido */
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none; /* Permite que o clique atravesse o texto perfeitamente */
}

.sp-avatar-wrapper:hover::after {
    opacity: 1;
}

/* Garante que, se houver um input de arquivo interno, ele seja totalmente clicável */
.sp-avatar-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 20;
}

.sp-avatar {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--cor-Yelo) !important;
    box-sizing: border-box; /* Borda pro lado de dentro, impedindo distorção */
    display: block; /* Remove espaços mortos/fantasma padrão de imagens (HTML) */
}

.sidebar-profile-modern h3 {
    margin: 0;
    font-size: 1.65rem !important; /* Aumentado consideravelmente */
    color: var(--verde-escuro);
    font-family: var(--font-titulos) !important;
    font-weight: 700 !important; /* Peso Bold para destacar a New Kansas */
    line-height: 1.2;
}

.sp-level-indicator {
    font-size: 0.9rem !important; /* Ajustado para o formato pílula */
    color: var(--verde-escuro) !important; /* Texto escuro para garantir leitura no fundo claro */
    background-color: #e8f5e9; /* Fundo verde menta */
    padding: 6px 14px;
    border-radius: 50px; /* Transforma num formato de pílula */
    font-weight: 700 !important;
    margin-top: 10px;
    display: inline-block;
    border: 1px solid #c8e6c9; /* Borda sutil para acabamento */
}

.modern-sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: none;
    display: flex;
}
.modern-sidebar-nav::-webkit-scrollbar { display: none; }

.modern-sidebar-nav ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important; /* Gap vertical padrão */
    flex-grow: 1;
}

/* --- SIDEBAR MODERNA (AJUSTADA PARA ALINHAMENTO PERFEITO) --- */

.nav-item-modern {
    display: flex;
    align-items: center;    /* Centralização vertical matemática */
    flex-direction: row;    /* Voltamos para o padrão: ícone na esquerda */
    display: flex !important;
    align-items: center !important; /* Alinha o centro do SVG com o centro do Texto */
    flex-direction: row !important; /* Mantém a ordem Icone -> Texto */
    justify-content: flex-start !important; 
    gap: 12px;
    padding: 12px 15px;
    border-radius: 50px !important;
        color: var(--verde-escuro) !important;
    text-decoration: none;
    font-weight: 600; 
    font-size: 1.05rem; /* Aumentado para ornar com o perfil */
    font-size: 1.05rem;
    letter-spacing: 0.3px;
    transition: background-color 0.2s, color 0.2s;
    position: relative;
}

/* O Segredo do Alinhamento do Ícone */
.sidebar-nav a.nav-item-modern svg {
    width: 22px; /* Aumentado proporcionalmente ao texto */
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--verde-escuro);
    display: block;         /* Mata o espaçamento de "baseline" do SVG */
    display: block; /* REMOVE o desalinhamento de baseline (espaço embaixo do svg) */
    transition: color 0.2s;
}

/* O Segredo do Alinhamento do Texto */
.sidebar-nav a.nav-item-modern span {
    display: flex;
    align-items: center;
    line-height: 1;         /* Remove alturas de linha extras que empurram o texto */
    margin-top: 1px;        /* Ajuste óptico: fontes costumam "flutuar" um pouco */
    display: block;
    line-height: 1; /* Remove alturas de linha que empurram o texto para baixo */
    margin-bottom: 0; /* Garante que não haja margem residual */
    padding: 0;
    color: var(--verde-escuro) !important;
}

.sidebar-nav a.nav-item-modern:hover {
    background: #f0f0f0;
    color: var(--verde-escuro) !important;
}

.sidebar-nav a.nav-item-modern:hover svg {
    color: var(--verde-escuro);
}

.sidebar-nav li.active a.nav-item-modern {
    background: #e8f5e9; /* Verde bem claro */
    color: var(--verde-escuro) !important;
    border-radius: 50px !important;
}

.sidebar-nav li.active a.nav-item-modern svg {
    opacity: 1;
    stroke: var(--verde-escuro);
}

.sidebar-nav li.active a.nav-item-modern::before {
    display: none;
}

/* Ajuste principal para comportar a nova sidebar */
@media (min-width: 992px) {
    .dashboard-main {
        margin-left: 220px !important; 
        width: calc(100% - 220px) !important; 
    }
    /* Esconder top nav antiga se usar sidebar lateral */
    .dashboard-top-nav {
        display: none !important;
    }
        /* Aumenta o gap dos itens do menu na versão desktop para preencher melhor a sidebar */
    .modern-sidebar-nav ul {
        gap: 22px !important;
    }
}

/* --- RESPONSIVIDADE MOBILE REFINADA --- */
@media (max-width: 992px) {
    .modern-hero-metrics {
        gap: 20px;
        justify-content: space-between;
        width: 100%;
    }
    
    .patients-metrics-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .p-metric:not(:last-child)::after {
        right: 0; top: auto; bottom: -8px;
        width: 80%; height: 1px;
        left: 10%;
    }

    .community-stats {
        flex-direction: column;
    }
    
    .modern-sidebar-container {
        display: none; /* No mobile, usar bottom nav ou menu hambúrguer */
    }
    
    .dashboard-top-nav {
        display: block !important; /* Mostra no mobile */
    }
}

/* ==========================================================================
   UPLOAD DE FOTO MOBILE (PÁGINA DE PERFIL)
   ========================================================================== */
.mobile-photo-upload-section {
    display: none; /* Escondido por padrão no Desktop (onde tem a sidebar) */
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 1px dashed #e0e0e0;
    padding-bottom: 25px;
}

.profile-photo-wrapper-mobile {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    cursor: pointer;
    margin-bottom: 10px;
    border: 3px solid var(--verde-escuro);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.profile-photo-wrapper-mobile:active { transform: scale(0.95); }

.profile-photo-wrapper-mobile img {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background-color: var(--cinza-borda);
}

.profile-photo-wrapper-mobile .camera-icon-badge {
    position: absolute; bottom: 0; right: -5px;
    background-color: var(--cor-Yelo); color: var(--verde-escuro);
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.mobile-photo-upload-section p { font-size: 0.9rem; color: #666; margin: 0; font-weight: 500; }

/* Exibe apenas em resoluções de tablet/celular */
@media (max-width: 992px) {
    .mobile-photo-upload-section { display: flex; }
}

/* Garante que o container ocupe a tela toda sem transbordar */
#dashboard-container {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
    height: calc(100vh / 0.88) !important;
    overflow-x: hidden;
}

.h-100 { height: 100%; }

.hero-benchmark {
    font-size: 0.95rem;
    color: var(--cor-Yelo);
    margin-top: 20px;
    background: rgba(0,0,0,0.15);
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
}

.btn-cta-hero {
    background-color: var(--branco-puro);
    color: var(--verde-escuro);
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    font-family: var(--font-principal);
}
.btn-cta-hero:hover {
    transform: translateY(-2px);
    background-color: #f8f9fa;
}

/* --- ESTILOS DAS PÁGINAS HUB (AGRUPAMENTOS APPLE-STYLE) --- */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding-top: 10px;
}

.hub-card {
    background-color: var(--branco-puro);
    border: 1px solid var(--cinza-borda);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.hub-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    border-color: var(--verde-escuro);
}

.hub-icon {
    width: 55px;
    height: 55px;
    border-radius: 16px;
    background-color: #f0fdf4;
    color: var(--verde-escuro);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.hub-info h3 {
    margin: 0 0 5px 0;
    font-family: var(--font-titulos);
    color: var(--verde-escuro);
    font-size: 1.2rem;
}

.hub-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--cinza-texto);
    line-height: 1.4;
}

.hub-card.logout-card:hover {
    border-color: #e63946;
}


/* ==========================================================================
   ARQUITETURA DE BLOCOS DE PERFIL (psi_meu_perfil.html)
   ========================================================================== */
.profile-block {
    border: 1px solid #e9ecef;
    border-radius: 16px;
    margin-bottom: 25px;
    background-color: #fff;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    overflow: visible;
}

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px; /* Restaurado o padding original */
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.block-header .section-title { margin: 0; font-size: 1.1rem; color: var(--verde-escuro); }
.block-actions { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-left: auto;
}
.block-actions .btn { 
    width: 110px !important; 
    height: 38px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* CORREÇÃO: Impede que botões ocultos ocupem espaço invisível empurrando o layout */
.block-actions .btn.hidden {
    display: none !important;
}
.block-actions .btn-principal { 
    border: 2px solid transparent !important; 
    font-weight: 600 !important; /* Ajuste fino: Reduz o peso da fonte para compensar o contraste e igualar visualmente ao "Cancelar" */
}
.block-actions .btn-secundario { border: 2px solid var(--verde-escuro) !important; }
.block-content { padding: 20px; }

/* Inputs desabilitados por padrão (Modo Visualização) */
.profile-block input:disabled,
.profile-block textarea:disabled,
.profile-block select:disabled {
    background-color: #f0f2f5 !important;
    cursor: not-allowed;
    border-color: transparent !important;
    color: #6c757d;
}

.profile-block .multiselect-tag.disabled .multiselect-display {
    background-color: #f0f2f5;
    cursor: not-allowed;
    border-color: transparent;
    color: #6c757d;
}

/* Estado de Edição Ativo */
.profile-block.editing {
    border-color: var(--verde-escuro);
    box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.1);
}

.profile-block.editing input,
.profile-block.editing textarea,
.profile-block.editing select {
    background-color: #fff !important;
    cursor: text;
    border-color: #ced4da !important;
    color: #333;
}

.profile-block.editing .multiselect-tag.disabled {
    opacity: 1;
    pointer-events: auto;
}

.profile-block.editing .multiselect-tag.disabled .multiselect-display {
    background-color: #fff;
    cursor: pointer;
    border-color: #ced4da;
}

/* ==========================================================================
   NOTIFICAÇÕES ESTILO PÍLULA (WHATSAPP)
   ========================================================================== */

#pill-notification-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2147483647; /* Highest z-index */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.pill-notification {
    pointer-events: auto;
    background: rgba(30, 41, 59, 0.95); /* Dark, modern background */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-family: var(--font-principal, sans-serif);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 12px 24px;
    border-radius: 50px; /* Pill shape */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(100px);
    animation: slideUpAndDown 4.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.pill-notification .icon { font-size: 1.1rem; }
.pill-notification.success .icon { color: #4ade80; }
.pill-notification.error .icon { color: #f87171; }
.pill-notification.info .icon { color: #60a5fa; }

@keyframes slideUpAndDown {
    0% { opacity: 0; transform: translateY(100px); }
    10% { opacity: 1; transform: translateY(0); }
    85% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(100px); }
}

/* Feedback Visual do Bloco */
.block-status {
    font-size: 0.85rem;
    font-weight: 600;
    transition: opacity 0.3s ease;
    opacity: 0;
}
.block-status.visible { opacity: 1; }
.block-status.success { color: var(--verde-sucesso); }
.block-status.error { color: var(--coral-quente); }

/* Helpers */
.hidden { display: none !important; }

/* Botão Sticky Global (Auto-save transição) */
.sticky-footer-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    left: auto;
    width: auto;
    background-color: transparent;
    padding: 0;
    box-shadow: none;
    z-index: 1001;
    transform: translateY(150%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sticky-footer-actions:not(.hidden) {
    transform: translateY(0);
}

.sticky-footer-actions p {
    display: none; /* Esconde o texto para ficar minimalista */
}

.sticky-footer-actions .btn {
    background-color: var(--verde-escuro);
    color: #fff;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(27, 67, 50, 0.3);
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.sticky-footer-actions .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(27, 67, 50, 0.4);
    background-color: #143d2e;
}

/* Spinner para botões */
.spinner {
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--verde-escuro);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   AJUSTES DE UX MOBILE: PERFIL (BOTÕES, STICKY FOOTER E ZOOM)
   ========================================================================== */
@media (max-width: 992px) {
    /* 1. Remove contorno de pílula dos botões de edição do bloco de perfil */
    .block-actions {
        gap: 5px !important;
    }
    .block-actions .btn {
        padding: 5px 8px !important;
        background: transparent !important;
        border: none !important;
        min-width: 0 !important; /* Reseta restrições de tamanho */
        width: auto !important;
        height: auto !important;
        font-size: 0.95rem !important;
        box-shadow: none !important;
        color: var(--verde-escuro) !important;
    }
    .block-actions .btn-cancel {
        color: #888 !important; /* Deixa o botão de cancelar mais discreto */
    }
    .block-actions .btn-save {
        font-weight: 800 !important;
    }

    /* 2. Botão Flutuante de Salvar responsivo e acima da navegação */
    .sticky-footer-actions {
        bottom: calc(var(--mobile-bottom-h, 80px) + 20px) !important;
        right: 20px !important;
        left: auto !important;
        width: auto !important;
        padding: 0 !important;
        background-color: transparent !important;
        transform: translateY(200px) !important; /* Oculto (Move para baixo da tela inteira) */
        opacity: 0;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
    }
    .sticky-footer-actions:not(.hidden) {
        transform: translateY(0) !important; /* Visível */
        opacity: 1;
    }
    .sticky-footer-actions .btn {
        padding: 12px 24px !important;
        font-size: 1rem !important;
    }

    /* 3. Evitar Zoom no iOS ao clicar nos inputs (Fonte >= 16px) */
    .profile-block input,
    .profile-block textarea,
    .profile-block select,
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px !important;
    }
}

/* --- FEED DE AVISOS (APP-LIKE) --- */
.avisos-feed-widget {
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
}

.avisos-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
    overflow-x: auto;
    scrollbar-width: none; /* Esconde scrollbar */
}
.avisos-filters::-webkit-scrollbar { display: none; }

.aviso-filter-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.aviso-filter-btn:hover { background: #e9ecef; }
.aviso-filter-btn.active {
    background: var(--verde-escuro);
    color: white;
    border-color: var(--verde-escuro);
}

.avisos-feed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aviso-feed-item {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e9ecef;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}
.aviso-feed-item:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}
.aviso-feed-item.unread {
    background: #f0fdf4;
    border-left: 4px solid #16a34a;
}
.aviso-feed-item.unread .aviso-title {
    font-weight: 700;
    color: var(--verde-escuro);
}

.aviso-feed-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.aviso-icon-wrapper {
    width: 40px; height: 40px; border-radius: 50%;
    background: #e8f5e9; color: #1B4332;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}
.aviso-feed-item.unread .aviso-icon-wrapper {
    background: #16a34a; color: white;
}
.aviso-title-group { flex-grow: 1; min-width: 0; }
.aviso-title {
    font-family: var(--font-principal); font-size: 1.05rem; font-weight: 600;
    color: #333; margin: 0 0 4px 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aviso-meta { font-size: 0.8rem; color: #888; display: block; }

.aviso-preview {
    margin: 10px 0 0 0; font-size: 0.95rem; color: #555; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis;
}

/* Accordion Expandido */
.aviso-feed-item.expanded .aviso-title { white-space: normal; overflow: visible; }
.aviso-feed-item.expanded .aviso-preview { display: none; }

.aviso-full-content {
    max-height: 0; opacity: 0; overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
    font-size: 0.95rem; color: #444; line-height: 1.6;
}
.aviso-feed-item.expanded .aviso-full-content {
    max-height: 1000px; /* Altura arbitrária grande para fluir */
    opacity: 1; margin-top: 15px; border-top: 1px solid #eee; padding-top: 15px;
}
.aviso-full-content p { margin-bottom: 10px; }
.aviso-full-content p:last-child { margin-bottom: 0; }

.aviso-feed-actions {
    margin-top: 15px; display: flex; gap: 10px; justify-content: flex-end;
}
    display: block;
}
.aviso-card-psi .aviso-conteudo {
    margin: 0;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.5;
}
.aviso-card-psi .aviso-conteudo p {
    margin-bottom: 10px;
}
.aviso-card-psi .aviso-conteudo p:last-child {
    margin-bottom: 0;
}
/* --- Segmented Control (App-like) --- */
.segmented-control {
    display: inline-flex;
    background-color: #e9ecef;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    border: none;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label {
    padding: 8px 16px;
    cursor: pointer;
    color: #555;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    border: none;
}

.segmented-control input[type="radio"]:checked + label {
    background-color: white;
    color: var(--verde-escuro);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Botão Like nos Comentários */
.comment-like-btn.liked.reddit-pill {
    color: var(--coral-quente); background-color: #fff5f5;
}
.comment-like-btn.liked.reddit-pill svg {
    fill: var(--coral-quente); stroke: var(--coral-quente);
}
/* ==========================================================================
   AJUSTES DO MODAL DE NOVO ARTIGO (E MODAIS EM GERAL)
   ========================================================================== */

/* 1. Ajuste opcional para deixar o modal do blog um pouco mais largo no Desktop */
#modal-artigo .custom-modal-box,
#modal-blog .custom-modal-box,
#modal-post .custom-modal-box {
    max-width: 750px;
}

/* 2. Limita a altura do campo de texto/editor para evitar que o modal passe da tela */
.custom-modal-box textarea,
.custom-modal-box .rich-text-editor {
    min-height: 150px !important; /* Altura inicial razoável */
    max-height: 45vh !important;  /* Máximo de 45% da altura da tela */
    min-height: 100px !important;
    max-height: 40vh !important;  /* Controla altura no mobile */
    overflow-y: auto !important;  /* Rolagem APENAS dentro da caixa se o texto for longo */
}

/* Controla especificamente o Quill Editor para comportamento App-like */
#modal-artigo .ql-container,
#view-form-artigo .ql-container,
#modal-blog .ql-container {
    max-height: 40vh !important;
    overflow-y: auto !important;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Força a estrutura dos botões de ação a abraçarem o texto e ficarem no rodapé */
.custom-modal-box .form-acoes,
.custom-modal-box .modal-footer {
    display: flex !important;
    justify-content: flex-end !important; /* Joga os botões para o canto */
    gap: 12px !important;
    margin-top: 20px !important;
}

/* 3. Ajusta as pílulas (botões) do rodapé para abraçarem o texto elegantemente */
.custom-modal-box .modal-footer .btn,
.custom-modal-box .form-acoes .btn {
    width: auto !important;         /* Remove larguras forçadas (ex: 100%) */
    min-width: 0 !important;        /* Remove largura mínima padrão do dashboard */
    padding: 10px 24px !important;  /* Deixa a pílula enxuta e proporcional */
    padding: 8px 20px !important;   /* Deixa a pílula mais enxuta (app-like) */
    font-size: 0.95rem !important;  /* Tamanho de fonte legível */
    flex-grow: 0 !important;        /* Impede que o botão estique para os lados */
    justify-content: center;
    white-space: nowrap;            /* Impede que o texto do botão quebre em duas linhas */
}

/* 4. Reduz o espaço vazio antes dos botões para o modal ficar mais compacto */
.custom-modal-box .modal-footer,
.custom-modal-box .form-acoes {
    margin-top: 20px !important;
    gap: 12px !important;
}

/* ==========================================================================
   PLG: BANNER DE LEADS (WHATSAPP CLICKS)
   ========================================================================== */
.lead-plg-banner {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-left: 6px solid #f59e0b;
    border-radius: 16px;
    padding: 20px 25px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.1);
    animation: slideDownFade 0.5s ease-out;
    flex-wrap: wrap;
    gap: 15px;
}

.lead-plg-content { display: flex; align-items: center; gap: 15px; }

.lead-plg-icon {
    width: 48px; height: 48px;
    background-color: #f59e0b; color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex-shrink: 0;
    animation: pulse-fab 2s infinite;
}

.lead-plg-text h3 { margin: 0 0 5px 0; color: #92400e; font-size: 1.2rem; font-family: var(--font-titulos); }
.lead-plg-text p { margin: 0; color: #b45309; font-size: 0.95rem; }

.lead-plg-btn {
    background-color: var(--verde-escuro); color: #fff;
    padding: 10px 24px; border-radius: 50px;
    text-decoration: none; font-weight: bold; font-size: 0.95rem;
    transition: transform 0.2s, box-shadow 0.2s; white-space: nowrap;
}

.lead-plg-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(27, 67, 50, 0.2); }

@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}