/* Modal de Compras - Estilos Principais */
.compra-modal-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-bottom: none;
    padding: 15px 20px;
    position: relative;
}

.compra-modal-header .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.compra-modal-header .modal-title i {
    margin-right: 8px;
}

.compra-modal-header .close {
    color: white;
    opacity: 0.8;
    font-size: 1.5rem;
    font-weight: 300;
    text-shadow: none;
}

.compra-modal-header .close:hover {
    opacity: 1;
}

.compra-modal-body {
    padding: 0;
    max-height: 80vh;
    overflow-y: auto;
    background: #f8f9fa;
}

.compra-modal-footer {
    background: white;
    border-top: 1px solid #dee2e6;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Navegação por Abas - Compras */
.compra-tabs {
    background: white;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.compra-tabs .tab-nav {
    display: flex;
    padding: 0;
    margin: 0;
    list-style: none;
}

.compra-tabs .tab-button {
    flex: 1;
    background: transparent;
    border: none;
    padding: 15px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #6c757d;
    font-size: 0.9rem;
    position: relative;
}

.compra-tabs .tab-button:hover:not(.disabled) {
    background: #f8f9fa;
    color: #495057;
}

.compra-tabs .tab-button.active {
    color: #28a745;
    background: #f8f9fa;
}

.compra-tabs .tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #28a745;
}

.compra-tabs .tab-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.compra-tabs .tab-button i {
    font-size: 1.2rem;
}

.compra-tabs .tab-text {
    font-size: 0.8rem;
    font-weight: 500;
}

.compra-tabs .tab-button .badge {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Conteúdo das Abas - Compras */
.compra-tab-content {
    min-height: 400px;
}

.compra-tab-pane {
    display: none;
    padding: 20px;
}

.compra-tab-pane.active {
    display: block;
}

/* Formulário de Compra */
.compra-form {
    max-width: 100%;
}

.compra-form .form-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.compra-form .section-title {
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}

.compra-form .section-title i {
    color: #28a745;
}

.compra-form .subsection-title {
    color: #6c757d;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Informações da Compra */
.compra-info-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 15px 20px;
    margin: -20px -20px 20px -20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.compra-info-header .info-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.compra-info-header .total-display {
    font-size: 1.2rem;
    font-weight: 600;
}

.compra-info-header .saldo-display {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
}

/* Resumo da Compra */
.compra-resumo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.compra-resumo .resumo-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.compra-resumo .resumo-item .label {
    color: #6c757d;
    font-weight: 500;
}

.compra-resumo .resumo-item .value {
    font-weight: 600;
    color: #495057;
}

.compra-resumo .resumo-item .value.total {
    color: #28a745;
    font-size: 1.1rem;
}

/* Botão Adicionar Item - Compras */
.compra-add-item-section {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.compra-add-item-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    color: white;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
}

.compra-add-item-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.3);
    color: white;
}

.compra-add-item-desc {
    color: #6c757d;
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Cabeçalho dos Itens - Compras */
.compra-itens-header {
    margin-bottom: 20px;
}

.compra-itens-header .section-title {
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.compra-itens-header .section-title i {
    color: #28a745;
}

.compra-itens-header .badge {
    font-size: 0.8rem;
    margin-left: 8px;
}

/* Estado Vazio - Compras */
.compra-itens-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.compra-empty-state {
    max-width: 300px;
    margin: 0 auto;
}

.compra-empty-icon {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 15px;
}

.compra-empty-state h6 {
    color: #495057;
    margin-bottom: 10px;
}

.compra-empty-state p {
    color: #6c757d;
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Lista de Itens - Compras */
.compra-itens-lista {
    gap: 15px;
}

.compra-itens-lista .item-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.compra-itens-lista .item-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #28a745;
}

.compra-itens-lista .item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 15px;
}

.compra-item-numero {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.compra-item-titulo {
    flex: 1;
    min-width: 0;
}

.compra-item-titulo h6 {
    margin: 0 0 5px 0;
    font-weight: 600;
    color: #495057;
}

.compra-item-titulo small {
    color: #6c757d;
    font-size: 0.8rem;
}

.compra-item-acoes {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.compra-item-acoes .btn {
    padding: 5px 10px;
    font-size: 0.8rem;
    border-radius: 4px;
}

.compra-item-acoes .btn:hover {
    transform: translateY(-1px);
}

/* Corpo do Item - Compras */
.compra-item-body {
    padding-top: 10px;
    border-top: 1px solid #f8f9fa;
}

.compra-item-produto {
    margin-bottom: 10px;
}

.compra-item-produto strong {
    color: #495057;
    font-weight: 600;
}

.compra-item-descritivo {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-style: italic;
}

.compra-item-descritivo i {
    margin-right: 5px;
    color: #28a745;
}

/* Valores do Item - Compras */
.compra-item-valores {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 10px;
}

.compra-valor-item {
    text-align: center;
    flex: 1;
    min-width: 80px;
}

.compra-valor-label {
    display: block;
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.compra-valor-numero {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.compra-total-item {
    border-left: 2px solid #28a745;
    padding-left: 15px;
}

.compra-total-item .compra-valor-numero {
    color: #28a745;
    font-size: 1rem;
    font-weight: 700;
}

/* Resumo dos Itens - Compras */
.compra-itens-resumo {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.compra-resumo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.compra-resumo-row:last-child {
    margin-bottom: 0;
    padding-top: 10px;
    border-top: 2px solid #e9ecef;
}

.compra-resumo-label {
    color: #6c757d;
    font-weight: 500;
    font-size: 0.9rem;
}

.compra-resumo-valor {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.compra-total-geral {
    font-size: 1.1rem;
}

.compra-total-geral .compra-resumo-valor {
    color: #28a745;
    font-size: 1.2rem;
    font-weight: 700;
}

/* Responsividade - Compras */
@media (max-width: 768px) {
    .compra-modal-body {
        max-height: 70vh;
    }
    
    .compra-tab-pane {
        padding: 15px;
    }
    
    .compra-form .form-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .compra-info-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .compra-resumo {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .compra-item-valores {
        flex-direction: column;
        gap: 10px;
    }
    
    .compra-valor-item {
        min-width: 100%;
    }
    
    .compra-total-item {
        border-left: none;
        border-top: 2px solid #28a745;
        padding-left: 0;
        padding-top: 10px;
    }
    
    .compra-tabs .tab-button {
        padding: 12px 8px;
    }
    
    .compra-tabs .tab-button i {
        font-size: 1rem;
    }
    
    .compra-tabs .tab-text {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .compra-modal-header {
        padding: 12px 15px;
    }
    
    .compra-modal-footer {
        padding: 12px 15px;
    }
    
    .compra-tab-pane {
        padding: 10px;
    }
    
    .compra-form .form-section {
        padding: 12px;
    }
    
    .compra-info-header {
        margin: -10px -10px 15px -10px;
        padding: 12px 15px;
    }
    
    .compra-tabs .tab-button {
        padding: 10px 5px;
    }
    
    .compra-tabs .tab-text {
        font-size: 0.6rem;
    }
    
    .compra-add-item-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .compra-item-acoes .btn {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
}

/* Scrollbar personalizada */
.compra-modal-body::-webkit-scrollbar {
    width: 6px;
}

.compra-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.compra-modal-body::-webkit-scrollbar-thumb {
    background: #28a745;
    border-radius: 3px;
}

.compra-modal-body::-webkit-scrollbar-thumb:hover {
    background: #218838;
}

/* Estilos específicos para o modal de item de compra */
.compra-info-compact {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 15px 20px;
    margin: -15px -15px 20px -15px;
    border-radius: 8px 8px 0 0;
}

.compra-info-compact .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.compra-info-compact .info-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.compra-info-compact .info-icon {
    font-size: 1.2rem;
    opacity: 0.8;
}

.compra-info-compact .info-content {
    display: flex;
    flex-direction: column;
}

.compra-info-compact .info-label {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 2px;
}

.compra-info-compact .info-value {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Responsividade para info compact */
@media (max-width: 768px) {
    .compra-info-compact {
        margin: -15px -15px 15px -15px;
    }
    
    .compra-info-compact .info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
} 