/* =========================================
   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;
    align-self: stretch;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 999;
    transition: left 0.3s ease, width 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

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

.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;
    position: relative;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.1); color: var(--white); }
.nav-link i { width: 20px; text-align: center; flex-shrink: 0; }

/* =========================================
   3.1 SIDEBAR RECOLHÍVEL (DESKTOP) — modo ícones
   Botão .sidebar-collapse-toggle alterna a classe
   .is-collapsed na .sidebar. O texto de cada link
   (envolvido em .nav-link-text pelo menu-mobile.js)
   vira um "flyout" que aparece ao lado do ícone
   no hover.
   ========================================= */
.sidebar-collapse-toggle {
    width: 30px;
    height: 30px;
    margin: -10px 0 24px auto;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}
.sidebar-collapse-toggle:hover { background: rgba(255,255,255,0.16); color: var(--white); }
.sidebar-collapse-toggle i { transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); }

.nav-link-text {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    max-width: 180px;
    opacity: 1;
    transition: opacity 0.2s ease, max-width 0.3s ease;
}

.sidebar.is-collapsed {
    width: 88px;
    padding: 30px 14px;
}
.sidebar.is-collapsed .sidebar-logo { justify-content: center; overflow: hidden; }
.sidebar.is-collapsed .sidebar-logo span,
.sidebar.is-collapsed .sidebar-logo .logo-text { display: none; }
.sidebar.is-collapsed .sidebar-collapse-toggle { margin-left: auto; margin-right: auto; }
.sidebar.is-collapsed .sidebar-collapse-toggle i { transform: rotate(180deg); }

.sidebar.is-collapsed .nav-link { justify-content: center; padding: 12px; }

/* O texto original de cada link só some visualmente — quem mostra o nome
   no hover agora é o balão único .sidebar-flyout-tooltip (fixed, no body),
   posicionado via JS. Isso evita o balão ficar "atrás" de qualquer card
   do .main-content que tenha seu próprio stacking context (position +
   sombra), já que position:fixed não depende do contexto da .sidebar. */
.sidebar.is-collapsed .nav-link-text { max-width: 0; opacity: 0; }

/* Balão único, reaproveitado para todos os links (criado pelo JS) */
.sidebar-flyout-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    background: #1f2818;
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 8px 14px;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.3);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-50%) translateX(-6px) scale(0.96);
    transform-origin: left center;
    transition: opacity 0.18s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 99999;
}
.sidebar-flyout-tooltip::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px 5px 5px 0;
    border-style: solid;
    border-color: transparent #1f2818 transparent transparent;
}
.sidebar-flyout-tooltip.is-visible {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
    transition-delay: 0.12s;
}

/* No mobile a sidebar continua sendo a gaveta (drawer) de sempre —
   o modo ícones é exclusivo do desktop. */
@media (max-width: 992px) {
    .sidebar-collapse-toggle { display: none; }
    .sidebar.is-collapsed { width: 80%; max-width: 280px; padding: 30px 20px; }
    .sidebar.is-collapsed .nav-link { justify-content: flex-start; padding: 12px 15px; }
    .sidebar.is-collapsed .nav-link-text { max-width: 180px; opacity: 1; }
    .sidebar-flyout-tooltip { display: none; }
}

.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%; }

/* =========================================
   3.5. FOOTER ENXUTO DO SISTEMA (DESKTOP + MOBILE)
   ========================================= */
