/* ========================
   ОСНОВА АДМИН ПАНЕЛИ
   ======================== */


.admin-layout {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.admin-page-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #FFFFFF;
}

/* ========================
   САЙДБАР (ЛЕВОЕ МЕНЮ)
   ======================== */
.admin-sidebar {
    width: 240px;
    background: #23232B;
    border-radius: 10px;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-mobile-toggle {
    display: none;
    /* Скрыто на ПК */
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    transition: 0.2s;
    position: relative;
    border-radius: 5px;
}

.admin-main {
    padding-bottom: 20px;
}

.sidebar-nav .nav-item.active {
    background-color: #404048;
    /* Цвет фона активной плашки */
    border-radius: 8px;
    /* Скругление углов, настройте под свой макет (например 6px или 10px) */
}

/* Опционально: эффект при наведении на другие ссылки (hover) */
.sidebar-nav .nav-item:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.nav-badge {
    background: #FF0069;
    color: #FFF;
    font-size: 10px;
    font-weight: bold;
    border-radius: 70px;
    line-height: 1.3;
    padding: 2px 5.5px;
    display: flex;
    margin-left: auto;
    align-items: center;
    justify-content: center;
}

/* ========================
   ПРАВЫЙ КОНТЕНТ (КАРТОЧКА)
   ======================== */
.admin-content {
    flex: 1;
    min-width: 0;
}

.admin-panel-card {
    background: #23232B;
    border-radius: 10px;
    padding: 20px;
}

.admin-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1;
}

/* 1. СТАТИСТИКА */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #FFFFFF33;
    margin-bottom: 20px;
}

.stat-card {
    background: #404048;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    display: flex;
    line-height: 1;
}

.stat-val {
    font-size: 32px;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: #FFFFFF;
    font-weight: 600;
}

/* 2. УПРАВЛЕНИЕ ЗАДАНИЯМИ */
.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1;
}

.edit-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: 0.2s;
}

.edit-btn:hover {
    color: #FF0069;
}

.tasks-manage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    row-gap: 0;
}

