.container {
    padding: 20px;
    max-width: 95%; /* Ocupa quase toda a tela em telas muito grandes */
    width: 1600px;  /* Limite máximo confortável para UltraWide */
    margin: 0 auto;
}

h1 {
    color: var(--primary-blue);
    margin-bottom: 30px;
    text-align: center;
}

.config-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: bold;
    color: #444;
    margin-bottom: 5px;
}

.input-group input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

.upload-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.xml-header-card {
    background: #f8fafc;
    padding: 15px 25px;
    border-radius: 12px;
    border-left: 5px solid var(--primary-blue);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-info-item {
    display: flex;
    flex-direction: column;
}

.header-info-item .label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.header-info-item .value {
    font-size: 1rem;
    color: #1e293b;
    font-weight: 600;
}

.header-info-item.full-width {
    width: 100%;
    margin-top: 5px;
    border-top: 1px dashed #cbd5e1;
    padding-top: 12px;
}

.parcelas-list, .pagamentos-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.parcela-pill, .pagamento-pill {
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #475569;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.parcela-pill:hover, .pagamento-pill:hover {
    border-color: var(--primary-blue);
    background: #fff;
}

.parcela-pill .n-dup {
    background: var(--primary-blue);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
}

.parcela-pill .v-dup, .pagamento-pill .v-pag {
    font-weight: 700;
    color: #0f172a;
}

.pagamento-pill {
    background: #f0fdf4;
    border-color: #dcfce7;
    color: #166534;
}

.pagamento-pill .v-pag {
    color: #15803d;
}

.total-highlight {
    color: #059669 !important;
    font-size: 1.15rem !important;
}

#infoFornecedor {
    color: var(--primary-blue);
}

.row-conferido {
    background-color: #f0fdf4 !important; /* Verde bem clarinho */
}

.row-conferido td {
    color: #166534;
}

.row-conferido input {
    opacity: 0.6;
}

.check-conferido {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #16a34a;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-primary:hover {
    background-color: #0a3d8d;
}

.results-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

table th, table td {
    text-align: left;
    padding: 10px 8px; /* Reduzi um pouco o padding lateral */
    border-bottom: 1px solid #eee;
    white-space: nowrap; /* Evita quebra de linha em colunas de valores */
}

/* Permitir quebra de linha apenas na descrição para economizar espaço horizontal */
table td:nth-child(3), table th:nth-child(3) {
    white-space: normal;
    min-width: 200px;
    max-width: 400px;
}

table th {
    background-color: #f8fafc;
    color: #333;
    font-weight: bold;
}

table tr:hover {
    background-color: #f1f5f9;
    cursor: pointer;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 70%;
    max-width: 800px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 15px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-blue);
    color: white;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.close-modal {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-body {
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

.calculo-unitario-section {
    background-color: #f1f5f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    border: 1px solid #e2e8f0;
}

.calc-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.calc-group label {
    font-size: 0.75rem;
    font-weight: bold;
    color: #475569;
    text-transform: uppercase;
}

.calc-group input {
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    width: 100px;
}

.resultado-conversao {
    flex-grow: 1;
    text-align: right;
    font-size: 1.1rem;
}

.resultado-conversao .destaque {
    display: block;
    font-weight: 800;
    color: var(--primary-blue);
    font-size: 1.4rem;
}

.detalhes-xml-titulo {
    font-size: 0.9rem;
    font-weight: bold;
    color: #64748b;
    margin-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 5px;
}

.detalhe-item {
    display: flex;
    border-bottom: 1px solid #f1f5f9;
    padding: 10px 0;
}

.detalhe-item:last-child {
    border-bottom: none;
}

.detalhe-item .label {
    font-weight: bold;
    color: #64748b;
    width: 200px;
    flex-shrink: 0;
}

.detalhe-item .value {
    color: #1e293b;
    word-break: break-all;
}

/* Painel do Gestor e Composição */
.composicao-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.comp-card {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.comp-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comp-sub {
    font-size: 0.6rem;
    color: #94a3b8;
    margin-bottom: 4px;
}

.comp-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.highlight-lucro {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

/* Tabela de Memória de Cálculo */
.tabela-detalhes-calculo {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.tabela-detalhes-calculo td {
    padding: 10px 15px;
    border-bottom: 1px solid #f1f5f9;
}

.tabela-detalhes-calculo td:last-child {
    text-align: right;
    font-weight: 500;
}

.tabela-detalhes-calculo .bold {
    font-weight: bold;
    color: #1e293b;
}

.tabela-detalhes-calculo .row-total {
    background-color: #f8fafc;
    font-weight: bold;
    color: var(--primary-blue);
    font-size: 1rem;
}

.margem-individual-input, .preco-final-input {
    width: 85px;
    padding: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-family: inherit;
}

.preco-final-input {
    font-weight: bold;
    color: var(--primary-blue);
    border-color: #bfdbfe;
    background-color: #eff6ff;
}

/* Dashboard de Resumo da Nota */
.xml-summary-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.summary-card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.summary-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
}

.summary-value.red { color: #ef4444; }
.summary-value.green { color: #10b981; }
.summary-value.gray { color: #64748b; }
.summary-value.blue { color: #3b82f6; }

.summary-card.highlight {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.summary-card.primary {
    background: #eff6ff;
    border-color: #bfdbfe;
}

/* Ajustes para telas menores (Notebooks) */
@media (max-width: 1400px) {
    .container {
        width: 100%;
        max-width: 100%;
        padding: 10px;
    }

    .results-section {
        padding: 10px;
    }

    table th, table td {
        padding: 8px 4px;
        font-size: 0.85rem;
    }

    .margem-individual-input, .preco-final-input {
        width: 75px;
        padding: 4px;
    }
}