.sys-footer {
    width: 100%;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

.sys-footer-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.sys-footer-credit {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
}

.sys-footer-credit b {
    color: var(--primary);
    font-weight: 700;
}

/* =========================================
   4. HEADER ENXUTO DO SISTEMA (DESKTOP + MOBILE)
   Substitui o header institucional do site nas
   páginas do sistema. Fica fixo no topo, acima
   de tudo, tanto em desktop quanto em mobile.
   ========================================= */
.sys-topbar {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background: var(--primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    z-index: 1000;
}

.sys-topbar-inner {
    height: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sys-topbar-logo {
    display: flex;
    align-items: center;
}

.sys-topbar-logo a,
.sys-topbar-logo .custom-logo-link {
    max-height: 45px !important;
    color: var(--white);
    font-weight: 800;
    font-size: 1.2rem;
    display: flex !important;
    align-items: center !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.sys-topbar-logo a:hover,
.sys-topbar-logo .custom-logo-link:hover {
    transform: scale(1.12) translateY(-2px);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.2));
}

.sys-topbar-logo img,
.sys-topbar-logo .custom-logo {
    max-height: 45px !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    filter: brightness(0) invert(1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.sys-topbar-logo a:hover img,
.sys-topbar-logo .custom-logo-link:hover img,
.sys-topbar-logo a:hover .custom-logo,
.sys-topbar-logo .custom-logo-link:hover .custom-logo {
    transform: scale(1.12) translateY(-2px);
}


.sys-topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sys-topbar-user {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-align: right;
}

.sys-topbar-user-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
}

.sys-topbar-user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--white);
}

.sys-topbar-back,
.sys-topbar-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.sys-topbar-back:hover,
.sys-topbar-logout:hover {
    background: rgba(255,255,255,0.12);
    color: var(--white);
}

.sys-topbar-toggle {
    display: none; /* Só aparece no mobile, junto com a sidebar recolhível */
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 6px;
}

/* Antiga versão mobile-only (mantida por compatibilidade, se ainda referenciada
   em algum template do sistema) — mas o header principal agora é .sys-topbar */
.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; }

    /* O botão hambúrguer do header enxuto (#sysMenuToggle, em header.php)
       alterna a classe "painel-financeiro-aberto" no <body> — não uma
       classe "active" na própria .sidebar/.menu-overlay. Sem esta ponte,
       o JS roda (body recebe a classe, overflow trava) mas nada na tela
       se move, porque o CSS só reagia a .sidebar.active/.menu-overlay.active. */
    body.painel-financeiro-aberto .sidebar { left: 0; }
    body.painel-financeiro-aberto .menu-overlay { display: block; opacity: 1; }

    .sys-header, .sys-toggle { display: flex; }

    .sys-topbar-toggle { display: flex; align-items: center; justify-content: center; }
    .sys-topbar-user { display: none; }
    .sys-topbar-inner { padding: 0 16px; }
    .sys-topbar-logo a,
    .sys-topbar-logo img,
    .sys-topbar-logo .custom-logo-link img,
    .sys-topbar-logo .custom-logo {
        max-height: 36px !important;
    }
    
    .sys-footer-inner {
        padding: 12px 16px;
    }
    
    .sys-footer-credit {
        font-size: 0.75rem;
    }
    
        .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;
}

/* --- AGENDA DO DIA (Dashboard) --- */
.agenda-dia-box {
    background: var(--white);
    padding: 25px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid #eef2ed;
    border-left: 5px solid var(--primary);
    margin-bottom: 30px;
}
.agenda-dia-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.agenda-dia-header-inner {
    justify-content: flex-end;
}
.agenda-dia-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}
.agenda-dia-header h3 i { color: var(--primary); }
.agenda-dia-data {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: capitalize;
    background: var(--bg-app);
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
}
.agenda-dia-vazia {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
    padding: 20px 0 6px;
    margin: 0;
}
.agenda-dia-lista {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 340px;
    overflow-y: auto;
}
.agenda-dia-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}
.agenda-dia-item:hover { background: var(--bg-app); }
.agenda-dia-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.agenda-dia-titulo {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.agenda-dia-recorrente {
    color: var(--primary);
    font-size: 0.75rem;
    margin-right: 6px;
}
.agenda-dia-coluna {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-app);
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.agenda-dia-prioridade {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    white-space: nowrap;
}
.agenda-dia-prioridade.prioridade-baixa { background: var(--success-bg); color: var(--success); }
.agenda-dia-prioridade.prioridade-normal { background: #fef9e7; color: #9a7d0a; }
.agenda-dia-prioridade.prioridade-alta { background: var(--danger-bg); color: var(--danger); }

@media screen and (max-width: 768px) {
    .agenda-dia-box { padding: 20px; }
    .agenda-dia-item { flex-wrap: wrap; }
    .agenda-dia-titulo { flex-basis: 100%; order: 1; }
    .agenda-dia-coluna, .agenda-dia-prioridade { order: 2; }
}

/* --- ACCORDION DA AGENDA DO DIA (resumo fechado + expandir) --- */
.agenda-accordion {
    padding: 0;
    overflow: hidden;
}

.agenda-accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 22px 25px;
    text-align: left;
    font-family: inherit;
}

.agenda-accordion-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(63, 80, 46, 0.1);
    color: var(--primary);
    font-size: 1.05rem;
}

