/* Estilos personalizados para o módulo de Planejamento */

/* Estilo para os cards de resumo fixos */
#resumo-cards {
    position: relative;
    z-index: 1000;
    transition: all 0.3s ease;
}

#resumo-cards .card {
    width: 160px;  /* Largura fixa para os cards */
    min-height: 120px;  /* Altura mínima para manter a proporção */
    margin: 0 auto 0.5rem;  /* Centraliza e adiciona espaço abaixo */
    display: flex;
    flex-direction: column;
}

#resumo-cards.fixed-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 5px 10px;  /* Mais compacto */
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    margin: 0;
    max-width: 100%;
}

/* Ajuste para o conteúdo interno do card */
#resumo-cards .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.4rem;  /* Padding interno reduzido */
}

#resumo-cards .card-subtitle {
    margin-bottom: 0.1rem;  /* Espaço mínimo abaixo do subtítulo */
    font-size: 0.7rem;  /* Fonte menor para o subtítulo */
    font-weight: 600;
}

#resumo-cards .text-sm {
    font-size: 0.65rem;  /* Fonte menor */
    margin-bottom: 0.05rem;  /* Espaço mínimo entre linhas */
    line-height: 1.1;
}

#resumo-cards .meta-valor,
#resumo-cards .gasto-valor,
#resumo-cards .saldo-valor {
    font-size: 0.65rem;  /* Fonte menor para valores */
}

/* Ajuste para quando a sidebar estiver aberta */
@media (min-width: 768px) {
    #resumo-cards.fixed-top {
        left: 240px; /* Largura da sidebar */
        max-width: calc(100% - 250px);
    }
    
    #resumo-cards-inner {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        max-width: 800px;
        margin: 0 auto;
    }
}

/* Ajuste para o conteúdo não ficar escondido atrás do header fixo */
.content-with-fixed-header {
    padding-top: 200px; /* Ajuste conforme necessário */
}

/* Estilo para o seletor de itens por página */
#itensPorPagina {
    width: auto;
}

/* Estilo para o card do gráfico de evolução financeira */
.card {
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.375rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    padding: 0.75rem 1.25rem;
}

.card-title {
    margin-bottom: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.card-body {
    padding: 1.25rem;
}

/* Estilo para o canvas do gráfico */
#evolucaoFinanceira {
    width: 100%;
    height: 300px;
}

/* Estilos para os botões de remoção */
.receita-item .btn-remover,
.despesa-item .btn-remover {
    display: flex;
    align-items: flex-end;
    height: 100%;
    padding-top: 24px; /* Alinha com os campos de entrada */
}

.receita-item .btn-danger,
.despesa-item .btn-danger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 38px; /* Altura padrão dos inputs do Bootstrap */
    background-color: transparent;
    border: none; /* Removendo a borda */
    color: #dc3545;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    box-shadow: none; /* Garantindo que não haja sombra/contorno */
    outline: none; /* Removendo o outline padrão */
}

.receita-item .btn-danger:hover,
.despesa-item .btn-danger:hover {
    background-color: #dc3545;
    color: white;
}

.receita-item .btn-danger i,
.despesa-item .btn-danger i {
    font-size: 1.25rem; /* Aumentando o tamanho do ícone */
}

/* Estilos para despesas parceladas */
.despesa-item {
    position: relative;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #fff;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.despesa-item:hover {
    background-color: #f8f9fa;
}

.despesa-item.border-primary {
    border-left: 3px solid #0d6efd !important;
    background-color: #f8f9ff;
}

.despesa-item .badge {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
}

/* Cards principais */
.card {
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}

/* Cabeçalhos dos cards */
.card-header {
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Tabelas */
.table {
    margin-bottom: 0;
}

/* Linhas alternadas */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-striped tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-top: none;
    padding: 0.75rem 1rem;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

/* Formulários */
.form-control, .form-select {
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Botões */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn i {
    margin-right: 0.25rem;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 0.25rem;
}

/* Barras de progresso */
.progress {
    height: 0.5rem;
    border-radius: 0.25rem;
    background-color: #f0f2f5;
}

/* Cards de resumo */
.card-resumo {
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.card-resumo:hover {
    transform: translateY(-2px);
}

/* Responsividade */
@media (max-width: 767.98px) {
    .table-responsive {
        border: 0;
    }
    
    .table thead {
        display: none;
    }
    
    .table, .table tbody, .table tr, .table td {
        display: block;
        width: 100%;
    }
    
    .table tr {
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.25rem;
        padding: 0.5rem;
    }
    
    .table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #f0f2f5;
    }
    
    .table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 45%;
        text-align: left;
        font-weight: 600;
    }
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Personalização da barra de rolagem */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
