.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-container h1 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #333;
}

.dashboard-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.user-info-card,
.user-courses-card,
.user-progress-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-info-card h2,
.user-courses-card h2,
.user-progress-card h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #4a90e2;
    padding-bottom: 10px;
}

#userInfo {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.info-label {
    font-weight: 500;
    color: #666;
}

.info-value {
    color: #333;
    font-weight: 600;
}

#userCourses {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-course-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #4a90e2;
    cursor: pointer;
    transition: background 0.2s;
}

.user-course-item:hover {
    background: #e3f2fd;
}

.user-course-item.locked {
    opacity: 0.6;
    border-left-color: #999;
    cursor: not-allowed;
}

.progress-item {
    margin-bottom: 20px;
}

.progress-bar-container {
    background: #e0e0e0;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    background: linear-gradient(90deg, #4a90e2, #357abd);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }
}

/* Уведомления о новых сообщениях в ЛК */
.dashboard-messenger-unread-badge {
    display: inline-block;
    min-width: 20px;
    padding: 2px 7px;
    margin-left: 6px;
    border-radius: 10px;
    background: #e53935;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    vertical-align: middle;
}

.messenger-unread-notice {
    margin: 0 20px 12px;
    padding: 0;
}

.messenger-unread-notice__btn {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    display: block;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #3390ec, #2870c7);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 14px rgba(51, 144, 236, 0.35);
    -webkit-tap-highlight-color: transparent;
}

.messenger-unread-notice__btn:active {
    filter: brightness(1.05);
}

@media (max-width: 768px) {
    .messenger-unread-notice {
        margin: 0 10px 10px;
    }
}

/* --- Только ЛК (dashboard.html): лишняя синяя кнопка «Навігація»; остальные страницы не затрагиваем --- */
body.page-user-dashboard #navToggle {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Отступ под кнопку убран — inline padding-top:50px на .sidebar-nav больше не нужен */
body.page-user-dashboard #sidebar .sidebar-nav {
    padding-top: 12px !important;
}

/* Мобилка: меню участника в потоке вместо скрытой панели без гамбургера */
@media (max-width: 768px) {
    body.page-user-dashboard #sidebar {
        position: relative;
        left: 0 !important;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        padding-top: 56px;
        box-sizing: border-box;
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
        z-index: 1;
    }

    /* Фиксированная шапка внутри main — отступ без зарезервированного места под гамбургер */
    body.page-user-dashboard .main-content {
        padding-top: 88px;
    }
}

/* --- Мессенджер ЛК на телефоне: один экран — список ИЛИ чат (как в Telegram); десктоп не затрагивается --- */
body.page-user-dashboard .messenger-mobile-back-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 4px 0 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: #f0f0f0;
    color: #3390ec;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

body.page-user-dashboard .messenger-mobile-back-btn:active {
    background: #e0e0e0;
}

@media (max-width: 768px) {
    body.page-user-dashboard #messengerPage .messenger-container {
        flex-direction: column;
        height: auto;
        min-height: 280px;
        max-height: calc(100dvh - 200px);
        max-height: calc(100vh - 200px);
    }

    body.page-user-dashboard #messengerPage .messenger-sidebar {
        width: 100% !important;
        max-width: none;
        min-height: 220px;
        flex: 1 1 auto;
        border-right: none;
    }

    /* Режим «только список» */
    body.page-user-dashboard #messengerPage .messenger-container:not(.messenger-mobile--chat-open) .messenger-chat-area {
        display: none !important;
    }

    /* Режим «открыт чат» */
    body.page-user-dashboard #messengerPage .messenger-container.messenger-mobile--chat-open .messenger-sidebar {
        display: none !important;
    }

    body.page-user-dashboard #messengerPage .messenger-container.messenger-mobile--chat-open .messenger-chat-area {
        display: flex !important;
        flex-direction: column;
        flex: 1 1 auto;
        width: 100% !important;
        min-height: min(70dvh, 560px);
        min-height: min(70vh, 560px);
        max-height: calc(100dvh - 200px);
        max-height: calc(100vh - 200px);
    }

    body.page-user-dashboard #messengerPage .messenger-container.messenger-mobile--chat-open .messenger-mobile-back-btn {
        display: inline-flex;
    }

    body.page-user-dashboard #messengerPage .messenger-container.messenger-mobile--chat-open .messenger-chat-header {
        flex-wrap: nowrap;
        align-items: center;
    }
}
