/**
 * team-community.css — страницы команд в стиле /blog: список /team/all (+ панель «Поиск»),
 * страница команды /team/<id>, участники /team/<id>/members, правка /team/<id>/edit,
 * статистика /team/<id>/stat.
 *
 * Подключается ПОСЛЕ team-redesign.css и переопределяет его только внутри обёрток
 * .tc (основная колонка) и .tc-side (правая панель «Поиск»). Свои переменные — с префиксом
 * --tc-*, т.к. team-redesign.css задаёт глобальные --primary/--muted/--border в :root.
 * Таблица участников и статистика — в team-community-pages.css (подключается на этих двух страницах).
 * Откат — убрать подключение файлов и классы tc / tc-side в views/team/*.php.
 */

html body .tc,
html body .tc-side {
    --tc-brand: var(--ui-accent, #9a4669);
    --tc-brand-strong: var(--ui-accent-strong, #7d3655);
    --tc-brand-hover: var(--ui-accent-hover, #833a59);
    --tc-soft: var(--ui-accent-soft, #f7edf2);
    --tc-soft-hover: var(--ui-accent-soft-hover, #f0dde7);
    --tc-line: var(--ui-accent-line, #ecd3df);
    --tc-on: #ffffff;
    --tc-card: #ffffff;
    --tc-card-line: #ececec;
    --tc-text: #2b2f33;
    --tc-body: #3d4751;
    --tc-muted: #6b7280;
    --tc-danger: #b3261e;
    --tc-danger-soft: #fdecea;
}
html body.dark-theme .tc,
html body.dark-theme .tc-side {
    --tc-brand: var(--ui-accent, #e9a6bc);
    --tc-brand-strong: var(--ui-accent-strong, #f0bfd0);
    --tc-brand-hover: var(--ui-accent-hover, #f3c6d5);
    --tc-soft: var(--ui-accent-soft, #362732);
    --tc-soft-hover: var(--ui-accent-soft-hover, #43303d);
    --tc-line: var(--ui-accent-line, #4a3442);
    --tc-on: var(--ui-accent-on, #241b23);
    --tc-card: var(--dark-bg-card, #2a2a2a);
    --tc-card-line: var(--dark-border-primary, #404040);
    --tc-text: var(--dark-text-primary, #e8e8e8);
    --tc-body: var(--dark-text-secondary, #b0b0b0);
    --tc-muted: var(--dark-text-muted, #888888);
    --tc-danger: #f2a49d;
    --tc-danger-soft: #3a2424;
}

/* ===== Общая колонка и заголовки ===== */
html body .tc {
    max-width: none;
    margin: 0;
    padding: 0;
    color: var(--tc-text);
}
html body .tc h1,
html body .tc .team-main-title {
    margin: 0 0 18px !important;
    padding: 0 0 10px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--tc-line) !important;
    color: var(--tc-text) !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}
html body .tc .team-header-section {
    margin: 0;
    padding: 0;
    border: 0;
}
html body .tc .team-section-title,
html body .tc .team-section-subtitle,
html body .tc .team-form-section-title {
    margin: 0 0 12px !important;
    color: var(--tc-text) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.3;
}
html body .tc .team-section-subtitle {
    margin-top: 18px !important;
    font-size: 15px !important;
}
html body .tc .team-section-title,
html body .tc .team-section-subtitle,
html body .tc .team-form-section-title,
html body .tc .team-title {
    padding: 0 !important;
    border: 0 !important;
}
html body .tc :is(.team-description, .team-profile, .team-alert, .team-table, .team-invites, .team-form-card, .for_table_container) a:not(.team-button):not(.btn) {
    color: var(--tc-brand) !important;
}
html body .tc :is(.team-description, .team-profile, .team-alert, .team-table, .team-invites, .team-form-card, .for_table_container) a:not(.team-button):not(.btn):hover {
    color: var(--tc-brand-hover) !important;
}

/* ===== Вкладки «переводы / участники / другие команды» — таблетки ===== */
html body .tc .team-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 16px !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
}
html body .tc .team-tabs .team-tab {
    padding: 6px 14px !important;
    border: 1px solid transparent !important;
    border-radius: 999px !important;
    background: var(--tc-soft) !important;
    color: var(--tc-brand-strong) !important;
    font-size: 13px !important;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none !important;
}
html body .tc .team-tabs .team-tab:hover {
    background: var(--tc-soft-hover) !important;
}
html body .tc .team-tabs .team-tab.active {
    background: var(--tc-brand) !important;
    border-color: var(--tc-brand) !important;
    color: var(--tc-on) !important;
}

/* ===== Кнопки ===== */
html body .tc .team-button,
html body .tc-side .team-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 14px !important;
    border: 1px solid var(--tc-brand) !important;
    border-radius: 8px !important;
    background: var(--tc-brand) !important;
    background-image: none !important;
    box-shadow: none !important;
    color: var(--tc-on) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.3;
    text-decoration: none !important;
    text-shadow: none !important;
    cursor: pointer;
    transform: none !important;
}
html body .tc .team-button:hover,
html body .tc-side .team-button:hover {
    background: var(--tc-brand-hover) !important;
    border-color: var(--tc-brand-hover) !important;
}
html body .tc .team-button-outline,
html body .tc-side .team-button-outline {
    border-color: var(--tc-line) !important;
    background: var(--tc-card) !important;
    color: var(--tc-brand-strong) !important;
}
html body .tc .team-button-outline:hover,
html body .tc-side .team-button-outline:hover {
    border-color: var(--tc-line) !important;
    background: var(--tc-soft) !important;
}
html body .tc .team-button-danger {
    border-color: var(--tc-danger) !important;
    background: var(--tc-card) !important;
    color: var(--tc-danger) !important;
}
html body .tc .team-button-danger:hover {
    border-color: var(--tc-danger) !important;
    background: var(--tc-danger-soft) !important;
}
html body .tc .team-button-sm {
    min-height: 26px;
    padding: 3px 10px !important;
    font-size: 12px !important;
}
html body .tc .team-button-icon,
html body .tc-side .team-button-icon {
    margin: 0 !important;
    font-size: 13px;
}
html body .tc .team-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 20px !important;
}
html body .tc .team-actions .team-button {
    margin: 0 !important;
}

/* ===== Карточки: команда в списке, профиль, форма, таблица ===== */
html body .tc .team-card,
html body .tc .team-profile,
html body .tc .team-form-card,
html body .tc .team-members-list,
html body .tc .team-invite-section,
html body .tc-side .team-sidebar-card {
    margin: 0 0 16px !important;
    border: 1px solid var(--tc-card-line) !important;
    border-radius: 10px !important;
    background: var(--tc-card) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03) !important;
    color: var(--tc-text) !important;
}
html body .tc .team-card {
    display: flex;
    gap: 14px;
    padding: 14px !important;
    overflow: hidden;
    transition: border-color .15s ease;
    transform: none !important;
}
html body .tc .team-card:hover {
    border-color: var(--tc-line) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03) !important;
    transform: none !important;
}

/* Список команд: картинка и лайки */
html body .tc .team-image-container {
    position: relative;
    flex: 0 0 auto;
    width: 110px !important;
    height: 110px !important;
    border-radius: 8px;
    overflow: hidden;
    background: var(--tc-soft);
}
html body .tc .team-image {
    width: 110px !important;
    height: 110px !important;
    background-size: cover;
    background-position: center;
}
html body .tc .team-likes {
    right: 6px !important;
    bottom: 6px !important;
    padding: 2px 8px !important;
    border-radius: 999px !important;
    background: rgba(0, 0, 0, .6) !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 600;
}
html body .tc .team-likes::before {
    content: "\2665\00a0";
}
html body .tc .team-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 !important;
}
html body .tc .team-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px !important;
}
html body .tc .team-title {
    margin: 0 !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 1.3;
}
html body .tc .team-title a {
    color: var(--tc-text) !important;
    text-decoration: none !important;
}
html body .tc .team-title a:hover {
    color: var(--tc-brand) !important;
}
html body .tc .team-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 !important;
    padding: 2px 10px !important;
    border: 1px solid var(--tc-line) !important;
    border-radius: 999px !important;
    background: var(--tc-soft) !important;
    color: var(--tc-brand-strong) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}
html body .tc .team-badge-icon {
    margin: 0 !important;
}
html body .tc .team-info {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0 0 8px !important;
    color: var(--tc-muted) !important;
    font-size: 13px !important;
}
html body .tc .team-info-icon {
    margin-right: 4px !important;
}
html body .tc .team-description,
html body .tc .team-profile-description {
    margin: 0 0 10px !important;
    color: var(--tc-body) !important;
    font-size: 14px !important;
    line-height: 1.55;
    overflow-wrap: anywhere;
}
html body .tc .team-description img,
html body .tc .team-profile-description img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Обложки переводов в карточке */
html body .tc .team-books {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 0 !important;
}
html body .tc .book-thumbnail {
    width: 50px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--tc-soft);
}
html body .tc .book-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
html body .tc .book-more {
    width: 50px;
    height: 70px;
    border: 1px solid var(--tc-line) !important;
    border-radius: 6px;
    background: var(--tc-soft) !important;
    color: var(--tc-brand-strong) !important;
    font-size: 13px !important;
    font-weight: 700;
    text-decoration: none !important;
}
html body .tc .book-more:hover {
    background: var(--tc-soft-hover) !important;
}

/* ===== Пагинация (TbPager) — как в /blog ===== */
html body .tc .team-pagination {
    display: flex;
    justify-content: center;
    margin: 0 0 16px !important;
}
html body .tc .team-pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    list-style: none;
}
html body .tc .team-pagination li {
    margin: 0 !important;
}
html body .tc .team-pagination li > a,
html body .tc .team-pagination li > span {
    min-width: 32px;
    height: 32px;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: var(--tc-soft) !important;
    color: var(--tc-brand-strong) !important;
    font-size: 13px !important;
    font-weight: 600;
    line-height: 32px;
}
html body .tc .team-pagination li > a:hover {
    background: var(--tc-soft-hover) !important;
}
html body .tc .team-pagination li.active > a,
html body .tc .team-pagination li.active > span {
    background: var(--tc-brand) !important;
    color: var(--tc-on) !important;
}
html body .tc .team-pagination li.disabled > a,
html body .tc .team-pagination li.disabled > span {
    opacity: .5;
    cursor: default;
}

/* Пагинация и переключатель вида в «Переводы команды» (BooksPaginationWidget) */
html body .tc .team-books-section .books-pagination ul {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: none !important;
}
html body .tc .team-books-section .books-pagination li > a,
html body .tc .team-books-section .books-pagination li > span {
    float: none;
    min-width: 32px;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: var(--tc-soft) !important;
    color: var(--tc-brand-strong) !important;
    font-weight: 600;
    line-height: 32px;
    text-align: center;
}
html body .tc .team-books-section .books-pagination li > a:hover {
    background: var(--tc-soft-hover) !important;
}
html body .tc .team-books-section .books-pagination li.active > a {
    background: var(--tc-brand) !important;
    color: var(--tc-on) !important;
}
html body .tc .team-books-section .books-pagination li.disabled > a {
    opacity: .5;
}
html body .tc .team-books-section .books-view-mode-switcher .btn {
    border: 1px solid var(--tc-line) !important;
    border-radius: 8px !important;
    background: var(--tc-card) !important;
    background-image: none !important;
    box-shadow: none !important;
}
html body .tc .team-books-section .books-view-mode-switcher .btn.btn-info {
    border-color: var(--tc-brand) !important;
    background: var(--tc-soft) !important;
}
html body .tc .team-books-section .books-view-mode-switcher .btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}
html body .tc .team-books-section .books-view-mode-switcher .btn [class*="icon-"] {
    width: 15px;
    height: 15px;
    color: var(--tc-muted);
}
html body .tc .team-books-section .books-view-mode-switcher .btn.btn-info [class*="icon-"] {
    color: var(--tc-brand);
}

/* ===== Страница команды: профиль, объявление, цифры ===== */
html body .tc .team-profile {
    padding: 16px !important;
}
html body .tc .team-profile-header {
    display: flex;
    gap: 16px;
    margin: 0 0 14px !important;
}
html body .tc .team-profile-image img {
    max-width: 180px;
    height: auto;
    border-radius: 8px !important;
    box-shadow: none !important;
}
html body .tc .team-profile-site {
    margin: 0 0 12px !important;
    color: var(--tc-body) !important;
    font-size: 13px !important;
    overflow-wrap: anywhere;
}
html body .tc .team-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px !important;
    padding: 12px 14px !important;
    border: 1px solid var(--tc-line) !important;
    border-radius: 10px !important;
    background: var(--tc-soft) !important;
    color: var(--tc-text) !important;
    font-size: 14px;
}
html body .tc .team-alert-icon {
    margin: 0 !important;
    font-size: 20px !important;
}
html body .tc .team-stats-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 !important;
}
html body .tc .team-stat-card {
    flex: 1 1 140px;
    min-width: 0 !important;
    padding: 10px 12px !important;
    border: 1px solid var(--tc-line) !important;
    border-radius: 10px !important;
    background: var(--tc-soft) !important;
    box-shadow: none !important;
}
html body .tc .team-stat-icon {
    margin-right: 10px !important;
    font-size: 20px !important;
}
/* контурные иконки UiIcon: в карточках — серые, как в шапке; в кнопках — цвет текста */
html body .tc .team-stat-icon,
html body .tc .team-alert-icon,
html body .tc .team-info-icon,
html body .tc .team-profile-site-icon {
    display: inline-flex;
    align-items: center;
    color: var(--tc-muted) !important;
}
html body .tc .team-button-icon,
html body .tc-side .team-button-icon,
html body .tc .team-badge-icon {
    display: inline-flex;
    align-items: center;
}
html body .tc .team-stat-value {
    color: var(--tc-brand-strong) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
}
html body .tc .team-stat-label {
    color: var(--tc-muted) !important;
    font-size: 12px !important;
}
html body .tc .team-books-section {
    margin: 0 !important;
}

/* ===== Формы: правка команды, приглашение, панель «Поиск» ===== */
html body .tc .team-form-card {
    padding: 18px !important;
}
html body .tc .team-form-section {
    margin: 0 0 18px !important;
    padding: 0 0 16px !important;
    border-bottom: 1px solid var(--tc-card-line) !important;
}
html body .tc .team-form-section:last-of-type {
    border-bottom: 0 !important;
}
html body .tc .team-form-label,
html body .tc-side .team-form-label {
    display: block;
    float: none !important;
    width: auto !important;
    margin: 0 0 6px !important;
    color: var(--tc-text) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-align: left !important;
}
html body .tc .team-form-card .control-group {
    margin: 0 !important;
}
html body .tc .team-form-card .control-label {
    float: none !important;
    width: auto !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
    color: var(--tc-text) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-align: left !important;
}
html body .tc .team-form-card .controls {
    margin-left: 0 !important;
}
html body .tc .team-form-input,
html body .tc-side .team-form-input,
html body .tc-side .team-select {
    box-sizing: border-box;
    width: 100% !important;
    min-height: 36px;
    height: auto !important;
    margin: 0 !important;
    padding: 6px 10px !important;
    border: 1px solid var(--tc-card-line) !important;
    border-radius: 8px !important;
    background-color: var(--tc-card) !important;
    box-shadow: none !important;
    color: var(--tc-text) !important;
    font-size: 14px !important;
}
html body .tc-side .team-select {
    padding-right: 30px !important;
}
html body .tc .team-form-input:focus,
html body .tc-side .team-form-input:focus {
    border-color: var(--tc-brand) !important;
    outline: none;
    box-shadow: 0 0 0 3px var(--tc-soft) !important;
}
html body .tc .team-form-help {
    margin: 6px 0 0 !important;
    color: var(--tc-muted) !important;
    font-size: 12px !important;
}
html body .tc .team-form-checkbox-label,
html body .tc-side .team-form-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    color: var(--tc-text) !important;
    font-size: 14px !important;
    cursor: pointer;
}
html body .tc .team-form-checkbox-label input,
html body .tc-side .team-form-checkbox-label input {
    margin: 0 !important;
    accent-color: var(--tc-brand);
}
html body .tc .team-form-errors {
    margin: 0 0 16px !important;
    padding: 12px 14px !important;
    border: 1px solid var(--tc-danger) !important;
    border-radius: 10px !important;
    background: var(--tc-danger-soft) !important;
    color: var(--tc-danger) !important;
}
html body .tc .team-form-image-preview img {
    max-width: 180px;
    border-radius: 8px;
}
html body .tc .team-form-actions,
html body .tc-side .team-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0 !important;
}

/* Правая панель «Поиск» на /team/all — как панель рубрик блога */
html body .tc-side {
    margin: 0 0 20px;
}
html body .tc-side .team-sidebar-card {
    padding: 14px 16px !important;
}
html body .tc-side .team-sidebar-title {
    margin: 0 0 12px !important;
    padding: 0 0 8px !important;
    border-bottom: 1px solid var(--tc-line) !important;
    color: var(--tc-text) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.3;
}
html body .tc-side .team-form-group {
    margin: 0 0 12px !important;
}
html body .tc-side .team-form-actions .team-button {
    flex: 1 1 0;
}

@media (max-width: 768px) {
    html body .tc .team-card {
        flex-direction: column;
    }
    html body .tc .team-image-container,
    html body .tc .team-image {
        width: 100% !important;
        height: 150px !important;
    }
    html body .tc .team-profile-header {
        flex-direction: column;
    }
    html body .tc .team-profile-image img {
        max-width: 100%;
    }
}
