@media print {
    /* Hide Non-Printable Elements */
    .sidebar, 
    .header, 
    .mobile-toggle, 
    .btn:not(.btn-print-only),
    .nav-group-title, 
    .sidebar-overlay,
    .form-actions-buttons,
    .no-print {
        display: none !important;
    }

    /* Reset Body & Main Layout */
    body {
        background-color: #fff !important;
        font-family: var(--font-urdu);
        color: #000 !important;
        margin: 0 !important;
        padding: 0 !important;
        direction: rtl;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .content-area {
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Card & Table Reset */
    .card {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        width: 100% !important;
    }

    .card-header, .card-body {
        padding: 10px 0 !important;
    }

    .table {
        border: 1px solid #000 !important;
        width: 100% !important;
    }

    .table th, .table td {
        border: 1px solid #000 !important;
        padding: 5px !important;
        color: #000 !important;
        font-size: 10pt !important;
    }

    .table th {
        background-color: #f1f1f1 !important;
    }

    /* Vouchers (A5 Small Parchi) */
    .voucher-print-area {
        width: 148mm;
        min-height: 210mm; /* A5 Portrait */
        padding: 5mm;
        margin: 0 auto;
        border: 1px dashed #ccc;
    }

    .print-branding {
        text-align: center;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #000;
    }

    .print-branding h1 {
        font-size: 18pt !important;
        margin: 0;
        color: #000 !important;
    }

    .print-branding p {
        font-size: 10pt !important;
        margin: 5px 0 0;
    }

    .voucher-details-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 20px;
    }

    /* Ledgers & Reports (A4 Landscape usually) */
    .ledger-print-area {
        width: 100%;
        padding: 10mm;
    }

    .print-footer {
        margin-top: 50px;
        display: flex;
        justify-content: space-between;
    }

    .signature-line {
        border-top: 1px solid #000;
        width: 150px;
        text-align: center;
        padding-top: 5px;
        font-size: 9pt;
    }
}

/* Screen Mode: Only show print header in print preview */
.print-only {
    display: none;
}
@media print {
    .print-only {
        display: block !important;
    }
}
