/* Explain: Mobile CSS: live table shown as compact cards on narrow screens. */
/* זרימת ההדרכה בטלפון: טבלת המעקב החי מוצגת ככרטיסים במסך צר, וסינון „טרם חתמו” */

/* מסך המעקב החי: במסך צר כל שורה בטבלה מוצגת ככרטיס קומפקטי.
   שורה ראשונה: שם וסטטוס. מתחת: ת"ז ומחלקה, והציון בצד */
@media (max-width: 767.98px) {
    table.live-table thead {
        display: none;
    }

    table.live-table,
    table.live-table tbody {
        display: block;
        width: 100%;
    }

    table.live-table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 0.75rem;
        row-gap: 0.2rem;
        align-items: center;
        padding: 0.75rem 0.875rem;
    }

    table.live-table tbody td {
        display: block;
        min-width: 0;
        padding: 0;
        border: 0;
    }

    table.live-table tbody td[colspan] {
        grid-column: 1 / -1;
    }

    table.live-table tbody tr > td:nth-child(1):not([colspan]) {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        font-size: 1rem;
        line-height: 1.35;
    }

    table.live-table tbody tr > td:nth-child(4) {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    table.live-table tbody tr > td:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
        font-size: 0.8125rem;
    }

    table.live-table tbody tr > td:nth-child(3) {
        grid-column: 1;
        grid-row: 3;
        font-size: 0.8125rem;
        color: var(--text-muted);
        overflow-wrap: anywhere;
    }

    table.live-table tbody tr > td:nth-child(5) {
        grid-column: 2;
        grid-row: 2 / span 2;
        justify-self: end;
        min-width: 3.25rem;
        text-align: center;
    }

    table.live-table tbody tr > td:nth-child(2)::before {
        content: 'ת"ז ';
        color: var(--text-muted);
        font-weight: 600;
    }

    table.live-table tbody tr > td:nth-child(3)::before {
        content: 'מחלקה: ';
        font-weight: 600;
    }

    table.live-table tbody tr > td:nth-child(5)::before {
        content: 'ציון';
        display: block;
        font-family: var(--font-body);
        font-size: 0.6875rem;
        font-weight: 600;
        line-height: 1.2;
        color: var(--text-muted);
    }
}

/* סינון „טרם חתמו”: מסתירים את מי שכבר חתם (תגית החתימה הירוקה בשורה) */
.live-only-pending table.live-table tbody tr:has(.badge-success) {
    display: none !important;
}