/* === Consolidated forum theme === */
/* Duplicate declarations from older override layers were removed; remaining rules define the current UI. */


.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.user-avatar {
    --user-avatar-size: 42px;
    width: var(--user-avatar-size);
    height: var(--user-avatar-size);
    flex: 0 0 var(--user-avatar-size);
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--clr-primary-soft);
    color: var(--clr-primary-dark);
    border: 1px solid rgba(109, 74, 255, 0.14);
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.user-avatar--xs {
    --user-avatar-size: 28px;
    font-size: 0.72rem;
}

.user-avatar--sm {
    --user-avatar-size: 34px;
    font-size: 0.82rem;
}

.user-avatar--md {
    --user-avatar-size: 42px;
    font-size: 0.95rem;
}

.user-avatar--lg {
    --user-avatar-size: 64px;
    font-size: 1.35rem;
}

.user-avatar--xl {
    --user-avatar-size: 112px;
    font-size: 2.45rem;
}

.user-avatar__image,
.user-avatar__fallback {
    width: 100%;
    height: 100%;
}

.user-avatar__image {
    display: block;
    object-fit: cover;
}

.user-avatar__fallback {
    display: grid;
    place-items: center;
}




* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


body {
    min-height: 100vh;
}

.page-header {
    border-bottom: 2px solid var(--clr-border);
}

.post-card:not(.compact-post-card) {
    background: var(--clr-card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--clr-border);
    transition: all 0.3s ease;
    position: relative;
}

