.teacher-page {
    max-width: 1180px;
    margin: 0 auto;
}

.teacher-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.teacher-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.teacher-overview-card {
    min-height: 84px;
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    background: var(--app-surface);
    padding: .95rem 1rem;
    box-shadow: var(--app-shadow);
}

.teacher-overview-label {
    color: var(--app-text-soft);
    font-size: .78rem;
    margin-bottom: .3rem;
}

.teacher-overview-value {
    color: var(--app-text);
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.12;
}

.teacher-overview-text {
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

.teacher-filter-shell {
    padding: 1rem;
    border-radius: .75rem;
}

.teacher-filter-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(100px, max-content);
    align-items: end;
    gap: .75rem;
}

.teacher-filter-actions {
    display: flex;
    gap: .5rem;
}

.teacher-page-count {
    text-align: right;
    white-space: nowrap;
}

.teacher-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.teacher-card {
    min-height: 242px;
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    background: var(--app-surface);
    overflow: hidden;
    box-shadow: var(--app-shadow);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.teacher-card:hover {
    transform: translateY(-2px);
    border-color: var(--app-primary);
    box-shadow: 0 18px 38px rgba(15, 23, 42, .11);
}

.teacher-card-body {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 1rem;
}

.teacher-card-head,
.teacher-person,
.teacher-roster-main {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}

.teacher-card-head {
    justify-content: space-between;
}

.teacher-person,
.teacher-roster-main {
    min-width: 0;
}

.teacher-avatar,
.teacher-profile-avatar,
.teacher-class-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #fff;
    font-weight: 800;
}

.teacher-avatar {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: var(--app-primary);
    font-size: .92rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .1);
}

.teacher-card-subline {
    color: var(--app-text-soft);
    font-size: .85rem;
}

.teacher-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .9rem;
}

.teacher-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    color: var(--app-text-soft);
    background: #f8fafc;
    padding: .15rem .55rem;
    font-size: .74rem;
    font-weight: 750;
    white-space: nowrap;
}

.teacher-pill-success {
    color: #166534;
    border-color: #bbf7d0;
    background: #dcfce7;
}

.teacher-pill-muted {
    color: #475569;
    border-color: #e2e8f0;
    background: #f1f5f9;
}

.teacher-stat-stack {
    display: grid;
    gap: .5rem;
    margin-top: auto;
    padding-top: 1rem;
}

.teacher-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    color: var(--app-text-soft);
    font-size: .86rem;
    border-radius: .65rem;
    background: #f8fafc;
    padding: .55rem .65rem;
}

.teacher-stat-row strong {
    color: var(--app-text);
    font-size: .95rem;
    font-weight: 650;
    text-align: right;
    overflow-wrap: anywhere;
}

.teacher-card-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
    margin-top: 1rem;
}

.teacher-card-actions form {
    min-width: 0;
}

.teacher-empty-state {
    grid-column: 1 / -1;
    padding: 2.2rem 1rem;
    text-align: center;
}

.teacher-empty-state.compact {
    padding: 1.1rem;
    border: 1px dashed var(--app-border);
    border-radius: .75rem;
    color: var(--app-text-soft);
    background: #f8fafc;
}

.teacher-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.teacher-profile-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--app-border);
    border-radius: .8rem;
    background: linear-gradient(135deg, var(--app-surface), var(--app-primary-faint));
    padding: 1.25rem;
    box-shadow: var(--app-shadow);
}

.teacher-profile-main {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 1rem;
}

.teacher-profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--app-primary);
    border: 2px solid rgba(255, 255, 255, .88);
    font-size: 1.45rem;
}

.teacher-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.teacher-profile-contact,
.teacher-profile-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .9rem;
}

.teacher-profile-contact {
    color: var(--app-text-soft);
    font-size: .9rem;
}

.teacher-profile-pills {
    margin-top: .75rem;
}

.teacher-profile-pills span {
    border-radius: 999px;
    padding: .25rem .7rem;
    background: var(--app-primary-faint);
    border: 1px solid var(--app-border);
    color: var(--app-primary-strong);
    font-size: .82rem;
    font-weight: 700;
}

.teacher-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
}

.teacher-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(270px, 340px);
    gap: 1rem;
    align-items: start;
}

.teacher-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.teacher-info-label {
    color: var(--app-text-soft);
    font-size: .78rem;
    margin-bottom: .25rem;
}

.teacher-info-value {
    color: var(--app-text);
    font-size: .92rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.teacher-action-grid {
    display: grid;
    gap: .5rem;
}

.teacher-action-link {
    display: block;
    min-height: 42px;
    border: 1px solid var(--app-border);
    border-radius: .65rem;
    color: var(--app-text);
    background: #f8fafc;
    padding: .72rem .8rem;
    text-decoration: none;
    font-weight: 750;
}

.teacher-action-link:hover,
.teacher-action-link:focus {
    border-color: var(--app-primary);
    background: var(--app-primary-faint);
    color: var(--app-primary-strong);
}

.teacher-roster-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.teacher-roster-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    background: #f8fafc;
    padding: .85rem;
}

.teacher-class-mark {
    width: 38px;
    height: 38px;
    border-radius: .65rem;
    background: var(--app-primary);
    font-size: .82rem;
}

.teacher-roster-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .4rem;
}

.teacher-form-shell {
    max-width: 960px;
    padding: 1.25rem;
}

.teacher-form-section-title {
    flex: 0 0 100%;
    color: var(--app-text);
    border-top: 1px solid var(--app-border);
    margin-top: .25rem;
    padding-top: 1rem;
    font-size: .84rem;
    font-weight: 800;
}

.teacher-form-section-title:first-of-type {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

@media (max-width: 991.98px) {
    .teacher-overview-grid,
    .teacher-card-grid,
    .teacher-detail-layout,
    .teacher-info-grid,
    .teacher-roster-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .teacher-filter-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .teacher-page-count {
        text-align: left;
    }
}

@media (max-width: 767.98px) {
    .teacher-page-header,
    .teacher-profile-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .teacher-page-header .btn,
    .teacher-hero-actions,
    .teacher-hero-actions .btn {
        width: 100%;
    }

    .teacher-profile-main {
        align-items: flex-start;
    }

    .teacher-overview-grid,
    .teacher-card-grid,
    .teacher-detail-layout,
    .teacher-info-grid,
    .teacher-roster-grid {
        grid-template-columns: 1fr;
    }

    .teacher-filter-actions,
    .teacher-filter-actions .btn {
        width: 100%;
    }

    .teacher-card-actions {
        grid-template-columns: 1fr;
    }

    .teacher-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .teacher-roster-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .teacher-roster-actions,
    .teacher-roster-actions .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .teacher-profile-avatar {
        width: 76px;
        height: 76px;
    }
}

