/* =========================================
   SISTEMA FINANCEIRO - ESTILO UNIFICADO (FINAL)
   ========================================= */

/* 1. CORREÇÃO DA BARRA DE ADMIN DO WP */
#wpadminbar { display: none !important; }
html { margin-top: 0 !important; }

/* 2. VARIÁVEIS E BASE */
:root {
    /* Cores Institucionais */
    --primary: #3f502e;       /* Verde Escuro Principal */
    --primary-hover: #143820;
    --accent: #4f7942;        /* Verde Médio */
    --accent-hover: #3e6334;
    
    /* Cores Semânticas */
    --success: #10b981;       /* Verde Sucesso */
    --success-bg: #ecfdf5;
    --danger: #f43f5e;        /* Vermelho Erro/Despesa */
    --danger-bg: #fff1f2;
    --mei: #6366f1;           /* Roxo MEI */
    --me: #f59e0b;            /* Laranja ME */
    
    /* Neutros e Estrutura */
    --text-main: #1e2937;
    --text-muted: #64748b;
    --bg-app: #f8fafc;        /* Fundo Padrão */
    --bg-light: #f4f7f2;      /* Fundo Login */
    --white: #ffffff;
    --border-color: #e2e8f0;
    
    /* Layout */
    --sidebar-width: 260px;
    --radius: 12px;
    --shadow: 0 10px 25px rgba(0,0,0,0.03);
    --font-family: 'Inter', 'Montserrat', sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: var(--font-family); background-color: var(--bg-app); color: var(--text-main); }
a { text-decoration: none; }

/* =========================================
   3. LAYOUT GERAL (DESKTOP)
   ========================================= */
.dashboard-wrapper { display: flex; min-height: 100vh; background: var(--bg-app); }

/* Sidebar (Menu Lateral) */
.sidebar {
    width: var(--sidebar-width);
    background: #313e24;
    color: white;
    padding: 30px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 999;
    transition: left 0.3s ease;
}

.sidebar-logo {
    font-size: 1.4rem; font-weight: 800; margin-bottom: 40px;
    display: flex; align-items: center; gap: 10px; color: var(--white);
}

.nav-menu { list-style: none; padding: 0; margin: 0; flex-grow: 1; display: flex; flex-direction: column; }
.nav-item { margin-bottom: 5px; }
.nav-link {
    display: flex; align-items: center; gap: 12px; padding: 12px 15px;
    color: rgba(255,255,255,0.7); border-radius: var(--radius); transition: 0.3s; font-size: 0.95rem;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.1); color: var(--white); }
.nav-link i { width: 20px; text-align: center; }

.user-info {
    border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px;
    margin-top: auto; font-size: 0.8rem; color: rgba(255,255,255,0.5);
}

.main-content { flex-grow: 1; padding: 40px; overflow-y: auto; width: 100%; }

/* =========================================
   4. HEADER MOBILE EXCLUSIVO DO SISTEMA
   ========================================= */
.sys-header {
    display: none; /* Desktop: Oculto */
    align-items: center;
    justify-content: center; /* CENTRALIZA A LOGO */
    background: var(--primary);
    height: 60px;
    position: fixed;
    top: 0; /* Se quiser abaixo do menu do site, mude para 50px ou 60px */
    left: 0;
    width: 100%;
    z-index: 990; /* Abaixo do menu do site (se houver), acima do conteúdo */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 0 20px;
}

/* Botão Hambúrguer do Sistema (Canto Esquerdo) */
.sys-toggle {
    position: absolute; /* Tira do fluxo para não empurrar a logo */
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 992;
    padding: 5px;
    display: flex; align-items: center; justify-content: center;
}

/* Logo do Sistema Mobile (Centralizada) */
.sys-logo-mobile {
    color: var(--white);
    font-weight: 800;
    font-size: 1.1rem;
    white-space: nowrap;
    z-index: 991;
    display: flex; align-items: center; gap: 8px;
}

/* Fundo Escuro */
.menu-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 9999; opacity: 0; transition: opacity 0.3s;
}
.menu-overlay.active { display: block; opacity: 1; }