.tm-item {
    display: grid;
    grid-template-columns: 140px 1fr 100px;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tm-name {
    font-size: 15px;
    font-weight: 700;
    color: #FFFFFF;
}

.tm-progress {
    width: 100%;
    height: 6px;
    background: #4B4B58;
    border-radius: 3px;
    overflow: hidden;
}

.tm-bar {
    height: 100%;
    background: #FF0069;
    /* Розовая полоска */
    border-radius: 3px;
}

.tm-count {
    font-size: 13px;
    color: #A0AAB5;
    text-align: right;
}

@media (max-width: 1050px) {
    .tm-item {
        display: grid;
        grid-template-columns: 80px 1fr 100px;
        align-items: center;
        gap: 15px;
        padding: 15px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* ========================
   АДАПТИВ (ПЛАНШЕТЫ И ТЕЛЕФОНЫ)
   ======================== */
@media (max-width: 900px) {

    /* Главный layout — колонка вместо строки */
    .admin-layout {
        flex-direction: column;
        gap: 12px;
    }

    /* Сайдбар — на всю ширину, без фиксированной высоты */
    .admin-sidebar {
        width: 100%;
        min-width: 0;
        border-radius: 10px;
        overflow: hidden;
    }

    /* Мобильный аккордеон для меню */
    .sidebar-mobile-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 25px;
        background: #3B3B46;
        cursor: pointer;
        color: #FFFFFF;
        font-weight: 600;
        font-size: 16px;
    }

    .toggle-left {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .toggle-arrow {
        transition: transform 0.3s;
    }

    .toggle-arrow.open {
        transform: rotate(180deg);
    }

    /* Прячем навигацию по умолчанию на телефоне */
    .sidebar-nav {
        display: none;
        padding: 5px 0 15px 0;
    }

    .sidebar-nav.open {
        display: flex;
    }

    .nav-item.active {
        background: transparent;
    }

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

    .tasks-manage-grid {
        grid-template-columns: 1fr;
    }

    /* Таблица топ игроков на мобиле */
    .leaderboard-table .lb-row {
        grid-template-columns: 30px 1.5fr 1fr 1fr 1fr !important;
        font-size: 12px;
        padding: 15px 10px;
    }

    /* Основной контент занимает всю ширину */
    .admin-content {
        min-width: 0;
        width: 100%;
        overflow-x: hidden;
    }
}

/* ========================
   УНИКАЛЬНАЯ ТАБЛИЦА ТОП ИГРОКОВ (АДМИНКА)
   ======================== */
.admin-players-table-wrapper {
    background: #3B3B46;
    border-radius: 8px;
    overflow-x: auto;
    /* Появится легкий скролл, если экран супер-маленький */
    width: 100%;
}

.admin-players-table {
    min-width: 600px;
    /* Минимальная ширина таблицы на ПК */
    display: flex;
    flex-direction: column;
}

.apt-row {
    display: grid;
    /* 6 колонок для ПК */
    grid-template-columns: 60px 60px 1.5fr 2fr 1fr 1.2fr;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
    font-size: 14px;
    gap: 15px;
}

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

.apt-head {
    background: #181820;
    /* Темная шапка */
    font-weight: 700;
    border-bottom: none;
}

.apt-name {
    line-height: 1.3;
}

.apt-email {
    color: #E5E7EB;
    line-height: 1.3;
    word-break: break-all;
    /* Разрешаем красивый перенос почты */
}

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

.apt-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: block;
}

/* ========================
   АДАПТИВ (МАКС 900px)
   ======================== */
@media (max-width: 900px) {
    .admin-players-table {
        /* На телефонах сжимаем до 480px, дальше спасет скролл обертки */
        min-width: 480px;
    }

    .apt-hide-mobile {
        display: none !important;
        /* Убираем только аватарку */
    }

    .apt-row {
        /* 5 колонок на мобилке с правильными пропорциями */
        grid-template-columns: 40px 1.2fr 1.5fr 1fr 1fr;
        padding: 15px;
        gap: 10px;
        font-size: 12px;
    }

    .apt-head .apt-col {
        font-size: 11px;
        line-height: 1.2;
    }

    .apt-email {
        font-size: 11px;
        color: #A0AAB5;
        /* Почта серая и мельче на мобилке */
    }
}

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

}

@media (max-width: 600px) {
    .apt-email {
        display: inline-block;

        /* Ширина в символах. 8ch значит, что влезет примерно 8 букв, остальное скроется за ... */
        max-width: 8ch;

        /* Запрещаем тексту переноситься на новую строку */
        white-space: nowrap;

        /* Обрезаем всё, что не влезло */
        overflow: hidden;

        /* Добавляем троеточие в конце */
        text-overflow: ellipsis;

        /* Выравниваем, чтобы не прыгало относительно других элементов */
        vertical-align: middle;
    }
}

/* ========================
   ПОПАП РЕДАКТИРОВАНИЯ
   ======================== */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 20, 0.85);
    /* Темный полупрозрачный фон */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal-content {
    background: #18181E;
    /* Темный фон самого попапа */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 90%;
    max-width: 460px;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.custom-modal-overlay.active .custom-modal-content {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: #FF0069;
}

.modal-title {
    text-align: center;
    color: #FFFFFF;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.modal-subtitle {
    text-align: center;
    color: #A0AAB5;
    font-size: 14px;
    margin: 0 0 25px 0;
}

.modal-subtitle strong {
    color: #FFFFFF;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-input {
    background: #9CA3AF;
    /* Серый цвет полей ввода как на скрине */
    border: none;
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 14px;
    color: #1A1A24;
    font-weight: 600;
    font-family: inherit;
    outline: none;
}

.modal-input::placeholder {
    color: rgba(26, 26, 36, 0.4);
    font-weight: 600;
}

.modal-textarea {
    resize: none;
}

/* Радиокнопки статуса */
.status-options {
    display: flex;
    gap: 15px;
}

.status-radio-box {
    background: #23232B;
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-radio-box input[type="radio"] {
    accent-color: #A0AAB5;
    /* Цвет стандартной радиокнопки */
    cursor: pointer;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 2px;
}
.status-dot.green {
    background: #00D26A;
}
.status-dot.grey {
    background: #A0AAB5;
}
.dot-green {
    background: #00D26A;
}
.dot-red {
    background: #F84444;
}

/* Кнопки действий */
.modal-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.btn-modal-save {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid #FFFFFF;
    border-radius: 30px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-save:hover {
    background: #FFFFFF;
    color: #18181E;
}

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

.btn-modal-cancel:hover {
    color: #FF0069;
}



.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 20, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    /* Центрируем */
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
    /* Чтобы не прилипал к краям экрана */
    box-sizing: border-box;
}

.custom-modal-content {
    background: #18181E;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 740px;
    padding: 40px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;

    /* ИСПРАВЛЕНИЕ ВЫСОТЫ */
    height: max-content !important;
    /* Запрещаем растягиваться */
    max-height: 90vh;
    /* Если экран мелкий, попап не вылезет за пределы */
    overflow-y: auto;
    /* Добавит скролл ВНУТРИ попапа, если экран совсем крошечный */
}

/* Сбрасываем возможную высоту у формы */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: auto !important;
    margin: 0 !important;
}

.status-radio-box {
    background: #23232B;
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    flex-direction: row !important;
    /* Жестко в строку */
    align-items: center;
    gap: 8px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-radio-box input[type="radio"] {
    appearance: auto !important;
    /* Сбрасываем чужие стили */
    display: inline-block !important;
    margin: 0 !important;
    width: 16px !important;
    height: 16px !important;
    cursor: pointer;
}

/* Адаптив под мобилки */
@media (max-width: 600px) {
    .custom-modal-content {
        padding: 20px;
    }

    .status-options {
        flex-direction: column;
        gap: 10px;
    }

    .custom-modal-content {
        padding: 40px 16px;
    }

}

    .apt-email {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }
/* ===== STYLES EXTRACTED FROM TAB CSS FILES ===== */

/* --- from css/tovar.css --- */
/* Легенда под заголовком */
.goods-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #E5E7EB;
    margin-bottom: 25px;
}
/* Верхняя панель (Кнопка и Поиск) */
.goods-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.btn-add-product {
    background: transparent;
    border: 1px solid #FFFFFF;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 40px;
    cursor: pointer;
    transition: 0.2s;
}
.btn-add-product:hover {
    background: rgba(255, 255, 255, 0.1);
}
.goods-search {
    display: flex;
    align-items: center;
    background: #3B3B46;
    border-radius: 40px;
    padding: 10px 20px;
    width: 260px;
}
.goods-search input {
    background: transparent;
    border: none;
    color: #FFFFFF;
    outline: none;
    margin-left: 10px;
    width: 100%;
    font-size: 14px;
}
.goods-search input::placeholder {
    color: #A0AAB5;
}
/* Таблицы товаров */
.goods-table-wrapper {
    background: #3B3B46;
    border-radius: 8px;
    width: 100%;
    overflow: hidden;
}
/* Верхние панели на мобильных */
    .goods-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
.goods-search,
    .btn-add-product,
    .btn-dark-grey {
        width: 100%;
        justify-content: center;
    }

/* --- from css/balance.css --- */
/* Поиск в верхней карточке */
.balance-search-top {
    display: flex;
    align-items: center;
    background: #3B3B46;
    border-radius: 40px;
    padding: 10px 20px;
    width: 280px;
    /* ИСПРАВЛЕНО: Ширина как на макете, а не на 100% */
}
.balance-search-top input {
    background: transparent !important;
    border: none !important;
    color: #FFFFFF !important;
    outline: none !important;
    margin-left: 10px;
    width: 100%;
    font-size: 14px;
    box-shadow: none !important;
}
.balance-search-top input::placeholder {
    color: #A0AAB5;
}
.balance-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 25px -20px 20px -20px;
}
.found-count {
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 15px;
}
/* Карточки пользователей */
.user-b-card {
    background: #616165;
    /* ИСПРАВЛЕНО: Точный серый цвет как на макете */
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    color: #FFFFFF;
}
.user-b-card.collapsed {
    padding: 15px 20px;
}
/* Скрываем раскрытые секции когда карточка свёрнута */
.user-b-card.collapsed .ub-actions-section,
.user-b-card.collapsed .ub-input-group,
.user-b-card.collapsed .ub-footer,
.user-b-card.collapsed .ub-reset-section {
    display: none !important;
}
/* Показываем секции когда карточка раскрыта */
.user-b-card:not(.collapsed) .ub-actions-section,
.user-b-card:not(.collapsed) .ub-input-group,
.user-b-card:not(.collapsed) .ub-footer,
.user-b-card:not(.collapsed) .ub-reset-section {
    display: block !important;
}
.ub-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.ub-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ub-name {
    font-size: 13px;
    color: #E5E7EB;
}
.ub-email {
    font-size: 14px;
    font-weight: 700;
    word-break: break-all;
}
.ub-balance-block {
    display: flex;
    flex-direction: column;
    text-align: right;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}
