/* ===============================
   PRINT MODE — ONLY THE FINAL QUOTE
================================== */

@page {
    size: letter;
    margin: 14mm 12mm;   /* márgenes profesionales */
}

/* Default hidden print-only elements */
.print-only {
    display: none;
}

@media print {

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        font-size: 11pt !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Hide all the app interface */
    #topBar,
    #loginScreen,
    #authLoading,
    #accountModal,
    #toast,
    .no-print {
        display: none !important;
    }

    #appShell {
        display: block !important;
    }

    #appMain {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide every tab except the Final Quote */
    .tab-content {
        display: none !important;
    }

    #finalQuote {
        display: block !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #finalQuoteContent {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
    }

    #finalQuoteContent h2 {
        margin: 0 0 6px !important;
        font-size: 18pt !important;
    }

    #finalQuoteContent h3 {
        font-size: 13pt !important;
        margin: 14px 0 6px !important;
        padding-bottom: 4px !important;
        break-after: avoid;
        page-break-after: avoid;
    }

    #finalQuoteContent h4 {
        margin: 10px 0 6px !important;
    }

    #finalQuoteContent p {
        margin: 5px 0 !important;
    }

    /* Tables */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 6px 0 12px !important;
    }

    tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .fq-table td,
    .fq-table th {
        border: none !important;
        padding: 5px 6px !important;
        font-size: 10.5pt !important;
    }

    .fq-table th {
        background: #1e73be !important;
        color: #fff !important;
    }

    .fq-table tr:nth-child(even) td { background-color: #e8ebf0 !important; }
    .fq-table tr:nth-child(odd) td  { background-color: #f7f9fc !important; }
    .fq-total td                    { background-color: #dbe8f6 !important; }

    /* INCLUDED / EXCLUDED colors */
    .included {
        background: #e2f0d9 !important;
        color: #375623 !important;
    }

    .excluded {
        background: #fce4d6 !important;
        color: #9c0006 !important;
    }

    .warning {
        background: #fff4ce !important;
        color: #7a5b00 !important;
    }

    /* New page between page 1 and page 2 */
    .page-break {
        break-before: page;
        page-break-before: always;
        border: none !important;
        margin: 0 !important;
        height: 0;
    }

    .signatures p {
        margin: 16px 0 !important;
    }

    .print-only {
        display: block !important;
    }
}
