html,
body {
    min-height: 100%;
}

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 16px;
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    z-index: 1040;
}

.brand,
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand {
    margin-bottom: 28px;
}

.brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    color: #ffffff;
    font-weight: 800;
}

.brand strong,
.auth-brand h1 {
    display: block;
    margin: 0;
    color: var(--text-color);
    font-size: 1.02rem;
    line-height: 1.2;
}

.brand small,
.auth-brand p,
.page-subtitle,
.panel-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.nav-list {
    display: grid;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 650;
}

.nav-link:hover,
.nav-link.active {
    background: var(--surface-muted);
    color: var(--text-color);
}

.nav-link.active {
    box-shadow: inset 3px 0 0 var(--primary-color);
}

.nav-link svg,
.icon-btn svg,
.module-icon svg,
.panel-head svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.app-main {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 78px;
    padding: 14px 28px;
    background: color-mix(in srgb, var(--bg-color) 86%, transparent);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
}

.page-title {
    margin: 0;
    color: var(--text-color);
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    line-height: 1.2;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
    color: var(--text-color);
    box-shadow: none;
}

.icon-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.danger-btn {
    color: var(--danger-color);
}

.danger-btn:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.theme-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.theme-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-switch span {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    width: 66px;
    height: 36px;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-color);
    color: var(--text-muted);
}

.theme-switch span::before {
    content: "";
    position: absolute;
    left: 5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    transform: translateX(0);
    transition: transform var(--transition);
}

.theme-switch input:checked + span::before {
    transform: translateX(30px);
}

.theme-switch svg {
    z-index: 1;
    justify-self: center;
    width: 15px;
    height: 15px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 6px 10px 6px 6px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
}

.user-chip > span {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary-color) 16%, var(--surface-muted));
    color: var(--primary-color);
    font-weight: 800;
}

.user-chip strong,
.user-chip small {
    display: block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.15;
}

.user-chip small {
    color: var(--text-muted);
}

.content-wrap {
    width: min(100%, 1480px);
    margin: 0 auto;
    padding: 26px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-column: 1 / -1;
    gap: 18px;
}

.metric-card,
.panel {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--surface-color);
    box-shadow: var(--shadow-card);
}

.metric-card {
    display: grid;
    gap: 12px;
    min-height: 138px;
    padding: 18px;
}

.metric-card .metric-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--surface-muted);
}

.metric-value {
    margin: 0;
    color: var(--text-color);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
}

.metric-label {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tone-primary { color: var(--primary-color); }
.tone-success { color: var(--success-color); }
.tone-warning { color: var(--warning-color); }
.tone-info { color: var(--info-color); }
.tone-danger { color: var(--danger-color); }

.panel {
    min-width: 0;
    padding: 18px;
}

.chart-panel {
    grid-column: span 8;
}

.dashboard-grid > .panel:not(.chart-panel) {
    grid-column: span 4;
}

.notifications-panel {
    grid-column: span 8;
}

.panel-head,
.module-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-head h2,
.module-head h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.25;
}

.chart-box {
    min-height: 280px;
}

.status-pill,
.badge-soft {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--success-color) 14%, var(--surface-muted));
    color: var(--success-color);
    font-weight: 750;
    font-size: 0.78rem;
}

.fee-summary {
    display: grid;
    gap: 14px;
}

.fee-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-muted);
}

.fee-row strong {
    color: var(--text-color);
}

.progress {
    height: 10px;
    background: var(--surface-muted);
}

.progress-bar {
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
}

.quick-grid {
    display: grid;
    gap: 10px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--text-color);
    font-weight: 700;
}

.quick-action:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.notification-list {
    display: grid;
    gap: 10px;
}

.notification-item {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-muted);
}

.notification-item strong {
    color: var(--text-color);
}

.notification-item p {
    margin: 0;
    color: var(--text-muted);
}

.module-shell {
    display: grid;
    gap: 18px;
}

.module-head {
    margin-bottom: 0;
}

.module-head > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.module-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.module-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.attendance-self-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 18px;
}

.attendance-status-panel,
.attendance-summary-panel {
    display: grid;
    gap: 16px;
}

.attendance-status-card {
    display: grid;
    gap: 8px;
    min-height: 122px;
    align-content: center;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-muted);
}

.attendance-status-card strong {
    color: var(--text-color);
    font-size: 1.35rem;
    line-height: 1.2;
}

.attendance-status-card small {
    color: var(--text-muted);
}

