/*
 * R2.2.26-R2B
 * Excel Preview invalid-row visibility.
 * Admin / Super Admin shared Import Preview table only.
 */

/* Whole invalid Excel row */
.import-preview tbody tr:has(.row-error) {
    background: rgba(220, 38, 38, 0.10) !important;
    outline: 2px solid rgba(220, 38, 38, 0.38);
    outline-offset: -2px;
}

/* Keep the visual flag while hovering */
.import-preview tbody tr:has(.row-error):hover {
    background: rgba(220, 38, 38, 0.16) !important;
}

/* Row number becomes impossible to miss */
.import-preview tbody tr:has(.row-error) td:first-child {
    font-weight: 800;
    white-space: nowrap;
}

/* Visible error marker next to Excel row number */
.import-preview tbody tr:has(.row-error) td:first-child::after {
    content: " ⚠ ERROR";
    display: inline-block;
    margin-inline-start: 7px;
    padding: 2px 6px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
}

/* Arabic UI wording */
html[dir="rtl"] .import-preview tbody tr:has(.row-error) td:first-child::after,
html[lang^="ar"] .import-preview tbody tr:has(.row-error) td:first-child::after {
    content: " ⚠ خطأ";
}

/* Error explanation */
.import-preview .row-error {
    font-weight: 800;
    line-height: 1.45;
}

/* Visually separate real errors from normal warnings */
.import-preview td:has(.row-error) {
    border-inline-start: 4px solid currentColor;
}

/*
 * Invalid summary card is the third compact metric:
 * Total / Valid / Invalid / Imported
 */
.import-preview .metric-grid.compact article:nth-child(3) {
    border-width: 2px;
}

.import-preview tbody tr:has(.row-error) {
    scroll-margin-top: 90px;
}