.agenda-accordion-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.agenda-accordion-titulo {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

.agenda-accordion-resumo {
    font-size: 0.85rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-accordion-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: transform 0.25s ease;
}

.agenda-accordion.is-expanded .agenda-accordion-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.agenda-accordion.is-expanded .agenda-accordion-toggle {
    border-bottom: 1px solid #eef2ed;
}

.agenda-accordion-alerta {
    display: inline-flex;
    align-items: center;
    color: var(--danger);
    font-weight: 700;
}

.agenda-accordion-resumo-sep {
    margin: 0 6px;
    color: var(--text-muted);
}

.agenda-accordion.has-atraso {
    border-left-color: var(--danger);
}

.agenda-accordion.has-atraso .agenda-accordion-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Aviso de tarefas atrasadas dentro da coluna "Hoje" */
.kanban-alert-atrasadas {
    background: var(--danger-bg);
    border: 1px solid rgba(244, 63, 94, 0.25);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.kanban-alert-atrasadas-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--danger);
    line-height: 1.3;
}

.kanban-alert-atrasadas-lista {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kanban-alert-atrasadas-lista li {
    display: block;
}

.kanban-alert-atrasadas-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.76rem;
    color: #9c2436;
    text-decoration: none;
    padding: 4px 6px;
    margin: -4px -6px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.kanban-alert-atrasadas-link:hover {
    background: rgba(244, 63, 94, 0.12);
}

.kanban-alert-atrasadas-titulo {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.kanban-alert-atrasadas-dias {
    flex-shrink: 0;
    font-weight: 700;
    background: rgba(244, 63, 94, 0.14);
    padding: 1px 7px;
    border-radius: 20px;
}

.kanban-alert-atrasadas-icone {
    flex-shrink: 0;
    font-size: 0.68rem;
    color: #9c2436;
    opacity: 0.6;
}

.kanban-alert-atrasadas-link:hover .kanban-alert-atrasadas-icone {
    opacity: 1;
}

.kanban-alert-atrasadas-mais {
    font-size: 0.72rem;
    color: var(--danger);
    margin-top: 6px;
    font-weight: 600;
}

.agenda-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.agenda-accordion-body-inner {
    padding: 22px 25px 25px;
}

@media screen and (max-width: 768px) {
    .agenda-accordion-toggle { padding: 18px 20px; gap: 12px; }
    .agenda-accordion-body-inner { padding: 18px 20px 20px; }
    .agenda-accordion-titulo { font-size: 0.98rem; }
    .agenda-accordion-resumo { white-space: normal; }
}

/* --- 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; 
}
/* ===== Setas de rolagem - Agenda do Dia (Dashboard) ===== */
.agenda-kanban-scroll-wrap {
    position: relative;
}

.agenda-scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: #3f502e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s, transform 0.2s;
}

.agenda-scroll-arrow:hover {
    background: #3f502e;
    color: #ffffff;
}

.agenda-scroll-arrow-left {
    left: -8px;
}

.agenda-scroll-arrow-right {
    right: -8px;
}

.agenda-scroll-arrow.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}

.agenda-kanban-scroll-wrap.sem-overflow .agenda-scroll-arrow {
    display: none;
}

@media (max-width: 768px) {
    .agenda-scroll-arrow {
        width: 32px;
        height: 32px;
    }
    .agenda-scroll-arrow-left { left: 2px; }
    .agenda-scroll-arrow-right { right: 2px; }
}

