/* surfaces-students.css — Student card (list style), admin roles table, students/staff directory view
   Extracted from surfaces.css per P5.3 refactor 2026-05-24 */

/* ── Student card (table-style list) ── */
.student-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    min-height: 54px;
    border-bottom: 1px solid var(--border-default);
    transition: background-color 0.2s ease;
}

.student-card:last-child {
    border-bottom: none;
}

.student-card:hover {
    background-color: var(--color-primary-50);
}

.student-card.student-card-skeleton {
    pointer-events: none;
}

.student-card.student-card-skeleton:hover {
    background-color: transparent;
}

.student-card .btn-delete {
    width: 28px;
    height: 28px;
    min-width: 28px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #dc2626;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

.student-card:hover .btn-delete,
.student-card:focus-within .btn-delete {
    opacity: 1;
    pointer-events: auto;
}

.skeleton-line,
.skeleton-circle {
    display: inline-block;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.1s ease-in-out infinite;
}

.skeleton-line {
    height: 12px;
    border-radius: 999px;
}

.skeleton-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.student-card .btn-delete:hover {
    background-color: #fee2e2;
}

/* ── Student list container ── */
#studentsList {
    border: 1px solid #e3e8ef;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    background-color: #fff;
}

#studentsList.is-loading {
    background-color: #fff;
}

/* ── Admin roles table ── */
.admin-roles-table {
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
}

.admin-roles-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.8fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) minmax(100px, 0.6fr);
    gap: 8px;
    align-items: center;
}

.admin-roles-header {
    padding: 10px 12px;
    border-bottom: 1px solid #e3e8ef;
    background-color: #f8fafc;
    color: #5b6573;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.admin-roles-row {
    padding: 12px;
    border-bottom: 1px solid #edf1f5;
}

.admin-roles-row:last-child {
    border-bottom: none;
}

.admin-roles-cell {
    min-width: 0;
    color: #1f2937;
    font-size: 14px;
}

.admin-roles-input,
.admin-roles-select {
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--form-border-color);
    border-radius: var(--form-radius);
    font-size: 14px;
    box-sizing: border-box;
}

/* ── Student Directory view (Stitch-aligned) ── */
.students-directory-view {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.students-directory-top-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
}

.students-directory-title {
    margin: 0;
    font-family: var(--font-headline);
    font-size: var(--text-display);
    font-weight: var(--weight-extrabold);
    letter-spacing: var(--tracking-tight);
    color: var(--on-surface);
}

.students-directory-subtitle {
    margin: var(--space-2) 0 0;
    color: var(--on-surface-variant);
    font-size: var(--text-body);
    font-weight: var(--weight-medium);
}

.students-directory-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
}

.students-directory-stat-card {
    background: var(--surface-container-lowest);
    border: var(--ghost-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
    min-height: 132px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.students-directory-stat-label {
    margin: 0;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--on-surface-variant);
    font-weight: var(--weight-semibold);
}

.students-directory-stat-value {
    margin: var(--space-3) 0 0;
    font-family: var(--font-headline);
    font-size: 36px;
    font-weight: var(--weight-extrabold);
    letter-spacing: var(--tracking-tight);
    color: var(--on-surface);
}

.students-directory-stat-meta {
    margin: var(--space-2) 0 0;
    font-size: var(--text-xs);
    color: var(--on-surface-variant);
    font-weight: var(--weight-medium);
}

.students-directory-filters {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(150px, auto) minmax(150px, auto) auto;
    gap: var(--space-3);
    background: var(--surface-container-low);
    border-radius: var(--radius-xl);
    border: var(--ghost-border);
    padding: var(--space-4);
}

.students-directory-search-input {
    margin: 0;
    min-height: 44px;
    border: var(--ghost-border);
    border-radius: var(--radius-md);
    background: var(--surface-container-lowest);
    color: var(--on-surface);
    font-size: var(--text-sm);
    font-family: var(--font-body);
    padding: 0 var(--space-3);
}

.students-directory-search-input::placeholder {
    color: var(--on-surface-variant);
}

/* ── Students directory footer / pagination / empty ── */
.students-directory-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-bottom: var(--space-2);
}

.students-directory-results-summary {
    margin: 0;
    color: var(--on-surface-variant);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
}

.students-directory-pagination {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.students-directory-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-2);
    border-radius: var(--radius-md);
    border: var(--ghost-border);
    background: var(--surface-container-lowest);
    color: var(--on-surface);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    font-family: var(--font-body);
    cursor: pointer;
}

.students-directory-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.students-directory-page-btn.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--fg-on-primary);
}

.students-directory-pagination-ellipsis {
    color: var(--on-surface-variant);
    font-size: var(--text-sm);
    padding: 0 var(--space-1);
}

.students-directory-empty {
    background: var(--surface-container-lowest);
    border-radius: var(--radius-lg);
    border: var(--ghost-border);
    padding: var(--space-6);
}

/* Staff Directory variants keep Student Directory styles while handling single-stat/single-filter layouts. */
.staff-directory-view .students-directory-stats-grid {
    grid-template-columns: minmax(0, 320px);
    justify-content: flex-start;
}

.staff-directory-view .students-directory-filters {
    grid-template-columns: minmax(240px, 420px);
}