.attendance-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.attendance-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.class-attendance-panel {
    display: grid;
    gap: 16px;
}

.class-attendance-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto;
    gap: 12px;
    align-items: end;
}

.class-attendance-toolbar-actions {
    display: flex;
    gap: 10px;
}

.class-attendance-toolbar-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
}

.class-attendance-table td strong,
.class-attendance-table td small {
    display: block;
}

.class-attendance-table td small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.class-attendance-table .form-select,
.class-attendance-table .form-control {
    min-width: 150px;
}

.attendance-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.attendance-summary-grid div {
    display: grid;
    gap: 4px;
    min-height: 74px;
    align-content: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-muted);
}

.attendance-summary-grid span {
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
}

.attendance-summary-grid small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.module-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
}

.responsive-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.module-table {
    min-width: 720px;
}

.module-table th {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.module-table td {
    vertical-align: middle;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.row-actions .icon-btn {
    width: 34px;
    height: 34px;
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 220px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state svg {
    width: 38px;
    height: 38px;
}

.auth-body {
    min-height: 100vh;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--primary-color) 12%, transparent), transparent 36%),
        var(--bg-color);
}

.auth-page {
    display: grid;
    grid-template-columns: minmax(320px, 480px) minmax(0, 1fr);
    min-height: 100vh;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    padding: clamp(24px, 5vw, 56px);
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
}

.auth-brand h1 {
    font-size: 1.3rem;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-visual {
    position: relative;
    display: grid;
    place-items: center;
    padding: 48px;
    overflow: hidden;
}

body .modal-content {
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

body .modal-header,
body .modal-footer {
    border-color: var(--border-color);
}

.student-profile-view {
    display: grid;
    gap: 16px;
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-muted);
}

.profile-avatar {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 8px;
    background: var(--primary-color);
    color: var(--primary-contrast);
    font-size: 1.6rem;
    font-weight: 800;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
}

.profile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.profile-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.user-chip-link {
    cursor: pointer;
}

.user-chip-link:hover {
    border-color: var(--primary-color);
    color: var(--text-color);
}

.user-chip-link small {
    color: var(--text-muted);
}

.profile-hero h3,
.profile-panel h4 {
    margin: 0;
    color: var(--text-color);
}

.profile-hero p {
    margin: 4px 0 0;
    color: var(--text-muted);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.profile-panel {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
}

.profile-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.profile-panel-head .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.profile-panel h4 {
    font-size: 1rem;
}

.profile-row,
.profile-list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--border-color);
}

.profile-row span,
.profile-list-item span {
    color: var(--text-muted);
}

.profile-row strong,
.profile-list-item strong {
    color: var(--text-color);
    text-align: right;
}

.profile-list-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.profile-list-main strong {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.student-detail-page {
    display: grid;
    gap: 16px;
}

.student-detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.student-detail-toolbar .btn,
.student-identity-actions .btn,
.detail-section-head .btn,
.record-item .btn,
.student-profile-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.profile-actions .btn svg,
.student-detail-page .btn svg,
.student-profile-tabs .nav-link svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.student-detail-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.student-identity-panel,
.student-detail-main {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
    box-shadow: var(--shadow-soft);
}

.student-identity-panel {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 16px;
    padding: 18px;
}

.student-detail-photo-wrap {
    display: grid;
    place-items: center;
    min-height: 164px;
    border-radius: 8px;
    background: var(--surface-muted);
    border: 1px solid var(--border-color);
}

.student-detail-photo {
    width: 142px;
    height: 142px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
}

.student-detail-avatar {
    display: grid;
    place-items: center;
    width: 142px;
    height: 142px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    color: #ffffff;
    font-size: 3rem;
    font-weight: 800;
}

.student-identity-copy {
    display: grid;
    justify-items: center;
    gap: 6px;
    text-align: center;
}

.student-identity-copy h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.24rem;
    line-height: 1.25;
}

.student-identity-copy p {
    margin: 0;
    color: var(--text-muted);
}

.student-identity-actions {
    display: grid;
    gap: 8px;
}