.ub-balance-label {
    font-size: 12px;
    color: #E5E7EB;
    white-space: nowrap;
}
.ub-balance-val {
    font-size: 16px;
    font-weight: 700;
}
.ub-actions-section {
    margin-top: 25px;
}
.ub-section-title {
    font-size: 14px;
    font-weight: 700;
    display: block;
    margin-bottom: 10px;
}
/* Поля ввода (Инпуты) */
.ub-input-group {
    margin-bottom: 20px;
}
.ub-input-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}
.ub-input,
.ub-textarea {
    width: 100%;
    background: #C0C0C1;
    /* ИСПРАВЛЕНО: Светло-серый цвет по макету */
    border: none;
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 14px;
    color: #181820;
    outline: none;
    font-family: inherit;
}
.ub-input::placeholder,
.ub-textarea::placeholder {
    color: #5A5A64;
}
.ub-textarea {
    resize: vertical;
}
/* Кнопки Сохранить / Отмена */
.ub-footer {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-top: 30px;
}
/* Таблица истории */
.history-table-wrapper {
    background: #181820;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}
.ht-table {
    display: flex;
    flex-direction: column;
}
.ht-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr 1.5fr 1fr;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: #3B3B46;
    color: #FFFFFF;
    font-size: 12px;
    gap: 10px;
    justify-items: center;
}
.ht-row:last-child {
    border-bottom: none;
}
.ht-head {
    background: transparent;
    font-weight: 700;
    border-bottom: none;
    font-size: 11px;
}
.ht-bold {
    font-weight: 700;
}
.ht-date {
    color: #E5E7EB;
}
.ht-user strong {
    font-weight: 700;
}
.balance-search-top {
        width: 100%;
        /* На телефоне поиск тянется на всю ширину */
    }
