/* ====================================================
   GLOBAL.CSS - Estilos gerais de toda a aplicação
   ==================================================== */

/* 1. VARIÁVEIS DO TEMA CLARO E MEDIDAS GERAIS */
:root {
    --d-nav-h: 64px;
    --d-radius: 14px;
    --d-radius-sm: 8px;
    --d-radius-lg: 20px;
    --d-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    --d-shadow-glow: 0 0 24px rgba(66, 0, 124, 0.14); /* Usando o seu Roxo escuro aqui */
    --d-border: rgba(66, 0, 124, 0.22); /* Usando o seu Roxo escuro aqui */
    --d-border-h: rgba(66, 0, 124, 0.55);
    --d-section-gap: 80px;
}

[data-theme="dark"] {
    --d-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
    --d-shadow-glow: 0 0 24px rgba(172, 82, 217, 0.22); /* Usando o seu Roxo claro aqui */
    --d-border: rgba(172, 82, 217, 0.28); 
    --d-border-h: rgba(172, 82, 217, 0.65);
}
/* 3. RESET BÁSICO (Zera margens e paddings padrão do navegador) */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

/* Rolagem suave ao clicar em links internos */

/* 4. CONFIGURAÇÕES DO CORPO DA PÁGINA */
body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-main);
    color: var(--text-b);
    min-height: 100vh;
    overflow-x: hidden;
    /* Impede rolagem horizontal indesejada */
    transition: background-color 0.35s ease, color 0.35s ease;
    /* Transição suave ao trocar de tema */
}

/* Efeito de brilho de fundo (manchas roxas nas pontas da tela) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse 80% 60% at 20% 10%, rgba(124, 58, 237, 0.07) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(192, 38, 211, 0.05) 0%, transparent 55%);
}

/* Estilos de links, listas e inputs base */
a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: inherit;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: 0.87rem;
    color: var(--text-b);
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.25s;
}

/* 5. CUSTOMIZAÇÃO DA BARRA DE ROLAGEM (Scrollbar) */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-soft);
    border-radius: 3px;
}



/* 7. ESTRUTURA PRINCIPAL E GRIDS (Layout) */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 5% 80px;
    position: relative;
    z-index: 1;
}

/* Animação de entrada das seções (surgem subindo) */
.section {
    animation: fadeUp 0.5s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cabeçalho das seções (Título e ícone grande) */
.section-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
}

.section-badge {
    font-size: 1.8rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.section-title {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    font-weight: 800;
    color: var(--text-h);
    line-height: 1.2;
    margin-bottom: 4px;
}

.section-sub {
    font-size: 0.87rem;
    color: var(--text-m);
}

/* Grids reutilizáveis para alinhar os cards */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* 8. CARDS GLOBAIS (As "caixas" do site) */
.card {
    background: var(--bg-card);
    border: 1px solid var(--d-border);
    border-radius: var(--d-radius-lg);
    padding: 24px;
    box-shadow: var(--d-shadow);
    transition: border-color 0.25s, box-shadow 0.25s;
}

.card-glass {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Efeito de vidro fosco */
.card:hover {
    border-color: var(--d-border-h);
    box-shadow: var(--d-shadow), var(--d-shadow-glow);
}

/* Brilho ao passar o mouse */

/* Cards de estatísticas pequenas (ex: Planejamento) */
.card-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 22px;
}

.card-stat-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    border-color: transparent;
}

.card-stat-accent .stat-label,
.card-stat-accent .stat-value,
.card-stat-accent .stat-change {
    color: #fff;
    opacity: 0.9;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-m);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 800;
    color: var(--text-h);
}

.stat-change {
    font-size: 0.73rem;
    color: var(--text-m);
}

.stat-change.positive {
    color: #34d399;
}

/* Verde para positivo */
.stat-change.negative {
    color: #f87171;
}

/* Vermelho para negativo */

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

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-h);
    margin-bottom: 16px;
}

.card-header-row .card-title {
    margin-bottom: 0;
}