.student-side-details {
    display: grid;
    gap: 2px;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.student-detail-main {
    min-width: 0;
    overflow: hidden;
}

.student-profile-tabs {
    gap: 6px;
    padding: 14px 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.student-profile-tabs .nav-link {
    min-height: 38px;
    border-radius: 8px 8px 0 0;
    color: var(--text-muted);
    font-weight: 700;
}

.student-profile-tabs .nav-link.active {
    background: var(--primary-color);
    color: var(--primary-contrast);
}

.student-tab-content {
    padding: 18px;
}

.detail-section {
    display: grid;
    gap: 14px;
}

.detail-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.detail-section-head h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.05rem;
}

.detail-section-head span {
    color: var(--text-muted);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
}

.detail-row span {
    color: var(--text-muted);
}

.detail-row strong {
    color: var(--text-color);
    text-align: right;
    overflow-wrap: anywhere;
}

.record-list {
    display: grid;
    gap: 10px;
}

.record-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-muted);
}

.record-item > div:first-child {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.record-item strong {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
}

.record-item span {
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.detail-table {
    margin: 0;
}

.settings-page {
    display: grid;
    gap: 16px;
}

.settings-form {
    display: grid;
    gap: 16px;
}

.settings-section {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
    box-shadow: var(--shadow-soft);
}

.settings-section h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 0.96rem;
    font-weight: 700;
}

.settings-section .form-check {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-muted);
    min-height: 44px;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.settings-section .form-check:hover {
    border-color: color-mix(in srgb, var(--primary-color) 35%, var(--border-color));
    background: color-mix(in srgb, var(--primary-color) 6%, var(--surface-muted));
}

.settings-section .form-check-input {
    flex: 0 0 auto;
    margin-top: 0;
}

.settings-section .form-check-label {
    flex: 1 1 auto;
    color: var(--text-color);
    font-weight: 600;
}

.settings-section .form-check-input:checked + .form-check-label {
    color: var(--primary-color);
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.role-grid .form-check {
    display: flex;
    align-items: center;
    margin: 0;
}

.school-action-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.school-action-group .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.school-action-group .icon-btn svg {
    width: 16px;
    height: 16px;
}

.auth-visual::before {
    content: "";
    position: absolute;
    inset: 8%;
    border-radius: 8px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--primary-color) 24%, transparent), transparent),
        linear-gradient(315deg, color-mix(in srgb, var(--success-color) 22%, transparent), transparent),
        var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.visual-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 18px;
    width: min(760px, 100%);
}

.visual-stat {
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-color) 86%, transparent);
    backdrop-filter: blur(10px);
}

.visual-stat span {
    display: block;
    color: var(--text-color);
    font-size: 2rem;
    font-weight: 800;
}

.visual-stat small {
    color: var(--text-muted);
}

.min-w-0 {
    min-width: 0;
}

@media (max-width: 1180px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chart-panel,
    .dashboard-grid > .panel:not(.chart-panel),
    .notifications-panel {
        grid-column: 1 / -1;
    }

    .attendance-self-grid {
        grid-template-columns: 1fr;
    }

    .class-attendance-toolbar {
        grid-template-columns: 1fr 180px;
    }

    .class-attendance-toolbar-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 991.98px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        width: min(86vw, 300px);
        box-shadow: var(--shadow-soft);
        transition: transform var(--transition);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .topbar {
        padding: 12px 16px;
    }

    .content-wrap {
        padding: 18px 14px 28px;
    }

    .user-chip div {
        display: none;
    }

    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        display: none;
    }

    .student-detail-layout {
        grid-template-columns: 1fr;
    }

    .student-identity-panel {
        position: static;
    }
}

@media (max-width: 640px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .topbar-actions {
        gap: 6px;
    }

    .theme-switch span {
        width: 58px;
    }

    .theme-switch input:checked + span::before {
        transform: translateX(22px);
    }

    .panel,
    .metric-card {
        padding: 14px;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-hero,
    .profile-row,
    .profile-list-item {
        align-items: flex-start;
    }

    .profile-actions {
        width: 100%;
        margin-left: 0;
    }

    .student-profile-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .student-profile-tabs .nav-link {
        white-space: nowrap;
        border-radius: 8px;
    }

    .student-tab-content {
        padding: 14px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-section-head,
    .record-item,
    .detail-row {
        align-items: flex-start;
    }

    .detail-section-head,
    .record-item {
        flex-direction: column;
    }

    .detail-row strong {
        max-width: 58%;
    }

    .role-grid {
        grid-template-columns: 1fr;
    }

    .attendance-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .attendance-actions .btn {
        flex: 1 1 150px;
        justify-content: center;
    }

    .class-attendance-toolbar {
        grid-template-columns: 1fr;
    }

    .class-attendance-toolbar-actions .btn {
        flex: 1 1 140px;
        justify-content: center;
    }
}
