@media print {
    /* =================================================================
       1. TEKNIK VISIBILITY (NUCLEAR OPTION)
       ================================================================= */
    /* Sembunyikan SEMUA elemen di dalam body secara default */
    body * {
        visibility: hidden;
    }

    /* Munculkan HANYA area cetak dan isinya */
    #printArea, #printArea * {
        visibility: visible !important;
    }

    /* =================================================================
       2. POSISIKAN AREA CETAK
       ================================================================= */
    /* Cabut #printArea dari layout web dan paksa nempel di kertas */
    #printArea {
        position: fixed !important; /* Fixed = Nempel di viewport kertas */
        left: 0 !important;
        top: 0 !important;
        
        /* Paksa ukuran mengikuti margin @page */
        width: 100% !important;
        height: 100% !important;
        
        /* Reset margin/padding bawaan div */
        margin: 0 !important;
        padding: 0 !important;
        
        /* Pastikan background putih bersih */
        background: white !important;
        
        /* Layout Flexbox untuk Cover */
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: center !important;
        
        /* Pastikan layer paling atas */
        z-index: 99999 !important;
    }

    /* =================================================================
       3. ATUR MARGIN KERTAS FISIK (STANDAR 4-4-3-3)
       ================================================================= */
    @page {
        size: A4;
        /* Atas 3cm, Kanan 3cm, Bawah 3cm, Kiri 4cm */
        margin: 30mm 30mm 30mm 40mm !important; 
    }

    /* =================================================================
       4. STYLING KONTEN COVER
       ================================================================= */
    
    /* Reset Font */
    #printArea * {
        font-family: "Times New Roman", serif !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color: black !important;
    }

    /* Judul */
    #outJudul {
        font-size: 18pt !important;
        font-weight: bold !important;
        line-height: 1.2 !important;
        margin-bottom: 20px !important;
        text-transform: uppercase !important;
    }

    /* Logo */
    #outLogo {
        max-height: 55mm !important; /* Batasi tinggi logo */
        width: auto !important;
        object-fit: contain !important;
        margin: 20px auto !important;
    }

    /* Bagian Bawah (Kota & Tahun) */
    #printArea > .mt-auto {
        margin-top: auto !important;
        width: 100% !important;
    }

    /* =================================================================
       5. WATERMARK (JIKA ADA)
       ================================================================= */
    #watermark-print {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        z-index: 99999 !important;
        pointer-events: none;
    }

    .wm-card {
        transform: rotate(-30deg);
        padding: 20px 40px;
        border-radius: 20px;
        border: 2px dashed rgba(0,0,0,0.1);
        background: rgba(255, 255, 255, 0.95);
        text-align: center;
    }

    .wm-title {
        font-size: 30pt;
        font-weight: 800;
        color: rgba(0, 0, 0, 0.15);
    }
    
    .wm-sub, .wm-brand {
        font-size: 12pt;
        color: rgba(0, 0, 0, 0.15);
    }
}