.form-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 4px;
}

/*
 * profile.css gives every .container horizontal overflow protection. On the
 * footer container, `hidden` makes the vertical axis scrollable and the large
 * decorative word creates an inset scrollbar. `clip` avoids that scroll box.
 */
body[data-unified-profile="true"] .footer > .container {
    overflow-x: clip;
    overflow-y: visible;
}

/*
 * The desktop profile grid normally keeps an empty third column opposite the
 * section navigation so the profile card stays centered in the full viewport.
 * Lotus already reduces the usable viewport width; drop that spacer while its
 * panel is open and center the two visible columns in the remaining space.
 */
@media (min-width: 769px) {
    body[data-unified-profile="true"].scolaro-assistant-open .teacher-profile-container {
        max-width: 1040px;
    }

    body[data-unified-profile="true"].scolaro-assistant-open .profile-page-layout {
        grid-template-columns: 190px minmax(0, 782px);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.form-actions.visually-hidden {
    display: none !important;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin: 2rem;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: #f3f4f6;
}

.modal-body {
    padding: 1.5rem;
}

.text-danger {
    color: #dc2626;
}

#profileAccessPermissions {
    max-width: 1000px;
    margin: 0 auto 2rem;
    padding: 0 1.5rem;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.main-content > #profileAccessPermissions {
    display: none;
}

.profile-access-panel {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: none;
}

.profile-access-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.profile-access-header-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    background: #eff6ff;
    font-size: 1.25rem;
}

.profile-access-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.25rem;
}

.profile-access-header p,
.profile-access-empty {
    margin: 0.35rem 0 0;
    color: #475569;
    line-height: 1.55;
}

.profile-access-loading,
.profile-access-empty {
    padding: 1.5rem;
    color: #475569;
}

.profile-access-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.profile-access-groups {
    padding: 0 1.5rem 1.5rem;
}

.profile-access-scope {
    padding-top: 1.25rem;
}

.profile-access-scope + .profile-access-scope {
    margin-top: 0.25rem;
    border-top: 1px solid #cbd5e1;
}

.profile-access-scope-title {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
}

.profile-access-list-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
    padding: 0.85rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.profile-access-list-item:last-child {
    border-bottom: 0;
}

.profile-access-item-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    background: #eff6ff;
}

.profile-access-item-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.profile-access-item-copy strong,
.profile-access-item-copy small {
    display: block;
}

.profile-access-item-copy strong {
    color: #0f172a;
    font-size: 0.95rem;
}

.profile-access-item-copy small {
    margin-top: 0.2rem;
    color: #64748b;
    font-size: 0.82rem;
}

.profile-access-membership-status {
    flex: 0 0 auto;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    color: #1d4ed8;
    background: #dbeafe;
    font-size: 0.75rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    #profileAccessPermissions {
        padding: 0 1rem;
    }

    .profile-access-list {
        padding: 0;
    }

    .profile-access-groups {
        padding: 0 1rem 1rem;
    }

    .profile-access-list-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .profile-access-membership-status {
        margin-left: 44px;
    }
}

.btn-link {
    background: none;
    border: none;
    color: #3b82f6;
}
