body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    min-height: 100vh;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333;
    padding: 14px 20px;
    color: white;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.navbar a {
    color: white;
    text-decoration: none;
    padding: 14px 20px;
}

.navbar a:hover {
    background-color: #ddd;
    color: black;
}

.navbar ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.navbar li {
    float: left;
}

.navbar li a {
    display: block;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

.navbar li a:hover {
    background-color: #111;
}

.btn {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.form-check {
    margin-left: 10px;
}

.form-check-label {
    font-weight: normal;
    margin-left: 5px;
}

.container {
    margin-top: 80px;
    /* Espaço para a barra de navegação */
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 1200px;
    box-sizing: border-box;
    text-align: center;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1.1em;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
    margin-right: 10px;
}

.form-row .form-group:last-child {
    margin-right: 0;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.button-group button {
    padding: 15px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
    flex: 1;
}

.button-group button:hover {
    background-color: #218838;
}

.table {
    width: 100%;
    table-layout: fixed;
    /* Fixa a largura das colunas */
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.9em;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table thead tr {
    background-color: #009879;
    color: #ffffff;
}

.table tbody tr {
    border-bottom: 1px solid #dddddd;
    background-color: #f3f3f3;
    /* Cor de fundo alternada */
}

.avoid-break {
    page-break-inside: avoid;
    /* Evita quebra dentro desses elementos */
    -webkit-column-break-inside: avoid;
    break-inside: avoid;
}

.table tbody tr:nth-of-type(even) {
    background-color: #f3f3f3;
    background-color: white;
    /* Cor de fundo alternada */
}

.table tbody tr:hover {
    background-color: #f1f1f1;
}

.table tbody tr:last-of-type {
    border-bottom: 2px solid #009879;
}

.table-responsive {
    width: 100%;
}

/* Definição de larguras específicas para cada coluna */
.table-services th:nth-child(1),
.table-services td:nth-child(1) {
    width: 7%;
}

/* ID */
.table-services th:nth-child(2),
.table-services td:nth-child(2) {
    width: 15%;
}

/* Cliente */
.table-services th:nth-child(3),
.table-services td:nth-child(3) {
    width: 20%;
}

/* Descrição */
.table-services th:nth-child(4),
.table-services td:nth-child(4) {
    width: 10%;
}

/* Responsável */
.table-services th:nth-child(5),
.table-services td:nth-child(5) {
    width: 10%;
}

/* Status */
.table-services th:nth-child(6),
.table-services td:nth-child(6) {
    width: 8%;
}

/* Prioridade */
.table-services th:nth-child(7),
.table-services td:nth-child(7) {
    width: 10%;
}

/* Etapa */
.table-services th:nth-child(8),
.table-services td:nth-child(8) {
    width: 10%;
}

/* Adicione classes para lidar com texto longo */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Ações */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
    /* Espaço entre o cabeçalho e o título da tabela */
}

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
    /* Espaço entre o cabeçalho e a tabela */
}

.header .logo-and-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
    /* Centraliza logo e título */
}

.header .client-info {
    align-self: flex-start !important;
    /* Alinha as informações do cliente à esquerda */
    margin-top: 10px;
    /* Espaço entre logo/título e dados do cliente */
}

.logo img {
    width: 400px;
    /* Ajuste para o tamanho desejado, por exemplo, 25% da largura da viewport */
    height: auto;
    /* Mantém a proporção da imagem */
    max-width: 400px;
    /* Mantém a proporção do logo */
}

.client-info {
    text-align: left !important;
    width: 100%;
    margin-top: 10px;
    align-self: flex-start !important;
    /* Certifica que o alinhamento seja à esquerda */
}

.client-info p {
    text-align: left !important;
    margin: 0;
    padding: 2px 0;
    line-height: 1.2;
}

.title {
    margin-top: 50px;
    /* Ajuste para mais ou menos espaço */
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
}

.button-group button {
    padding: 15px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
    width: 100%;
    /* Faz o botão ocupar toda a largura disponível */
    margin-bottom: 10px;
    /* Espaçamento entre os botões */
}

.button-group button:last-child {
    margin-bottom: 0;
    /* Remove o espaçamento do último botão */
}

h1 {
    font-size: 2.5rem;
    color: #009879;
    font-weight: bold;
}

.form-inline input,
.form-inline select {
    width: auto;
    margin-right: 10px;
}

.form-inline button {
    padding: 10px 20px;
}

/* Estilos da tabela */
.styled-table {
    width: 100%;
    table-layout: fixed;
    /* Força as colunas a terem tamanhos fixos */
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.9em;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
}

.styled-table th,
.styled-table td {
    padding: 12px 15px;
    text-align: left;
    white-space: nowrap;
    width: 20%;
    /* Largura fixa para cada coluna */
    overflow: hidden;
    text-overflow: ellipsis;
}

.styled-table thead tr {
    background-color: #009879;
    color: #ffffff;
    border: 1px solid #dddddd;
}

.styled-table tbody tr {
    border-bottom: 1px solid #dddddd;
}

.styled-table tbody tr:nth-of-type(even) {
    background-color: #f3f3f3;
}

.styled-table tbody tr:last-of-type {
    border-bottom: 2px solid #009879;
}

/* Faz o cabeçalho da tabela fixar no topo ao rolar */
.styled-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #009879;
    color: #ffffff;
    border: 1px solid #dddddd;
    text-align: left;
    padding: 12px 15px;
}