.post-card:not(.compact-post-card):hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.post-title {
    color: var(--clr-text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.post-author::before {
    content: "\\1F464";
}

.post-content {
    white-space: pre-wrap;
    border-radius: var(--radius);
}

.attachment-preview {
    margin: 1rem 0 1.5rem;
    padding: 0.75rem;
    background: linear-gradient(145deg, #f8faff, #eef2ff);
    border: 1px solid #dbe4ff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.attachment-preview-comment {
    max-width: 420px;
    margin-left: 3rem;
}

.attachment-image {
    width: auto;
    max-width: 100%;
    max-height: min(720px, 70vh);
    object-fit: contain;
    border-radius: var(--radius);
    display: block;
    margin: 0 auto;
}

.attachment-input {
    margin-top: 0.75rem;
}

.attachment-image {
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.attachment-image:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
}

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.image-modal.active {
    display: flex;
}

.image-modal-preview {
    max-width: min(1200px, 94vw);
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    object-fit: contain;
    background: #000;
}

.image-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    border-radius: 999px;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
}

.post-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--clr-border);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--clr-bg);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    color: var(--clr-text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.action-btn:hover {
    background: var(--clr-primary);
    color: white;
    border-color: var(--clr-primary);
}

.like-btn:hover {
    background: var(--clr-success);
    border-color: var(--clr-success);
}

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

.delete-btn {
    background: var(--clr-danger);
    color: white;
    border: none;
}

.delete-btn:hover {
    background: #dc2626;
}

.comments-section {
    margin-top: 2rem;
}

.comments-tree {
    margin-left: 0;
}

.comment {
    margin-bottom: 1rem;
    position: relative;
}

.comment.reply {
    margin-left: 2rem;
    margin-top: 1rem;
    background: white;
    border-left: 3px solid var(--clr-primary-light);
}

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

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 32px;
    height: 32px;
    background: var(--clr-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.author-name {
    font-weight: 600;
    color: var(--clr-text-dark);
}

.comment-time {
    color: var(--clr-text-lighter);
    font-size: 0.75rem;
}

.comment-content {
    color: var(--clr-text-dark);
    line-height: 1.6;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
}

.reply-btn {
    background: none;
    border: none;
    color: var(--clr-primary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.reply-btn:hover {
    background: var(--clr-primary);
    color: white;
}

.reply-btn:disabled {
    color: var(--clr-text-lighter);
    cursor: default;
}

.reply-btn:disabled:hover {
    background: none;
    color: var(--clr-text-lighter);
}

.comment-form-container {
    box-shadow: var(--shadow);
}

.comment-form-title {
    color: var(--clr-text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--clr-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.comment-input:focus {
    outline: none;
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-counter {
    color: var(--clr-text-lighter);
    font-size: 0.875rem;
}

.submit-btn {
    padding: 0.75rem 2rem;
    background: var(--clr-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-btn:hover {
    background: var(--clr-primary-dark);
    transform: translateY(-2px);
}

.create-post-form {
    background: var(--clr-card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--clr-border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea.form-input {
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

@media (max-width: 1024px) {

    .main {
        margin-left: 220px;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .main {
        margin-left: 0;
    }

    .comment.reply {
        margin-left: 1rem;
    }
}

.hidden {
    display: none !important;
}

:root {
    --clr-primary-light: #e7c7ff;
    --clr-input: #f7f9fc;
    --clr-nav: #ffffff;
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --topbar-height: 64px;
}

:root[data-theme="dark"] {
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.34);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.42);
}

html {
    background: var(--clr-bg);
}

body {
    font-size: 15px;
    letter-spacing: 0;
}

.user-info {
    margin-left: auto;
    color: var(--clr-text-dark);
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info > div:first-child {
    display: none;
}

.user-info > div:last-child::after {
    content: "";
    width: 36px;
    height: 36px;
    margin-left: 12px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: #efd7ff;
    color: var(--clr-primary);
    vertical-align: middle;
}

:root[data-theme="dark"] .user-info > div:last-child::after {
    background: #352447;
    color: var(--clr-primary-dark);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
    border-color: var(--clr-primary);
}

body > .theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1200;
}

.main {
    margin-left: 0;
    min-height: calc(100vh - var(--topbar-height));
}

.main,
.page-content,
.profile-page {
    margin-right: auto;
    margin-left: auto;
}

.page-content {
    padding: 0;
}

.page-header {
    background: var(--clr-card);
    border-radius: var(--radius-xl);
    padding: 22px 24px;
    box-shadow: var(--shadow);
}

.page-header h1 {
    color: var(--clr-text-dark);
    font-size: 24px;
    line-height: 1.2;
    font-weight: 800;
    margin: 0;
}

.page-header .subtitle {
    color: var(--clr-text-light);
    margin-top: 8px;
}

.card,
.grid-card,
.post-card:not(.compact-post-card),
.comment-form-container,
.create-post-form,
.profile-card,
.profile-form,
.panel,
.stat-card,
.category-card {
    background: var(--clr-card) !important;
    border: 1px solid var(--clr-border) !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow) !important;
    color: var(--clr-text-dark);
}

.card,
.post-card:not(.compact-post-card),
.create-post-form,
.profile-form,
.profile-card,
.panel {
    padding: 24px;
}

.post-card:not(.compact-post-card):hover,
.grid-card:hover,
.activity-item:hover {
    transform: none;
    box-shadow: var(--shadow-md) !important;
}

.post-title,
.profile-name,
.section-title,
h1, h2, h3, h4 {
    color: var(--clr-text-dark);
    letter-spacing: 0;
}

.post-meta,
.muted,
.activity-preview,
.activity-meta,
.summary-label {
    color: var(--clr-text-light);
}

.form-input,
.form-control,
select {
    background: var(--clr-input) !important;
    color: var(--clr-text-dark) !important;
    border: 1px solid var(--clr-border) !important;
    border-radius: var(--radius) !important;
    box-shadow: none !important;
}

.form-input:focus,
.form-control:focus,
select:focus {
    outline: none;
    border-color: var(--clr-primary) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--clr-primary), transparent 86%) !important;
}

.submit-btn,
.btn-primary,
button.submit-btn {
    background: var(--clr-primary) !important;
    color: #fff !important;
    border: 1px solid var(--clr-primary) !important;
    border-radius: var(--radius) !important;
    box-shadow: none !important;
    font-weight: 800;
}

.submit-btn:hover,
.btn-primary:hover {
    background: var(--clr-primary-dark) !important;
    transform: none;
}

.action-btn,
.reply-btn,
.btn,
.btn-secondary {
    background: var(--clr-card) !important;
    color: var(--clr-text-dark) !important;
    border: 1px solid var(--clr-border) !important;
    border-radius: var(--radius) !important;
    box-shadow: none !important;
    font-weight: 700;
}

.action-btn:hover,
.reply-btn:hover,
.btn:hover,
.btn-secondary:hover {
    color: var(--clr-primary) !important;
    border-color: var(--clr-primary) !important;
    background: var(--clr-input) !important;
    transform: none;
}

.post-content,
.comment,
.summary-card,
.activity-item,
.student-card,
.discipline-chip,
.soft-badge {
    background: var(--clr-card);
    border-color: var(--clr-border);
    color: var(--clr-text-dark);
}

.tabs {
    border-bottom: 1px solid var(--clr-border);
}

.tab,
.tabs a {
    color: var(--clr-text-dark);
}

.tab.active,
.tabs a.active {
    color: var(--clr-primary);
    border-bottom-color: var(--clr-primary);
}

.alert,
.notification {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.data-table th,
.data-table tr:hover,
.list-item:hover {
    background: var(--clr-input);
}

.image-modal {
    background: rgba(2, 6, 23, 0.86);
}

@media (max-width: 1024px) {

    .main {
        padding: 18px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 0;
    }

    .user-info {
        margin-left: auto;
        font-size: 13px;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .theme-toggle {
        width: 34px;
        height: 34px;
    }

    .main {
        padding: 14px;
    }

    .page-header,
        .card,
        .post-card:not(.compact-post-card),
        .panel {
        padding: 16px;
    }

}

body {
    background: var(--clr-bg) !important;
}

.profile-page {
    max-width: 1240px;
}

.profile-page .panel,
.profile-page .identity-panel {
    color: var(--clr-text-dark);
}

.profile-page .profile-username,
.profile-page .muted,
.profile-page .summary-label,
.profile-page .activity-preview,
.profile-page .activity-meta {
    color: var(--clr-text-light);
}

.profile-page .summary-number {
    color: var(--clr-primary);
}

@media (max-width: 1280px) {
    :root {
        --topbar-height: 92px;
    }
}

@media (max-width: 900px) {

    .study-card-layout {
        grid-template-columns: 1fr;
    }

    .profile-page {
        padding: 14px;
    }

    .profile-page .identity-panel {
        position: static;
    }

    .profile-page .summary-grid,
        .profile-page .form-grid {
        grid-template-columns: 1fr;
    }

    .profile-activity-grid,
        .profile-learning-grid,
        .notification-child-settings,
        .notification-timing-grid {
        grid-template-columns: 1fr;
    }
}

:root[data-theme="dark"] {
    --clr-primary: #b56ce8;
    --clr-primary-light: #38224b;
    --clr-primary-dark: #d9b8f2;
    --clr-accent: #6ea77b;
    --clr-success: #54a36c;
    --clr-danger: #d36b7a;
    --clr-warning: #d3a84c;
    --clr-bg: #0b1220;
    --clr-card: #172235;
    --clr-card-muted: #101a2b;
    --clr-border: #2f3b52;
    --clr-text-dark: #f8fafc;
    --clr-text-light: #cbd5e1;
    --clr-text-lighter: #94a3b8;
    --clr-input: #0f172a;
    --clr-nav: #111827;
}

:root[data-theme="dark"] body {
    background: var(--clr-bg) !important;
}

:root[data-theme="dark"] .main > div[style*="background: white"],
:root[data-theme="dark"] .reply-form-container,
:root[data-theme="dark"] .empty-state,
:root[data-theme="dark"] .empty-notifications,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .profile-card,
:root[data-theme="dark"] .profile-form,
:root[data-theme="dark"] .category-card,
:root[data-theme="dark"] .stat-card,
:root[data-theme="dark"] .quick-actions,
:root[data-theme="dark"] .recent-users,
:root[data-theme="dark"] .action-card,
:root[data-theme="dark"] .activity-item,
:root[data-theme="dark"] .summary-card {
    background: var(--clr-card) !important;
    color: var(--clr-text-dark) !important;
    border-color: var(--clr-border) !important;
}

:root[data-theme="dark"] .notification-item,
:root[data-theme="dark"] .notification-item.unread {
    background: var(--clr-card) !important;
    border-color: var(--clr-border) !important;
    color: var(--clr-text-dark) !important;
}

:root[data-theme="dark"] .notification-title,
:root[data-theme="dark"] .notification-message,
:root[data-theme="dark"] .notification-meta,
:root[data-theme="dark"] .notification-item h1,
:root[data-theme="dark"] .notification-item h2,
:root[data-theme="dark"] .notification-item h3,
:root[data-theme="dark"] .notification-item a {
    color: var(--clr-text-dark) !important;
}

:root[data-theme="dark"] .notification-message,
:root[data-theme="dark"] .notification-meta {
    color: var(--clr-text-light) !important;
}

:root[data-theme="dark"] .message-author,
:root[data-theme="dark"] .message-content,
:root[data-theme="dark"] .message-time {
    color: var(--clr-text-dark) !important;
}

:root[data-theme="dark"] .comment.best-answer,
:root[data-theme="dark"] .best-answer {
    background: #132b24 !important;
    border-color: #2f6b51 !important;
    color: var(--clr-text-dark) !important;
}

:root[data-theme="dark"] .comment.best-answer *,
:root[data-theme="dark"] .best-answer * {
    color: var(--clr-text-dark) !important;
}

:root[data-theme="dark"] .best-answer .best-answer-badge,
:root[data-theme="dark"] .comment.best-answer .best-answer-badge {
    background: #2f6b51 !important;
    color: #e8fff2 !important;
}

:root[data-theme="dark"] .comment:not(.best-answer),
:root[data-theme="dark"] .activity-item,
:root[data-theme="dark"] .summary-card {
    background: #111c2e !important;
    color: var(--clr-text-dark) !important;
}

:root[data-theme="dark"] .comment:not(.best-answer) *,
:root[data-theme="dark"] .activity-item *,
:root[data-theme="dark"] .summary-card * {
    color: inherit;
}

:root[data-theme="dark"] .post-content,
:root[data-theme="dark"] .post-meta,
:root[data-theme="dark"] .comment-time {
    color: var(--clr-text-light) !important;
}

:root[data-theme="dark"] .post-title,
:root[data-theme="dark"] .comment-author,
:root[data-theme="dark"] .author-name,
:root[data-theme="dark"] .comment-content {
    color: var(--clr-text-dark) !important;
}

:root {
    --content-max-width: 1240px;
    --content-padding: 24px;
    --control-height: 42px;
}

html {
    scroll-padding-top: calc(var(--topbar-height) + 20px);
}

body {
    overflow-x: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--clr-primary), transparent 68%);
    outline-offset: 2px;
}

.main:not(.section-directory-page):not(.posts-page):not(.hub-home-page):not(.schedule-page-shell):not(.learning-page-shell):not(.learning-admin-page):not(.teacher-cabinet-page):not(.meetings-main),
.page-content,
.profile-page {
    width: min(100%, var(--content-max-width)) !important;
}

.main:not(.section-directory-page):not(.posts-page):not(.hub-home-page):not(.schedule-page-shell):not(.learning-page-shell):not(.learning-admin-page):not(.teacher-cabinet-page):not(.meetings-main) {
    padding: var(--content-padding) !important;
}

.page-header,
.notifications-header {
    gap: 16px !important;
}

.page-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.page-header h1,
.notifications-title {
    font-size: clamp(22px, 2vw, 30px) !important;
    line-height: 1.15 !important;
}

.card,
.grid-card,
.post-card:not(.compact-post-card),
.panel,
.notification-item,
.comment-form-container,
.create-post-form,
.profile-form,
.profile-card {
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.post-card:not(.compact-post-card),
.panel,
.card,
.notification-item {
    overflow: hidden;
}

.post-actions,
.form-actions,
.notification-actions {
    min-width: 0;
}

.main > div[style*="background: white"],
.main > div[style*="background: #fff"],
.main > div[style*="background:#fff"] {
    background: var(--clr-card) !important;
    border: 1px solid var(--clr-border) !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow) !important;
    color: var(--clr-text-dark) !important;
}

.main form[style*="display: flex"],
.main div[style*="display: flex"] {
    max-width: 100%;
}

.submit-btn,
.action-btn,
.reply-btn,
.btn,
.theme-toggle,
button {
    min-height: 36px;
}

.submit-btn,
.action-btn,
.reply-btn,
.btn,
.btn-primary,
.btn-secondary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    white-space: nowrap;
}

.form-input,
.form-control,
select {
    min-height: var(--control-height);
    max-width: 100%;
}

textarea,
.comment-input {
    line-height: 1.45;
}

.data-table {
    min-width: 760px;
}

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-xl);
}

.post-content,
.comment-content,
.activity-preview,
.notification-message,
.message-content {
    overflow-wrap: anywhere;
}

.post-actions,
.comment-actions {
    display: flex;
    flex-wrap: wrap;
}

.post-actions {
    gap: 10px !important;
}

.comment {
    max-width: 100%;
}

.notification-item {
    min-width: 0;
}

@media (max-width: 1100px) {
    :root {
        --content-padding: 18px;
    }
}

@media (max-width: 860px) {
    :root {
        --topbar-height: 64px;
        --content-padding: 14px;
    }

    .user-info {
        max-width: 36vw !important;
        font-size: 13px !important;
        justify-self: end;
    }

    .user-info > div:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-info > div:last-child::after {
        width: 32px;
        height: 32px;
        margin-left: 8px;
    }

    .main:not(.hub-home-page):not(.schedule-page-shell):not(.learning-page-shell):not(.learning-admin-page):not(.teacher-cabinet-page):not(.meetings-main),
        .profile-page {
        padding: var(--content-padding) !important;
    }

    .page-header .submit-btn,
        .notifications-header form {
        width: 100%;
    }

    .main > div[style*="background: white"] form,
        .main > div[style*="background: #fff"] form {
        display: grid !important;
        grid-template-columns: 1fr;
    }

    .post-card:not(.compact-post-card),
        .panel,
        .card,
        .notification-item,
        .comment-form-container {
        padding: 16px !important;
        border-radius: var(--radius-lg) !important;
    }

    .notification-item {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 12px !important;
    }

    .notification-actions {
        justify-content: stretch !important;
    }

    .notification-actions form,
        .notification-actions .submit-btn {
        width: 100%;
    }

    .post-actions form,
        .comment-actions form {
        width: 100%;
    }

    .post-actions .action-btn,
        .comment-actions .reply-btn,
        .comment-actions .action-btn {
        width: 100% !important;
    }

    .comment-header,
        .comment-actions {
        display: grid !important;
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .message-meta,
        .message-actions {
        flex-wrap: wrap;
    }

}

@media (max-width: 520px) {
    .user-info {
        max-width: 30vw !important;
    }

    .page-header h1,
        .notifications-title {
        font-size: 22px !important;
    }

    .summary-grid,
        .form-grid {
        grid-template-columns: 1fr !important;
    }

}

@media (max-width: 1280px) {

    .user-info {
        order: 4;
    }

}

@media (max-width: 860px) {
    html,
        body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        min-width: 0;
    }

    .user-info {
        display: none !important;
    }

    .main:not(.hub-home-page):not(.schedule-page-shell):not(.learning-page-shell):not(.learning-admin-page):not(.teacher-cabinet-page):not(.meetings-main),
        .page-content,
        .profile-page {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
    }

    .main:not(.hub-home-page):not(.schedule-page-shell):not(.learning-page-shell):not(.learning-admin-page):not(.teacher-cabinet-page):not(.meetings-main),
        .page-content {
        padding: 14px !important;
    }

    .page-header,
        .notifications-header {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        align-items: start !important;
        margin-bottom: 14px !important;
        padding: 16px !important;
        border-radius: var(--radius-xl);
        background: var(--clr-card);
        border: 1px solid var(--clr-border);
        box-shadow: var(--shadow-sm);
    }

    .page-header h1,
        .create-post-form h1,
        .notifications-title {
        font-size: 24px !important;
        line-height: 1.18 !important;
    }

    .page-header .submit-btn,
        .page-header .btn,
        .notifications-header form {
        width: 100% !important;
    }

    .card,
        .post-card:not(.compact-post-card),
        .create-post-form,
        .comment-form-container,
        .category-card,
        .notification-item,
        .profile-card,
        .profile-form,
        .panel {
        width: 100% !important;
        padding: 16px !important;
        border-radius: 14px !important;
        box-shadow: var(--shadow-sm) !important;
    }

    .post-content {
        padding: 0;
        background: transparent;
        border-left: 0;
        font-size: 16px;
    }

    .main > div[style*="background: white"] {
        padding: 14px !important;
        margin-bottom: 14px !important;
    }

    .main > div[style*="background: white"] form,
        .main > div[style*="background: #fff"] form,
        .form-actions,
        .form-footer,
        .post-actions,
        .post-actions form,
        .comment-actions,
        .comment-actions form {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: 100%;
    }

    .submit-btn,
        .action-btn,
        .reply-btn,
        .cancel-btn,
        .btn {
        width: 100%;
        min-height: 44px;
        padding: 0 14px !important;
        font-size: 15px;
        white-space: normal !important;
        text-align: center;
    }

    .form-input,
        .form-control,
        input,
        select,
        textarea {
        width: 100%;
        min-width: 0;
        font-size: 16px !important;
    }

    textarea.form-input,
        .comment-input {
        min-height: 180px;
    }

    .grid,
        .summary-grid,
        .form-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        margin-top: 14px !important;
    }

    .comment-header {
        align-items: start;
    }

    .comment.reply {
        margin-left: 0 !important;
    }

    .attachment-preview-comment {
        margin-left: 0;
        max-width: 100%;
    }

    .message-actions select,
        .message-actions button {
        width: 100% !important;
    }
}

@media (max-width: 520px) {
    :root {
        --topbar-height: 58px;
        --content-padding: 10px;
    }

    .main:not(.hub-home-page):not(.schedule-page-shell):not(.learning-page-shell):not(.learning-admin-page):not(.teacher-cabinet-page):not(.meetings-main),
        .page-content {
        padding: 10px !important;
    }

    .page-header h1,
        .create-post-form h1,
        .notifications-title {
        font-size: 22px !important;
    }

    .post-card:not(.compact-post-card),
        .create-post-form,
        .comment-form-container,
        .category-card,
        .card,
        .panel {
        padding: 14px !important;
    }

}

.question-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 28px;
    padding: 0 0.7rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.question-status i {
    font-size: 0.55rem;
}

.question-status.open {
    background: #eef2ff;
    color: #3730a3;
    border-color: #c7d2fe;
}

.question-status.open i {
    color: #4f46e5;
}

.question-status.answered {
    background: #e7f6f2;
    color: #11645b;
    border-color: #b8ddd5;
}

.question-status.answered i {
    color: #2f8f83;
}

.question-status.resolved {
    background: #e9f7ee;
    color: #22623a;
    border-color: #bfe4cb;
}

.question-status.resolved i {
    color: #3f8d58;
}

.question-status.needs-teacher {
    background: #fff4e5;
    color: #8a4b12;
    border-color: #f2d2a2;
}

.question-status.needs-teacher i {
    color: #c98224;
}

.comment.best-answer {
    background: color-mix(in srgb, var(--clr-success), var(--clr-card) 94%) !important;
    border-color: color-mix(in srgb, var(--clr-success), var(--clr-border) 70%) !important;
    border-left: 4px solid color-mix(in srgb, var(--clr-success), #2f6b51 20%) !important;
    box-shadow: none !important;
}

.best-answer-badge {
    width: fit-content;
    min-height: 28px;
    border: 1px solid color-mix(in srgb, var(--clr-success), var(--clr-border) 55%);
}

:root[data-theme="dark"] .question-status.open {
    background: #222844 !important;
    color: #c8cef8 !important;
    border-color: #3b456b !important;
}

:root[data-theme="dark"] .question-status.open i {
    color: #8793df !important;
}

:root[data-theme="dark"] .question-status.answered {
    background: #17312f !important;
    color: #acd8d1 !important;
    border-color: #315d58 !important;
}

:root[data-theme="dark"] .question-status.answered i {
    color: #6eb4aa !important;
}

:root[data-theme="dark"] .question-status.resolved {
    background: #172d22 !important;
    color: #b8dbc4 !important;
    border-color: #315942 !important;
}

:root[data-theme="dark"] .question-status.resolved i {
    color: #7ab38b !important;
}

:root[data-theme="dark"] .question-status.needs-teacher {
    background: #332918 !important;
    color: #e0c99b !important;
    border-color: #5c4b2d !important;
}

:root[data-theme="dark"] .question-status.needs-teacher i {
    color: #c6a35f !important;
}

:root[data-theme="dark"] .comment.best-answer,
:root[data-theme="dark"] .comment.reply.best-answer {
    background: #15243a !important;
    color: var(--clr-text-dark) !important;
    border-color: #345047 !important;
    border-left: 4px solid #5f9478 !important;
    box-shadow: none !important;
}

:root[data-theme="dark"] .comment.best-answer *,
:root[data-theme="dark"] .comment.reply.best-answer * {
    color: inherit;
}

:root[data-theme="dark"] .comment.best-answer .author-name,
:root[data-theme="dark"] .comment.best-answer .comment-content,
:root[data-theme="dark"] .comment.reply.best-answer .author-name,
:root[data-theme="dark"] .comment.reply.best-answer .comment-content {
    color: var(--clr-text-dark) !important;
}

:root[data-theme="dark"] .comment.best-answer .comment-time,
:root[data-theme="dark"] .comment.reply.best-answer .comment-time {
    color: var(--clr-text-light) !important;
}

:root[data-theme="dark"] .best-answer-badge,
:root[data-theme="dark"] .comment.best-answer .best-answer-badge {
    background: #203a31 !important;
    color: #c7ead6 !important;
    border-color: #3f705a !important;
}

.page-subtitle,
.muted {
    color: var(--clr-text-light);
}

.text-link {
    color: var(--clr-primary);
    text-decoration: none;
    font-weight: 700;
}

.text-link:hover {
    text-decoration: underline;
}

:root {
    --clr-primary: #6d4aff;
    --clr-primary-soft: #f1ecff;
    --clr-primary-soft-strong: #e6deff;
    --clr-primary-dark: #4b32b3;
    --clr-primary-muted: #8e7fe0;
    --clr-accent: #f59e0b;
    --clr-success: #16a34a;
    --clr-danger: #dc2626;
    --clr-warning: #d97706;
    --clr-info: #2563eb;
    --clr-bg: #f5f7fb;
    --clr-card: #ffffff;
    --clr-card-muted: #fafbff;
    --clr-border: #dde3ee;
    --clr-border-strong: #c9d4e5;
    --clr-text-dark: #1e293b;
    --clr-text-light: #64748b;
    --clr-text-lighter: #94a3b8;
    --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.05);
    --shadow: 0 18px 46px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 28px 64px rgba(15, 23, 42, 0.12);
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --container-width: 1180px;
    --form-width: 800px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
}

h1,
h2,
h3 {
    letter-spacing: -0.02em;
    color: var(--clr-text-dark);
}

h1 {
    font-size: clamp(2rem, 3vw, 2.7rem);
    font-weight: 700;
    line-height: 1.1;
}

h2 {
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    font-weight: 600;
    line-height: 1.2;
}

h3 {
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.35;
}

p,
span,
label,
input,
textarea,
select,
button {
    font-weight: 400;
}

.submit-btn,
.action-btn,
.cancel-btn,
.reply-btn,
button.submit-btn,
button.action-btn {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.submit-btn {
    box-shadow: 0 16px 30px rgba(109, 74, 255, 0.22);
}

.submit-btn:hover {
    transform: translateY(-1px);
}

.action-btn,
.cancel-btn,
.reply-btn {
    background: #fff;
    color: var(--clr-text-dark);
    border-color: var(--clr-border);
    box-shadow: none;
}

.action-btn:hover,
.cancel-btn:hover,
.reply-btn:hover {
    background: var(--clr-card-muted);
    border-color: var(--clr-border-strong);
    color: var(--clr-text-dark);
    transform: translateY(-1px);
}

.delete-btn:hover {
    border-color: #fca5a5;
}

.theme-toggle {
    position: static;
    border-radius: 14px;
    border: 1px solid var(--clr-border);
    background: #fff;
    color: var(--clr-text-dark);
    box-shadow: none;
}

.theme-toggle:hover {
    background: var(--clr-card-muted);
    transform: translateY(-1px);
}

.profile-avatar {
    margin: 0 auto 12px;
    border-radius: 22px;
}

.badge {
    min-width: 22px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.main:not(.section-directory-page):not(.posts-page):not(.hub-home-page):not(.schedule-page-shell):not(.learning-page-shell):not(.learning-admin-page):not(.teacher-cabinet-page):not(.meetings-main),
.page-content,
.profile-page {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 28px 24px 48px;
    min-height: auto;
}

.form-container,
.create-post-form {
    max-width: var(--form-width);
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
    padding-bottom: 0;
    border: 0;
}

.page-header h1,
.page-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.subtitle,
.page-subtitle {
    margin-top: 8px;
    color: var(--clr-text-light);
    font-size: 0.98rem;
    font-weight: 500;
}

.back-link,
.text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--clr-text-light);
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover,
.text-link:hover {
    color: var(--clr-primary-dark);
}

.card,
.panel,
.post-card:not(.compact-post-card),
.quick-actions,
.recent-users,
.stat-card,
.summary-card,
.notification-item,
.category-card,
.activity-item {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card,
.panel,
.post-card:not(.compact-post-card),
.quick-actions,
.recent-users {
    padding: 24px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel h2,
.panel-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.empty-state,
.empty-notifications {
    border: 1px dashed var(--clr-border-strong);
    border-radius: var(--radius-lg);
    background: var(--clr-card-muted);
    padding: 40px 28px;
    color: var(--clr-text-light);
    text-align: center;
}

.empty-state i,
.empty-notifications i {
    color: var(--clr-text-lighter);
}

.alert {
    border-radius: 16px;
    padding: 14px 18px;
    margin-bottom: 18px;
    font-weight: 500;
}

.alert-success {
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--clr-text-dark);
    font-weight: 600;
}

.form-hint,
.char-counter {
    color: var(--clr-text-light);
    font-size: 0.84rem;
}

.form-input,
.form-control,
input[type="text"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="password"],
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--clr-border);
    border-radius: 14px;
    background: #fff;
    color: var(--clr-text-dark);
    font-size: 0.96rem;
    box-shadow: none;
}

textarea.form-input,
textarea.form-control,
textarea {
    min-height: 140px;
    resize: vertical;
}

.form-input:focus,
.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(109, 74, 255, 0.42);
    box-shadow: 0 0 0 4px rgba(109, 74, 255, 0.12);
}

input[type="file"] {
    padding: 10px 12px;
    background: #fff;
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 9px 14px;
    border: 1px solid var(--clr-border);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

.form-actions,
.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--clr-border);
}

.question-status,
.access-badge,
.soft-badge,
.discipline-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.category-label {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(157, 90, 231, 0.22);
    color: #c084fc;
    font-size: 0.78rem;
    font-weight: 800;
}

.notification-item.unread {
    border-color: #d9d0ff;
}

.notification-icon {
    background: var(--clr-primary-soft);
    color: var(--clr-primary-dark);
}

.notification-title {
    font-size: 1rem;
    font-weight: 600;
}

.notification-meta {
    color: var(--clr-text-lighter);
}


.dashboard,
.profile-page > div {
    max-width: 100%;
}

.stats-grid,
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.stat-card {
    padding: 22px;
    text-align: left;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    color: var(--clr-text-light);
    text-transform: none;
    letter-spacing: 0;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    text-decoration: none;
}

.pagination a {
    border: 1px solid var(--clr-border);
    background: #fff;
}

.pagination a.disabled {
    opacity: 0.45;
    pointer-events: none;
}

@media (max-width: 1080px) {

    .identity-panel {
        position: static;
    }
}

@media (max-width: 900px) {
    .study-card-layout,
        .profile-edit-grid,
        .profile-activity-grid,
        .profile-learning-grid,
        .notification-child-settings,
        .notification-timing-grid {
        grid-template-columns: 1fr;
    }

    .identity-panel {
        position: static;
    }

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

@media (max-width: 760px) {

    .main:not(.posts-page):not(.hub-home-page):not(.schedule-page-shell):not(.learning-page-shell):not(.learning-admin-page):not(.teacher-cabinet-page):not(.meetings-main),
        .page-content,
        .profile-page {
        padding: 22px 16px 40px;
    }

    .page-header,
        .form-actions,
        .form-footer,
        .notifications-header {
        flex-direction: column;
        align-items: stretch;
    }
}

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-strong: #eef2ff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #d9e2ef;
    --border-strong: rgba(124, 58, 237, 0.18);
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-soft: #ede9fe;
    --success-soft: #ecfdf3;
    --success-text: #15803d;
    --info-soft: #eaf2ff;
    --info-text: #2563eb;
    --warning-soft: #fff7ed;
    --warning-text: #c2410c;
    --danger-soft: #fef2f2;
    --danger-text: #dc2626;
    --hero-bg: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(255, 255, 255, 0.94));
    --hero-panel-bg: rgba(255, 255, 255, 0.86);
    --header-bg: rgba(248, 250, 255, 0.9);
    --field-bg: #ffffff;
    --field-text: #0f172a;
    --field-placeholder: #94a3b8;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 14px 35px rgba(15, 23, 42, 0.10);
}

:root[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #172033;
    --surface-soft: #1e293b;
    --surface-strong: #111827;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: #334155;
    --border-strong: rgba(167, 139, 250, 0.4);
    --primary: #a78bfa;
    --primary-hover: #8b5cf6;
    --primary-soft: rgba(167, 139, 250, 0.16);
    --success-soft: rgba(34, 197, 94, 0.18);
    --success-text: #86efac;
    --info-soft: rgba(59, 130, 246, 0.18);
    --info-text: #93c5fd;
    --warning-soft: rgba(245, 158, 11, 0.18);
    --warning-text: #fdba74;
    --danger-soft: rgba(248, 113, 113, 0.16);
    --danger-text: #fca5a5;
    --hero-bg: linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(23, 32, 51, 0.96));
    --hero-panel-bg: rgba(15, 23, 42, 0.68);
    --header-bg: rgba(15, 23, 42, 0.92);
    --field-bg: #111827;
    --field-text: #e5e7eb;
    --field-placeholder: #94a3b8;
    --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 18px 50px rgba(0, 0, 0, 0.45);
}

