/* =========================================================
   BOOTSTRAP 4 FULL PRINT CSS
   Optimized for:
   - Tables
   - Invoices
   - Reports
   - Multi-page printing
   - A4 paper
========================================================= */

@media print {

    /* =====================================================
       PAGE
    ===================================================== */

    @page {
        size: A4;
        margin: 10mm;
    }

    html,
    body {
        width: 98%;
        height: auto;
        background: #fff !important;
        color: #000 !important;
        font-size: 12px;
        line-height: 1.4;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

	html[dir="rtl"] {
	  direction: rtl;
	}

    /* =====================================================
       HIDE ELEMENTS
    ===================================================== */

    .d-print-none,
    .no-print,
    nav,
    navbar,
    .navbar,
    .sidebar,
    .footer,
    .btn,
    button,
    .pagination,
    .form-control,
    .input-group,
    .modal,
    .tooltip,
    .popover {
        display: none !important;
    }

    /* =====================================================
       SHOW ONLY IN PRINT
    ===================================================== */

    .print-only {
        display: block !important;
    }

    /* =====================================================
       CONTAINER FIXES
    ===================================================== */

    .container,
    .container-fluid,
    .row,
    .col,
    [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .row {
        display: block !important;
    }

    /* =====================================================
       LINKS
    ===================================================== */

    a,
    a:visited {
        text-decoration: none !important;
        color: #000 !important;
    }

    a[href]:after {
        content: "" !important;
    }

    /* =====================================================
       HEADINGS
    ===================================================== */

    h1, h2, h3, h4, h5, h6 {
        color: #000 !important;
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    /* =====================================================
       PARAGRAPHS
    ===================================================== */

    p,
    blockquote,
    ul,
    ol,
    dl {
        page-break-inside: avoid;
    }

    /* =====================================================
       IMAGES
    ===================================================== */

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    /* =====================================================
       TABLES
    ===================================================== */

    table {
        width: 100% !important;
        border-collapse: collapse !important;
        background: #fff !important;
        margin-bottom: 15px;
    }

    table.table-bordered {
        border: 1px solid #000 !important;
    }

    table.table-bordered th,
    table.table-bordered td {
        border: 1px solid #000 !important;
        padding: 6px !important;
        vertical-align: top !important;
        background: #fff !important;
        color: #000 !important;
    }

    table thead {
        display: table-header-group;
    }

    table tfoot {
        display: table-footer-group;
    }

    table tr {
        page-break-inside: avoid;
    }

    .table-sm th,
    .table-sm td {
        padding: 3px !important;
    }

    .table-bordered {
        border: 1px solid #000 !important;
    }

    .table-bordered th,
    .table-bordered td {
        border: 1px solid #000 !important;
    }

    .table-striped tbody tr:nth-of-type(odd) {
        background-color: #f2f2f2 !important;
    }

    .table thead th {
        background: #ddd !important;
        color: #000 !important;
        font-weight: bold;
    }

    /* =====================================================
       BADGES
    ===================================================== */

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

    /* =====================================================
       CARDS
    ===================================================== */

    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        margin-bottom: 15px;
    }

    .card-header {
        background: #eee !important;
        border-bottom: 1px solid #000 !important;
        font-weight: bold;
    }

    /* =====================================================
       ALERTS
    ===================================================== */

    .alert {
        border: 1px solid #000 !important;
        background: transparent !important;
        color: #000 !important;
    }

    /* =====================================================
       FORMS
    ===================================================== */

    input,
    textarea,
    select {
        border: 1px solid #000 !important;
        background: #fff !important;
        color: #000 !important;
    }

    label {
        font-weight: bold;
    }

    /* =====================================================
       PAGE BREAK HELPERS
    ===================================================== */

    .page-break {
        page-break-before: always;
    }

    .page-break-after {
        page-break-after: always;
    }

    .avoid-break {
        page-break-inside: avoid;
    }

    /* =====================================================
       BOOTSTRAP UTILITIES
    ===================================================== */

    .shadow,
    .shadow-sm,
    .shadow-lg {
        box-shadow: none !important;
    }

    .border {
        border: 1px solid #000 !important;
    }

    /* =====================================================
       COLORS RESET
    ===================================================== */

    .bg-primary,
    .bg-secondary,
    .bg-success,
    .bg-danger,
    .bg-warning,
    .bg-info,
    .bg-dark {
        background: #eee !important;
        color: #000 !important;
    }

    .text-primary,
    .text-secondary,
    .text-success,
    .text-danger,
    .text-warning,
    .text-info,
    .text-dark {
        color: #000 !important;
    }

    /* =====================================================
       FLEX FIXES
    ===================================================== */

    .d-flex {
        display: block !important;
    }

    /* =====================================================
       PRINT HEADER / FOOTER
    ===================================================== */

    .print-header {
        margin-bottom: 20px;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
    }

    .print-footer {
        margin-top: 20px;
        border-top: 1px solid #000;
        padding-top: 10px;
        font-size: 11px;
    }

}