@media print {
    /* Hide non-essential elements */
    .sidebar-right, .top-header, .btn, .nav, footer, .no-print {
        display: none !important;
    }

    /* Reset layout for print */
    body {
        background-color: white !important;
        margin: 0;
        padding: 0;
        font-size: 12pt;
        direction: rtl;
    }

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

    .container, .container-fluid {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
    }

    /* Card styling for print */
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        break-inside: avoid;
        margin-bottom: 20px;
    }

    .card-header {
        background-color: #f8f9fa !important;
        color: black !important;
        border-bottom: 2px solid #333 !important;
        font-weight: bold;
    }

    /* Header for official documents */
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 30px;
        border-bottom: 3px double #333;
        padding-bottom: 15px;
    }

    .print-footer {
        display: block !important;
        position: fixed;
        bottom: 0;
        width: 100%;
        text-align: center;
        font-size: 10pt;
        border-top: 1px solid #ddd;
        padding-top: 5px;
    }

    /* Text adjustments */
    h2, h3, h4 {
        color: black !important;
    }

    .text-success, .text-danger, .text-primary {
        color: black !important;
    }

    .badge {
        border: 1px solid #333 !important;
        color: black !important;
        background: transparent !important;
    }
}

/* Hide print header/footer in screen view */
.print-header, .print-footer {
    display: none;
}