/* Define largura das colunas do cabeçalho e do corpo */
.styled-table th,
.styled-table td {
    padding: 12px 15px;
    text-align: left;
    white-space: nowrap;
    width: 20%;
    /* Ajuste para garantir a consistência entre as colunas */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Estilos de linhas alternadas */
.styled-table tbody tr {
    border-bottom: 1px solid #dddddd;
}

.styled-table tbody tr:nth-of-type(even) {
    background-color: #f3f3f3;
}

.styled-table tbody tr:last-of-type {
    border-bottom: 2px solid #009879;
}

/* Ajustar o espaçamento entre os ícones */
.styled-table td a {
    margin-right: 10px;
}

/* Ajustar o tamanho dos ícones, se necessário */
.styled-table td i {
    font-size: 1.2rem;
}

.text-danger {
    color: red !important;
}

.bg-danger {
    background-color: #f8d7da !important;
    /* Cor de fundo para o prazo vencido */
    color: #721c24 !important;
    /* Cor do texto para contraste */
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 15px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .form-group {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .form-row .form-group:last-child {
        margin-bottom: 0;
    }

    .button-group button {
        width: 100%;
        padding: 12px;
        font-size: 1em;
    }

    .styled-table {
        font-size: 0.8em;
    }
}

/* Definir largura fixa para as colunas */
.styled-table th,
.styled-table td {
    width: auto;
    /* Ajustar conforme a quantidade de colunas */
    overflow: hidden;
    text-overflow: ellipsis;
    /* Mostra "..." quando o texto é longo */
}

/* Impede o redimensionamento da tabela ao carregar novos dados */
.styled-table th,
.styled-table td {
    max-width: 200px;
    /* Define um tamanho máximo para as células */
    min-width: 150px;
    /* Define um tamanho mínimo para as células */
}

@media (max-width: 480px) {
    .navbar ul {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar li {
        width: 100%;
    }

    .navbar li a {
        text-align: left;
        padding: 10px 20px;
    }

    .table {
        font-size: 0.7em;
    }
}

@media print {

    /* Garantir que a cor de fundo e o texto do cabeçalho sejam mantidos */
    .table thead th {
        background-color: #28a745 !important;
        color: white !important;
        border: 1px solid black !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Remover box-shadow e background-color geral */
    .container {
        box-shadow: none !important;
        background-color: white !important;
    }

    body,
    .table {
        background: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Garantir que a cor de fundo e o texto do cabeçalho "Padrão de Entrada" sejam mantidos */
    .table thead tr th {
        background-color: #28a745 !important;
        color: white !important;
        border: 1px solid black !important;
    }

    .table thead tr th {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Estilo específico para o cabeçalho "Padrão de Entrada" */
    .table thead tr th[scope="col"] {
        background-color: #28a745 !important;
        color: white !important;
    }

    .table thead tr th[scope="row"] {
        background-color: #28a745 !important;
        color: white !important;
    }

    /* Estilo para o cabeçalho "Padrão de Entrada" */
    tr.avoid-break th {
        background-color: #28a745 !important;
        color: white !important;
        text-align: center !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Remover outros estilos que possam interferir */
    body,
    .table {
        background: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Remover o fundo verde das linhas "Totais" e outras linhas específicas */
    tr.avoid-break.totais th,
    tr.avoid-break.final th {
        background-color: white !important;
        color: black !important;
    }

    /* Linha específica para a linha de totais */
    tr.totais th {
        background-color: white !important;
        color: black !important;
    }

    /* Linha específica para a última linha */
    tr.final th {
        background-color: white !important;
        color: black !important;
    }

    .client-info p {
        text-align: left !important;
        margin: 0 !important;
        padding: 2px 0 !important;
        line-height: 1.2 !important;
        width: 100% !important;
    }

    /* Estilo adicional para garantir o alinhamento */
    .client-info {
        text-align: left !important;
        display: block !important;
        width: 100% !important;
    }
}

body {
    text-align: left !important;
}

/* Garantir que o container também não tenha centralização aplicada */
.container {
    text-align: left !important;
}

.kanban-board {
    display: flex;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    padding: 10px;
}


.kanban-column-header {
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

.kanban-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 80px;
    /* Altura mínima para garantir espaço */
    max-height: 120px;
    /* Altura máxima do cartão */
    display: flex;
    flex-direction: column;
}

.kanban-item-content {
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Limita para 2 linhas */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 100%;
    /* Garante que não ultrapasse o cartão */
    word-wrap: break-word;
    /* Quebra palavras longas */
    margin-bottom: 10px;
    /* Espaço para os ícones */
}

.kanban-item-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: absolute;
    bottom: 10px;
    right: 10px;
}

.kanban-item-actions i {
    margin-left: 8px;
    color: #6c757d;
    cursor: pointer;
}

.kanban-columns {
    display: flex;
    overflow-x: auto;
    /* Adiciona rolagem horizontal */
    white-space: nowrap;
    /* Impede que as colunas quebrem */
    padding-bottom: 20px;
    /* Espaço para a barra de rolagem */
}

.kanban-column {
    flex: 0 0 250px;
    /* Largura fixa para cada coluna */
    width: 250px;
    /* Largura fixa para cada coluna */
    margin-right: 15px;
    /* Espaçamento entre colunas */
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    position: relative;
    overflow: visible;
    /* Garante que não haja rolagem na coluna */
}

/* Opcional: Tooltip para texto completo */
.kanban-item[title] {
    cursor: help;
}

.kanban-items {
    overflow: visible;
    /* Remove barra de rolagem interna */
    height: auto;
    /* Permite crescimento natural */
}

.kanban-item {
    background-color: white;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 4px;
    cursor: move;
    /* Indica que o item pode ser movido */
}

.kanban-placeholder {
    height: 50px;
    background-color: #f0f0f0;
    border: 1px dashed #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin: 10px 0;
}

.kanban-placeholder .add-service-icon {
    color: #6c757d;
    font-size: 24px;
}

.kanban-item h6 {
    margin: 0;
}

.kanban-item p {
    margin: 5px 0
}

.hidden {
    display: none !important;
}

.unclassified-items {
    margin-top: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
}

.unclassified-items-title {
    font-weight: bold;
    color: #6c757d;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.unclassified-items-title i {
    margin-right: 10px;
    color: #dc3545;
}

.unclassified-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.unclassified-item {
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.unclassified-item-actions {
    display: flex;
    gap: 10px;
}

/* Estilos para a seção da Lista de Carga */
#listaCargaTable {
    width: 95%;
    max-width: 95%;
    margin: 0 auto;
    font-size: 10pt;
    table-layout: auto;
    /* Colunas auto-ajustáveis */
    border-collapse: collapse;
}

#listaCargaTable th,
#listaCargaTable td {
    border: 1px solid #000;
    padding: 4px;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
    word-wrap: break-word;
    page-break-inside: avoid;
}

/* Ajustar a coluna Descrição para ser maior e auto-ajustável */
#listaCargaTable th:nth-child(1),
#listaCargaTable td:nth-child(1) {
    min-width: 100px;
    /* Largura mínima para garantir espaço */
    width: 50%;
    /* Priorizar a Descrição, ocupando mais espaço */
}

/* Definir largura mínima fixa para as demais colunas */
#listaCargaTable th:nth-child(2),
#listaCargaTable td:nth-child(2),
/* Qtd */
#listaCargaTable th:nth-child(3),
#listaCargaTable td:nth-child(3),
/* Pot. (W) */
#listaCargaTable th:nth-child(4),
#listaCargaTable td:nth-child(4),
/* Pot. (VA) */
#listaCargaTable th:nth-child(5),
#listaCargaTable td:nth-child(5),
/* F.P. */
#listaCargaTable th:nth-child(6),
#listaCargaTable td:nth-child(6),
/* F.D. */
#listaCargaTable th:nth-child(7),
#listaCargaTable td:nth-child(7),
/* Fases */
#listaCargaTable th:nth-child(8),
#listaCargaTable td:nth-child(8),
/* Tot. (kW) */
#listaCargaTable th:nth-child(9),
#listaCargaTable td:nth-child(9),
/* Tot. (kVA) */
#listaCargaTable th:nth-child(10),
#listaCargaTable td:nth-child(10) {
    /* Corr. (A) */
    min-width: 50px;
    /* Largura mínima fixa para compactar */
    width: auto;
    /* Permitir ajuste automático dentro do espaço restante */
}

/* Estilo específico para a linha final (POT.TOTAL, POT.DEMANDADA, ALIMENT.) */
#listaCargaTable tr.final th {
    border: 1px solid #000;
    padding: 4px;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
    word-wrap: break-word;
}

#listaCargaTable tr.final th:nth-child(1) {
    width: 30%;
    /* POT.TOTAL ocupa menos espaço */
}

#listaCargaTable tr.final th:nth-child(2) {
    width: 40%;
    /* POT.DEMANDADA com espaço para texto longo */
}

#listaCargaTable tr.final th:nth-child(3) {
    width: 30%;
    /* ALIMENT. com espaço suficiente */
}

