.attendance-stats {
    grid-template-columns: repeat(4, 1fr);
}

.attendance-stats .student-stat:nth-child(1) strong { color: var(--success); }
.attendance-stats .student-stat:nth-child(2) strong { color: #d64545; }
.attendance-stats .student-stat:nth-child(3) strong { color: #c98a0a; }

.att-options {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}

.att-option { position: relative; }

.att-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.att-option span {
    display: inline-block;
    min-width: 38px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.att-option input:focus-visible + span {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.att-option input:checked + span.p { background: #e3f6ee; border-color: var(--success); color: var(--success); }
.att-option input:checked + span.a { background: #fdeaea; border-color: #d64545; color: #d64545; }
.att-option input:checked + span.l { background: #fff4dc; border-color: #c98a0a; color: #c98a0a; }
.att-option input:checked + span.v { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

.att-remark {
    width: 100%;
    min-width: 140px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}

.attendance-banner {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.9rem;
}

.attendance-history {
    margin-top: 20px;
}

@media (max-width: 700px) {
    .attendance-stats { grid-template-columns: repeat(2, 1fr); }
}

button.inline-link {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

/* ===== Attendance on phones: one card per student, all status buttons visible ===== */
@media screen and (max-width: 700px) {
    .att-table { min-width: 0 !important; width: 100%; }
    .att-table thead { display: none; }
    .att-table, .att-table tbody { display: block; width: 100%; }
    .att-table tr {
        display: grid;
        grid-template-columns: 30px 1fr;
        gap: 4px 10px;
        padding: 14px 16px;
        border-bottom: 1px solid var(--border);
    }
    .att-table td { display: block; padding: 0; border: 0; }
    .att-table td:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; color: var(--muted); font-weight: 700; padding-top: 2px; }
    .att-table td:nth-child(2) { grid-column: 2; grid-row: 1; }
    .att-table td:nth-child(3) { grid-column: 2; grid-row: 2; font-size: 12px; color: var(--muted); }
    .att-table td:nth-child(4) { grid-column: 1 / -1; margin-top: 10px; }
    .att-table td:nth-child(5) { grid-column: 1 / -1; margin-top: 8px; }
    .att-table .att-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .att-table .att-option span { display: block; min-width: 0; padding: 11px 4px; }
    .att-table .att-remark { min-width: 0; padding: 10px 12px; }
}