/* 9. FORMULÁRIOS */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-m);
    letter-spacing: 0.03em;
}

.field-group input,
.field-group select,
.field-group textarea {
    background: var(--inp-bg);
    border: 1px solid var(--inp-brd);
    border-radius: var(--d-radius-sm);
    padding: 10px 14px;
    color: var(--text-b);
    outline: none;
    resize: vertical;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* Borda roxa ao clicar no input */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Barrinha de arrastar (Range slider do formulário de metas) */
.range-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.range-input {
    flex: 1;
    accent-color: var(--accent);
    height: 4px;
}

.range-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 36px;
}

/* 10. BOTÕES GLOBAIS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 50px;
    padding: 10px 22px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    transition: all 0.25s;
    white-space: nowrap;
    
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    
}

.btn-primary:hover {
    background: var(--accent2);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--d-border-h);
}

.btn-outline:hover {
    background: var(--accent-soft);
}

.btn.small {
    padding: 7px 16px;
    font-size: 0.78rem;
}

.btn.full-width {
    width: 100%;
    justify-content: center;
}

/* 11. COMPONENTES UTILITÁRIOS (Mensagem vazia, Toast e Modal) */
.empty-state {
    text-align: center;
    color: var(--text-m);
    font-size: 0.83rem;
    padding: 24px 0;
    opacity: 0.7;
}

/* Toast (Mensagem verde de sucesso que sobe na tela) */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-card);
    border: 1px solid var(--d-border-h);
    border-radius: 50px;
    box-shadow: var(--d-shadow), var(--d-shadow-glow);
    padding: 10px 24px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-b);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 999;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
/* 
/* Fundo escuro e janela do Modal 
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--d-border-h);
    border-radius: var(--d-radius-lg);
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--d-shadow), 0 0 60px rgba(124, 58, 237, 0.18);
    position: relative;
    transform: scale(0.95);
    transition: transform 0.25s;
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    color: var(--text-m);
    font-size: 1.4rem;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-h);
} */

/* 12. RODAPÉ (Footer) */
footer {
    background: var(--bg-footer);
    padding: 50px 6%;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 30px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flogo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 4px;
}

.fdesc {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.48);
    line-height: 1.65;
    margin-bottom: 10px;
}

.ftag {
    display: inline-block;
    background: rgba(168, 85, 247, 0.22);
    color: #c4b5fd;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

.fcol h5 {
    font-size: 0.84rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 14px;
}

.fcol ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fcol ul li a {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.48);
    transition: color 0.25s;
}

.fcol ul li a:hover {
    color: #c4b5fd;
}

.fbot {
    background: var(--bg-footer);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 6%;
    text-align: center;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.32);
}

/* 13. RESPONSIVIDADE GLOBAL (Ajustes para Tablet e Celular) */
@media (max-width: 960px) {
    .grid-4 {
        grid-template-columns: 1fr 1fr;
    }

    /* Transforma grid de 4 colunas em 2 */
    .nav-links {
        display: none;
    }

    /* Esconde o menu normal */

    /* Estiliza o menu dropdown mobile */
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--d-nav-h);
        left: 0;
        right: 0;
        background: var(--nav-bg);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--nav-brd);
        padding: 16px 5%;
        z-index: 199;
    }

    .nav-link {
        border-radius: var(--d-radius-sm);
        padding: 10px 14px;
    }

    .hamburger {
        display: flex;
    }

    /* Mostra o botão hamburguer */
    .avatar-name {
        display: none;
    }

    /* Esconde o nome do usuário para poupar espaço */
}

@media (max-width: 900px) {
    footer {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {

    .grid-2,
    .grid-4,
    .field-row {
        grid-template-columns: 1fr;
    }

    /* Transforma todos os grids em coluna única (uma coisa debaixo da outra) */
    .section-title {
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }
}

@media (max-width: 600px) {
    footer {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .main-content {
        padding: 24px 4% 80px;
    }

    .card {
        padding: 16px;
    }
}