/* ===== Correção: garantir que o container role horizontalmente =====
   O tarefas-kanban.css deixa as colunas encolherem (flex-shrink padrão)
   pra caberem 100% na largura do container — por isso não sobrava nada
   pra rolar. Aqui travamos a largura da coluna e impedimos o encolhimento,
   forçando o overflow real dentro do wrapper. */
.agenda-kanban-scroll-wrap .kanban-columns {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    width: 100% !important;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.agenda-kanban-scroll-wrap .kanban-column {
    flex: 0 0 340px !important;
    width: 340px !important;
    min-width: 340px !important;
}

@media (max-width: 768px) {
    .agenda-kanban-scroll-wrap .kanban-column {
        flex: 0 0 280px !important;
        width: 280px !important;
        min-width: 280px !important;
    }
}

/* Esconde a barra de scroll nativa (as setas já cuidam da navegação) */
.agenda-kanban-scroll-wrap .kanban-columns {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge legado */
}
.agenda-kanban-scroll-wrap .kanban-columns::-webkit-scrollbar {
    display: none; /* Chrome, Edge, Safari */
}

/* ===== Layout: Agenda do Dia + Calendário lado a lado ===== */
.dashboard-agenda-layout {
    display: grid;
    grid-template-columns: 1fr 50%;
    gap: 30px;
    align-items: start;
}

.dashboard-agenda-kanban-wrap {
    min-width: 0;
}

.dashboard-calendar-wrap {
    position: sticky;
    top: 100px;
}

#dashboard-calendar {
    background: white;
    border: 0.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

/* FullCalendar customização para dashboard */
#dashboard-calendar .fc {
    font-family: var(--font-family, 'Inter', 'Montserrat', sans-serif);
}

#dashboard-calendar .fc-button-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    font-size: 0.85rem;
    padding: 6px 12px;
}

#dashboard-calendar .fc-button-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

#dashboard-calendar .fc-button-primary:not(:disabled).fc-button-active {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Cabeçalhos do calendário */
#dashboard-calendar .fc-col-header-cell {
    padding: 10px 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

/* Células do calendário */
#dashboard-calendar .fc-daygrid-day {
    padding: 8px 4px;
}

#dashboard-calendar .fc-daygrid-day-frame {
    min-height: 80px;
}

#dashboard-calendar .fc-daygrid-day-number {
    padding: 6px 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

#dashboard-calendar .fc-daygrid-day.fc-day-today {
    background-color: rgba(63, 80, 46, 0.08);
}

/* Eventos no calendário */
#dashboard-calendar .fc-event {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    border-radius: 4px;
    font-size: 0.7rem;
    padding: 2px 4px;
    margin-top: 2px;
}

#dashboard-calendar .fc-event-title {
    font-weight: 500;
}

/* Responsive: calendário em coluna abaixo em telas pequenas */
@media (max-width: 1400px) {
    .dashboard-agenda-layout {
        grid-template-columns: 1fr 380px;
        gap: 24px;
    }
}

@media (max-width: 1200px) {
    .dashboard-agenda-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dashboard-calendar-wrap {
        position: relative;
        top: 0;
    }
    
    #dashboard-calendar {
        padding: 12px;
    }
}

@media (max-width: 768px) {
    .dashboard-agenda-layout {
        grid-template-columns: 1fr;
    }
    
    #dashboard-calendar {
        padding: 8px;
    }
    
    #dashboard-calendar .fc-daygrid-day-frame {
        min-height: 60px;
    }
    
    #dashboard-calendar .fc-col-header-cell {
        font-size: 0.75rem;
        padding: 6px 2px;
    }
    
    #dashboard-calendar .fc-daygrid-day-number {
        padding: 4px 2px;
        font-size: 0.8rem;
    }
}

/* =========================================
   WIDGET DE PREVISÃO DO TEMPO (Dashboard)
   ========================================= */
.weather-widget {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: linear-gradient(120deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--white);
    margin-bottom: 24px;
    overflow: hidden;
    min-height: 118px;
}

