/**
 * Issue #10663 § M11 — Shared per-row state CSS module.
 *
 * Single source of truth for the 5-state row visuals used by:
 *   • Admin Diagnostic Modal (#10477 / #10480 / PR #10482)
 *   • Bulk N-row right-panel (#10663 OP.B)
 *
 * Lifted from admin-diagnostic-modal.css (cwDiagPulse + cw-diag-badge-{blue,green,red}
 * + cw-diag-row-error) and generalized so both surfaces consume the same classes.
 *
 * Row states (data-row-status on <tr>):
 *   pending  — blank cells, no animation (queued, not yet picked by the fetch pool)
 *   loading  — shimmer skeleton, pulsing badge (Promise pool dispatched, awaiting response)
 *   done     — full data, green badge
 *   partial  — one source OK + one source ERR (per-source badge color decides)
 *   error    — both sources ERR (red row tint + retry icon in checkbox col)
 *
 * @author Olivier RAVEAU - Oliv.Ai
 * @date 2026-05-28
 */

/* ── Badge palette (kept identical to admin-diagnostic-modal for visual parity) ── */
.cw-row-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    line-height: 1.3;
}
.cw-row-badge--blue {
    background: #cce5ff;
    color: #004085;
    animation: cwRowPulse 1.2s ease-in-out infinite;
}
.cw-row-badge--green { background: #d4edda; color: #155724; }
.cw-row-badge--red   { background: #f8d7da; color: #721c24; }
.cw-row-badge--amber { background: #fff3cd; color: #856404; }

@keyframes cwRowPulse {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 1; }
}

/* ── Status-dot pills (●green / ●red / ●amber) per IFS mockup ── */
.cw-row-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}
.cw-row-dot--ok    { background: #28a745; }
.cw-row-dot--bad   { background: #dc3545; }
.cw-row-dot--warn  { background: #ffc107; }
.cw-row-dot--off   { background: #ced4da; }

/* ── Per-row state styling ── */
tr[data-row-status="pending"] td:not(.cw-row-cell--keep) {
    color: #adb5bd;
}

tr[data-row-status="loading"] .cw-row-shimmer {
    display: inline-block;
    height: 12px;
    width: 100%;
    max-width: 120px;
    border-radius: 3px;
    background: linear-gradient(90deg, #e9ecef 0%, #f8f9fa 50%, #e9ecef 100%);
    background-size: 200% 100%;
    animation: cwRowShimmer 1.5s linear infinite;
}
@keyframes cwRowShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

tr[data-row-status="error"] {
    background: #fff5f5;
}
tr[data-row-status="error"]:hover {
    background: #ffe5e5;
}
tr[data-row-status="error"] td {
    color: #721c24;
}
tr[data-row-status="partial"] {
    background: #fffbf2;
}
tr[data-row-status="partial"]:hover {
    background: #fff5e0;
}
tr[data-row-status="done"]:hover {
    background: #e7f1ff;
}

/* ── Retry icon in checkbox column (error/partial rows only) ── */
.cw-row-retry-btn {
    background: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    transition: all .15s ease;
}
.cw-row-retry-btn:hover {
    background: #dc3545;
    color: #fff;
    transform: rotate(180deg);
}

/* ── Truncated cell with title tooltip ── */
.cw-row-cell--ellipsis {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
