/* --- Print Styles --- */
@media print {
    /* Hide everything by default */
    body>* {
        display: none !important;
    }

    /* Show only the print containers */
    body>#print-report-container,
    body>#print-container {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background-color: white !important;
    }

    /* Reset body */
    body {
        background-color: white !important;
        overflow: visible !important;
        height: auto !important;
    }

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

#print-report-container {
    display: none;
}

/* --- Permission Level Badge --- */
.permission-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    font-size: 0;
    color: transparent;
    border-radius: 9999px;
    border: 2px solid #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.badge-l1 {
    background: linear-gradient(180deg, #22c55e, #16a34a);
}

.badge-l2 {
    background: linear-gradient(180deg, #34d399, #16a34a);
}

.badge-hidden {
    display: none;
}

.badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.35), 0 1px 2px rgba(0, 0, 0, 0.15);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(22, 163, 74, 0), 0 1px 2px rgba(0, 0, 0, 0.15);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0), 0 1px 2px rgba(0, 0, 0, 0.15);
    }
}

.drag-handle {
    cursor: grab;
    color: #64748b;
    background: transparent;
    border: 0;
    padding: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-end: 6px;
}

.drag-handle:active {
    cursor: grabbing;
}

.item-row.row-dragging {
    opacity: 0.6;
    background-color: #f8fafc;
}

/* Label next to username */
.permission-badge-label {
    display: none;
    /* default hidden; shown when menu open */
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(180deg, #22c55e, #16a34a);
    border-radius: 9999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    margin-inline-start: 6px;
    /* RTL/LTR-aware spacing */
    white-space: nowrap;
}

/* Show label only when the user menu is open */
#user-menu-button[aria-expanded="true"] .permission-badge-label {
    display: inline-flex;
}

body.work-order-mode #terms-section {
    display: none !important;
}

/* body.work-order-mode #tax-toggle-row {
    display: none !important;
} */

/* FORCE SHOW Unit Price in Work Order Mode (User Request) */
body.work-order-mode .col-unit-price {
    display: table-cell !important;
}
