/* Reset e configurações gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --gray-color: #95a5a6;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Topo */
.topo {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 20px 0;
    border-left: 5px solid var(--secondary-color);
}

.logo {
    width: 289px;
    height: 335px;
    object-fit: contain;
    border: 2px solid var(--light-color);
    border-radius: var(--border-radius);
    padding: 10px;
    background: white;
}

.textos-topo {
    flex: 1;
}

.texto {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.texto:nth-child(1) {
    color: var(--secondary-color);
    font-size: 2.2rem;
}

.texto:nth-child(2) {
    color: var(--accent-color);
    font-size: 1.9rem;
}

.texto:nth-child(3) {
    color: var(--success-color);
    font-size: 1.7rem;
}

/* Meio */
.meio {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.upload-section h2,
.nf-info h2,
.acoes-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--light-color);
    padding-bottom: 10px;
}

.upload-area {
    border: 3px dashed var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    background: #f8f9fa;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover {
    background: #e3f2fd;
    border-color: var(--accent-color);
}

.upload-area i {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.upload-area p {
    color: var(--gray-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.formato-info {
    font-size: 0.9rem !important;
    color: var(--gray-color) !important;
}

/* Botões */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(41, 128, 185, 0.3);
}

.btn-secondary {
    background: var(--gray-color);
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-export {
    background: white;
    color: var(--dark-color);
    border: 2px solid var(--light-color);
}

.btn-export:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

/* Informações da NF */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--secondary-color);
}

.info-item label {
    font-weight: bold;
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.info-item span {
    color: var(--dark-color);
    font-size: 1.1rem;
}

/* Tabela de Itens */
.itens-table-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

.itens-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.itens-table th {
    background: var(--primary-color);
    color: white;
    padding: 12px;
    text-align: left;
}

.itens-table td {
    padding: 12px;
    border-bottom: 1px solid var(--light-color);
}

.itens-table tbody tr:hover {
    background: #f8f9fa;
}

.itens-table tfoot {
    background: #e3f2fd;
}

/* Dropdown de Relatórios */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    min-width: 200px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background: white;
    min-width: 250px;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    z-index: 1000;
    margin-top: 5px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid var(--light-color);
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: var(--secondary-color);
}

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

/* Seção de Relatórios */
.relatorio-section {
    background: white;
    border: 2px solid var(--light-color);
    border-radius: var(--border-radius);
    margin-top: 30px;
    padding: 20px;
}

.relatorio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-color);
}

.relatorio-content {
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

/* Estilos específicos para o Termo de Retirada */
.termo-container {
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.4;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    background: white;
    border: 1px solid #ccc;
}

.termo-titulo {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 30px;
    text-decoration: underline;
}

.termo-conteudo {
    margin-bottom: 30px;
}

.termo-tabela {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9rem;
}

.termo-tabela th,
.termo-tabela td {
    border: 1px solid #000;
    padding: 8px;
    text-align: left;
}

.termo-tabela th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.termo-total {
    text-align: right;
    font-weight: bold;
    margin: 20px 0;
    font-size: 1.1rem;
}

.termo-assinaturas {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
}

.termo-assinatura {
    text-align: center;
    width: 45%;
}

.linha-assinatura {
    border-top: 1px solid #000;
    margin-top: 50px;
    padding-top: 5px;
}

/* Rodapé */
.rodape {
    background: var(--primary-color);
    color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 20px;
}

.rodape-content p {
    margin-bottom: 10px;
}

.versao {
    color: var(--light-color);
    font-size: 0.9rem;
}

.contato {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.contato p {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsividade */
@media (max-width: 1024px) {
    .topo {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        width: 200px;
        height: auto;
    }
    
    .texto {
        font-size: 1.4rem;
    }
    
    .texto:nth-child(1) {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .btn-group {
        flex-direction: column;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .contato {
        flex-direction: column;
        gap: 10px;
    }
}

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

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

/* Estados */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Loader */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}