/* --- High-End Modern Studio Print Invoice (Auven Signature Style) --- */

@media print {
    /* 1. Global Reset & Typography */
    html, body {
        height: auto;
        background-color: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        color: #111;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-size: 10pt;
        line-height: 1.4;
    }

    /* Hide Screen UI */
    .sidebar, .navbar, .topbar, .btn, .btn-m, .alert, #draft-section, #settings-card, .page-header, 
    .card-m, .card, .invoice-summary-sheet-m, #committed-items-tbody + tfoot,
    .mt-4.mb-4.text-center, [onclick="window.print(); return false;"] {
        display: none !important;
    }

    #print-invoice-modern {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
        position: relative !important;
        background-color: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .page-content > *:not(#print-invoice-modern) {
        display: none !important;
    }

    @page {
        size: A4;
        margin: 15mm 20mm;
    }

    /* 2. Header: Logo (Left) & Metadata (Right) */
    .print-header-studio {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        margin-bottom: 60px !important;
        padding-bottom: 30px;
        border-bottom: 1px solid #eee;
    }

    .header-left .logo img {
        height: 40px;
        margin-bottom: 12px;
    }

    .header-left .company-info {
        font-size: 8.5pt;
        color: #666 !important;
        line-height: 1.6;
    }

    .header-right {
        text-align: right;
    }

    .header-right h1 {
        font-size: 24pt;
        font-weight: 800;
        margin: 0 0 15px 0;
        letter-spacing: -0.02em;
        text-transform: uppercase;
    }

    .meta-grid-studio {
        display: inline-grid;
        grid-template-columns: auto auto;
        gap: 8px 30px;
        text-align: left;
    }

    .meta-item-studio .label {
        font-size: 7.5pt;
        font-weight: 800;
        color: #999 !important;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .meta-item-studio .val {
        font-size: 10pt;
        font-weight: 700;
        color: #111 !important;
    }

    .status-paid { color: #3DDB85 !important; font-weight: 800; }

    /* 3. Billing Section */
    .billing-section-studio {
        margin-bottom: 50px;
        max-width: 350px;
    }

    .billing-section-studio .label {
        font-size: 8pt;
        font-weight: 800;
        color: #111 !important;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        margin-bottom: 12px;
        display: block;
    }

    .client-name-studio {
        font-size: 14pt;
        font-weight: 800;
        margin: 0 0 6px 0;
        color: #000 !important;
    }

    .client-details-studio {
        font-size: 10pt;
        color: #444 !important;
        line-height: 1.6;
    }

    /* 4. Items Table (Ultra-Clean) */
    .items-table-studio {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 40px;
    }

    .items-table-studio th {
        text-align: left;
        padding: 12px 0;
        font-size: 8pt;
        font-weight: 800;
        text-transform: uppercase;
        color: #111 !important;
        letter-spacing: 0.05em;
        border-bottom: 2px solid #111;
    }

    .items-table-studio td {
        padding: 18px 0;
        border-bottom: 1px solid #eee;
        vertical-align: top;
    }

    .items-table-studio tr:last-child td {
        border-bottom: 1px solid #eee;
    }

    .item-main-title {
        font-size: 10.5pt;
        font-weight: 700;
        color: #000 !important;
        margin-bottom: 4px;
    }

    .item-sub-desc {
        font-size: 9pt;
        color: #888 !important;
    }

    .sub-product-line-studio {
        font-size: 9pt;
        color: #666 !important;
        margin-top: 6px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* 5. Financial Summary */
    .totals-wrapper-studio {
        width: 300px;
        margin-left: auto;
    }

    .total-line-studio {
        display: flex !important;
        justify-content: space-between !important;
        padding: 6px 0;
        font-size: 10pt;
        color: #444 !important;
        font-weight: 500;
    }

    .grand-total-studio {
        display: flex !important;
        justify-content: space-between !important;
        padding: 20px 0;
        margin-top: 10px;
        border-top: 1px solid #eee;
        font-size: 16pt;
        font-weight: 800;
        color: #3DDB85 !important; /* Auven Green */
        letter-spacing: -0.01em;
    }

    .grand-total-studio .label {
        color: #111 !important;
        text-transform: uppercase;
        font-size: 12pt;
    }

    /* 6. Footer & Sign-off */
    .print-footer-studio {
        margin-top: 80px;
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
    }

    .footer-notes {
        max-width: 350px;
    }

    .footer-notes h4 {
        font-size: 8.5pt;
        font-weight: 800;
        margin: 0 0 8px 0;
        text-transform: uppercase;
    }

    .footer-notes p {
        font-size: 9pt;
        color: #777 !important;
        margin: 0;
        line-height: 1.5;
    }

    .thank-you-msg {
        font-size: 11pt;
        font-weight: 700;
        color: #111 !important;
    }

    /* Helpers */
    .text-end { text-align: right !important; }
    .text-center { text-align: center !important; }
    .fw-800 { font-weight: 800 !important; }
}