.ht-row {
        grid-template-columns: 30px 1fr 1.2fr 1.2fr 1fr;
        padding: 10px 5px;
        font-size: 10px;
        gap: 5px;
    }
.ht-head {
        font-size: 9px;
    }
.ht-col {
        word-break: break-word;
        line-height: 1.2;
    }
.ub-header {
        flex-direction: column;
        gap: 10px;
    }
.ub-balance-block {
        text-align: left;
    }
.ht-user {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.ht-user {
        display: inline-block;

        /* Ширина в символах. 8ch значит, что влезет примерно 8 букв, остальное скроется за ... */
        max-width: 8ch;

        /* Запрещаем тексту переноситься на новую строку */
        white-space: nowrap;

        /* Обрезаем всё, что не влезло */
        overflow: hidden;

        /* Добавляем троеточие в конце */
        text-overflow: ellipsis;

        /* Выравниваем, чтобы не прыгало относительно других элементов */
        vertical-align: middle;
    }

/* --- from css/block.css --- */
/* Поиск по сотрудникам */
.block-search {
    display: flex;
    align-items: center;
    background: #3B3B46;
    /* Темно-серый */
    border-radius: 40px;
    padding: 10px 20px;
    width: 280px;
}
.block-search input {
    background: transparent !important;
    border: none !important;
    color: #FFFFFF !important;
    outline: none !important;
    margin-left: 10px;
    width: 100%;
    font-size: 14px;
    box-shadow: none !important;
}
.block-search input::placeholder {
    color: #A0AAB5;
}
.block-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 20px -20px;
}
/* Таблицы */
.block-table-wrapper {
    background: #181820;
    /* Фон шапки таблицы (черный) */
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}
.block-table {
    display: flex;
    flex-direction: column;
}
.bt-row {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1fr 1fr;
    /* 4 колонки */
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: #23232B;
    /* Темный фон строк */
    color: #FFFFFF;
    font-size: 13px;
    gap: 15px;
}
.bt-row:last-child {
    border-bottom: none;
}
.bt-head {
    background: transparent;
    font-weight: 700;
    border-bottom: none;
    font-size: 13px;
}
.bt-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}
.bt-email {
    color: #E5E7EB;
}
/* Действия (кнопки) */
.bt-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}
.btn-restore,
.btn-block-action,
.btn-delete-action {
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 0;
    transition: 0.2s;
}
.btn-restore:hover,
.btn-block-action:hover {
    color: #FF0069;
}
.btn-delete-action:hover {
    color: #FF5A5F;
}
.block-search {
        width: 100%;
        /* Поиск на всю ширину */
    }
