/* ============================================
   FINAPP - COMPONENTES PADRONIZADOS
   ============================================
   Este arquivo centraliza todos os estilos de
   componentes reutilizados nas views.
   ============================================ */

/* ============================================
   CARDS DE TOTAIS
   ============================================ */
.card-total {
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    color: #fff;
    min-width: 160px;
}

.card-total:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-total.active {
    border: 2px solid #0d6efd !important;
}

/* Status - Pago/Recebido (Verde) */
.card-total-pago,
.card-total-recebido,
.card-total-titular {
    background: linear-gradient(135deg, #1e7e34 0%, #28a745 100%);
}

/* Status - Agendado (Amarelo) */
.card-total-agendado {
    background: linear-gradient(135deg, #d39e00 0%, #ffc107 100%);
    color: #212529;
}

/* Status - Pendente (Cinza) */
.card-total-pendente {
    background: linear-gradient(135deg, #5a6268 0%, #6c757d 100%);
}

/* Status - Enviado/Vermelho */
.card-total-enviado,
.card-total-titular-alt {
    background: linear-gradient(135deg, #c82333 0%, #dc3545 100%);
}

/* Total Geral/Saldo (Roxo - Padrao) */
.card-total-geral,
.card-total-saldo {
    background: linear-gradient(135deg, #6c3483 0%, #8e44ad 100%);
}

/* Total Geral Alternativo (Azul - para Receitas) */
.card-total-geral-alt {
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
}

/* ============================================
   CARD DE FILTROS
   ============================================ */
.card-filtros {
    background: linear-gradient(135deg, #1a3a5c 0%, #0d2840 100%);
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card-filtros .form-label {
    color: #e9ecef;
    font-weight: 500;
}

.card-filtros .form-control,
.card-filtros .form-select {
    background-color: #fff;
    border: 1px solid #ced4da;
    color: #212529;
}

.card-filtros .form-control::placeholder {
    color: #6c757d;
}

.card-filtros .btn-outline-secondary {
    color: #fff;
    border-color: #fff;
}

.card-filtros .btn-outline-secondary:hover {
    background-color: #fff;
    color: #2c3e50;
}

.card-filtros .form-check-input {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.card-filtros .form-check-input:checked {
    background-color: #0a1628;
    border-color: #1a3a5c;
}

.card-filtros .form-switch .form-check-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.card-filtros .form-switch .form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.card-filtros .form-check-input:focus {
    border-color: #1a3a5c;
    box-shadow: 0 0 0 0.25rem rgba(26, 58, 92, 0.4);
}

/* ============================================
   TABELAS - ESTILOS COMUNS
   ============================================ */
.table th {
    white-space: nowrap;
}

.table th[data-sort]:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

/* Coluna de acoes padronizada */
.table th.col-acoes,
.table td.col-acoes {
    min-width: 120px;
    width: 120px;
    text-align: center;
}

/* Linha sem subcategoria (destaque) */
.table-styled tbody tr.sem-subcategoria td {
    background-color: #a8a595 !important;
    color: #f8fafc !important;
}

.table-styled tbody tr.sem-subcategoria:hover td {
    background-color: #b3a667 !important;
}

/* ============================================
   TITULOS DE PAGINA
   ============================================ */
.page-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: #a8ece5;
    margin-bottom: -10px !important;
}

.page-title-accent {
    color: var(--finapp-accent, #fca311);
}

/* ============================================
   BADGES PADRONIZADOS
   ============================================ */
.badge-total {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* ============================================
   RESPONSIVIDADE - CARDS DE TOTAIS
   ============================================ */
@media (max-width: 576px) {
    .card-total {
        min-width: 140px;
    }

    .card-total .card-body {
        padding: 0.75rem;
    }

    .card-total h6 {
        font-size: 0.75rem;
    }

    .card-total h4 {
        font-size: 1rem;
    }
}

/* ============================================
   RESPONSIVIDADE - TABELAS
   ============================================ */
@media (max-width: 768px) {
    /* Ocultar colunas menos importantes em mobile */
    .table .col-hide-mobile {
        display: none;
    }

    /* Reduzir padding em mobile */
    .table td,
    .table th {
        padding: 0.5rem 0.25rem;
        font-size: 0.85rem;
    }

    /* Coluna de acoes menor em mobile */
    .table th.col-acoes,
    .table td.col-acoes {
        min-width: 80px;
        width: 80px;
    }
}

/* ============================================
   RESPONSIVIDADE - FILTROS
   ============================================ */
@media (max-width: 576px) {
    .card-filtros .card-body {
        padding: 0.75rem;
    }

    .card-filtros .form-label {
        font-size: 0.85rem;
    }
}

/* ============================================
   MODAIS - PADRONIZACAO
   ============================================ */
.modal-footer .btn {
    min-width: 100px;
}

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

/* ============================================
   BOTOES DE ACAO NA TABELA
   ============================================ */
.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-action i {
    width: 14px;
    text-align: center;
}

/* ============================================
   DROPDOWN DE SUBCATEGORIA (FILTRO)
   ============================================ */
.subcategoria-dropdown {
    max-height: 300px;
    overflow-y: auto;
}

.subcategoria-dropdown .dropdown-item {
    padding: 0.5rem 1rem;
}

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

/* ============================================
   FLEX UTILITIES PARA CARDS
   ============================================ */
.cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cards-container .card-total {
    flex: 1 1 auto;
}

@media (max-width: 576px) {
    .cards-container {
        gap: 0.25rem;
    }

    .cards-container .card-total {
        flex: 1 1 calc(50% - 0.25rem);
        max-width: calc(50% - 0.25rem);
    }
}

/* ============================================
   TABELAS STYLED - ESTILOS COMPACTOS
   ============================================ */
.table-styled {
    font-size: 0.89rem;
    table-layout: fixed;
    width: 100%;
}

.table-styled th,
.table-styled td {
    white-space: nowrap;
    /* padding: 0.4rem 0.5rem; */
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badges menores nas tabelas */
.table-styled .badge {
    font-size: 0.86rem;
    font-weight: normal !important;
    padding: 0.18rem 0.4rem;
}

/* ============================================
   TABELA MOVCARTAO - LARGURAS DAS COLUNAS
   ============================================ */
#tabelaMovCartao th:nth-child(1),
#tabelaMovCartao td:nth-child(1) { width: 40px; }      /* Checkbox */
#tabelaMovCartao th:nth-child(2),
#tabelaMovCartao td:nth-child(2) { width: 14%; }       /* Estabelecimento */
#tabelaMovCartao th:nth-child(3),
#tabelaMovCartao td:nth-child(3) { width: 10%; }       /* Descricao */
#tabelaMovCartao th:nth-child(4),
#tabelaMovCartao td:nth-child(4) { width: 6%; }        /* Valor */
#tabelaMovCartao th:nth-child(5),
#tabelaMovCartao td:nth-child(5) { width: 9%; }        /* Categoria */
#tabelaMovCartao th:nth-child(6),
#tabelaMovCartao td:nth-child(6) { width: 10%; }       /* SubCategoria */
#tabelaMovCartao th:nth-child(7),
#tabelaMovCartao td:nth-child(7) { width: 5%; }        /* Titular */
#tabelaMovCartao th:nth-child(8),
#tabelaMovCartao td:nth-child(8) { width: 5%; }        /* Tipo */
#tabelaMovCartao th:nth-child(9),
#tabelaMovCartao td:nth-child(9) { width: 6%; }        /* Banco */
#tabelaMovCartao th:nth-child(10),
#tabelaMovCartao td:nth-child(10) { width: 7%; }       /* Origem */
#tabelaMovCartao th:nth-child(11),
#tabelaMovCartao td:nth-child(11) { width: 5%; }       /* Ignorar */
#tabelaMovCartao th:nth-child(12),
#tabelaMovCartao td:nth-child(12) { width: 9%; }       /* Data e Hora */
#tabelaMovCartao th:nth-child(13),
#tabelaMovCartao td:nth-child(13) { width: 70px; }     /* Acoes */
