/* =========================================
   RESET E CONFIGURAÇÕES GERAIS
   ========================================= */
* { 
    margin: 0; 
    padding: 0; 
    font-family: 'Segoe UI', Arial, sans-serif; 
    
}
body{
    background: #e0e0e0; 
}

/* =========================================
   CONFIGURAÇÃO DE PÁGINA (CRUCIAL PARA 10x8)
   ========================================= */
@page {
    size: 100mm 80mm; /* Define o tamanho exato do papel */
    margin: 0; /* Remove margens do navegador */
}
.btn-planilha{
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 10px 10px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    text-transform: uppercase;
    text-decoration: none;
}
.btn-planilha:hover{
    background-color: #219150;
}

/* =========================================
   PAINEL DE CONTROLE (Mantido Igual)
   ========================================= */
.controle-painel {
    background-color: #2c3e50; 
    color: white;
    padding: 15px 20px;
    position: sticky; 
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 40px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.btn-area{
    display: flex;
    justify-content: space-between;
    position: sticky;
    padding: 20px;
    top: 90px;
}

.grupo-input {
    display: flex;
    flex-direction: column;
}

.grupo-input label {
    font-size: 12px;
    margin-bottom: 4px;
    opacity: 0.8;
}

.controle-painel input, 
.controle-painel select {
    padding: 8px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    min-width: 200px;
}

.status-resumo {
    margin-left: auto; 
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-imprimir {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    text-transform: uppercase;
}

.btn-imprimir:hover {
    background-color: #219150;
}

.checkbox-container {
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    padding: 8px 12px !important;
    border-radius: 4px;
    height: 36px; 
}
.checkbox-container input {
    min-width: auto !important;
    transform: scale(1.3);
    cursor: pointer;
}
.checkbox-container label {
    margin: 0;
    cursor: pointer;
    font-size: 13px;
}

/* =========================================
   BOTÕES EXTERNOS (Mantido Igual)
   ========================================= */
.wrapper-etiqueta {
    display: flex;
    flex-direction: column;
    align-items: center; 
    margin-bottom: 30px; 
}

.controles-externos {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #333;
    color: white;
    padding: 5px 20px;
    border-radius: 15px 15px 0 0; 
    margin-bottom: -1px; 
    z-index: 10;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    min-width: 200px;
    justify-content: center;
}

.controles-externos button {
    background: #f1c40f; 
    border: none;
    color: #000;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s;
}

.controles-externos button:hover {
    transform: scale(1.15);
    background: #ffdb4d;
}
.controles-externos span {
    font-weight: bold;
    font-size: 14px;
    min-width: 90px;
    text-align: center;
}
/* =========================================
   ESTRUTURA DA ETIQUETA (AJUSTADA PARA 10x8)
   ========================================= */
.etiqueta {
    width: 100mm;
    height: 80mm; /* <--- MUDANÇA PRINCIPAL: ALTURA */
    background: white;
    padding: 4mm; /* Reduzi padding para caber conteúdo */
    box-sizing: border-box; 
    display: flex;
    flex-direction: column; 
    justify-content: space-between;
    /* Visualização na tela */
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    border: 1px solid #ccc;
    /* Impressão */
    page-break-after: always; 
    break-after: page;
    overflow: hidden; /* Corta se passar do tamanho */
}
/* =========================================
   CABEÇALHO
   ========================================= */
.header-etiqueta {
    display: flex;
    justify-content: space-between; 
    align-items: center; 
    height: 15mm; /* Reduzi de 15mm para 12mm */
    margin-bottom: 1mm;
}

.logo-anacapri {
    max-height: 40%; 
    max-width: 30mm;  
    object-fit: contain; 
}

.logo-transportadora {
    max-height: 130%; 
    max-width: 250mm;
    object-fit: contain;
}

/* =========================================
   CONTEÚDO
   ========================================= */
.conteudo {
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    margin-top: 5px;
    gap: 5px;
}

.conteudo h2 {
    font-size: 13pt; /* Ajuste leve */
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.0;
    margin: 0 0 2mm 0;
}

.conteudo p {
    font-size: 10pt;
    margin: 1px 0;
    line-height: 1.2;
}

.obs {
    font-size: 9pt;
    font-style: italic;
    color: #555;
    margin-top: 2px !important;
}

.cep-box {
    margin: 5px 0px; /* Reduzi de 15px para 5px */
    font-size: 14pt;
    font-weight: bold;
    display: inline-block; 
    border-radius: 4px;
}
.cep-box .city{
    font-size: 13px;
}
.complemento{
    display: flex;
    gap: 10px;
    font-weight: 500;
    font-size: 20px;
}
/* =========================================
   RODAPÉ (Arezzo + ID)
   ========================================= */
.footer-layout {
    margin-top: auto;
    border-top: 1px dashed #999;
    padding-top: 2px;
    display: flex;
    justify-content: space-between; 
    align-items: flex-end; 
}
.remetente-box {
    text-align: left;
    max-width: 85%;
}

.label-remetente {
    font-size: 10pt;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0px;
    color: #333;
}

.nome-remetente {
    font-size: 9pt; 
    text-transform: uppercase;
    display: block;
    line-height: 1.5;
}

.endereco-remetente {
    font-size: 7pt;
    margin: 0;
    color: #000;
    line-height: 1.0;
}

.id-numero {
    font-size: 10pt;
    font-weight: bold;
    color: #000;
}

/* =========================================
   GHOST PRINTING (Mantido Igual)
   ========================================= */
.copia-oculta {
    display: none !important;
}

/* =========================================
   NOVA MISSÃO: LE CORDON BLEU
   ========================================= */
.etiqueta-lcb {
    justify-content: flex-start;
}

.header-lcb {
    height: 8mm;
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}
.logo-lcb {
    max-height: 100%;
    max-width: 80mm;
    object-fit: contain;
}
.conteudo-lcb {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.conteudo-lcb h2 {
    font-size: 14pt;
    font-weight: 900;
    margin: 0 0 2mm 0;
    text-transform: uppercase;
}
.conteudo-lcb{
    font-size: 11pt;
    margin: 0 0 4mm 0;
    line-height: 1.2;
}
.endereco-lcb{
    display: flex;
    flex-direction: column;
    font-weight: 500;
    gap: 5px;
}
.box-materiais {
    border: 2px solid #000;
    border-radius: 5px;
    padding: 2mm;
    min-height: 18mm;
    margin-top: 5px;
}
.box-materiais p {
    font-size: 10pt;
    margin: 2px 0;
    white-space: pre-wrap; /* Respeita as quebras de linha da planilha */
}
.footer-lcb {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 3mm;
    height: 5mm;
}
.footer-conf {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 3mm;
    height: 20mm;
}
.urgente-text {
    font-size: 18pt;
    font-weight: 900;
    margin: 0;
    line-height: 1;
}
.logo-grapha {
    max-height: 100%;
    max-width: 35mm;
    object-fit: contain;
}
.footer-conf .logo-grapha {
    max-height: 40%;
    max-width: 35mm;
}
/* =========================================
   FOLHA DE CONFERÊNCIA (TAMANHO LIVRE)
   ========================================= */
.etiqueta-conferencia {
    height: auto !important; /* Destrava a altura fixa da etiqueta normal */
    width: auto !important;
    min-width: 150mm;
    min-height: 100%; /* Tamanho mínimo para não ficar nanica */
    padding-bottom: 5mm; 
    page-break-inside: avoid; /* Evita que a impressora corte a lista no meio da folha */
}
/* Espaçamento extra para os itens respirarem na conferência */
.item-conferencia {
    margin: 8px 0;
    font-size: 12pt;
}
/* =========================================
   ELEMENTOS NOVOS LE CORDON BLEU
   ========================================= */
.item-conferencia {
    margin: 6px 0;
    display: flex;
    align-items: center;
    font-size: 11pt;
}
/* O quadradinho de dar check com a caneta */
.check-box {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #000;
    margin-right: 8px;
    border-radius: 3px;
}
/* Destaque para a Etiqueta Individual */
.produto-destaque {
    display: flex;
    flex-direction: column;
    justify-content: left;
    align-items: left;
    gap: 10px;
    height: 50%;
    margin-top: 1px;
}
.nome-prod-destaque {
    font-size: 16pt;
    font-weight: 900;
    text-align: left;
    text-transform: uppercase;
}
.qtd-prod-destaque {
    font-size: 14pt;
    font-weight: bold;
    text-align: center;
    margin: 0;
    padding: 2px 10px;
    width: 40%;
    border: 1px solid #000;
    border-radius: 5px;
}

/* =========================================
   LISTA DE ENVIO (TABELA DE ROMANEIO)
   ========================================= */
.tabela-envio {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.tabela-envio th, .tabela-envio td {
    border: 1px solid #aaa;
    padding: 10px;
    font-size: 12pt;
    text-align: left;
}
.tabela-envio th {
    background-color: #f2f2f2;
    text-align: center;
}
.tabela-envio td.centro {
    text-align: center;
}
/* O quadradinho do Check na tabela */
.check-tabela {
    width: 20px;
    height: 20px;
    border: 2px solid #000;
    margin: 0 auto;
}



/* =========================================
   DECLARAÇÃO DE CONTEÚDO (CORREIOS)
   ========================================= */
.declaracao-box {
    width: 100%;
    font-family: Arial, sans-serif;
    color: #000;
    margin-bottom: 20px;
    page-break-after: always;
    break-after: page;
}
.dec-header {
    display: flex;
    border: 2px solid #000;
    margin-bottom: 5px;
}
.dec-header-title {
    flex-grow: 1;
    text-align: center;
    font-weight: bold;
    font-size: 16pt;
    padding: 5px;
    border-right: 2px solid #000;
    text-transform: uppercase;
}
.dec-header-id {
    width: 35mm;
    text-align: center;
    font-weight: bold;
    font-size: 14pt;
    padding: 5px;
}
.dec-rem-dest {
    display: flex;
    border: 2px solid #000;
    margin-bottom: 5px;
}
.dec-col {
    width: 50%;
    padding: 5px 8px;
}
.dec-col.left {
    border-right: 2px solid #000;
}
.dec-col-title {
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid #000;
    margin-bottom: 5px;
    padding-bottom: 2px;
    letter-spacing: 2px;
}
.dec-field {
    font-size: 9pt;
    margin-bottom: 4px;
    text-transform: uppercase;
}
.dec-field strong {
    font-size: 8.5pt;
}
.dec-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #000;
    margin-bottom: 5px;
}
.dec-table th, .dec-table td {
    border: 1px solid #000;
    padding: 4px 6px;
    font-size: 9pt;
    text-align: center;
}
.dec-table th {
    font-weight: bold;
    letter-spacing: 1px;
}
.dec-table .text-left {
    text-align: left;
}
.dec-footer-text {
    border: 2px solid #000;
    padding: 8px;
    font-size: 8.5pt;
    text-align: justify;
    margin-bottom: 5px;
    line-height: 1.3;
}
.dec-signatures {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 30px;
    padding: 0 10px;
}
.dec-obs {
    border: 2px solid #000;
    padding: 5px 8px;
    font-size: 8.5pt;
}




/* =========================================
   MODO DE IMPRESSÃO
   ========================================= */

@media print {
    body { background: white; }
    
    .no-print, .controles-externos { 
        display: none !important; 
    }

    .wrapper-etiqueta {
        display: block;
        margin: 0;
    }

    /* 1. REGRA PARA A ETIQUETA TÉRMICA (PADRÃO) */
    .etiqueta {
        margin: 0;
        box-shadow: none;
        border: none;
        page-break-after: always;
        break-after: page;
        /* Garante as medidas no papel pequeno */
        width: 100mm;
        height: 80mm; 
        overflow: hidden; /* Evita que vaze para outra folha */
    }

    /* 2. EXCEÇÃO PARA A FOLHA DE CONFERÊNCIA (A4) */
    .etiqueta.etiqueta-conferencia {
        width: 100% !important; /* Usa toda a largura do papel A4 */
        height: auto !important; /* Cresce o quanto precisar */
        min-height: 100% !important; 
        padding: 10mm !important; /* Margem de segurança da impressora */
        page-break-inside: avoid !important; /* Tenta não cortar a tabela no meio */
        overflow: visible; /* Libera o conteúdo para aparecer tudo */
    }

    .copia-oculta {
        display: block !important;
    }
}