/* Estilos para a seção de Padrão de Entrada */
#padraoEntradaTable {
    width: 95%;
    max-width: 95%;
    margin: 10px auto;
    font-size: 10pt;
    table-layout: auto;
    /* Colunas auto-ajustáveis */
    border-collapse: collapse;
}

#padraoEntradaTable th,
#padraoEntradaTable td {
    border: 1px solid #000;
    padding: 4px;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
    word-wrap: break-word;
    page-break-inside: avoid;
}

/* Estilos para a seção de abreviações (nota de rodapé) */
.table-footer {
    text-align: left !important;
    margin-top: 10px;
    /* Espaço entre a tabela de padrão de entrada e a nota de rodapé */
    width: 95%;
    max-width: 95%;
    margin-left: auto;
    margin-right: auto;
    font-size: 6pt;
    /* Fonte menor para a nota de rodapé */
    line-height: 1.1;
    /* Reduz o espaço entre linhas */
}

.table-footer .abbreviations-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 colunas por padrão */
    gap: 10px;
    width: 100%;
    text-align: left;
}

.table-footer .abbreviation-item {
    margin: 0;
    /* Remove margem para eliminar espaço entre linhas */
    padding: 0;
    /* Remove padding para compactar */
    line-height: 1.1;
    /* Garante que não haja espaço extra */
}