.bt-row {
        /* На мобилке колонки сжимаются как на макете 2 */
        grid-template-columns: 1fr 90px 1fr 120px;
        padding: 15px 10px;
        font-size: 10px;
        gap: 5px;
    }
.bt-head {
        font-size: 10px;
    }
.bt-user {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
.bt-user svg {
        display: block;
        /* Оставляем иконку, текст под ней */
    }
.bt-email {
        word-break: break-all;
        /* Перенос длинной почты */
    }
.bt-actions {

        gap: 5px;
    }
.btn-restore,
    .btn-block-action {
        font-size: 10px;
        flex-direction: column;
        gap: 4px;
    }
.bt-actions img {
        width: 14px;
        height: 14px;
    }
.bt-row {
        grid-template-columns: 0.5fr 0.5fr 50px 80px;
        font-size: 9px;
    }
.bt-head {
        font-size: 9px;
    }
.bt-email {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.bt-email {
        display: inline-block;

        /* Ширина в символах. 8ch значит, что влезет примерно 8 букв, остальное скроется за ... */
        max-width: 8ch;

        /* Запрещаем тексту переноситься на новую строку */
        white-space: nowrap;

        /* Обрезаем всё, что не влезло */
        overflow: hidden;

        /* Добавляем троеточие в конце */
        text-overflow: ellipsis;

        /* Выравниваем, чтобы не прыгало относительно других элементов */
        vertical-align: middle;
    }

/* --- from css/map.css --- */
* ========================
   УПРАВЛЕНИЕ КАРТОЙ ЗАДАНИЙ
   ======================== */

/* Шапка и легенда */
.map-page-header {
    text-align: center;
    margin-bottom: 30px;
}
.map-status-legend {
    font-size: 14px;
    color: #E5E7EB;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
/* Основная сетка: Карта + Сектора */
.map-tasks-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    padding: 0px 16px;
}
.am-planet-card {
    background: #3B3B46;
    border-radius: 8px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}
.am-planet-card img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}
.am-planet-card p {
    font-size: 13px;
    font-weight: 700;
    color: #FFF;
    line-height: 1.2;
}
.am-dots {
    display: flex;
    gap: 5px;
}
/* Правая панель (Задания по секторам) */
.am-tasks-panel {
    background: #3B3B46;
    border-radius: 12px;
    padding: 20px;
}
/* Карточка задания (универсальная) */
.am-task-card {
    background: #181820;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}
.am-task-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.am-task-actions button {
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: Inter;
    font-weight: 700;
    font-style: Bold;
    font-size: 15px;

}
.am-task-actions button:hover {
    color: #FFF;
}
.am-task-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: #FFF;
}
.am-tt-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}
.am-task-body {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.am-task-desc {
    font-size: 13px;
    color: #E5E7EB;
    margin-bottom: 10px;
}
.am-task-reward {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #FFF;
}
.am-task-reward img {
    width: 20px;
    height: 20px;
}
.am-deleted-grid .am-task-card {
    background: #3B3B46;
    /* Удаленные карточки серые */
    margin-bottom: 0;
}
.am-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
/* ЗАДАНИЯ НА ПРОВЕРКУ */
.am-review-panel {
    background: #23232D;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}
.am-review-title {
    font-size: 18px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 25px;
}
.am-review-card {
    background: #3B3B46;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
}
.am-rv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.am-rv-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #FFF;
    font-weight: 500;
}
.am-rv-body {
    margin-left: 26px;
    /* Отступ под стрелочкой */
}
.am-rv-desc {
    font-size: 14px;
    color: #FFF;
    margin-bottom: 10px;
}
.am-rv-reward {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 20px;
}
.am-rv-meta p {
    font-size: 13px;
    color: #E5E7EB;
    margin-bottom: 6px;
}
.am-rv-meta strong {
    color: #FFF;
}
.am-download-link {
    color: #E5E7EB;
    margin-left: 5px;
}
.am-rv-comment-box {
    margin-top: 20px;
}
.am-rv-comment-box label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 10px;
}
.am-rv-comment-box textarea {
    width: 100%;
    height: 60px;
    background: #A0AAB5;
    border: none;
    border-radius: 6px;
    padding: 12px;
    color: #111;
    font-family: 'Inter', sans-serif;
    resize: none;
    margin-bottom: 20px;
}
.am-rv-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}
.btn-accept {
    padding: 10px 25px;
    background: transparent;
    border: 1px solid #FFF;
    border-radius: 100px;
    color: #FFF;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.3s;
}
.btn-accept:hover {
    background: #FFF;
    color: #181820;
}
.btn-reject {
    background: none;
    border: none;
    color: #FFF;
    text-decoration: underline;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
}
.btn-reject:hover {
    color: #A0AAB5;
}
.am-rv-header {
    cursor: pointer;
    user-select: none;
    /* Чтобы текст не выделялся при быстром клике */
}
.am-rv-body {
    padding-top: 10px;
}
.map-tasks-container {
        grid-template-columns: 1fr;
        /* Одна колонка на мобилке */
        gap: 40px;
    }
