/* ============================================
   MODAIS
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 14px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================
   MODAL DE RESUMO - VERSÃO FINAL COM TEMAS
   ============================================ */

.modal-resumo {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-resumo.active {
    display: flex;
}

.modal-resumo-content {
    background: var(--bg-card);
    border-radius: 12px;
    width: auto;
    max-width: 750px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-resumo-header {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-dark));
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-resumo-header h2 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.modal-resumo-close {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
}

.modal-resumo-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-light);
}

.modal-resumo-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--bg-card);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* ABAS */
.modal-tabs {
    display: flex;
    gap: 8px;
    padding: 0 20px;
    background: var(--bg-light);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn i {
    width: 18px;
    height: 18px;
}

.tab-btn:hover {
    color: var(--primary-green);
}

.tab-btn.active {
    color: var(--primary-green);
    border-bottom: 2px solid var(--primary-green);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* CARDS LADO A LADO - LARGURA 355px cada */
.two-cards-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    justify-content: center;
}

.card-resumo-small {
    width: 355px;
    min-width: 355px;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.card-resumo-small h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-green);
    margin: 0 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary-green);
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item.destaque .info-value {
    color: var(--primary-green);
    font-weight: 700;
    font-size: 16px;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    font-weight: 600;
    color: var(--text-dark);
}

.info-value .percent {
    font-size: 12px;
    font-weight: bold;
    color: var(--primary-green);
}

.info-descricao {
    margin-top: 8px;
    padding-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
}

/* Card Investimento */
.card-investimento {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-dark));
    color: white;
}

.card-investimento h3 {
    color: white;
    border-bottom-color: rgba(255,255,255,0.3);
}

.card-investimento .info-label {
    color: rgba(255,255,255,0.8);
}

.card-investimento .info-value {
    color: white;
}

.investimento-valor {
    font-size: 30px;
    font-weight: 800;
    text-align: center;
}

.investimento-parcela {
    font-size: 13px;
    text-align: center;
    opacity: 0.9;
}

.investimento-condicoes {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
}

.condicao {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Detalhamento Financeiro */
.full-width-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.full-width-card h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-green);
    margin: 0 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary-green);
}

.detalhamento-lista {
    background: var(--bg-card);
    border-radius: 10px;
}

.detalhe-linha {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.detalhe-linha:last-child {
    border-bottom: none;
}

.detalhe-linha.total {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 2px solid var(--primary-green);
    font-weight: 700;
}

.detalhe-linha.total span:first-child {
    color: var(--primary-green);
}

.detalhe-linha span:first-child {
    color: var(--text-muted);
}

.detalhe-linha span:last-child {
    font-weight: 600;
    color: var(--text-dark);
}

/* Tabela */
.tabela-container {
    overflow-x: auto;
    background: var(--bg-card);
    border-radius: 10px;
}

.tabela-financas {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.tabela-financas th,
.tabela-financas td {
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.tabela-financas th {
    background: var(--primary-green);
    color: white;
    font-weight: 600;
}

.tabela-financas td {
    color: var(--text-dark);
}

.obs-financiamento {
    font-size: 9px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
}

.empty-tab {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-tab i {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    color: var(--text-muted);
}

/* Responsividade */
@media (max-width: 800px) {
    .modal-resumo-content {
        max-width: 95%;
    }
    .two-cards-row {
        flex-direction: column;
        align-items: center;
    }
    .card-resumo-small {
        width: 100%;
        min-width: auto;
    }
}

/* Adicione ao final do arquivo modal.css */

/* ============================================
   FILTROS DO MODAL
   ============================================ */

.modal-filtros {
    background: var(--bg-light);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.filtro-group {
    flex: 1;
    min-width: 140px;
}

.filtro-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.filtro-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    background: var(--bg-card);
    color: var(--text-dark);
    cursor: pointer;
}

.filtro-select:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.1);
}

.filtro-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.filtro-actions .btn-small {
    padding: 6px 12px;
    font-size: 11px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.filtro-actions .btn-small:hover {
    background: var(--primary-dark);
}

.contador-placas {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Responsividade para os filtros */
@media (max-width: 600px) {
    .modal-filtros {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filtro-actions {
        margin-left: 0;
        justify-content: space-between;
    }
    
    .filtro-group {
        min-width: auto;
    }
}