/* REGRAS RESPONSIVAS */
@media (max-width: 992px) {
    .dashboard-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 80%;
        max-width: 280px;
        height: 100vh;
        z-index: 10001; /* Fica na frente de tudo */
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }
    .sidebar.active { left: 0; }
    
    .sys-header, .sys-toggle { display: flex; }
    
        .main-content {
        padding: 10px 10px 10px 10px!important;
    }

    .period-filter {
    padding: 0px 0px !important;
    background: transparent !important;
    }
    
    /* Grid Mobile */
    .form-financeiro, .form-grid { grid-template-columns: 1fr !important; gap: 15px; }
    .charts-grid { grid-template-columns: 1fr !important; }
}

/* =========================================
   5. COMPONENTES (Cards, Forms, Tabelas)
   ========================================= */
.card-box, .chart-box, .shortcut-card {
    background: var(--white); padding: 25px; border-radius: 20px;
    box-shadow: var(--shadow); border: 1px solid #eef2ed; margin-bottom: 30px; position: relative;
}
.card-box h3, .chart-box h3 { margin-top: 0; color: var(--text-main); font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }

/* Forms */
.form-financeiro, .form-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 15px; align-items: flex-end; }
.input-group label, .group label, .form-group label { display: block; font-size: 11px; font-weight: 800; color: #888; text-transform: uppercase; margin-bottom: 8px; }
.input-group input, .input-group select, .group input, .group select, .form-group input {
    width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 10px; background: #fbfbfb; font-family: var(--font-family); font-size: 0.95rem; transition: 0.2s;
}
.input-group input:focus, .group input:focus { outline: none; border-color: var(--primary); background: var(--white); }

.btn-action {
    border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary); color: var(--white); border: none; cursor: pointer; transition: 0.2s;
}
.btn-action:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* 1. CONTAINER DA TABELA */
.table-container {
    width: 100%;
    border-radius: 8px;
    background: #fff;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 2. TABELA DESKTOP */
.table-financeira {
    width: 100%;
    border-collapse: collapse;
}

/* 3. CABEÇALHO */
.table-financeira th {
    text-align: left;
    padding: 15px;
    color: #94a3b8;
    font-size: 11px;
    text-transform: uppercase;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    font-weight: 600;
}

/* 4. CÉLULAS */
.table-financeira td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #1e2937;
}

.table-financeira tr:last-child td {
    border-bottom: none;
}

/* 5. BADGES */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    margin-right: 8px;
}

.badge.me {
    background: #fef3c7;
    color: #92400e;
}

.badge.mei {
    background: #dbeafe;
    color: #1e40af;
}