.am-planet-card {
        padding: 15px 5px;
    }
.am-planet-card img {
        width: 45px;
        height: 45px;
    }
.am-planet-card p {
        font-size: 11px;
    }
.am-rv-body {
        margin-left: 0;
    }
.am-review-panel {
        padding: 20px 15px;
    }
.am-review-card {
        padding: 15px;
    }
.am-rv-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
.btn-accept {
        width: 100%;
    }
.am-planet-card {
        scroll-snap-align: start;
        padding: 15px 5px;

        /* МАГИЯ ЗДЕСЬ: заставляем карточку сжиматься, даже если контент внутри длинный */
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }
.am-planet-card img {
        width: 45px;
        height: 45px;
        /* Чтобы картинка тоже не распирала блок */
        max-width: 100%;
    }
.am-planet-card p {
        font-size: 11px;
        width: 100%;

        /* Заставляем длинный текст переноситься или ломаться на новые строки */
        white-space: normal;
        word-break: break-word;
        text-align: center;

        /* Если нужно ограничить по высоте, чтобы карточки были ровными */
        line-height: 1.2;
    }
/* ========================
   СБРОС ПАРОЛЯ В КАРТОЧКЕ ЮЗЕРА
   ======================== */
.ub-reset-section {
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.ub-reset-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}
.ub-reset-row .ub-input {
    flex: 1;
    width: auto;
}
.btn-reset-pass {
    background: #FF5A5F;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.btn-reset-pass:hover {
    background: #e04a4f;
}
