/* ===========================================
   Café 360 — Reset GLOBAL de impressão / Salvar PDF
   Carregado por ÚLTIMO (vence as regras das telas).

   Motivo: no WebView do Android (PrintManager) e em vários navegadores, o
   PDF saía EM BRANCO. Causas que este reset elimina de uma vez:
     1. #app com min-height:100vh + header sticky → 1ª página vazia.
     2. .app-content com animation fadeInUp (começa em opacity:0/translateY)
        → o snapshot da impressão pega o quadro invisível = página branca.
     3. html/body/#app sem altura/overflow resetados → conteúdo clipado.
   Aqui só mexe em @media print — a tela normal fica intacta.
   =========================================== */

@media print {
    @page { margin: 1.4cm; }

    /* --- Shell: solta altura, overflow e fundo --- */
    html, body {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        background: #fff !important;
        background-image: none !important;
    }

    #app {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        background: #fff !important;
        background-image: none !important;
    }

    /* --- Conteúdo: SEM animação e SEMPRE visível (mata o blank do fadeInUp) --- */
    .app-content {
        display: block !important;
        flex: none !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    /* CAUSA RAIZ do PDF em branco: central-relatorios.css tem, no @media print,
       `body * { visibility: hidden }` — uma regra GLOBAL que escondia o conteúdo
       de TODAS as telas ao imprimir (só a Central, que é .rel-papel, escapava).
       Aqui reafirmamos o conteúdo do app como visível, anulando esse vazamento. */
    .app-content,
    .app-content * {
        visibility: visible !important;
        animation: none !important;
        opacity: 1 !important;
    }

    /* --- Esconde TODA a interface (sobra só o "papel") --- */
    .app-header,
    .bottom-nav,
    .fab, .fab-ia, .fab-cafezinho,
    .drawer, .drawer-overlay,
    .toast-container,
    .confirm-overlay,
    .sheet-overlay, .sheet-card,
    .pro-banner, .pro-strip,
    .trial-pill, .status-pill,
    .cafezinho-balao, .cafezinho-fab, .cafezinho-modal,
    .btn-ficha-pdf, .rel-sem-print,
    .no-print {
        display: none !important;
    }

    /* Header sticky vira estático por garantia (caso alguma tela não o esconda) */
    .app-header { position: static !important; }

    /* Garante que fundos/cores saiam no PDF (senão alguns somem) */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
