/* ESTILOS ESTRITOS DA DANFE - FIDELIDADE VISUAL 100% */
@page {
    size: A4;
    margin: 0;
}

@media print {
    body {
        margin: 0;
        padding: 0;
        background: #fff;
    }
    #login-screen,
    .dashboard-sidebar,
    .dashboard-topbar,
    #money-bg,
    #toast-container,
    .btn-floating-preview {
        display: none !important;
    }
    .view-content {
        display: none !important;
    }
    .dashboard-layout,
    .dashboard-main,
    #view-gerar-nota,
    .app-container,
    .app-preview {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        position: static !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
    }
    .app-sidebar {
        display: none !important;
    }
    #danfe-page {
        margin: 0 !important;
        box-shadow: none !important;
        width: 210mm !important;
        height: 297mm !important;
        page-break-after: always;
    }
}

#danfe-page {
    width: 210mm;
    min-height: 297mm;
    padding: 5mm 5mm 5mm 5mm; /* Margens mínimas */
    box-sizing: border-box;
    background-color: #fff;
    margin: 0 auto;
    font-family: "Times New Roman", Times, serif !important;
    color: #000;
    box-shadow: 0 0 10px rgba(0,0,0,0.2); /* Só para preview, removido no print */
    position: relative;
    display: flex;
    flex-direction: column;
}

#danfe-page * {
    font-family: "Times New Roman", Times, serif !important;
    box-sizing: border-box;
    line-height: 1.1;
}

.danfe-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin-bottom: 2px;
}

.danfe-table td, .danfe-table th {
    border: 1.5px solid #000;
    padding: 1px 3px;
    vertical-align: top;
}

.danfe-table th {
    text-align: left;
    font-weight: normal;
}

.danfe-label {
    font-size: 7px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

.danfe-value {
    font-size: 10px;
    font-weight: bold;
    display: block;
    min-height: 12px;
    word-break: break-word;
}

/* Tipografia Obrigatória */
.font-24 { font-size: 24px; }
.font-18 { font-size: 18px; }
.font-11 { font-size: 11px; }
.font-10 { font-size: 10px; }
.font-9 { font-size: 9px; }
.font-8 { font-size: 8px; }
.bold { font-weight: bold; }

/* Utilitários */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.w-10 { width: 10%; }
.w-15 { width: 15%; }
.w-20 { width: 20%; }
.w-25 { width: 25%; }
.w-30 { width: 30%; }
.w-40 { width: 40%; }
.w-50 { width: 50%; }

.border-0 { border: none !important; }
.border-top-0 { border-top: none !important; }
.border-bottom-0 { border-bottom: none !important; }

/* Tabela de Produtos */
#table-produtos-danfe th .danfe-label {
    text-align: left;
}
#table-produtos-danfe td {
    font-size: 9px; /* Exigência para produtos */
    padding: 2px 3px;
    border: 1.5px solid #000;
}
#table-produtos-danfe tbody tr {
    height: 15px; /* Minimum height for empty rows */
}
#table-produtos-danfe tbody td {
    border-bottom: 1px dashed #999; /* Standard visual for DANFE product rows when not full */
    border-top: 0;
}
#table-produtos-danfe tbody tr:last-child td {
    border-bottom: 1.5px solid #000;
}

/* -------------------------------------
   NOVO CABEÇALHO DO EMITENTE
-------------------------------------- */
.logo-container {
    width: 100%;
    text-align: center;
    padding: 4px;
}

.logo-container img {
    max-width: 160px;
    max-height: 65px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.company-divider {
    border-top: 1px solid #000;
    margin-top: 4px;
    margin-bottom: 4px;
}

.company-name {
    font-family: "Times New Roman", serif !important;
    font-size: 12px !important;
    font-weight: bold;
    text-align: center;
}

.company-info {
    font-family: "Times New Roman", serif !important;
    font-size: 9px !important;
    text-align: center;
    font-weight: normal;
}
