/* ========================
   СТИЛИ ЛИЧНОГО КАБИНЕТА
   ======================== */

.cabinet-main {
    padding: 0px 16px 20px;
}

.cabinet-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cabinet-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
}

/* Шапка внутри кабинета */
.cabinet-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-balance span {
    font-family: Inter;
    font-weight: 700;
    font-style: Bold;
    font-size: 20px;
    text-align: center;
    color: #FFF;
}

.user-avatar-small {
    display: flex;
    max-width: 37px;
    width: 100%;
    max-height: 37px;
    height: 100%;
}

.user-avatar-small img {
    height: auto !important;
}

.header-user-panel {
    display: flex;
    align-items: center;
    gap: 50px;
}

.notifications-wrapper {
    position: relative;
}

.bell-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bell-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #E20074;
    color: #FFF;
    font-size: 10px;
    font-weight: bold;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-balance,
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.user-avatar-small svg {
    border-radius: 50%;
}

/* Секции кабинета */
.cabinet-section {
    background: #23232B;
    border-radius: 10px;
    padding: 20px;
}


.profile-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.profile-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.profile-avatar-large {
    position: relative;
}

.avatar-plus {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #FFF;
    color: #0098FF;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    border: 2px solid #23232D;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-info h2 {
    font-family: Inter;
    font-weight: 700;
    font-style: Bold;
    font-size: 20px;
    color: #FFFFFF;
}

.profile-info p {
    font-family: Inter;
    font-weight: 400;
    font-style: Regular;
    font-size: 15px;
}

.mark-cont strong {
    font-family: Inter;
    font-weight: 700;
    font-style: Bold;
    font-size: 20px;
    color: #FFFFFF;
}

.trophy-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trophy-text p {
    font-family: Inter;
    font-weight: 700;
    font-style: Bold;
    font-size: 20px;
}

.profile-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.trophy-icon {
    font-size: 40px;
    line-height: 1;
}

.trophy-text .tr-label {
    font-size: 14px;
    font-weight: bold;
}

.trophy-text .tr-value {
    font-size: 16px;
    font-style: italic;
    font-weight: bold;
}

.section-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 25px 0;
}

.subsection-title {
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
}

.section-main-title {
    text-align: center;
    font-size: 24px;
    margin-bottom: 30px;
}

/* Таблица истории */
.history-table {
    display: flex;
    flex-direction: column;

}

.t-row {
    display: grid;
    grid-template-columns: 0.5fr 0.4fr 2fr;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    background: #404048;
    padding: 15px 20px;
    gap: 10px;
}

.t-row:last-child {
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 10px;
}

.t-head {
    background: #181820;
    padding-top: 15px;
    padding-right: 20px;
    padding-bottom: 15px;
    padding-left: 20px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    font-weight: bold;
    color: #FFF;
}

.t-col:not(:first-child) {
    text-align: center;
}

.t-col.positive {
    color: #A0AAB5;
    /* По макету светлый текст */
}

.show-all-link {
    text-align: right;
    margin-top: 15px;
}

.show-all-link a {
    color: #A0AAB5;
    text-decoration: underline;
    font-size: 14px;
}