/* 6. RESPONSIVIDADE MOBILE - CARDS */
@media screen and (max-width: 768px) {

    .card-box, .chart-box, .shortcut-card {
    background: transparent;
        box-shadow: none;
    border: none;
    }


    .btn-nav, .btn-confirma {
    width: 100%!important;
    }
    /* Esconde a tabela tradicional */
    .table-financeira thead {
        display: none;
    }
    
    .table-financeira,
    .table-financeira tbody,
    .table-financeira tr,
    .table-financeira td {
        display: block;
        width: 100%;
    }
    
    /* Cada linha vira um card */
    .table-financeira tr {
        margin-bottom: 15px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 15px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    
    .table-financeira tr:last-child {
        margin-bottom: 0;
    }
    
    /* Remove bordas internas */
    .table-financeira td {
        padding: 8px 0;
        border: none;
        text-align: left;
    }
    
    /* Adiciona labels antes de cada dado */
    .table-financeira td:before {
        content: attr(data-label);
        display: block;
        font-size: 10px;
        text-transform: uppercase;
        color: #94a3b8;
        font-weight: 600;
        margin-bottom: 4px;
        letter-spacing: 0.5px;
    }
    
    /* Primeiro item (nome + badge) sem label */
    .table-financeira td:first-child {
        padding-bottom: 12px;
        margin-bottom: 8px;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .table-financeira td:first-child:before {
        display: none;
    }
    
    /* Nome do cliente em destaque */
    .table-financeira td:first-child {
        font-size: 16px;
        font-weight: 600;
        color: #1e2937;
    }
    
    /* Botões de ação em linha */
    .table-financeira td.actions-cell {
        padding-top: 12px;
        margin-top: 8px;
        border-top: 1px solid #f1f5f9;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .table-financeira td.actions-cell:before {
        display: none;
    }
    
    .table-financeira td.actions-cell button {
        flex: 1;
        min-width: calc(50% - 4px);
        padding: 10px;
        font-size: 13px;
        border-radius: 6px;
        border: 1px solid #e2e8f0;
        background: #fff;
        color: #475569;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .table-financeira td.actions-cell button:hover {
        background: #f8fafc;
        border-color: #cbd5e1;
    }
    
    .table-financeira td.actions-cell button.primary {
        background: #3b82f6;
        color: #fff;
        border-color: #3b82f6;
    }
    
    .table-financeira td.actions-cell button.primary:hover {
        background: #2563eb;
    }
    
    /* Ajuste do container */
    .table-container {
        margin: 15px 0;
        border-radius: 0;
        box-shadow: none;
    }
}

/* 7. MOBILE PEQUENO (< 480px) */
@media screen and (max-width: 480px) {
    .table-financeira tr {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .table-financeira td {
        padding: 6px 0;
        font-size: 14px;
    }
    
    .table-financeira td:first-child {
        font-size: 15px;
    }
    
    .badge {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .table-financeira td.actions-cell button {
        padding: 8px;
        font-size: 12px;
    }
}

/* 8. HOVER APENAS DESKTOP */
@media (hover: hover) and (min-width: 769px) {
    .table-financeira tbody tr:hover {
        background-color: #f8fafc;
    }
}

/* Badges */
.badge, .badge-tipo { padding: 4px 10px; border-radius: 6px; font-size: 10px; font-weight: 800; text-transform: uppercase; display: inline-block; }
.badge-receita { background: var(--success-bg); color: var(--success); }
.badge-despesa { background: var(--danger-bg); color: var(--danger); }
.badge-mei { background: #e0e7ff; color: var(--mei); }
.badge-me { background: #fef3c7; color: var(--me); }

/* Filtros */
.nav-mes-pill { display: flex; align-items: center; background: var(--white); padding: 6px 10px; border-radius: 50px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); width: fit-content; }
.btn-nav { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f1f5f9; color: #333; transition: 0.2s; }
.btn-nav:hover { background: #e2e8f0; }
.period-filter { background: var(--white); padding: 20px 25px; border-radius: 20px; box-shadow: var(--shadow); margin-bottom: 30px; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.period-filter select { padding: 10px 15px; border: 2px solid var(--border-color); border-radius: 12px; min-width: 200px; }
.period-filter button { padding: 10px 20px; background: var(--primary); color: white; border: none; border-radius: 12px; font-weight: 600; cursor: pointer; }

/* Gráficos e Status */
.charts-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 30px; margin-top: 30px; }
.chart-container { position: relative; height: 300px; width: 100%; }
.btn-status { border: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; gap: 8px; }
.btn-status.pago { background: var(--success-bg); color: var(--success); }
.btn-status.pendente { background: var(--white); border: 1px solid var(--border-color); color: var(--text-muted); }

/* =========================================
   6. TELA DE LOGIN
   ========================================= */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-light); padding: 20px; }
.login-card { background: var(--white); width: 100%; max-width: 400px; padding: 40px; border-radius: 24px; box-shadow: 0 20px 50px rgba(0,0,0,0.05); text-align: center; border: 1px solid var(--border-color); }
.login-card h2 { color: var(--primary); font-size: 1.5rem; margin-bottom: 10px; }
.login-card p { color: #666; font-size: 0.9rem; margin-bottom: 30px; }
.error-msg { background: var(--danger-bg); color: var(--danger); padding: 12px; border-radius: 10px; font-size: 0.8rem; margin-bottom: 20px; font-weight: 600; }
.back-home { display: inline-block; margin-top: 25px; color: #999; font-size: 0.8rem; text-decoration: none; }

/* --- BOTÕES DE AÇÃO RÁPIDA (Estilo Card) --- */
.btn-action-card {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    background: #fff;
    border: 1px solid #f0f0f0;
}

/* Efeito Hover */
.btn-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-color: transparent;
}

/* Cores Específicas */
.btn-action-card.receita { border-left: 4px solid var(--success); }
.btn-action-card.despesa { border-left: 4px solid var(--danger); }

/* Ícone Circular */
.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 15px;
    flex-shrink: 0;
}

.receita-icon { background: var(--success-bg); color: var(--success); }
.despesa-icon { background: var(--danger-bg); color: var(--danger); }

/* Texto */
.btn-text {
    flex-grow: 1; /* Ocupa o espaço restante */
    display: flex;
    flex-direction: column;
}

.btn-title {
    font-weight: 700;
    color: var(--text-main);
    font-size: 14px;
}

.btn-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Seta Direita */
.arrow-icon {
    color: #ccc;
    font-size: 12px;
    transition: 0.2s;
}

.btn-action-card:hover .arrow-icon {
    color: var(--primary);
    transform: translateX(3px);
}

/* Ajuste para o container que envolve filtros e o botão "Novo Cliente" */
.filtros-container {
    display: flex;
    flex-wrap: wrap; /* Permite quebrar linha */
    gap: 15px;
    align-items: center;
    justify-content:建设-between;
    margin-bottom: 20px;
}

/* Responsividade para Mobile (Até 768px) */
@media (max-width: 768px) {
    .filtros-container {
        flex-direction: column; /* Empilha um em cima do outro */
        align-items: stretch; /* Faz os botões ocuparem a largura total */
    }

    .filtros-container form, 
    .filtros-container .btn-verde {
        width: 100%;
    }

    /* Ajuste para os cards de resumo (Total de Clientes) */
    .resumo-header {
        flex-direction: column;
        gap: 10px;
    }
}

/* =========================================
   9. PAGINAÇÃO (UX/UI SYSTEM - V2)
   ========================================= */
.pagination-wrapper {
    margin-top: 20px;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--border-color);
}

/* Removemos os estilos de lista padrão do WordPress */
.pagination-wrapper ul.page-numbers {
    display: flex;
    padding: 0;
    margin: 0;
    list-style: none;
    gap: 8px; /* Espaço entre os botões */
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

/* ESTILO DOS BOTÕES (Links e Span) */
.pagination-wrapper ul.page-numbers li a,
.pagination-wrapper ul.page-numbers li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;  /* Tamanho ideal para toque (44px é o padrão Apple/Google) */
    height: 44px;
    padding: 0 12px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px; /* Acompanha o --radius do sistema */
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    cursor: pointer;
}

/* ESTILO HOVER (Passar o mouse) */
.pagination-wrapper ul.page-numbers li a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0fdf4; /* Um verde muito suave de fundo */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(63, 80, 46, 0.15);
}

/* ESTILO ATIVO (Página Atual) */
.pagination-wrapper ul.page-numbers li span.current {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(63, 80, 46, 0.4);
    cursor: default;
    transform: scale(1.05); /* Leve destaque de tamanho */
}

/* ESTILO DOTS (...) */
.pagination-wrapper ul.page-numbers li span.dots {
    border: none;
    background: transparent;
    box-shadow: none;
    min-width: auto;
    padding: 0 5px;
    color: #ccc;
}

/* AJUSTES PARA ÍCONES (Setas) */
.pagination-wrapper .page-numbers .prev,
.pagination-wrapper .page-numbers .next {
    font-size: 0.85rem;
    color: var(--primary); /* Setas sempre na cor da marca */
}

/* --- RESPONSIVIDADE MOBILE --- */
@media screen and (max-width: 480px) {
    .pagination-wrapper {
        padding: 15px 0;
        border-top: none; /* Mais limpo no mobile */
    }

    .pagination-wrapper ul.page-numbers {
        gap: 6px;
    }

    /* Reduz levemente para caber telas pequenas, mas mantém tocável */
    .pagination-wrapper ul.page-numbers li a,
    .pagination-wrapper ul.page-numbers li span {
        min-width: 38px;
        height: 38px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
}


/* =========================================
   10. FILTROS AVANÇADOS (UX)
   ========================================= */
.filter-wrapper {
    margin-bottom: 25px;
    background: transparent;
}

.filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Campos de Seleção (Estilo Padrão) */
.sys-select, 
.sys-input-search {
    height: 45px;
    padding: 0 15px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--white);
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: var(--font-family);
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    /* Aparência nativa limpa */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%233f502e%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 10px auto;
    padding-right: 35px; /* Espaço para a seta customizada */
}

/* Campo de Busca com Ícone */
.filter-search {
    position: relative;
    flex-grow: 1; /* Ocupa o espaço restante */
    min-width: 200px;
}

.filter-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.sys-input-search {
    width: 100%;
    padding-left: 40px; /* Espaço para a lupa */
    background-image: none; /* Remove seta do select se herdada */
}

/* Foco nos Campos */
.sys-select:focus,
.sys-input-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(63, 80, 46, 0.1);
}

/* Botões de Ação do Filtro */
.btn-filter {
    height: 45px;
    width: 45px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.btn-filter:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-clear {
    background: #fee2e2;
    color: var(--danger);
    text-decoration: none; /* Reset para link */
}

.btn-clear:hover {
    background: #fecaca;
    color: #991b1b;
}

/* RESPONSIVIDADE MOBILE (Filtros) */
@media screen and (max-width: 768px) {
    .filter-form {
        gap: 8px;
        background: var(--white);
        padding: 15px;
        border-radius: 15px;
        border: 1px solid var(--border-color);
        box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    }
    
    .filter-item {
        flex: 1 1 45%; /* 2 por linha */
        width: auto;
    }
    
    .sys-select, .sys-input-search {
        width: 100%;
        font-size: 0.85rem;
        height: 40px;
    }
    
    /* Busca ocupa linha inteira no mobile */
    .filter-search {
        flex: 1 1 100%;
        order: -1; /* Joga a busca para o topo no mobile (padrão de app) */
        margin-bottom: 5px;
    }
    
    /* Botões ficam lado a lado */
    .btn-filter {
        flex: 1;
        height: 40px;
    }
}

/* Botão Exportar Excel */
.btn-excel {
    background: #10b981; /* Verde Sucesso */
    color: white;
}

.btn-excel:hover {
    background: #059669; /* Verde mais escuro no hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

/* Ajuste Mobile: Garantir que os botões (Filtro, Excel, Limpar) fiquem alinhados */
@media screen and (max-width: 768px) {
    .filter-form .btn-filter {
        flex: 1; /* Todos ocupam o mesmo tamanho na linha */
        min-width: 45px;
    }
    
    /* Se tiver muitos botões, garante que não quebrem feio */
    .filter-form {
        gap: 8px;
    }
}

.cadu-consultoria-card {
    background: var(--white);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cadu-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    text-align: left;
}

.cadu-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--mei);
}

.btn-cadu {
    background: #25D366; /* Cor oficial do WhatsApp para destaque */
    color: white !important;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    width: 100%;
    transition: transform 0.2s;
}

.btn-cadu:hover {
    transform: scale(1.02);
    background: #128C7E;
}

/* --- CARD DO CADU IA (Novo estilo harmônico) --- */

.cadu-box {
    /* Herda o estilo base dos outros cards */
    background: var(--white);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    /* Destaque lateral na cor primária (verde do tema) */
    border-left: 5px solid var(--primary);
    display: flex;
    flex-direction: column;
    /* Remove o justify-content que causava o buraco */
    gap: 20px; 
}

.cadu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin: 0; /* Remove margem padrão do h3 */
}

.cadu-title {
    margin: 0;
    font-size: 16px;
    color: var(--text-main);
    display: flex;
    align-items: center;
}

.cadu-title i {
    /* Ícone na cor primária para destaque */
    color: var(--primary);
    margin-right: 10px;
    font-size: 1.2rem;
}

.cadu-status {
    background: rgba(0, 200, 81, 0.15); /* Fundo verde claro (baseado na var --success) */
    color: var(--success);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.cadu-text {
    font-size: 0.95rem;
    color: #64748b; /* Cor de texto secundário do tema */
    line-height: 1.6;
    margin: 0; /* Remove margens extras para aproximar do botão */
}

.btn-cadu-whatsapp {
    /* Cor oficial do WhatsApp para reconhecimento imediato */
    background: #25D366;
    color: white !important;
    text-align: center;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(37, 211, 102, 0.2);
}

.btn-cadu-whatsapp i {
    font-size: 1.4rem;
}

.btn-cadu-whatsapp:hover {
    background: #1fb455; /* Verde um pouco mais escuro no hover */
    transform: translateY(-3px);
    box-shadow: 0 7px 12px rgba(37, 211, 102, 0.3);
}

/* --- NAVEGAÇÃO DE PERÍODO (Centralizada e Redonda) --- */

.period-nav {
    display: flex;
    align-items: center;
    justify-content: center; /* Centraliza o bloco na tela */
    gap: 20px; /* Espaço entre setas e o texto */
    margin-bottom: 30px;
    background: transparent;
}

.period-display {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    text-transform: capitalize;
    min-width: 180px; /* Garante que o texto não "pule" ao mudar de mês */
    text-align: center;
}

.btn-nav-round {
    width: 42px;         /* Largura Fixa */
    height: 42px;        /* Altura Fixa igual a largura */
    border-radius: 50%;  /* 50% garante um Círculo Perfeito */
    
    display: flex;       /* Centraliza o ícone dentro da bolinha */
    align-items: center;
    justify-content: center;
    
    background: var(--white);
    border: 1px solid #e2e8f0;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.btn-nav-round:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(63, 80, 46, 0.3); /* Sombra suave na cor primary */
}

.btn-nav-round i {
    font-size: 14px; /* Tamanho do ícone ajustado */
}


/* ==========================================
   UX & UI: MÓDULO FINANCEIRO PESSOAL
   ========================================== */

/* 1. Tipografia e Espaçamento Base */
.dashboard-wrapper * { box-sizing: border-box; }
.card-box h3 { font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }

/* 2. Grid de Resumo 50/30/20 */
.summary-container {
    background: white; padding: 25px; border-radius: 16px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); margin-bottom: 30px;
}
.summary-header {
    display: flex; justify-content: space-between; align-items: center; 
    margin-bottom: 25px; border-bottom: 1px solid #f1f5f9; padding-bottom: 15px;
}
.summary-renda {
    font-size: 1.2rem; font-weight: 800; color: var(--success, #10b981);
    background: #ecfdf5; padding: 8px 16px; border-radius: 8px;
}
.progress-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px;
}

/* Cartões de Progresso Individuais */
.progress-card { 
    background: #f8fafc; padding: 18px; border-radius: 12px; 
    border: 1px solid #e2e8f0; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.progress-card:hover {
    transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}
.card-header { 
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; font-size: 0.95rem; color: #334155; font-weight: 600;
}
.card-header span { font-weight: 700; color: #0f172a; }

/* A Barra de Progresso (Visual Feedback) */
.progress-bar-bg { 
    width: 100%; height: 10px; background: #e2e8f0; 
    border-radius: 6px; overflow: hidden; margin-bottom: 8px;
}
.progress-fill { 
    height: 100%; border-radius: 6px; 
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); /* Suavidade UX */
}
.progress-card small { font-size: 0.8rem; font-weight: 600; display: block; text-align: right; }

/* 3. Formulário (Touch Targets para Mobile) */
.form-financeiro { display: flex; flex-direction: column; gap: 16px; }
.form-financeiro .input-group { display: flex; flex-direction: column; gap: 6px; }
.form-financeiro label { font-size: 0.85rem; font-weight: 600; color: #475569; }
.form-financeiro input, 
.form-financeiro select {
    width: 100%; padding: 12px 16px; border: 1px solid #cbd5e1; 
    border-radius: 8px; font-size: 1rem; color: #1e293b; background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    height: 48px; /* Touch target ideal Apple/Google */
}
.form-financeiro input:focus, 
.form-financeiro select:focus {
    outline: none; border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}
.btn-submit-pf {
    background: var(--primary); color: white; width: 100%; height: 48px;
    border: none; border-radius: 8px; cursor: pointer; font-weight: 700;
    font-size: 1rem; transition: background 0.2s ease, transform 0.1s ease;
    margin-top: 10px;
}
.btn-submit-pf:active { transform: scale(0.98); }

/* 4. Grid da Página (Formulário lado a lado com Tabela) */
.page-grid {
    display: grid; grid-template-columns: 1fr 2fr; gap: 30px; align-items: start;
}

/* 5. Tabela Responsiva (UX Mobile First) */
.table-financeira { width: 100%; border-collapse: collapse; }
.table-financeira th, .table-financeira td {
    padding: 14px 16px; text-align: left; border-bottom: 1px solid #f1f5f9;
}
.table-financeira th { 
    font-size: 0.85rem; text-transform: uppercase; color: #64748b; font-weight: 700; background: #f8fafc;
}
.badge-regra {
    padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
    background: #e2e8f0; color: #475569; display: inline-block;
}

/* ==========================================
   RESPONSIVIDADE (MOBILE)
   ========================================== */
@media (max-width: 992px) {
    /* Empilha o formulário e a tabela */
    .page-grid { grid-template-columns: 1fr; gap: 20px; }
    
    /* Ajustes de cabeçalho */
    .summary-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .summary-renda { width: 100%; text-align: center; }
}

@media (max-width: 768px) {
    .dashboard-wrapper main header { flex-direction: column; align-items: stretch; gap: 15px; }
    .dashboard-wrapper main header form { width: 100%; }
    .dashboard-wrapper main header input[type="month"] { flex: 1; height: 48px; }
    .dashboard-wrapper main header button { height: 48px; width: 48px; display: flex; justify-content: center; align-items: center; }

    /* Transforma a tabela em formato de Cartões no Mobile */
    .table-financeira thead { display: none; } /* Esconde o cabeçalho original */
    .table-financeira tbody tr {
        display: block; background: #fff; border: 1px solid #e2e8f0;
        border-radius: 12px; margin-bottom: 12px; padding: 12px;
    }
    .table-financeira tbody td {
        display: flex; justify-content: space-between; align-items: center;
        padding: 8px 0; border: none; font-size: 0.95rem;
    }
    .table-financeira tbody td:not(:last-child) { border-bottom: 1px dashed #e2e8f0; }
    
    /* Cria pseudo-labels para explicar o dado no celular */
    .table-financeira tbody td::before {
        content: attr(data-label); font-weight: 600; color: #64748b; font-size: 0.8rem;
    }
    
    /* Ajusta o alinhamento da coluna valor no mobile */
    .table-financeira tbody td[data-label="Valor"] { font-size: 1.1rem; }
}

/* 3. Formulário (Blindado contra o tema global) */
.form-financeiro { 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
    width: 100%;
}

.form-financeiro .input-group { 
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
    width: 100%; 
    align-items: flex-start; /* Garante que nada fuja para a direita */
}

.form-financeiro .input-group label { 
    font-size: 0.85rem; 
    font-weight: 600; 
    color: #475569; 
    text-align: left; 
    width: 100%; 
}

.form-financeiro input, 
.form-financeiro select {
    width: 100% !important; /* O !important barra a interferência do tema */
    max-width: 100%;
    padding: 12px 16px; 
    border: 1px solid #cbd5e1; 
    border-radius: 8px; 
    font-size: 1rem; 
    color: #1e293b; 
    background: #fff;
    box-sizing: border-box;
    height: 48px; 
}