body,
.main,
.page-content,
.profile-page {
    background: var(--bg);
    color: var(--text);
}

body {
    background: radial-gradient(circle at top left, rgba(124, 58, 237, 0.08), transparent 24rem),
        var(--bg);
    color: var(--text);
}

:root[data-theme="dark"] body {
    background: radial-gradient(circle at top left, rgba(124, 58, 237, 0.16), transparent 26rem),
        linear-gradient(180deg, #0f172a 0%, #111827 100%);
}

.theme-toggle,
.page-header h1,
.page-header h2,
.panel h2,
.panel-header h2,
.post-title,
.post-title a,
.notification-title,
.activity-title {
    color: var(--text);
}

.subtitle,
.page-subtitle,
.post-meta,
.notification-meta,
.notification-message,
.activity-preview,
.activity-meta,
.chat-total-count {
    color: var(--muted);
}

.text-link,
.back-link {
    color: var(--muted);
}

.text-link:hover,
.back-link:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--border-strong);
}

.panel,
.card,
.post-card:not(.compact-post-card),
.quick-actions,
.recent-users,
.stat-card,
.summary-card,
.notification-item,
.category-card,
.activity-item {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow-soft);
}

.stat-number,
.summary-number {
    color: var(--primary);
}

.stat-label {
    color: var(--muted);
}

