﻿/* ═══════════════════════════════════════════════════════════ */
/* 🖨️ Print Stylesheet - MediTech Program Table              */
/* ═══════════════════════════════════════════════════════════ */

@media print {

    /* ─── تنظیمات صفحه ─── */
    @page {
        size: A4 landscape;
        margin: 0.1cm;
    }

    /* ─── تنظیمات کلی ─── */
    body {
        direction: rtl;
        font-family: Tahoma, Arial, sans-serif;
        font-size: 10pt;
        margin: 0;
        color: #000;
        background: #fff;
    }

    /* ─── مخفی کردن عناصر غیرضروری ─── */
    .no-print,
    .btn,
    button,
    .shift-select,
    .color-guide,
    .custom-notification,
    .navbar,
    .site-header,
    .welcome-bar,
    footer,
    .modal,
    .modal-backdrop {
        display: none !important;
    }

    /* ─── جدول ─── */
    table.program-table {
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        border: 2px solid #000 !important;
        font-size: 8pt !important;
        page-break-inside: auto;
    }

        table.program-table th,
        table.program-table td {
            /* ریست کامل موقعیت‌های sticky/fixed */
            position: static !important;
            top: auto !important;
            right: auto !important;
            left: auto !important;
            bottom: auto !important;
            z-index: auto !important;
            /* حاشیه و فاصله */
            border: 1px solid #000 !important;
            padding: 5px 3px !important;
            /* ترازبندی */
            text-align: center !important;
            vertical-align: middle !important;
            line-height: 1.5 !important;
            /* متن */
            white-space: normal !important;
            word-break: break-word !important;
            /* پس‌زمینه */
            background-color: #fff !important;
            box-shadow: none !important;
            /* اندازه */
            width: auto !important;
            min-width: auto !important;
            max-width: auto !important;
        }

    /* ─── هدر جدول ─── */
    .program-table thead {
        display: table-header-group !important;
        position: static !important;
        top: auto !important;
    }

        .program-table thead th {
            position: static !important;
            top: auto !important;
            background: #f5f5f5 !important;
            font-weight: bold !important;
            border-bottom: 2px solid #000 !important;
        }

            .program-table thead th small {
                font-size: 7pt !important;
                display: block !important;
                line-height: 1.2 !important;
            }

    /* ─── ستون‌های ثابت (ریست) ─── */
    .program-table th.fixed-col,
    .program-table td.fixed-col,
    .program-table th.fixed-col-2,
    .program-table td.fixed-col-2,
    .program-table th.fixed-col-3,
    .program-table td.fixed-col-3,
    .program-table th.fixed-col-4,
    .program-table td.fixed-col-4,
    .program-table th.fixed-col-5,
    .program-table td.fixed-col-5,
    .program-table th.total-col-header,
    .program-table td.total-col {
        position: static !important;
        top: auto !important;
        right: auto !important;
        z-index: auto !important;
        background-color: #fff !important;
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }

    /* ─── عرض ستون‌های ثابت ─── */
    .program-table th.fixed-col,
    .program-table td.fixed-col {
        width: 5% !important;
        max-width: 25px !important;
    }

    .program-table th.fixed-col-2,
    .program-table td.fixed-col-2 {
        width: 18% !important;
        max-width: 140px !important;
        text-align: right !important;
        padding-right: 8px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .program-table th.fixed-col-3,
    .program-table td.fixed-col-3 {
        width: 9% !important;
        max-width: 75px !important;
    }

    .program-table th.fixed-col-4,
    .program-table td.fixed-col-4 {
        width: 7% !important;
        max-width: 65px !important;
    }

    .program-table th.fixed-col-5,
    .program-table td.fixed-col-5 {
        width: 7% !important;
        max-width: 65px !important;
    }

    .program-table th.total-col-header,
    .program-table td.total-col {
        width: 5% !important;
        max-width: 55px !important;
    }

    /* ─── ستون روزها ─── */
    table.program-table th:not(.fixed-col):not(.fixed-col-2):not(.fixed-col-3):not(.fixed-col-4):not(.fixed-col-5):not(.total-col-header),
    table.program-table td:not(.fixed-col):not(.fixed-col-2):not(.fixed-col-3):not(.fixed-col-4):not(.fixed-col-5):not(.total-col) {
        width: 5% !important;
        min-width: 24px !important;
        max-width: 24px !important;
        padding: 3px 1px !important;
    }

    /* ─── رنگ‌بندی ملایم ─── */
    .first-half-col {
        background-color: #f0f9ff !important;
        border-left: 1px solid #000 !important;
    }

    .second-half-col {
        background-color: #f1f8e9 !important;
        border-left: 1px solid #000 !important;
    }

    .friday-col {
        background-color: #ffebee !important;
        border-left: 1px solid #000 !important;
    }

    .holiday-col {
        background-color: #fff8e1 !important;
        border-left: 1px solid #000 !important;
    }

    /* ─── مقدار شیفت ─── */
    .shift-value {
        display: block !important;
        font-size: 8pt !important;
        font-weight: normal !important;
        text-align: center !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.4 !important;
    }

    /* ─── هدر اطلاعات ─── */
    .header-info {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
        margin-bottom: 10px !important;
        padding: 8px !important;
        page-break-after: avoid !important;
    }

    /* ─── جلوگیری از شکستن ردیف‌ها ─── */
    .program-table tbody tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .program-table tbody td {
        height: auto !important;
        min-height: 28px !important;
        max-height: none !important;
    }

    /* ─── ردیف جمع ─── */
    .program-table tbody tr.totals-row td {
        line-height: 1.5 !important;
        min-height: 35px !important;
        padding: 4px 2px !important;
        font-size: 8pt !important;
        background: #f9f9f9 !important;
        font-weight: bold !important;
    }

    /* ─── کانتینر ─── */
    .table-container {
        width: 100% !important;
        overflow: visible !important;
        border: none !important;
        box-shadow: none !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* ─── اطمینان از نمایش کامل ─── */
    .program-table,
    .program-table *,
    .table-container,
    .header-info {
        overflow: visible !important;
    }

    /* ─── حذف تمام Transition و Animation ─── */
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}
.holiday-col {
    background-color: #ffe5e5 !important;
    color: #c62828 !important;
    font-weight: 600;
}

    .holiday-col small {
        color: #c62828;
    }

.friday-col {
    background-color: #fff3cd !important;
    color: #856404 !important;
}