/* Student page directory list — subgrid for shared column tracks */

/* Show a full directory page (up to 100 rows) without an inner scrollbar —
   the page itself scrolls instead of a nested 28rem panel. */
.student-list-panel .directory-card-list-scroll:not(.directory-card-list-scroll--menu-open),
.student-list-panel .directory-card-list-scroll--menu-open {
    --directory-list-scroll-max-height: none;
    max-height: none;
    overflow-y: visible;
}

.student-directory-list {
    --student-row-hover: #fde68a;
    /* Active = report mint; break = amber; inactive = slate */
    --student-row-active-a: #ffffff;
    --student-row-active-b: #c5e6d6;
    --student-row-break-a: #fff7e6;
    --student-row-break-b: #fde68a;
    --student-row-inactive-a: #f1f5f9;
    --student-row-inactive-b: #cbd5e1;
    grid-template-columns:
        minmax(12rem, 1.75fr)
        minmax(8rem, 1fr)
        minmax(3rem, 0.45fr)
        minmax(5rem, 0.65fr)
        minmax(4.5rem, 0.55fr)
        minmax(5rem, 0.7fr)
        minmax(5.5rem, 0.75fr)
        minmax(10rem, 10rem);
    min-width: 48rem;
}

.student-directory-list-header {
    padding: 0 0.85rem 0.35rem;
}

.student-directory-list-header span:last-child {
    justify-self: end;
}

.student-directory-list .student-directory-row__subjects {
    overflow: hidden;
    max-height: 2.6rem;
}

.student-directory-row__subjects {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
    min-width: 0;
}

.student-directory-row__subject {
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.25;
    color: var(--app-text-muted, #1e293b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.student-directory-row__meta {
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
    color: var(--app-text-muted, #1e293b);
    line-height: 1.25;
    white-space: nowrap;
}

.student-directory-row__status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.student-directory-row__status .retention-score-pill {
    font-size: 0.625rem;
    min-width: 0;
    padding: 0.15rem 0.45rem;
}

.student-directory-row__today {
    font-size: 0.6875rem;
    white-space: nowrap;
}

.student-directory-row__today .retention-score-pill {
    font-size: 0.625rem;
    min-width: 0;
    padding: 0.15rem 0.45rem;
}

.student-directory-row__today-muted {
    font-size: 0.6875rem;
    color: var(--app-text-muted-soft, #334155);
}

.student-directory-row__actions {
    min-width: 0;
    overflow: visible;
    justify-self: end;
}

.student-directory-row__actions .student-list-action-bar {
    flex-wrap: nowrap;
    justify-content: flex-end;
    width: max-content;
    margin-left: auto;
}

.student-directory-list .student-directory-row:has(.list-action-btn--more.is-open),
.student-directory-list .student-directory-row:has(.student-list-action-btn--more.is-open) {
    position: relative;
    z-index: 1060;
}

.student-directory-list .student-list-more-menu {
    right: 0.75rem;
    transform: translateX(-0.35rem);
    z-index: 1061;
}

.student-directory-list .student-list-more-menu.is-viewport-positioned {
    right: auto;
    transform: none;
}

.student-directory-list .student-directory-row__actions {
    overflow: visible;
}

/*
 * Status stripes + report-style amber hover (student list only).
 * Must beat directory-card-list.css (same !important + more :not() on hover).
 */
.student-list-panel .directory-card-subgrid-list.student-directory-list > article.student-directory-row {
    transition: background-color 0.15s ease;
}

.student-list-panel .directory-card-subgrid-list.student-directory-list > article.student-directory-row--active:nth-of-type(odd) {
    background: var(--student-row-active-a) !important;
}

.student-list-panel .directory-card-subgrid-list.student-directory-list > article.student-directory-row--active:nth-of-type(even) {
    background: var(--student-row-active-b) !important;
}

.student-list-panel .directory-card-subgrid-list.student-directory-list > article.student-directory-row--break:nth-of-type(odd) {
    background: var(--student-row-break-a) !important;
}

.student-list-panel .directory-card-subgrid-list.student-directory-list > article.student-directory-row--break:nth-of-type(even) {
    background: var(--student-row-break-b) !important;
}

.student-list-panel .directory-card-subgrid-list.student-directory-list > article.student-directory-row--inactive:nth-of-type(odd) {
    background: var(--student-row-inactive-a) !important;
}

.student-list-panel .directory-card-subgrid-list.student-directory-list > article.student-directory-row--inactive:nth-of-type(even) {
    background: var(--student-row-inactive-b) !important;
}

.student-list-panel .directory-card-subgrid-list.student-directory-list > article.student-directory-row:hover:not(.attendance-off-allocated-day):not(.attendance-on-allocated-day):not(.attendance-checkout-overdue-blink) {
    background: var(--student-row-hover) !important;
    box-shadow: none !important;
}

@media (max-width: 768px) {
    .student-directory-list {
        grid-template-columns:
            minmax(10rem, 1.4fr)
            minmax(7rem, 0.95fr)
            minmax(4.5rem, 0.6fr)
            minmax(4rem, 0.5fr)
            minmax(4.5rem, 0.65fr)
            minmax(5rem, 0.7fr)
            minmax(9rem, 9rem);
    }
}