.notification-filter-btn,
.pagination a,
.pagination span {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.pagination a:hover {
    background: var(--surface-soft);
    border-color: var(--border-strong);
}

.form-input,
.form-control,
input[type="text"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="password"],
select,
textarea {
    background: var(--field-bg);
    color: var(--field-text);
    border-color: var(--border);
}

.form-input::placeholder,
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--field-placeholder);
}

.form-input:focus,
.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.14);
}

input[type="file"]::file-selector-button {
    background: var(--surface-soft);
    color: var(--text);
    border-color: var(--border);
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
}

.submit-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    color: #fff;
}

.action-btn,
.cancel-btn,
.reply-btn,
.theme-toggle {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.action-btn:hover,
.cancel-btn:hover,
.reply-btn:hover,
.theme-toggle:hover {
    background: var(--surface-soft);
    color: var(--text);
    border-color: var(--border-strong);
}

.delete-btn {
    background: var(--danger-soft);
    color: var(--danger-text);
    border-color: rgba(248, 113, 113, 0.32);
}

.delete-btn:hover {
    background: rgba(248, 113, 113, 0.24);
    color: var(--danger-text);
}

.question-status,
.access-badge,
.soft-badge,
.discipline-chip {
    border-color: transparent;
}

.question-status.open {
    background: var(--info-soft);
    color: var(--info-text);
    border-color: rgba(59, 130, 246, 0.2);
}

.question-status.answered {
    background: var(--success-soft);
    color: var(--success-text);
    border-color: rgba(34, 197, 94, 0.2);
}

.question-status.resolved {
    background: rgba(148, 163, 184, 0.18);
    color: var(--text);
    border-color: rgba(148, 163, 184, 0.22);
}

.question-status.needs-teacher {
    background: var(--warning-soft);
    color: var(--warning-text);
    border-color: rgba(245, 158, 11, 0.2);
}

.soft-badge,
.category-label {
    background: var(--primary-soft);
    color: var(--primary);
}

.comment-form-container {
    background: var(--surface-soft);
    border-color: var(--border);
}

.clickable-card {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.clickable-card:hover,
.clickable-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(124, 58, 237, 0.35);
}

.clickable-card:focus-visible {
    outline: 2px solid rgba(124, 58, 237, 0.35);
    outline-offset: 2px;
}

:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .notification-filter-btn,
:root[data-theme="dark"] .pagination a,
:root[data-theme="dark"] .pagination span {
    background: var(--surface-strong);
}

:root[data-theme="dark"] .notification-item,
:root[data-theme="dark"] .activity-item,
:root[data-theme="dark"] .summary-card,
:root[data-theme="dark"] .category-card,
:root[data-theme="dark"] .post-card:not(.compact-post-card),
:root[data-theme="dark"] .panel {
    color: var(--text);
}

:root[data-theme="dark"] .activity-preview,
:root[data-theme="dark"] .activity-meta,
:root[data-theme="dark"] .post-meta,
:root[data-theme="dark"] .notification-meta,
:root[data-theme="dark"] .notification-message {
    color: var(--muted);
}

:root[data-theme="dark"] .notification-item.unread {
    border-color: rgba(167, 139, 250, 0.28);
}

:root[data-theme="dark"] .notification-icon {
    background: var(--primary-soft);
    color: var(--primary);
}

:root[data-theme="dark"] .best-answer {
    background: rgba(22, 163, 74, 0.16);
    border-color: rgba(74, 222, 128, 0.25);
}

:root[data-theme="dark"] .best-answer-badge {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}

@media (max-width: 760px) {
    .clickable-card:hover,
    .clickable-card:focus-visible {
        transform: none;
    }
}

body {
    padding-top: 0 !important;
}

@media (max-width: 1280px) and (min-width: 1091px) {
    :root {
        --topbar-height: 64px;
    }

    .user-info {
        order: initial;
    }
}

.theme-toggle {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
}


@media (max-width: 860px) {
    body {
        padding-top: var(--topbar-height) !important;
    }
}

@media (max-width: 640px) {
    .main:not(.hub-home-page):not(.schedule-page-shell):not(.learning-page-shell):not(.learning-admin-page):not(.teacher-cabinet-page):not(.meetings-main),
        .page-content,
        .profile-page {
        padding: 18px 12px 32px;
    }

    .notification-item {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 12px;
        border-radius: 16px;
    }

    .notification-icon {
        width: 40px;
        height: 40px;
    }

}

@media (max-width: 1280px) {

    .main:not(.hub-home-page):not(.schedule-page-shell):not(.learning-page-shell):not(.learning-admin-page):not(.teacher-cabinet-page):not(.meetings-main),
        .page-content,
        .profile-page {
        padding-top: 24px;
    }
}

.presence-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    color: var(--clr-text-light);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.2;
}