/* Ajustar para 4 colunas em telas maiores */
@media (min-width: 768px) {
    .table-footer .abbreviations-columns {
        grid-template-columns: repeat(4, 1fr);
        /* 4 colunas em telas maiores */
    }
}

#memorialCalculoContainer {
    margin-top: 20px;
}

#memorialCalculoContainer h2 {
    text-align: center;
}

#memorialCalculoContainer table {
    font-size: 0.9em;
}

#memorialCalculoContainer .notes {
    font-size: 0.8em;
    margin-top: 20px;
}

#memorialCalculoContainer .notes ul {
    padding-left: 20px;
}

/* Estilos para o Memorial de Cálculo */
.memorial-calculo {
    font-family: sans-serif;
    line-height: 1.5;
}
.memorial-calculo h2, .memorial-calculo h3, .memorial-calculo h4 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #333;
}
.memorial-calculo h2 {
    text-align: center;
    border-bottom: 2px solid #28a745; /* Green color like the original table */
    padding-bottom: 5px;
    margin-bottom: 1em;
}
.memorial-calculo table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
    font-size: 0.9em;
}
.memorial-calculo th, .memorial-calculo td {
    border: 1px solid #ccc;
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
}
.memorial-calculo th {
    background-color: #e9ecef; /* Light gray background for headers */
    font-weight: bold;
}
.memorial-calculo td.number {
    text-align: right;
}
 .memorial-calculo .total-row th, .memorial-calculo .total-row td {
     font-weight: bold;
     background-color: #f8f9fa; /* Slightly different background for totals */
 }
 .memorial-calculo .final-demand {
     margin-top: 1.5em;
     font-weight: bold;
     font-size: 1.1em;
 }
 .memorial-calculo .conclusion {
     margin-top: 1.5em;
     border-top: 1px solid #ccc;
     padding-top: 1em;
 }
 .memorial-calculo .info-p {
     margin-bottom: 0.5em;
     font-size: 0.95em;
 }
 .memorial-calculo .info-p strong {
     min-width: 150px;
     display: inline-block;
 }
 .memorial-calculo ul {
     list-style: disc;
     margin-left: 20px;
     font-size: 0.9em;
 }
 .avoid-break { /* Ensure table rows don't break across pages */
     page-break-inside: avoid;
 }

