/* Modal específico para tabela de orçamentos */
.budgets-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.budgets-modal-container {
    background: white;
    border-radius: 12px;
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

.budgets-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.budgets-modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.budgets-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.budgets-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.budgets-modal-content {
    flex: 1;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.budgets-modal-body {
    flex: 1;
    padding: 20px 25px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.budgets-modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}

/* Ajustes específicos para a tabela no modal */
.budgets-table-container-modal {
    flex: 1;
    overflow: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
}

.budgets-table-modal {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 800px;
}

.budgets-table-modal th {
    background: var(--primary-color);
    color: white;
    padding: 14px 10px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.budgets-table-modal th:last-child {
    border-right: none;
}

.budgets-table-modal td {
    padding: 12px 10px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.budgets-table-modal tr:hover {
    background-color: #f8f9fa;
}

.budgets-table-modal tr:nth-child(even) {
    background-color: #fafafa;
}

.budgets-table-modal tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

/* Colunas otimizadas para o modal */
.budget-number-col-modal {
    width: 130px;
    font-weight: 600;
    color: var(--primary-color);
}

.budget-client-col-modal {
    width: 220px;
    min-width: 150px;
}

.budget-total-col-modal {
    width: 120px;
    text-align: right;
    font-weight: 600;
}

.budget-date-col-modal {
    width: 110px;
}

.budget-items-col-modal {
    width: 80px;
    text-align: center;
}

.budget-status-col-modal {
    width: 110px;
}

.budget-actions-col-modal {
    width: 200px;
    text-align: center;
}

/* Botões no modal */
.actions-inline-modal {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

.btn-table-modal {
    padding: 7px 12px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
}

.btn-table-modal-edit {
    background: #17a2b8;
    color: white;
}

.btn-table-modal-edit:hover {
    background: #138496;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-table-modal-status {
    background: #6c757d;
    color: white;
}

.btn-table-modal-status:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-table-modal-delete {
    background: #dc3545;
    color: white;
}

.btn-table-modal-delete:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Status badges no modal */
.status-badge-table-modal {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    min-width: 75px;
}

/* Informações do footer */
.budgets-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 13px;
}

.budgets-count {
    color: #6c757d;
    font-weight: 500;
}

.budgets-total {
    color: var(--primary-color);
    font-weight: 600;
}

/* Estados vazios no modal */
.budgets-empty-state-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
    color: #6c757d;
    text-align: center;
}

.budgets-empty-state-modal i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 20px;
}

.budgets-empty-state-modal h4 {
    color: #6c757d;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

/* Loading state */
.budgets-loading-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
}

.budgets-loading-modal i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsividade do modal */
@media (max-width: 1200px) {
    .budgets-modal-container {
        width: 98%;
        height: 90vh;
        max-height: 600px;
    }
}

@media (max-width: 768px) {
    .budgets-modal-container {
        width: 99%;
        height: 95vh;
        max-height: 500px;
        margin: 10px;
    }
    
    .budgets-modal-header {
        padding: 15px 20px;
    }
    
    .budgets-modal-body {
        padding: 15px 20px;
    }
    
    .budgets-modal-footer {
        padding: 12px 20px;
    }
    
    .budgets-table-modal {
        font-size: 12px;
        min-width: 600px;
    }
    
    .budgets-table-modal th,
    .budgets-table-modal td {
        padding: 8px 6px;
    }
    
    .btn-table-modal {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .actions-inline-modal {
        flex-direction: column;
        gap: 3px;
    }
    
    .budgets-summary {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .budgets-modal-header h3 {
        font-size: 1.2rem;
    }
    
    .budgets-table-modal {
        min-width: 500px;
    }
    
    .btn-table-modal .btn-text {
        display: none;
    }
    
    .btn-table-modal {
        padding: 6px 8px;
    }
}