.presence-dot {
    width: 0.62rem;
    height: 0.62rem;
    min-width: 0.62rem;
    border-radius: 999px;
    border: 2px solid #fff;
    background: #94a3b8;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.presence-label[data-presence-status="ONLINE"] .presence-dot,
.presence-dot[data-presence-status="ONLINE"] {
    background: #22c55e;
}

.presence-label[data-presence-status="OFFLINE"] .presence-dot,
.presence-dot[data-presence-status="OFFLINE"] {
    background: #94a3b8;
}

.presence-label[data-presence-status="AWAY"] .presence-dot,
.presence-dot[data-presence-status="AWAY"] {
    background: #f59e0b;
}

.presence-label[data-presence-status="DO_NOT_DISTURB"] .presence-dot,
.presence-dot[data-presence-status="DO_NOT_DISTURB"] {
    background: #ef4444;
}

.presence-avatar-wrap {
    position: relative;
    width: fit-content;
    flex-shrink: 0;
}

.presence-avatar-wrap .presence-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
}

.presence-status-form {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.75rem;
    padding: 0.7rem;
    border: 1px solid var(--clr-border);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.72);
}

.presence-status-form .form-label {
    margin-bottom: 0;
    font-size: 0.84rem;
}

.presence-status-form .form-control {
    min-height: 40px;
    padding: 8px 12px;
}

.presence-status-form .form-hint {
    font-size: 0.78rem;
    line-height: 1.35;
}

.presence-status-form select {
    width: 100%;
}

:root[data-theme="dark"] .presence-dot {
    border-color: #0f172a;
}

:root[data-theme="dark"] .presence-status-form {
    background: rgba(15, 23, 42, 0.45);
}
