﻿/* ============================================================
   استایل مشترک PDF گزارش‌های تحلیلی
   ============================================================ */

/* فونت فارسی برای html2canvas — embed شده */
@font-face {
    font-family: 'VazirmatnPDF';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'VazirmatnPDF';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

/* محدوده گزارش (همان printArea) */
#printArea {
    font-family: 'VazirmatnPDF', Tahoma, Arial, sans-serif;
    direction: rtl;
    background: #fff;
    color: #000;
    padding: 10px;
}

    #printArea .report-title {
        text-align: center;
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 8px;
        border-bottom: 2px solid #333;
        padding-bottom: 6px;
        color: #000;
    }

    #printArea .report-meta {
        text-align: center;
        font-size: 11px;
        color: #444;
        margin-bottom: 12px;
        line-height: 1.8;
    }

        #printArea .report-meta span {
            margin: 0 6px;
        }

    /* جدول در PDF */
    #printArea table {
        width: 100%;
        border-collapse: collapse;
        background: #fff;
    }

        #printArea table th,
        #printArea table td {
            border: 1px solid #666;
            padding: 5px 6px;
            font-size: 10px;
            text-align: center;
            color: #000;
        }

        #printArea table th {
            background: #e0e0e0 !important;
            font-weight: bold;
        }

        #printArea table tr.rank-first td {
            background: #f5f5f5 !important;
            font-weight: bold;
        }

    /* نمودارها */
    #printArea .chart-container {
        page-break-inside: avoid;
        text-align: center;
        margin: 12px 0;
    }

        #printArea .chart-container h4 {
            font-size: 12px;
            font-weight: bold;
            margin-bottom: 6px;
            color: #000;
        }

    #printArea canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    /* جلوگیری از شکستن جدول */
    #printArea table tr {
        page-break-inside: avoid;
    }

    #printArea table thead {
        display: table-header-group;
    }

    /* فوتر امضا (اختیاری) */
    #printArea .report-footer {
        margin-top: 20px;
        font-size: 10px;
        color: #555;
        border-top: 1px dashed #999;
        padding-top: 8px;
        display: flex;
        justify-content: space-between;
    }
