﻿/* ==========================================
   DOCUMENTO DE ORÃ‡AMENTO (DESIGN PREMIUM)
   ========================================== */
.invoice-container {
    background: #ffffff;
    color: #1f2937;
    padding: 40px;
    font-family: 'Inter', sans-serif;
    max-width: 800px;
    margin: 0 auto;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 24px;
    margin-bottom: 32px;
}

.invoice-brand h2 {
    margin: 0;
    color: var(--primary);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.invoice-badge {
    background: var(--primary);
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 12px;
}

.invoice-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.invoice-section-title {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 6px;
}

.invoice-meta-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #4b5563;
}

.invoice-table-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 32px;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.invoice-table th {
    background: #f9fafb;
    color: #374151;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.invoice-table td {
    padding: 16px;
    font-size: 0.9rem;
    color: #1f2937;
    border-bottom: 1px solid #f3f4f6;
}

.invoice-table tbody tr:last-child td { border-bottom: none; }

.invoice-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.invoice-obs {
    flex: 1;
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.5;
}

.invoice-totals {
    width: 320px;
}

.invoice-totals-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95rem;
    color: #4b5563;
}

.invoice-totals-row.grand {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    border-top: 2px solid #e5e7eb;
    padding-top: 12px;
    margin-top: 4px;
}

.invoice-footer {
    margin-top: 60px;
    text-align: center;
    border-top: 1px solid #f3f4f6;
    padding-top: 32px;
}

.signature-line {
    width: 280px;
    border-top: 1px solid #9ca3af;
    margin: 0 auto 8px;
}

/* ==========================================
   TRANSPARÃŠNCIA PARA O PAPEL TIMBRADO
   ========================================== */
/* No seu style.css, procure e ajuste: */
.invoice-container.modo-timbre {
    /* Ajuste este valor (ex: 350px) para o texto comeÃ§ar apÃ³s o seu cabeÃ§alho impresso */
    padding-top: 350px !important; 
    background-size: 100% 100% !important;
}

/* Garante que o texto dentro dos blocos nÃ£o fique muito apertado */
.info-value {
    margin-bottom: 10px;
}

.invoice-container.modo-timbre .esconder-no-timbre {
    display: none !important; /* Esconde o texto da empresa se usar imagem */
}

.invoice-container.modo-timbre .invoice-table th,
.invoice-container.modo-timbre .invoice-table td,
.invoice-container.modo-timbre .total-box,
.invoice-container.modo-timbre .info-value {
    background-color: transparent !important; /* Remove fundos cinzentos */
    border-color: rgba(0, 0, 0, 0.1) !important; /* Linhas mais suaves */
}
/* ==========================================
   DOCUMENTO DE ORÃ‡AMENTO (DESIGN & IMPRESSÃƒO)
   ========================================== */

/* Estrutura Interna */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.invoice-brand h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.6rem;
    font-weight: 800;
    text-transform: uppercase;
}

.invoice-info-block { margin-bottom: 30px; }
.info-label { 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    color: #64748b; 
    font-weight: 700; 
    margin-bottom: 5px; 
}
.info-value { font-size: 0.95rem; color: #1e293b; line-height: 1.5; }

/* Totais */
.total-section { display: flex; justify-content: flex-end; }
.total-box {
    width: 280px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
}
.total-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.95rem; }
.total-row.final {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #e2e8f0;
    font-weight: 800;
    font-size: 1.2rem;
    color: #0f172a;
}

/* ==========================================
   ESTILO DO ORÃ‡AMENTO (TELA)
   ========================================== */