.weather-widget-loading,
.weather-widget-error {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
    width: 100%;
}
.weather-loading-icon { font-size: 1.4rem; animation: weatherPulse 1.6s ease-in-out infinite; }
@keyframes weatherPulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.weather-widget-error { color: #ffe3e3; }

.weather-now {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 28px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.15);
}
.weather-now-icon { font-size: 2.6rem; text-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.weather-now-temp { font-size: 2rem; font-weight: 800; line-height: 1; }
.weather-now-desc { font-size: 0.85rem; color: rgba(255,255,255,0.85); margin-top: 2px; }
.weather-now-local {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.weather-forecast {
    display: flex;
    align-items: center;
    flex-grow: 1;
    overflow-x: auto;
    padding: 12px 20px;
    gap: 6px;
}

.weather-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1 1 0;
    min-width: 64px;
    padding: 8px 6px;
    border-radius: 10px;
    transition: background 0.2s ease;
    cursor: pointer;
}
.weather-day:hover, .weather-day:focus-visible { background: rgba(255,255,255,0.1); outline: none; }
.weather-day.is-today { background: rgba(255,255,255,0.14); }
.weather-day-label { font-size: 0.72rem; text-transform: uppercase; font-weight: 700; color: rgba(255,255,255,0.75); letter-spacing: 0.3px; }
.weather-day i { font-size: 1.15rem; }
.weather-day-temps { display: flex; align-items: baseline; gap: 5px; font-size: 0.85rem; }
.weather-day-temps strong { font-weight: 800; }
.weather-day-temps small { color: rgba(255,255,255,0.65); }

.weather-now { cursor: pointer; }
.weather-now:focus-visible { outline: 2px solid rgba(255,255,255,0.6); outline-offset: -2px; }

/* ── Popover de detalhes por hora (hover ou clique) ── */
.weather-hour-popover {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -6px) scale(0.96);
    background: #1e293b;
    color: var(--white);
    border-radius: 12px;
    box-shadow: 0 16px 32px rgba(0,0,0,0.28);
    padding: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 99999;
    max-width: 94vw;
}
.weather-hour-popover.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1);
}
.weather-hour-popover::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 6px 6px 6px;
    border-style: solid;
    border-color: transparent transparent #1e293b transparent;
}
.weather-hour-popover.is-above::before {
    top: auto;
    bottom: -6px;
    border-width: 6px 6px 0 6px;
    border-color: #1e293b transparent transparent transparent;
}

.weather-hour-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    width: 456px;
    max-width: 100%;
}
.weather-hour-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 52px;
    padding: 8px 6px;
    border-radius: 8px;
}
.weather-hour-row:hover { background: rgba(255,255,255,0.08); }
.weather-hour-time { font-size: 0.7rem; color: rgba(255,255,255,0.6); font-weight: 600; }
.weather-hour-row i { font-size: 1rem; color: #ffd166; }
.weather-hour-rain { font-size: 0.65rem; color: #7dd3fc; display: flex; align-items: center; gap: 3px; min-height: 12px; }
.weather-hour-temp { font-size: 0.85rem; font-weight: 800; }
.weather-hour-empty { padding: 10px 14px; font-size: 0.8rem; color: rgba(255,255,255,0.7); }

@media (max-width: 480px) {
    .weather-hour-row { min-width: 44px; }
}

/* Página de Tarefas: o container não tem padding lateral próprio (cada
   bloco — page-header, kanban-board — cuida do seu próprio respiro), então
   o widget precisa da mesma margem à direita pra não encostar na borda.
   Só no desktop — no mobile o layout/padding já é outro (sidebar vira
   gaveta) e essa margem extra deixava o card mais estreito que os demais. */
@media (min-width: 993px) {
    .tarefas-page .weather-widget {
        width: calc(100% - 24px) !important;
        margin-right: 24px !important;
    }
}

@media (max-width: 768px) {
        .weather-widget {
        flex-direction: column;
        min-height: auto;
        margin: 10px;
    }
    .weather-now { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.15); width: 100%; box-sizing: border-box; }
    .weather-forecast { width: 100%; box-sizing: border-box; justify-content: space-between; }
    .weather-day { min-width: 46px; }
}