html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: #f3f4f8;
}

.tbl-cotacao-wrapper {
    font-family: 'Inter', Arial, sans-serif;
    background: #f9fafb;
    /* (ALTERAÇÃO) Removido padding-top, pois o alerta está fora */
    padding: 0 2px 2px 2px;
    width: 100%;
    min-height: 100%;
    margin: 0;
    border-radius: 0;
    overflow-x: auto;
    box-sizing: border-box;
}



/* Estilo para o Alerta fora da tabela */
.alerta-wrapper {
    font-family: 'Inter', Arial, sans-serif;
    background-color: #fffbeb;
    color: #b45309;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    padding: 4px !important;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    margin: 0px;
    white-space: normal;
}

.tbl-cotacao {
    width: 100%;
    table-layout: fixed;
    min-width: 850px;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.tbl-cotacao th,
.tbl-cotacao td {
    padding: 9px 12px;
    border: 1px solid #e5e7eb;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tbl-cotacao th {
    background: #f3f6fa;
    font-weight: 600;
    letter-spacing: .05em;
    color: #223355;
}

.tbl-cotacao .tbl-orcado,
.tbl-cotacao .tbl-qtd {
    text-align: center;
}

.tbl-cotacao .tbl-orcado,
.tbl-cotacao td.tbl-fornecedor {
    text-align: right;
}

/* --- ESTILOS DE DESTAQUE E TOTAIS --- */
.tbl-cotacao td.tbl-selecionado {
    background-color: #e7fff645 !important;
    border: 1px solid #5affbd;
    font-weight: bold;
    box-shadow: inset 0 0 3px rgb(24 191 95 / 30%);
    padding: 9px 12px !important;
}

/* --- ITENS COM VALOR ZERO (FORNECEDOR SEM PREÇO) --- */
.tbl-cotacao td.tbl-semvalor {
    background-color: #ffecec !important; /* vermelho suave */
    color: #b91c1c !important; /* vermelho escuro */
    font-weight: 600;
    border: 1px solid #fecaca;
}


.tbl-cotacao .destaque-vencedor {
    background: linear-gradient(90deg,#c2ffe7 20%,#e8fff6 100%) !important;
    color: #0f5132 !important;
    font-weight: bold;
    border: 2px solid #34d399 !important;
    box-shadow: 0 0 0 2px #34d39933;
}

.tbl-cotacao .fa-trophy {
    margin-right: 4px;
    color: gold;
    font-size: 13px;
}

.tbl-cotacao .tbl-total-proposta td {
    background: #f3f6fa;
    color: #102442;
    font-weight: 700;
    text-align: right;
}

/* --- CSS PARA LINHAS DE RESUMO E TOTAIS --- */
/* Estilo para Total Produto e Produtos Selecionados */
.tbl-cotacao .tbl-totais-info td {
    --totais-padding-y: 6px;
    --totais-padding-x: 12px;
    --totais-font-size: 11px;
    --totais-font-weight: 600;
    --totais-color: #075985;
    --totais-bg-color: #e0f2fe;
    --totais-border-color: #bae6fd;

    padding: var(--totais-padding-y) var(--totais-padding-x);
    font-size: var(--totais-font-size);
    font-weight: var(--totais-font-weight);
    color: var(--totais-color);
    background-color: var(--totais-bg-color);
    border-color: var(--totais-border-color);
    text-align: right !important;
}

.tbl-cotacao .tbl-totais-info td:first-child {
    text-align: left;
}

/* Estilo para Descontos */
.tbl-cotacao .tbl-descontos-info td {
    background-color: #f0fdf4;
    color: #15803d;
    font-weight: 600;
    text-align: right;
}

.tbl-cotacao .tbl-descontos-info td:first-child {
    text-align: left;
}

/* Estilo para Frete, Seguro, Impostos */
.tbl-cotacao .tbl-custos-info td {
    --custo-padding-y: 4px;
    --custo-padding-x: 12px;
    --custo-font-size: 10px;
    --custo-font-weight: 500;
    --custo-color: #694765;
    --custo-bg-color: #f9fafb;
    --custo-border-color: #e5e7eb;

    padding: var(--custo-padding-y) var(--custo-padding-x);
    font-size: var(--custo-font-size);
    font-weight: var(--custo-font-weight);
    color: var(--custo-color);
    background-color: var(--custo-bg-color);
    border-color: var(--custo-border-color);
    text-align: right;
}

.tbl-cotacao .tbl-custos-info td:first-child {
    text-align: left;
    font-weight: 600;
    color: #334155;
}

/* Estilo para as outras linhas de resumo (Pagamento, Prazo, etc.) */
.tbl-cotacao .tbl-resumo-info td {
    --resumo-padding-y: 4px;
    --resumo-padding-x: 12px;
    --resumo-font-size: 10px;
    --resumo-font-weight: 500;
    --resumo-color: #475569;
    --resumo-bg-color: #f8fafc;
    --resumo-border-color: #e5e7eb;

    padding: var(--resumo-padding-y) var(--resumo-padding-x);
    font-size: var(--resumo-font-size);
    font-weight: var(--resumo-font-weight);
    color: var(--resumo-color);
    background-color: var(--resumo-bg-color);
    border-color: var(--resumo-border-color);
    text-align: right;
}

.tbl-cotacao .tbl-resumo-info td:first-child {
    text-align: left;
    font-weight: 600;
    color: #334155;
}

/* --- CSS PARA COLUNAS FIXAS (STICKY) --- */
.old_tbl-cotacao tr > *:nth-child(-n+6) {
    position: -webkit-sticky;
    position: sticky;
    z-index: 10;
}

/* --- COLUNAS FIXAS (STICKY) — agora são 4 --- */
.tbl-cotacao tr > *:nth-child(-n+4) {
  position: -webkit-sticky;
  position: sticky;
  z-index: 10;
}


/* Offsets usando as variáveis de largura (4 colunas fixas) */
.tbl-cotacao tr > *:nth-child(1) { left: 0; }
.tbl-cotacao tr > *:nth-child(2) { left: var(--c1-width); }
.tbl-cotacao tr > *:nth-child(3) { left: calc(var(--c1-width) + var(--c2-width)); }
.tbl-cotacao tr > *:nth-child(4) { left: calc(var(--c1-width) + var(--c2-width) + var(--c3-width)); }


/* .tbl-cotacao tr > *:nth-child(1) { left: 0; }
.tbl-cotacao tr > *:nth-child(2) { left: var(--c1-width); }
.tbl-cotacao tr > *:nth-child(3) { left: calc(var(--c1-width) + var(--c2-width)); }
.tbl-cotacao tr > *:nth-child(4) { left: calc(var(--c1-width) + var(--c2-width) + var(--c3-width)); }
.tbl-cotacao tr > *:nth-child(5) { left: calc(var(--c1-width) + var(--c2-width) + var(--c3-width) + var(--c4-width)); }
.tbl-cotacao tr > *:nth-child(6) { left: calc(var(--c1-width) + var(--c2-width) + var(--c3-width) + var(--c4-width) + var(--c5-width)); } */

/* Fundo sólido para colunas fixas durante o scroll */
.tbl-cotacao thead tr:nth-of-type(1) th,
.tbl-cotacao thead tr:nth-of-type(2) th {
    background-color: #f3f6fa;
}

.tbl-cotacao tbody td {
    background-color: #ffffff;
}

.tbl-cotacao tfoot tr td {
    background-color: #fafafa;
}

.tbl-cotacao tfoot .tbl-totais-info td {
    background-color: var(--totais-bg-color);
}

.tbl-cotacao tfoot .tbl-total-proposta td {
    background-color: #f3f6fa;
}

.tbl-cotacao tfoot .tbl-descontos-info td {
    background-color: #f0fdf4;
}

.tbl-cotacao tfoot .tbl-custos-info td {
    background-color: var(--custo-bg-color);
}

.tbl-cotacao tfoot .tbl-resumo-info td {
    background-color: var(--resumo-bg-color);
}



/* Permitir quebra de linha no nome do produto */
.tbl-cotacao .tbl-prd {
    white-space: normal !important;  /* permite quebra */
    word-wrap: break-word;           /* quebra palavras longas */
    overflow-wrap: anywhere;         /* quebra em qualquer ponto, se necessário */
    text-overflow: clip !important;  /* remove "..." */
}




/* Permitir quebra de linha no nome do produto */
.tbl-cotacao .tbl-und {
    text-align: center;
    
}

/* Permitir quebra de linha no nome do produto */
.tbl-cotacao .item-col {
    text-align: center;
    
}

