/* ============================================================
   ESTILOS GERAIS E DASHBOARD
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

.dashboard {
    overflow-y: auto;
    padding: 20px;
}

.search-box {
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.search-box:focus {
    border-color: var(--cor-primaria);
}

.data-table-title {
    background-color: var(--cor-dark);
    color: #fff;
    font-size: 1.1rem;
}

.data-table-wrapper {
    background: var(--cor-card);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--cor-dark);
}

.data-table th, .data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle; /* Alinhamento vertical garantido */
}

/* Coluna do código */
.codigo-link {
    color: #2c343a;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
}

/* Coluna de Ação (Copiar) */
.coluna-acao {
    width: 50px;
    text-align: center !important;
    padding: 15px 5px !important;
}

.btn-copiar {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 5px;
    border-radius: 4px;
}

.btn-copiar:hover {
    color: var(--cor-primaria);
    background-color: #f8f8f8;
    transform: scale(1.1);
}

/* ============================================================
   ESTILO DO MODAL E FOLHA A4
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    overflow-y: auto;
    padding: 20px 0;
}

.modal-conteudo {
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.folha-a4 {
    background: white;
    width: 210mm;
    height: 297mm;
    padding: 10mm;
    box-sizing: border-box;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: scale(0.7); 
    transform-origin: top center;
    margin-bottom: -80mm;
}

.fechar {
    position: fixed;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.btn-imprimir {
    background-color: #e31d1a;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.2rem;
    margin-top: 20px;
}

/* ============================================================
   ESTILO DAS ETIQUETAS
   ============================================================ */
.bloco-etiqueta {
    text-align: center;
    width: 100%;
    height: 25%; /* Cada uma ocupa exatamente um quarto da folha */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-bottom: 1px dashed #aaa;
    box-sizing: border-box;
}
.bloco-etiqueta:last-child {
    border-bottom: none;
}

.codigo-grande {
    font-family: 'Inter', sans-serif; 
    font-size: 62pt !important;
    font-weight: 700;
    margin: 0;
    color: #000 !important;
    letter-spacing: -1px;
    line-height: 1.1;
}

.descricao-pneu {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 18pt !important;
    font-weight: bold;
    margin-top: 5px;
    text-transform: uppercase;
}

/* ============================================================
   CONFIGURAÇÃO DE IMPRESSÃO
   ============================================================ */
@media print {
    @page {
        size: A4;
        margin: 0 !important;
    }

    html, body {
        margin: 0 !important;
        padding: 0 !important;
        height: 297mm !important;
        width: 210mm !important;
        overflow: hidden !important;
    }

    body * {
        display: none !important;
    }

    #modal-etiqueta, 
    #modal-etiqueta .modal-conteudo, 
    #area-impressao, 
    #area-impressao * {
        display: flex !important;
        visibility: visible !important;
    }

    .modal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .modal-conteudo {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }

    .folha-a4 {
        width: 210mm !important;
        height: 297mm !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        transform: scale(1) !important;
        box-shadow: none !important;
    }

    .bloco-etiqueta {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        height: 74mm !important; 
        max-height: 74mm !important;
        min-height: 74mm !important;
        border-bottom: 1px dashed #000 !important;
        box-sizing: border-box !important;
        page-break-inside: avoid !important;
    }

    .bloco-etiqueta:last-child {
        border-bottom: none !important;
    }

    .codigo-grande {
        font-size: 60pt !important;
        margin: 0 !important;
        line-height: 1.1 !important;
    }

    .descricao-pneu {
        font-size: 16pt !important;
        margin-top: 5mm !important;
    }
}

/* Notificação Flutuante (Toast) */
.toast-container {
    position: fixed;
    top: 15vh;
    right: 45vw;
    background-color: #333;
    color: #fff;
    padding: 12px 25px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10002;
    border-left: 4px solid #28a745;
}

.toast-container.mostrar {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Estilo do Campo de Entrada --- */
.input-etiqueta-extra {
    display: block;
    width: 60%;
    margin: 10px auto;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16pt;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-weight: bold;
}

/* --- Texto que será replicado (alvo-replica) --- */
.alvo-replica {
    font-size: 20pt;
    font-weight: bold;
    margin-top: 5mm;
    min-height: 1.2em;
    text-align: center;
    color: #000;
}

/* --- Correção do Fundo Azul (Preenchimento Automático) --- */
.input-etiqueta-extra:-webkit-autofill,
.input-etiqueta-extra:-webkit-autofill:hover, 
.input-etiqueta-extra:-webkit-autofill:focus {
    -webkit-text-fill-color: #000 !important;
    box-shadow: 0 0 0px 1000px white inset !important;
    -webkit-box-shadow: 0 0 0px 1000px white inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* No CSS geral (fora do media print) */
.somente-impressao {
    display: none; /* Esconde no monitor */
}

/* ... (resto do seu código acima) ... */

@media print {
    /* 1. Esconde o input e seu placeholder completamente */
    .input-etiqueta-extra {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    /* 2. Mostra a div que tem o texto formatado */
    .somente-impressao {
        display: block !important;
        visibility: visible !important;
    }
    
    /* 3. Garante que se estiver vazio, não ocupe espaço */
    .alvo-replica:empty {
        display: none !important;
    }
}