/* Estilos específicos para impressão */
@media print {
    @page {
        size: A4 landscape;
        /* Orientação paisagem */
        margin: 0.5cm;
    }

    body {
        margin: 0;
        padding: 0;
    }

    #listaCargaTable,
    #padraoEntradaTable {
        width: 95%;
        max-width: 95%;
        margin: 10px auto;
        font-size: 10pt;
    }

    #listaCargaTable th,
    #listaCargaTable td,
    #padraoEntradaTable th,
    #padraoEntradaTable td {
        border: 1px solid #000;
        padding: 4px;
        text-align: center;
        vertical-align: middle;
    }

    /* Ajustar a coluna Descrição na impressão */
    #listaCargaTable th:nth-child(1),
    #listaCargaTable td:nth-child(1) {
        min-width: 100px;
        width: 50%;
    }

    /* Definir largura mínima fixa para as demais colunas na impressão */
    #listaCargaTable th:nth-child(2),
    #listaCargaTable td:nth-child(2),
    #listaCargaTable th:nth-child(3),
    #listaCargaTable td:nth-child(3),
    #listaCargaTable th:nth-child(4),
    #listaCargaTable td:nth-child(4),
    #listaCargaTable th:nth-child(5),
    #listaCargaTable td:nth-child(5),
    #listaCargaTable th:nth-child(6),
    #listaCargaTable td:nth-child(6),
    #listaCargaTable th:nth-child(7),
    #listaCargaTable td:nth-child(7),
    #listaCargaTable th:nth-child(8),
    #listaCargaTable td:nth-child(8),
    #listaCargaTable th:nth-child(9),
    #listaCargaTable td:nth-child(9),
    #listaCargaTable th:nth-child(10),
    #listaCargaTable td:nth-child(10) {
        min-width: 50px;
        width: auto;
    }

    /* Estilo específico para a linha final na impressão */
    #listaCargaTable tr.final th:nth-child(1) {
        width: 30%;
    }

    #listaCargaTable tr.final th:nth-child(2) {
        width: 40%;
    }

    #listaCargaTable tr.final th:nth-child(3) {
        width: 30%;
    }

    /* Alinhar informações do cliente à esquerda na impressão */
    #previewHeader .client-info {
        text-align: left !important;
    }

    #previewHeader .client-info p {
        text-align: left !important;
        margin: 2px 0;
    }

    .table-footer {
        text-align: left !important;
        margin-top: 10px;
        width: 95%;
        max-width: 95%;
        margin-left: auto;
        margin-right: auto;
        font-size: 6pt;
        /* Fonte menor na impressão */
        line-height: 1.1;
        page-break-before: avoid;
        /* Evita quebra de página antes da nota de rodapé */
        page-break-inside: avoid;
        /* Evita quebra dentro da nota de rodapé */
    }

    .table-footer .abbreviations-columns {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        /* 4 colunas na impressão */
        gap: 10px;
        width: 100%;
        text-align: left !important;
    }

    .table-footer .abbreviation-item {
        margin: 0;
        padding: 0;
        line-height: 1.1;
        text-align: left !important;
    }

    /* Garantir que a tabela de padrão de entrada e a nota de rodapé fiquem na mesma página, se possível */
    #padraoEntradaTable {
        page-break-after: auto;
        /* Permite que a nota de rodapé siga a tabela */
    }

    /* Estilo para células vazias */
    .empty-cell {
        background-color: #f0f0f0 !important;
        border: 1px solid #000 !important;
    }

    /* Evitar quebras de página */
    #listaCargaTable tr,
    #padraoEntradaTable tr {
        page-break-inside: avoid;
    }

    /* Ocultar elementos desnecessários */
    .no-print {
        display: none !important;
    }

    /* Garantir que o conteúdo caiba na página */
    #previewContainer {
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }
}