.invoice-container {
    background: #ffffff;
    width: 210mm;
    min-height: 297mm;
    margin: 20px auto;
    padding: 40px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* MODO PAPEL TIMBRADO ATIVADO */
.invoice-container.modo-timbre {
    background-position: center top !important;
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
    
    /* ðŸš€ AUMENTADO: Empurra TODO o conteÃºdo (incluindo o NÂº da Proposta) para baixo */
    padding-top: 300px !important; 
    
    padding-left: 25mm !important;
    padding-right: 25mm !important;
    border: none !important;
    box-shadow: none !important;
}

.invoice-container.modo-timbre .esconder-no-timbre {
    display: none !important;
}

.invoice-header { display: flex; justify-content: space-between; margin-bottom: 30px; border-bottom: 1px solid #eee; padding-bottom: 20px; }
.invoice-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.invoice-table th { background: #f8fafc; text-align: left; padding: 12px; font-size: 12px; text-transform: uppercase; border-bottom: 2px solid #eee; }
.invoice-table td { padding: 12px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }

.total-box { width: 250px; margin-left: auto; background: #f8fafc; padding: 15px; border-radius: 8px; }
.total-row { display: flex; justify-content: space-between; margin-bottom: 5px; }
.total-row.final { border-top: 2px solid #ddd; padding-top: 10px; font-weight: 800; font-size: 18px; }

/* ==========================================
   IMPRESSÃƒO DEFINITIVA (PDF)
   ========================================== */
@media print {
    @page { 
        size: A4; 
        margin: 0 !important; /* REMOVE CABEÃ‡ALHOS DO NAVEGADOR */
    }

    body { background: white !important; }
    body > *:not(#modal-fatura) { display: none !important; }

    #modal-fatura { 
        position: absolute !important; 
        top: 0; left: 0; width: 100% !important; 
        margin: 0 !important; padding: 0 !important;
        display: block !important; 
    }

    .modal { 
        width: 210mm !important; 
        height: 297mm !important;
        margin: 0 !important; padding: 0 !important;
        border: none !important; box-shadow: none !important;
    }

    .invoice-container {
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 !important;
        border: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .hide-print { display: none !important; }
}
/* ==========================================
   ESTILO PROFISSIONAL: BUDGET MASTER ABNT
   ========================================== */
.budget-modern {
    background: #ffffff;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 40px;
    color: #1a1a1a;
    position: relative;
    box-sizing: border-box;
    font-size: 12pt; /* PadrÃ£o ABNT */
}

.budget-modern.modo-timbre {
    background-color: transparent !important;
    background-size: 100% 100% !important;
    padding-top: 380px !important; /* Ajustado para a logo Lider */
    padding-left: 25mm !important;
    padding-right: 25mm !important;
}

.budget-modern.modo-timbre .esconder-no-timbre {
    display: none !important;
}

.budget-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.data-section-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: #2563eb;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.data-content {
    font-size: 13px;
    color: #334155;
    line-height: 1.6;
}

.data-content strong {
    color: #000;
    font-size: 15px;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.modern-table th {
    background: #0f172a;
    color: #fff;
    font-size: 11px;
    text-transform: uppercase;
    padding: 12px;
    text-align: left;
}

.modern-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.summary-row.total-main {
    background: #2563eb;
    color: #fff;
    padding: 15px;
    border-radius: 6px;
    font-weight: 900;
    font-size: 18px;
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.signature-area {
    margin-top: 80px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    text-align: center;
}

.sig-line {
    border-top: 1px solid #000;
    padding-top: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

@media print {
    @page { size: A4; margin: 0 !important; }
    body > *:not(#modal-fatura) { display: none !important; }
    #modal-fatura { position: absolute; left: 0; top: 0; width: 100%; display: block !important; }
}
/* ==========================================
   ESTILOS DO ORÃ‡AMENTO PROFISSIONAL (A4)
   ========================================== */
.orcamento-profissional {
    width: 210mm;
    min-height: 297mm; /* PadrÃ£o A4 */
    padding: 20mm;
    background: #ffffff;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    margin: 0 auto;
}

/* CabeÃ§alho */
.orcamento-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 3px solid var(--accent);
    padding-bottom: 25px;
    margin-bottom: 35px;
}

.empresa-info h2 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 800;
}

.empresa-info p, .orcamento-meta p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.orcamento-meta {
    text-align: right;
}

.orcamento-meta h1 {
    color: var(--accent);
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.numero-orcamento {
    font-size: 1.1rem !important;
    color: var(--text-primary) !important;
    font-weight: 700;
    margin-bottom: 15px !important;
}

/* TÃ­tulos das seÃ§Ãµes */
.section-title {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 6px;
    margin-bottom: 12px;
}

/* Dados do Cliente */
.cliente-info {
    background: var(--bg-gray);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 35px;
}

.cliente-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.cliente-grid p {
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.cliente-endereco {
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Tabela de Itens */
.itens-orcamento table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 35px;
}

.itens-orcamento th {
    background: var(--primary-light);
    color: #ffffff;
    padding: 12px 15px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
}

.itens-orcamento td {
    padding: 15px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.item-cod {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* RodapÃ© (Totais e ObservaÃ§Ãµes) */
.orcamento-footer {
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

.observacoes-bloco {
    width: 55%;
}

.box-cinza {
    background: var(--bg-gray);
    border: 1px solid var(--border-light);
    padding: 15px;
    border-radius: 8px;
}

.box-cinza p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.totais-bloco {
    width: 40%;
    background: var(--bg-gray);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    height: fit-content;
}

.linha-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.destaque-total {
    font-size: 1.25rem;
    color: var(--accent);
    font-weight: 800;
    border-top: 2px solid var(--border-light);
    padding-top: 15px;
    margin-top: 5px;
    margin-bottom: 0;
}

/* CrÃ©ditos */
.doc-creditos {
    margin-top: 50px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    border-top: 1px dashed var(--border-light);
    padding-top: 15px;
}
/* Impede que uma linha da tabela seja dividida entre duas pÃ¡ginas */
.modern-table tr {
    page-break-inside: avoid !important;
}

/* Garante que o container possa crescer infinitamente para baixo */
.budget-modern {
    height: auto !important;
    min-height: 297mm;
    overflow: visible !important;
}

/* Se quiser forÃ§ar uma quebra de pÃ¡gina manual em algum lugar, use esta classe no HTML: */
.quebra-pagina {
    page-break-before: always;
}