/* Задания */
.task-group-title {
    font-size: 16px;
    margin-bottom: 15px;
    margin-top: 30px;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-card {
    background: #3B3B46;
    border-radius: 10px;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.task-info .t-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.task-info .t-desc {
    font-size: 14px;
    color: #A0AAB5;
}

.btn-outline {
    border: 1px solid #FFF;
    background: transparent;
    color: #FFF;
    padding: 10px 25px;
    border-radius: 100px;
    font-weight: bold;
    font-size: 12px;
    transition: 0.3s;
}

.btn-outline:hover {
    background: #FFF;
    color: #000;
}

.btn-status {
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: bold;
    color: #FFF;
    text-align: center;
}

.btn-status.grey {
    background: #6B7280;
}

.btn-status.pink {
    background: #E20074;
}

/* Турнирная таблица */
.leaderboard-table {
    display: flex;
    flex-direction: column;
}

.lb-row {
    display: grid;
    grid-template-columns: 50px 60px 2fr 2fr 1.5fr 1fr;
    align-items: center;
    padding: 15px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    position: relative;
}

.lb-head {
    font-weight: bold;
    border-bottom: none;
}

.text-right {
    text-align: right;
}

.sm-ava {
    width: 32px;
    height: 32px;
    background: #0098FF;
    border-radius: 50%;
}

.active-row {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.you-are-here {
    position: absolute;
    top: -10px;
    left: 10px;
    background: #E20074;
    color: #FFF;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: bold;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.page-btn {
    width: 32px;
    height: 32px;
    background: #3B3B46;
    color: #FFF;
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.page-btn.active {
    border: 1px solid #A0AAB5;
}

.page-btn.empty {
    background: transparent;
}


/* ========================
   ПОПАП УВЕДОМЛЕНИЙ
   ======================== */
.notifications-dropdown {
    display: none;
    /* Скрыто по умолчанию */
    position: absolute;
    top: 40px;
    left: -160px;
    /* Смещение, чтобы центр был под колокольчиком */
    width: 340px;
    background: #30363D;
    border: 1px solid #0098FF;
    border-radius: 12px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Треугольничек (хвостик) наверху */
.notifications-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #30363D;
    border-top: 1px solid #0098FF;
    border-left: 1px solid #0098FF;
}

.notifications-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notif-header h2 {
    font-size: 16px;
    margin: 0;
}

.close-notif {
    color: #FFF;
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
}

.notif-body {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notif-item {
    background: #4B5563;
    border-radius: 8px;
    padding: 15px;
}

.notif-item-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.notif-name {
    font-weight: bold;
    font-size: 14px;
}

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

.action-check {
    color: #10B981;
    cursor: pointer;
}

.action-cross {
    color: #EF4444;
    cursor: pointer;
}

.notif-info {
    font-size: 12px;
    color: #E5E7EB;
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.notif-time {
    font-size: 11px;
    color: #9CA3AF;
}

.notif-footer {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.notif-footer button {
    background: none;
    border: none;
    color: #FFF;
    text-decoration: underline;
    font-size: 12px;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ========================
   ПОПАП "ДОБАВИТЬ ОТВЕТ"
   ======================== */
.answer-popup-content {
    max-width: 600px;
    background: #1C2128;
}

.answer-task-title {
    font-size: 20px;
    margin-bottom: 10px;
}

.file-drop-area {
    background: #2D333B;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    margin-top: 20px;
}

.file-drop-area .file-icon {
    font-size: 32px;
    margin-bottom: 15px;
    color: #0098FF;
}

.file-drop-area p {
    font-size: 14px;
    color: #FFF;
    margin-bottom: 5px;
}

.file-drop-area .sub-text {
    font-size: 12px;
    color: #A0AAB5;
}

@media (max-width: 768px) {
    .lb-row {
        grid-template-columns: 30px 40px 1fr 1fr;
    }

    .lb-col:nth-child(4),
    .lb-col:nth-child(5) {
        display: none;
        /* Прячем почту и отдел на мобилке */
    }

    .profile-hero {
        flex-direction: column;
        align-items: flex-start;
    }
}



/* ========================
   ОБНОВЛЕННЫЙ ПОПАП УВЕДОМЛЕНИЙ
   ======================== */
.notifications-dropdown {
    width: 360px;
    /* Чуть шире под новый дизайн */
}

.notif-body {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    /* Добавляем скролл, если уведомлений много */
    overflow-y: auto;
}

/* Красивый скроллбар для уведомлений */
.notif-body::-webkit-scrollbar {
    width: 4px;
}

.notif-body::-webkit-scrollbar-thumb {
    background: #0098FF;
    border-radius: 4px;
}

.notif-item {
    background: #5E636A;
    /* Серый цвет карточек как на макете */
    border-radius: 8px;
    padding: 15px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.n-icon-col {
    flex-shrink: 0;
    padding-top: 2px;
}

.n-text-col {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.n-title {
    font-size: 13px;
    color: #FFFFFF;
    margin-bottom: 6px;
    line-height: 1.3;
}

.n-title strong {
    font-weight: bold;
}

.n-comment {
    font-size: 11px;
    color: #D1D5DB;
    margin-bottom: 8px;
}

.n-coins {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #D1D5DB;
    font-weight: 600;
    margin-bottom: 8px;
}

.notif-time {
    font-size: 10px;
    color: #9CA3AF;
}

.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #FFF;
}


@media (max-width: 600px) {
    .task-card {
        background: #3B3B46;
        border-radius: 10px;
        padding: 20px;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 15px;
        flex-direction: column;
    }

    .cabinet-section {
        background: #23232D;
        border-radius: 12px;
        padding: 10px;
    }
}

/* ========================
   КНОПКА БУРГЕР-МЕНЮ
   ======================== */
.burger-btn {
    display: none;
    /* Скрыт на компьютерах */
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
    /* Поверх всего */
}

.burger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: #FFFFFF;
    border-radius: 2px;
    transition: 0.3s;
}

/* ========================
   АДАПТИВ (МАКС 600px)
   ======================== */
@media (max-width: 600px) {
    .burger-btn {
        display: flex;
        /* Показываем бургер */
    }

    .cabinet-header-container {
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Прячем всю панель пользователя и превращаем ее в выпадающее меню */
    .header-user-panel {
        display: none;
        /* Скрыто по умолчанию */
        position: absolute;
        top: 50px;
        /* Отступ вниз от шапки */
        left: 0;
        width: 100%;
        background: #23232D;
        /* Темный фон меню */
        padding: 20px;
        flex-direction: column;
        gap: 20px;
        box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.5);
        z-index: 100;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Класс, который покажет меню (добавляется через JS) */
    .header-user-panel.active {
        display: flex;
        animation: fadeInMenu 0.3s forwards;
    }

    /* Выравниваем элементы внутри мобильного меню по центру */
    .notifications-wrapper,
    .user-balance,
    .user-profile {
        display: flex;
        justify-content: center;
        width: 100%;
        justify-content: center;
    }

    /* Позиционируем попап уведомлений внутри мобильного меню */
    .notifications-dropdown {
        top: 40px;
        left: 50%;
        transform: translateX(-50%);
        width: 90vw;
        /* Попап уведомлений на всю ширину экрана */
    }

    .notifications-dropdown::before {
        left: 50%;
        /* Центрируем хвостик попапа уведомлений */
    }

    /* Анимация превращения бургера в крестик */
    .burger-btn.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .burger-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .burger-btn.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}

/* Анимация плавного появления мобильного меню */
@keyframes fadeInMenu {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}





/* ========================
   ТУРНИРНАЯ ТАБЛИЦА
   ======================== */
.leaderboard-table {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.lb-row {
    display: grid;
    /* Десктоп: место | аватар | имя | почта | отдел | рейтинг */
    grid-template-columns: 60px 60px 1.5fr 2fr 1.2fr 100px;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    position: relative;
    color: #E5E7EB;
    background: #8E8E8E80;
}

.lb-place {
    font-weight: bold;
    font-size: 16px;
}

.lb-score {
    font-weight: bold;
    color: #0098FF;
    text-align: right;
}

.sm-ava {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #0098FF;
}

.lb-row:last-child {
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 10px;
}

.lb-row:last-child {
    border-bottom: none;
}

/* Темная шапка таблицы */
.lb-head {
    background: #181820;
    border-radius: 10px 10px 0 0;
    border-bottom: none;
    font-weight: 700;
    color: #FFFFFF;
}

/* Выделенная строка "Ты здесь" */
.active-row {
    background: #5E636A;
    /* Серый фон из макета */
    border-radius: 8px;
    border-bottom: none;
    margin: -1px 0;
    /* Накладываем поверх соседних бордеров, чтобы скрыть их стык */
    z-index: 2;
}

/* Розовая плашка над местом */
.you-are-here {
    position: absolute;
    top: -12px;
    left: 20px;
    background: #E20074;
    color: #FFF;
    font-size: 11px;
    padding: 4px 14px;
    border-radius: 100px;
    font-weight: 700;
}

.text-right {
    text-align: right;
}

/* Иконка аватара */
.sm-ava {
    width: 32px;
    height: 32px;
    background: #0098FF;
    border-radius: 50%;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.page-btn {
    width: 36px;
    height: 36px;
    background: #3B3B46;
    color: #FFF;
    border: 1px solid transparent;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
}

.page-btn:hover {
    background: #4B4B58;
}

.page-btn.active {
    border-color: #A0AAB5;
    background: transparent;
}

.page-btn.empty {
    background: transparent;
    cursor: default;
}

/* ========================
   АДАПТИВ ТАБЛИЦЫ (МАКС 600px)
   ======================== */
@media (max-width: 600px) {

    /* Скрываем аватар и email на мобилке */
    .lb-hide-mobile {
        display: none !important;
    }

    /* Таблица: 4 колонки (место, имя, отдел, рейтинг) */
    .lb-row {
        grid-template-columns: 40px 1.2fr 1fr auto;
        padding: 13px 10px;
        gap: 5px;
    }

    .lb-row .lb-name,
    .lb-row .lb-dept {
        font-size: 13px;
        line-height: 1.3;
    }

    .lb-head div {
        font-size: 12px;
        line-height: 1.2;
    }

    .lb-score {
        font-size: 13px;
    }

    .you-are-here {
        left: 10px;
        top: -10px;
        font-size: 10px;
        padding: 3px 10px;
    }

    .page-btn {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
}



/* ========================
   ПОПАП "ДОБАВИТЬ ОТВЕТ"
   ======================== */
.answer-popup-content {
    max-width: 740px;
    background: #181820;
    /* Темный фон из макета */
    padding: 40px;
    border-radius: 16px;
    border: 1px solid #30363D;
    text-align: center;
    height: max-content !important;
    /* Запрещаем растягиваться */
    max-height: 90vh;
    /* Если экран мелкий, попап не вылезет за пределы */
    overflow-y: auto;
}

.answer-main-title {
    font-size: 24px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 25px;
}

.answer-task-title {
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 10px;
}

.answer-task-desc {
    font-size: 14px;
    color: #E5E7EB;
    line-height: 1.5;
    margin-bottom: 30px;
    padding: 0 10px;
}

/* Зона Drag & Drop */
.file-drop-area {
    background: #23232D;
    /* Темно-серый фон зоны перетаскивания */
    border: 1px solid #3B3B46;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 25px;
}

.file-drop-content {
    padding: 30px 20px;
}

.file-icon {
    margin-bottom: 15px;
}

.file-drop-text {
    font-size: 14px;
    color: #FFFFFF;
    line-height: 1.4;
    margin-bottom: 8px;
}

.file-drop-subtext {
    font-size: 13px;
    color: #6B7280;
}

/* Нижняя полоса с прикрепленным файлом */
.file-attached-bar {
    background: #1C1E26;
    /* Чуть темнее фон для файла */
    border-top: 1px solid #3B3B46;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0098FF;
    font-size: 14px;
}

.file-delete-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.hide-mobile {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.file-delete-btn:hover {
    opacity: 0.7;
}

/* Текстовое поле для комментария */
.comment-group {
    text-align: left;
    margin-bottom: 25px;
}

.comment-group label {
    display: block;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 10px;
}

.comment-group textarea {
    width: 100%;
    height: 120px;
    background: #A0AAB5;
    /* Серый фон как на макете */
    color: #111;
    /* Темный текст при вводе */
    padding: 15px;
    border-radius: 8px;
    border: none;
    resize: none;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.comment-group textarea::placeholder {
    color: #6B7280;
    /* Темно-серый плейсхолдер */
}

.comment-group textarea:focus {
    outline: 2px solid #0098FF;
}

/* Кнопки попапа */
.submit-answer-btn {
    width: 100%;
    padding: 15px;
    background: transparent;
    color: #FFFFFF;
    border: 1px solid #FFFFFF;
    border-radius: 100px;
    /* Круглые края */
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 20px;
}

.submit-answer-btn:hover {
    background: #FFFFFF;
    color: #181820;
}

.cancel-answer-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    text-decoration: underline;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
}

.cancel-answer-btn:hover {
    color: #A0AAB5;
}


@media (max-width: 600px) {
    .answer-popup-content {
        max-width: 740px;
        background: #181820;
        /* Темный фон из макета */
        padding: 40px 16px;
        border-radius: 16px;
        border: 1px solid #30363D;
        text-align: center;
    }

    .cabinet-main {
        padding: 0px 0px 20px;
    }
}

/* ========================
   АДАПТИВ ТАБЛИЦЫ ИСТОРИИ (МАКС 600px)
   ======================== */
@media (max-width: 600px) {
    .t-row {
        /* Фиксируем место под дату (~85px) и сумму (~60px), остальное под текст (1fr) */
        grid-template-columns: 85px 60px 1fr;
        padding: 12px 10px;
        /* Сужаем боковые отступы */
        gap: 8px;
        /* Уменьшаем расстояние между колонками */
        font-size: 12px;
        /* Уменьшаем размер текста для компактности */
    }

    .t-head {
        padding-top: 12px;
        padding-bottom: 12px;
        font-size: 11px;
        /* Текст в шапке делаем чуть меньше */
    }

    /* 1-я колонка: Время */
    .t-col:nth-child(1) {
        white-space: nowrap;
        /* Запрещаем времени переноситься на новую строку (20.04 | 15:30 будет в одну линию) */
    }

    /* 2-я колонка: Сумма */
    .t-col:nth-child(2) {
        text-align: center;
    }

    /* 3-я колонка: Комментарий */
    .history-table .t-col:nth-child(3) {
        text-align: left !important;
        /* Прибиваем коммент к левому краю, чтобы длинный текст было удобно читать */
        line-height: 1.4;
        word-wrap: break-word;
        /* Если в комментарии будет очень длинное слово, оно перенесется, а не сломает таблицу */
    }
}

.mark-cont {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* ========================
   ЗОНА ЗАГРУЗКИ ФАЙЛОВ (МОДАЛКА)
   ======================== */
.upload-image-wrapper {
    width: 100%;
    max-width: 475px;
    margin: 0 auto;
    background: #23232D;
    border: 1px solid #30363D;
    overflow: hidden;
    margin-bottom: 30px;
    position: relative;
}

/* Скрываем стандартный страшный input */
.hidden-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* Зона, куда перетаскивать */
.upload-drop-zone {
    padding: 16px 40px;
    text-align: center;
    transition: background 0.3s;
}

/* Эффект при наведении/перетаскивании файла */
.upload-image-wrapper:hover .upload-drop-zone,
.upload-drop-zone.dragover {
    background: #2D333B;
}

.upload-text {
    font-size: 13px;
    color: #E5E7EB;
    line-height: 1.4;
    margin-bottom: 8px;
}

.upload-subtext {
    font-size: 12px;
    color: #6B7280;
    line-height: 1.4;
}

/* Список прикрепленных файлов */
.upload-files-list {
    background: #1C1E26;
    /* Чуть темнее фон для файла, как на макете */
    border-top: 1px solid #30363D;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 3;
    /* Чтобы кнопки удаления нажимались поверх инпута */
}

.file-attached-item {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #30363D;
}

.file-attached-item:last-child {
    border-bottom: none;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0098FF;
    /* Синий цвет текста файла */
    font-size: 13px;
}

/* Иконка скрепки */
.file-name svg {
    width: 14px;
    height: 14px;
    fill: #6B7280;
}

.file-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    transition: color 0.2s;
}

.file-delete-btn:hover {
    color: #EF4444;
    /* Красный при наведении */
}

.file-delete-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ========================
   ЗАГРУЗКА АВАТАРА
   ======================== */
.profile-avatar-large {
    position: relative;
    width: 95px;
    /* Задайте размер кружка (если не был задан) */
    height: 95px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Дефолтная SVG иконка */
#default-avatar-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Загруженное фото */
#user-uploaded-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Обрезает фото ровно по кругу */
    border-radius: 50%;
    display: block;
}

/* Кнопка с плюсиком */
.avatar-plus {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #FFF;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid #23232B;
    /* Темная обводка под цвет фона секции профиля */
    transition: transform 0.2s ease;
}

.avatar-plus:hover {
    transform: scale(1.1);
    /* Легкое увеличение при наведении */
}

.avatar-plus svg {
    width: 24px;
    height: 24px;
}
/* Кнопка выхода в хедере личного кабинета */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: #fff;
    padding: 7px 15px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    margin-left: 8px;
}
.logout-btn:hover {
    background: rgba(255, 80, 80, 0.2);
    border-color: rgba(255, 80, 80, 0.4);
    color: #ff8080;
}
.logout-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.logout-btn:hover svg {
    transform: translateX(3px);
}

/* Home button */
.home-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: #fff;
    padding: 7px 15px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}
.home-btn:hover {
    background: rgba(108, 61, 255, 0.25);
    border-color: rgba(108, 61, 255, 0.5);
    color: #b79cff;
}
.home-btn svg {
    flex-shrink: 0;
}

/* ========================
   FIX: АДАПТИВ ШАПКИ (gap + кнопки)
   ======================== */

/* Уменьшаем gap в шапке на средних экранах */
@media (max-width: 1024px) {
    .header-user-panel {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .header-user-panel {
        gap: 12px;
    }
    .logout-btn span,
    .home-btn span {
        display: none; /* Скрываем текст кнопок, оставляем только иконки */
    }
    .logout-btn,
    .home-btn {
        padding: 7px 10px;
        margin-left: 0;
    }
}

/* На маленьких экранах кнопки «Главная» и «Выйти» тоже идут в бургер-меню */
@media (max-width: 600px) {
    .logout-btn span,
    .home-btn span {
        display: inline; /* В мобильном меню текст снова показываем */
    }
    .logout-btn,
    .home-btn {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        padding: 10px 20px;
    }
    /* Таблицы на мобилке — запрет горизонтального переполнения */
    .leaderboard-table,
    .history-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .lb-row,
    .t-row {
        min-width: 0;
    }
    .header-user-panel.active {
        gap: 16px;
    }
}

/* ========================
   МОИ ПОКУПКИ — КАБИНЕТ
   ======================== */

.purchases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 4px;
}

.purchase-card {
    background: radial-gradient(circle at 20% 20%, rgba(108,61,255,0.12) 0%, rgba(28,33,40,0.95) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.purchase-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(108,61,255,0.2);
}

.purchase-card-img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
}

.purchase-card-img-placeholder {
    width: 100%;
    height: 110px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(108,61,255,0.15), rgba(168,85,247,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.purchase-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.purchase-card-price {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #A0AAB5;
}

.purchase-card-price img {
    width: 16px;
    height: 16px;
}

.purchase-card-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
}

.purchase-status-pending {
    background: rgba(234,179,8,0.15);
    color: #eab308;
    border: 1px solid rgba(234,179,8,0.3);
}

.purchase-status-approved {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
    border: 1px solid rgba(34,197,94,0.3);
}

.purchase-status-rejected {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.3);
}

.purchase-card-date {
    font-size: 11px;
    color: #606880;
    margin-top: auto;
}

@media (max-width: 768px) {
    .purchases-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Описание товара в карточке покупки */
.purchase-card-desc {
    font-size: 12px;
    color: #8B8B9E;
    line-height: 1.4;
    margin: -4px 0 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
