﻿/* الهيدر والفوتر للطباعة فقط */
.print-only {
    display: none;
}

@media print {
    /*body * {
        display: none !important;*/ /* اخفي الكل */
    /*}*/

    .no-print {
        display: none !important;
    }
    /* اظهر التقرير فقط */
    .print-area,
    .print-area * {
        display: block !important;
        visibility: visible !important;
    }

    /* تاكد ان التقرير يشغل عرض الصفحة */
    .print-area {
        position: relative !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    /* العناصر المسموح تظهر */
    .print-only,
    .report-container,
    .report-container *,
    .header,
    .footer {
        visibility: visible !important;
    }

    @page {
        margin: 120px 30px 80px 30px; /* مساحة للهيدر والفوتر */
    }

    .report-container {
        position: absolute;
        left: 0;
        top: 100px;
        width: 100%;
        margin-top: 120px; /* نفس ارتفاع الهيدر */
        margin-bottom: 80px; /* نفس ارتفاع الفوتر */
        color: #000;
    }

    /* الهيدر */
    .header.print-only {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 100px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #000;
        padding: 0 20px;
        background: #fff;
        color: #000;
    }

    .header-left {
        flex: 1;
        text-align: left;
    }

    .header-center {
        flex: 1;
        text-align: center;
    }

    .header-right {
        flex: 1;
        text-align: right;
        font-size: 14px;
    }

    .company-logo {
        width: 80px;
        height: auto;
    }

    /* الفوتر */
    .footer.print-only {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: 2px solid #000;
        font-size: 12px;
        padding: 0 20px;
        background: #fff;
        color: #000;
    }

    /* ترقيم الصفحات */
    .pageNumber:after {
        content: counter(page);
    }

    .totalPages:after {
        content: counter(pages);
    }
}
