/**
 * Team Admin Menu — компактная панель управления командой на публичной странице.
 *
 * Панель стоит первой в сайдбаре, на десктопе закрепляется под навбаром,
 * пункты сгруппированы по смыслу: заявки/состав, набор, команда, опасная зона.
 */

.team-admin-card {
    border: 1px solid var(--border-light);
    border-radius: 14px;
    background: var(--bg-primary);
    box-shadow:
        0 1px 2px rgba(16, 24, 40, 0.05),
        0 12px 26px -22px rgba(16, 24, 40, 0.35);
}

.team-admin-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--border-light);
    border-radius: 14px 14px 0 0;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.team-admin-card__icon {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid color-mix(in srgb, var(--primary) 26%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    font-size: 0.92rem;
}

.team-admin-card__titles {
    min-width: 0;
}

.team-admin-card__title {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
}

.team-admin-card__subtitle {
    margin: 0.1rem 0 0;
    color: var(--text-muted);
    font-size: 0.66rem;
    line-height: 1.2;
}

.team-admin-menu {
    padding: 0.3rem 0.35rem 0.4rem;
}

.team-admin-menu__group + .team-admin-menu__group {
    margin-top: 0.1rem;
}

.team-admin-menu__label {
    padding: 0.35rem 0.5rem 0.15rem;
    color: var(--text-muted);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.team-admin-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
    padding: 0.38rem 0.45rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.team-admin-item + .team-admin-item {
    margin-top: 1px;
}

.team-admin-item:hover,
.team-admin-item:focus-visible {
    background: var(--bg-secondary);
    color: var(--primary);
    text-decoration: none;
}

.team-admin-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.team-admin-item__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--primary);
    font-size: 0.78rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.team-admin-item:hover .team-admin-item__icon {
    border-color: color-mix(in srgb, var(--primary) 32%, var(--border-light));
}

.team-admin-item__icon--success {
    border-color: color-mix(in srgb, var(--success) 30%, var(--border-light));
    background: color-mix(in srgb, var(--success) 12%, var(--bg-secondary));
    color: var(--success);
}

.team-admin-item__icon--warning {
    border-color: color-mix(in srgb, var(--warning) 32%, var(--border-light));
    background: color-mix(in srgb, var(--warning) 14%, var(--bg-secondary));
    color: var(--warning);
}

.team-admin-item__title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-admin-item__chevron {
    flex: 0 0 auto;
    margin-left: 2px;
    color: var(--text-muted);
    font-size: 0.58rem;
    transition: color 0.15s ease;
}

.team-admin-item:hover .team-admin-item__chevron {
    color: var(--primary);
}

.team-admin-item__badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
}

.team-admin-item__status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-muted) 14%, transparent);
    color: var(--text-secondary);
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.team-admin-item__status.is-open {
    background: color-mix(in srgb, var(--success) 14%, transparent);
    color: #1e8e3e;
}

[data-theme="dark"] .team-admin-item__status.is-open {
    color: #5ee06a;
}

.team-admin-item--danger {
    color: var(--danger);
}

.team-admin-item--danger .team-admin-item__icon {
    border-color: color-mix(in srgb, var(--danger) 26%, var(--border-light));
    background: color-mix(in srgb, var(--danger) 10%, var(--bg-secondary));
    color: var(--danger);
}

.team-admin-item--danger:hover,
.team-admin-item--danger:focus-visible {
    background: color-mix(in srgb, var(--danger) 8%, transparent);
    color: var(--danger);
}

.team-admin-menu__group--danger {
    margin-top: 0.35rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border-light);
}

.team-admin-menu__group--danger .team-admin-menu__label {
    color: color-mix(in srgb, var(--danger) 70%, var(--text-muted));
}

/* Светлая тема красит .card i.bi в серый — в панели иконки должны наследовать цвет плитки. */
[data-theme="light"] .team-admin-card i.bi,
[data-theme="light"] .team-admin-card i.fas {
    color: inherit;
}

@media (min-width: 992px) {
    .team-admin-card {
        position: sticky;
        top: 1rem;
        z-index: 2;
    }
}

@media (max-width: 575.98px) {
    .team-admin-card__head {
        padding: 0.65rem 0.7rem;
    }

    .team-admin-menu {
        padding: 0.25rem 0.3rem 0.35rem;
    }

    .team-admin-item {
        padding: 0.36rem 0.4rem;
        font-size: 0.76rem;
    }

    .team-admin-item__icon {
        width: 26px;
        height: 26px;
        font-size: 0.74rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .team-admin-item,
    .team-admin-item__icon,
    .team-admin-item__chevron {
        transition: none;
    }
}
