/**
 * Pluggable ERP Protection CSS
 * Hides exports, pagination, and disables text selection / copying.
 */

/* 1. Hide all DataTables export and copy buttons */
.dt-buttons,
.buttons-excel,
.buttons-csv,
.buttons-pdf,
.buttons-print,
.buttons-copy,
.dt-button {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* 2. Hide all tableToExcel and table2excel export buttons */
button[onclick*="tableToExcel"],
button[onclick*="table2excel"],
a[onclick*="tableToExcel"],
a[onclick*="table2excel"],
span[onclick*="tableToExcel"],
span[onclick*="table2excel"],
.btn-excel,
.excel-btn,
.btn-export {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* 3. Hide pagination controls and total record counts */
.dataTables_paginate,
.dataTables_info,
.dataTables_length,
.paging_simple_numbers,
.pagination {
    display: none !important;
    visibility: hidden !important;
}

/* 4. Disable text selection across all ERP views */
body, table, th, td, tr, div, p, span, h1, h2, h3, h4, h5, h6, .card, .card-block, .page-body {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* 5. Keep form inputs, selects, and textareas selectable so basic data entry works */
input, textarea, select {
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    user-select: auto !important;
}

/* 6. Print Lockdown (Neutering browser print & save-as-PDF) */
@media print {
    body * {
        display: none !important;
    }
    body::before {
        content: "Printing and exporting data from this ERP is restricted by policy.";
        display: block !important;
        font-size: 20px !important;
        color: #dc2626 !important;
        text-align: center !important;
        margin-top: 100px !important;
        font-family: sans-serif !important;
    }
}
