/* ============================================
   ЦМВС (CIIC) — стили по брендбуку
   Источник: ciic-brandbook.pdf (Руководство по использованию
   фирменного стиля, 13.09.2022)
   Шрифт: Futura Futuris (Light, Regular, Bold) → веб: Jost
   Наклонные начертания не используются (по брендбуку).
   ============================================ */

/* CSS переменные — базовая палитра ЦМВС (Apple-like) */
:root {
    /* Базовая палитра из брендбука ЦМВС */
    --ciic-color-gray: #BBBBBC;         /* основной серый */
    --ciic-color-blue: #3C40C6;         /* акцентный синий */
    --ciic-color-red: #FF3F34;          /* акцентный красный */
    --ciic-color-white: #FFFFFF;        /* базовый белый */
    --ciic-color-text: #1A1A1A;         /* основной текст */

    /* Семантические токены (для совместимости с существующей версткой) */
    --primary-color: var(--ciic-color-blue);
    --secondary-color: var(--ciic-color-gray);
    --accent-deep: #111111;
    --accent-sand: #F5F5F7;            /* светлый фон в духе Apple */
    --accent-olive: #2D3748;

    /* Состояния */
    --primary-hover: #3235a6;          /* ~10% темнее синего */
    --secondary-hover: rgba(187, 187, 188, 0.16);
    
    /* Текст и фон */
    --text-primary: var(--ciic-color-text);
    --text-secondary: rgba(26, 26, 26, 0.7);
    --text-light: rgba(26, 26, 26, 0.5);
    --bg-main: #F2F2F7;
    --bg-white: var(--ciic-color-white);
    --border-color: rgba(187, 187, 188, 0.5);
    --bg-light: rgba(187, 187, 188, 0.08);
    
    /* Нейтральные */
    --accent-gray: rgba(187, 187, 188, 0.3);
    --accent-dark-gray: #666666;
    
    /* Тени и радиусы */
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.08);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Типографика */
    --font-weight-regular: 400;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --heading-tracking: -0.02em;

    /* Отступы */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
}

/* ============================================
   Базовые стили
   ============================================ */

body {
    /* ciic-brandbook.pdf: Futura Futuris → веб Jost (Light, Regular, Bold); наклонные не используются */
    font-family: 'Jost', 'Futura', 'Century Gothic', -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
    font-style: normal;
    background-color: var(--bg-main);
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Типографика - Apple-style иерархия */
h1, .h1 {
    font-size: 32px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.2;
    letter-spacing: var(--heading-tracking);
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

h2, .h2 {
    font-size: 28px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
    letter-spacing: var(--heading-tracking);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

h3, .h3 {
    font-size: 22px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.4;
    letter-spacing: var(--heading-tracking);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

h4, .h4 {
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.4;
    letter-spacing: var(--heading-tracking);
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

h5, .h5 {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.5;
    letter-spacing: var(--heading-tracking);
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

p {
    font-size: 15px;
    font-weight: var(--font-weight-regular);
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

small, .small,
.text-caption {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ============================================
   Общие стили ссылок (по брендбуку ЦМВС — синие, без подчёркивания)
   ============================================ */

/* Ссылки в таблицах и списках — синие без подчёркивания */
.rating-table a,
.participants-table a,
.projects-list a,
.event-link {
    color: var(--primary-color) !important;
    text-decoration: none !important;
    font-weight: 500;
    transition: color 0.2s ease;
}

.rating-table a:hover,
.participants-table a:hover,
.projects-list a:hover,
.event-link:hover {
    color: var(--primary-hover) !important;
    text-decoration: none !important;
}

/* Ссылки на профили участников */
a[href*="participant_detail"],
a[href*="project_detail"] {
    color: var(--primary-color) !important;
    text-decoration: none !important;
    font-weight: 500;
}

a[href*="participant_detail"]:hover,
a[href*="project_detail"]:hover {
    color: var(--primary-hover) !important;
    text-decoration: none !important;
}

/* ============================================
   Верхняя панель
   ============================================ */

.top-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.top-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    gap: var(--spacing-md);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.top-bar-menu-user-col {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
}

.top-bar-user-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-shrink: 0;
}

.top-bar-logo-img {
    height: 32px;
    width: auto;
}

.top-bar-title {
    font-weight: 600;
    font-size: 18px;
    color: var(--ciic-color-blue);
    text-decoration: none;
    transition: color 0.2s;
}

.top-bar-title:hover {
    color: var(--primary-color);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.points-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    text-decoration: none;
    color: var(--text-primary);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 8px;
    transition: all 0.2s;
}

.points-link:hover {
    background: var(--bg-light);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.trophy-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 22px;
}

.trophy-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.user-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 15px;
}

.points-badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 16px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(27, 54, 93, 0.25);
}

/* ============================================
   Основной контент
   ============================================ */

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-lg);
}

/* ============================================
   Гамбургер-кнопка
   ============================================ */

.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    margin-right: var(--spacing-md);
}

.hamburger-btn span {
    width: 100%;
    height: 3px;
    background: var(--secondary-color);
    border-radius: 3px;
    transition: all 0.3s;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

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

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* ============================================
   Оверлей для мобильного меню
   ============================================ */

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* ============================================
   Боковое меню
   ============================================ */

.sidebar {
    width: 220px;
    flex-shrink: 0;
}

.sidebar-menu {
    background: var(--bg-white);
    border-radius: 12px;
    padding: var(--spacing-sm) 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 80px;
}

.sidebar-menu-item {
    padding: var(--spacing-md) var(--spacing-lg);
    display: block;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 15px;
}

.sidebar-menu-item:hover {
    background: rgba(60, 64, 198, 0.04);
    color: var(--ciic-color-blue);
    border-left-color: var(--ciic-color-blue);
    padding-left: calc(var(--spacing-lg) - 3px);
}

.sidebar-menu-item.active {
    background: rgba(60, 64, 198, 0.06);
    border-left-color: var(--ciic-color-blue);
    font-weight: var(--font-weight-semibold);
    color: var(--ciic-color-blue);
}

/* ============================================
   Контент
   ============================================ */

.content-area {
    flex: 1;
    min-width: 0;
}

.card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-subtle);
    margin-bottom: var(--spacing-xl);
    border: none;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.card-header {
    background: var(--bg-white);
    border-bottom: 1px solid rgba(187, 187, 188, 0.3);
    padding: var(--spacing-xl);
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Заголовки блоков в карточках просмотра — в два раза меньше по высоте */
.card-header.card-header-compact {
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-md);
}

.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5 {
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
    font-size: 18px;
    margin: 0;
    letter-spacing: -0.2px;
    width: 100%;
}

.card-header h2 {
    font-size: 24px;
}

.card-header h3 {
    font-size: 20px;
}

.card-header h4 {
    font-size: 18px;
}

/* Центрирование заголовков в карточках */
.card-header.text-center h2,
.card-header.text-center h3,
.card-header.text-center h4,
.card-header.text-center h5,
.card-header h5.text-center {
    text-align: center;
}

/* Для вложенных карточек (например, в about.html) */
.card .card-header {
    justify-content: center;
}

.card .card-header h5.text-center {
    text-align: center;
    width: 100%;
}

.card-body {
    padding: var(--spacing-xl);
}

/* Кнопки — единый компонент в духе Apple */
.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 15px;
    padding: 10px 20px;
    letter-spacing: 0;
    border-width: 1px;
    border-style: solid;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 14px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* Primary */
.btn-primary {
    background-color: var(--ciic-color-blue);
    border-color: var(--ciic-color-blue);
    color: #FFFFFF;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #FFFFFF;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Secondary */
.btn-secondary,
.btn-outline-secondary {
    background-color: transparent;
    border-color: var(--ciic-color-gray);
    color: var(--ciic-color-text);
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
    background-color: rgba(187, 187, 188, 0.1);
    border-color: var(--ciic-color-gray);
    color: var(--ciic-color-text);
}

/* Outline Primary */
.btn-outline-primary {
    background-color: transparent;
    border: 1px solid var(--ciic-color-blue);
    color: var(--ciic-color-blue);
}

.btn-outline-primary:hover {
    background-color: rgba(60, 64, 198, 0.08);
    border-color: var(--ciic-color-blue);
    color: var(--ciic-color-blue);
}

.btn-outline-success {
    background-color: transparent;
    border: 1px solid var(--ciic-color-blue);
    color: var(--ciic-color-blue);
}

.btn-outline-success:hover {
    background-color: rgba(60, 64, 198, 0.08);
    border-color: var(--ciic-color-blue);
    color: var(--ciic-color-blue);
}

/* Danger */
.btn-danger {
    background-color: var(--ciic-color-red);
    border-color: var(--ciic-color-red);
    color: #FFFFFF;
}

.btn-danger:hover {
    background-color: #e0382f;
    border-color: #e0382f;
    color: #FFFFFF;
}

.btn-outline-danger {
    background-color: transparent;
    border-color: var(--ciic-color-red);
    color: var(--ciic-color-red);
}

.btn-outline-danger:hover {
    background-color: rgba(255, 63, 52, 0.08);
    color: var(--ciic-color-red);
}

/* Tertiary / Icon */
.btn-tertiary,
.btn-icon,
.btn-link.footer-link,
.datagrid-filter-btn {
    background-color: rgba(187, 187, 188, 0.15);
    border-color: transparent;
    color: var(--ciic-color-text);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.btn-tertiary:hover,
.btn-icon:hover,
.datagrid-filter-btn:hover {
    background-color: rgba(187, 187, 188, 0.25);
}

.btn-link {
    border-color: transparent;
    background: transparent;
    color: var(--ciic-color-blue);
    padding-left: 0;
    padding-right: 0;
}

.btn-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Кнопки-иконки по всему порталу: только иконка, круглая рамка */
.btn-icon-only {
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;
    min-height: 2rem !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    flex-shrink: 0;
    aspect-ratio: 1;
    box-sizing: border-box;
}
.btn-icon-only i {
    font-size: 1.1rem;
}
.btn-icon-only.dropdown-toggle::after {
    display: none;
}

/* ============================================
   Профиль
   ============================================ */

/* Первая строка: Общая информация растягивается, фото справа */
.participant-detail-top-row {
    display: flex;
    gap: var(--spacing-lg);
    align-items: stretch;
    margin-top: 0;
}

.participant-general-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.participant-general-info h5 {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.participant-general-info .table {
    flex: 1;
    display: table;
}

.participant-photo-top-right {
    flex-shrink: 0;
    margin-left: var(--spacing-lg);
    display: flex;
    align-items: flex-start;
    align-self: flex-start;
}

.participant-photo-img {
    width: auto;
    max-width: 250px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: block;
}


/* Раздел с именем - отделение отступом и чертой */
.participant-name-section,
.profile-name-section {
    padding-bottom: var(--spacing-md);
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
}

/* Выравнивание высоты блоков в первой строке */
.participant-detail-row {
    display: flex;
    align-items: stretch;
}

.participant-detail-row > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.participant-detail-row > [class*="col-"] > h5 {
    margin-top: 0;
}

.participant-detail-row > [class*="col-"] .table {
    flex-grow: 1;
}

/* Выравнивание высоты строк в таблицах */
.participant-detail-row .table tr,
.row .table tr {
    height: auto;
}

/* Выравнивание высоты строк между блоками "Общая информация" и "Образование" */
.participant-general-info .table tr,
.row .col-md-6:first-child .table tr {
    min-height: 40px;
}

.participant-general-info .table th,
.participant-general-info .table td {
    padding-top: 10px;
    padding-bottom: 10px;
    vertical-align: middle;
}

/* Выравнивание высоты строк в блоке "Образование" */
.row .col-md-6:first-child .table th,
.row .col-md-6:first-child .table td {
    padding-top: 10px;
    padding-bottom: 10px;
    vertical-align: middle;
}

.participant-detail-row .table th,
.row .table th {
    padding-top: 8px;
    padding-bottom: 8px;
    vertical-align: middle;
}

.participant-detail-row .table td,
.row .table td {
    padding-top: 8px;
    padding-bottom: 8px;
    vertical-align: middle;
}

.participant-name,
.profile-name {
    white-space: nowrap;
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
}

/* Адаптивность для фото в карточке участника */
@media (max-width: 768px) {
    .participant-detail-top-row {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .participant-photo-top-right {
        margin-left: 0;
        align-self: center;
    }
    
    .participant-photo-img {
        max-width: 150px;
        max-height: 150px;
    }
}

.profile-header {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.profile-photo {
    float: left;
    margin-right: 20px;
    margin-bottom: 10px;
}

.profile-photo img {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    object-fit: cover;
}

.profile-info {
    overflow: hidden;
}

.profile-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.profile-details {
    color: var(--text-secondary);
    line-height: 1.8;
}

.profile-details table {
    width: 100%;
}

.profile-details th {
    width: 150px;
    font-weight: 500;
    color: var(--text-secondary);
    vertical-align: top;
}

.profile-details td {
    color: #000;
}

/* ============================================
   Рейтинг
   ============================================ */

.rating-table a {
    color: var(--primary-color) !important;
    text-decoration: none !important;
    font-weight: 500;
    transition: color 0.2s ease;
}

.rating-table a:hover {
    color: var(--primary-hover) !important;
    text-decoration: none !important;
}

/* Медали для топ-3 */
.medal-gold {
    color: gold;
    font-size: 1.5em;
}

.medal-silver {
    color: silver;
    font-size: 1.5em;
}

.medal-bronze {
    color: #cd7f32;
    font-size: 1.5em;
}

/* ============================================
   Календарь (FullCalendar)
   ============================================ */

#calendar {
    max-width: 100%;
    margin: 20px auto;
}

.calendar-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.calendar-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-bottom: none;
}

.calendar-header h3 {
    color: white;
    font-weight: 500;
}

.calendar-body {
    background: white;
}

/* Стили брендбука для календаря */
.fc {
    font-family: 'Jost', 'Futura', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.fc-header-toolbar {
    margin-bottom: 1.5em;
}

.fc-button-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.fc-button-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.fc-button-primary:disabled {
    background-color: var(--accent-gray, #E1E3E6) !important;
    border-color: var(--accent-gray, #E1E3E6) !important;
    color: var(--text-secondary, #666666) !important;
}

.fc-button-active {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.fc-today-button {
    display: none !important;
}

.fc-event {
    cursor: pointer;
    border: none;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 0.85em;
    white-space: normal !important;
    word-wrap: break-word;
    line-height: 1.4;
    margin: 2px 0;
    background-color: rgba(27, 54, 93, 0.1) !important;
    color: var(--text-primary) !important;
    border: 1.5px solid rgba(27, 54, 93, 0.25) !important;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    text-align: center !important;
}

.fc-event:hover {
    background-color: rgba(27, 54, 93, 0.18) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.12);
    border-color: rgba(27, 54, 93, 0.4) !important;
}

.fc-event *,
.fc-event-title,
.fc-event-title-container {
    color: var(--text-primary) !important;
}

.fc-event-title {
    white-space: normal !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: var(--text-primary) !important;
    text-align: center !important;
    font-weight: 600;
    font-size: 0.9em;
}

.fc-event-registered {
    background-color: rgba(27, 54, 93, 0.15) !important;
    color: var(--text-primary) !important;
    border-left: 3px solid var(--primary-color) !important;
    font-weight: 600;
}

.fc-event-registered *,
.fc-event-registered .fc-event-title {
    color: var(--text-primary) !important;
}

.fc-event-registered:hover {
    background-color: rgba(27, 54, 93, 0.22) !important;
    border-left-width: 4px !important;
    color: var(--text-primary) !important;
}

.fc-daygrid-day {
    background-color: var(--bg-white, #ffffff);
}

.fc-daygrid-day:hover {
    background-color: var(--bg-light, #fafafa);
}

.fc-col-header-cell {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
}

.fc-day-today {
    background-color: rgba(27, 54, 93, 0.06) !important;
}

.fc-daygrid-day-number {
    color: var(--text-primary, #1a1a1a) !important;
    text-decoration: none !important;
    font-weight: 400;
}

.fc-daygrid-day-number:hover {
    color: var(--text-primary, #1a1a1a) !important;
    text-decoration: none !important;
}

.fc-daygrid-day a {
    color: var(--text-primary, #1a1a1a) !important;
    text-decoration: none !important;
}

.fc-daygrid-day a:hover {
    color: var(--text-primary, #1a1a1a) !important;
    text-decoration: none !important;
}

.fc-daygrid-day-top {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.fc-daygrid-day-number {
    padding: 4px;
    text-align: left;
}

.fc-col-header-cell {
    background-color: var(--primary-color) !important;
    color: white !important;
    font-weight: 500;
}

.fc-col-header-cell a {
    color: white !important;
    text-decoration: none !important;
}

.fc-col-header-cell a:hover {
    color: white !important;
    text-decoration: none !important;
}

/* Плавные переходы для всех элементов календаря */
.fc-daygrid-day,
.fc-event,
.fc-button {
    transition: all 0.2s ease;
}

/* ============================================
   Список мероприятий
   ============================================ */

.events-list-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.events-list-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-bottom: none;
}

.events-list-header h4 {
    color: white;
    font-weight: 500;
}

.event-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    background: white;
}

.event-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.event-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.event-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.event-date {
    color: var(--text-secondary, #666);
    font-weight: 500;
    white-space: nowrap;
}

.event-description {
    color: var(--text-primary, #333);
    line-height: 1.5;
}

.event-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.event-location {
    color: var(--text-secondary, #666);
}

/* ============================================
   Проекты
   ============================================ */

.projects-list a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.projects-list a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

/* ============================================
   Адаптивность для мобильных устройств
   ============================================ */

@media (max-width: 992px) {
    .hamburger-btn {
        display: flex;
    }
    
    .top-bar-menu-user-col {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        order: 1;
    }
    
    .top-bar-menu-user-col .points-link {
        padding-left: 0;
    }
    
    .top-bar-title {
        order: 2;
    }
    
    .main-container {
        flex-direction: column;
        padding: var(--spacing-md);
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        background: var(--bg-white);
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
        overflow-y: auto;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar-menu {
        position: static;
        display: block;
        padding: var(--spacing-lg) 0;
        box-shadow: none;
        border-radius: 0;
        height: 100%;
    }
    
    .sidebar-menu-item {
        padding: var(--spacing-md) var(--spacing-lg);
        border-left: 3px solid transparent;
        border-bottom: none;
        border-radius: 0;
    }
    
    .sidebar-menu-item:hover,
    .sidebar-menu-item.active {
        border-left-color: var(--secondary-color);
        border-bottom: none;
        padding-left: var(--spacing-lg);
    }
}

@media (max-width: 768px) {
    .top-bar-content {
        padding: 0 var(--spacing-md);
        flex-wrap: wrap;
    }
    
    .top-bar-right {
        width: 100%;
        justify-content: flex-end;
        margin-top: var(--spacing-sm);
    }
    
    .main-container {
        padding: var(--spacing-md);
    }
    
    .content-area {
        overflow-x: hidden;
        max-width: 100%;
    }
    
    .card-header,
    .card-body {
        padding: var(--spacing-md);
    }
    
    .profile-photo {
        float: none;
        text-align: center;
        margin-right: 0;
        margin-bottom: var(--spacing-lg);
    }
    
    /* Календарь на мобильных */
    #calendar {
        margin: 10px auto;
    }
    
    .fc-header-toolbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1em;
        padding: 10px 0;
    }
    
    .fc-toolbar-chunk {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .fc-toolbar-title {
        font-size: 1.1em !important;
        font-weight: 500;
        margin: 0;
    }
    
    .fc-button {
        font-size: 0.9em;
        padding: 8px 12px;
        border-radius: 8px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        transition: all 0.2s ease;
    }
    
    .fc-button:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    }
    
    .fc-button:active {
        transform: translateY(0);
    }
    
    .fc-prev-button, .fc-next-button {
        font-size: 1.2em;
        padding: 10px 14px;
    }
    
    .fc-daygrid-day {
        min-height: 60px;
        padding: 4px;
    }
    
    .fc-daygrid-day-number {
        font-size: 0.95em;
        font-weight: 500;
        padding: 6px 8px;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 4px;
    }
    
    .fc-day-today .fc-daygrid-day-number {
        background-color: var(--primary-color) !important;
        color: white !important;
        font-weight: 600;
    }
    
    .fc-day-today {
        background-color: rgba(27, 54, 93, 0.08) !important;
    }
    
    .fc-daygrid-event {
        margin: 2px 0;
        border-radius: 3px;
    }
    
    .fc-event {
        font-size: 0.7em;
        padding: 3px 6px;
        margin: 1px 0;
        border-radius: 4px;
        line-height: 1.3;
        min-height: 18px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .fc-daygrid-day-events {
        margin-top: 4px;
    }
    
    .fc-col-header-cell {
        font-size: 0.8em;
        padding: 10px 4px;
        font-weight: 500;
    }
    
    .fc-daygrid-day-frame {
        padding: 2px;
    }
    
    .fc-scrollgrid {
        border: none;
    }
    
    .fc-scrollgrid-section > table {
        border-collapse: separate;
        border-spacing: 2px;
    }
    
    .card {
        margin: 0 -15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .card-header {
        padding: 15px;
        background: white;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .card-body {
        padding: 10px;
    }
    
    /* Список мероприятий на мобильных */
    .events-list-card {
        margin: 0 -15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .events-list-header {
        padding: 12px 15px;
    }
    
    .events-list-header h4 {
        font-size: 1.1em;
    }
    
    .events-list-body {
        padding: 10px;
    }
    
    .event-item {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .event-title {
        font-size: 1em;
        line-height: 1.4;
    }
    
    .event-date {
        font-size: 0.85em;
        margin-top: 4px;
    }
    
    .event-description {
        font-size: 0.9em;
    }
    
    .event-meta {
        font-size: 0.85em;
    }
    
    .d-flex.w-100.justify-content-between {
        flex-direction: column;
    }
    
    .event-date {
        align-self: flex-start;
        margin-top: 8px;
    }
}

@media (max-width: 576px) {
    .top-bar-title {
        font-size: 16px;
    }
    
    .user-name {
        font-size: 14px;
    }
    
    .points-badge {
        font-size: 12px;
        padding: 2px var(--spacing-sm);
    }
    
    /* Календарь на очень маленьких экранах */
    .fc-header-toolbar {
        padding: 8px 0;
    }
    
    .fc-toolbar-title {
        font-size: 1em !important;
    }
    
    .fc-button {
        font-size: 0.85em;
        padding: 8px 10px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .fc-prev-button, .fc-next-button {
        font-size: 1.1em;
        padding: 8px 12px;
    }
    
    .fc-daygrid-day {
        min-height: 50px;
    }
    
    .fc-daygrid-day-number {
        font-size: 0.85em;
        width: 28px;
        height: 28px;
        padding: 4px;
    }
    
    .fc-event {
        font-size: 0.65em;
        padding: 2px 4px;
        min-height: 16px;
    }
    
    .fc-col-header-cell {
        font-size: 0.75em;
        padding: 8px 2px;
    }
    
    .fc-daygrid-day-frame {
        padding: 1px;
    }
    
    .fc-daygrid-day-top {
        padding: 2px;
    }
    
    /* Список мероприятий на очень маленьких экранах */
    .event-item {
        padding: 10px;
    }
    
    .event-title {
        font-size: 0.95em;
    }
    
    .event-description {
        font-size: 0.85em;
    }
}

/* ============================================
   Футер
   ============================================ */

.site-footer {
    background-color: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-xl) var(--spacing-lg);
    margin-top: var(--spacing-xxl);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.footer-links .footer-link {
    line-height: 1.5;
    padding: 0.375rem 0.75rem;
    box-sizing: border-box;
}

.footer-link {
    color: var(--ciic-color-blue);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

.footer-links a.footer-link {
    display: inline-flex;
    align-items: center;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}

/* Улучшенное выделение при наведении на мобильных */
@media (hover: hover) and (pointer: fine) {
    .fc-daygrid-day:hover {
        background-color: rgba(27, 54, 93, 0.05) !important;
    }
    
    .fc-event:hover {
        transform: scale(1.02);
        box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    }
}

/* ============================================
   Подсказки о баллах
   ============================================ */

.points-hint {
    display: block;
    margin-top: 4px;
    margin-bottom: 8px;
    color: var(--primary-color) !important;
    font-size: 0.875rem;
    font-weight: 500;
}

.points-hint i {
    color: var(--primary-color);
    margin-right: 4px;
}

.profile-right .points-hint {
    text-align: center;
    margin-top: 8px;
}

/* ============================================
   Профиль - современный стиль
   ============================================ */

.profile-container {
    background: var(--bg-white);
    border-radius: 16px;
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}

.profile-name-section {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.profile-name {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin: 0;
}

.profile-layout {
    display: flex;
    gap: var(--spacing-xl);
    margin-bottom: calc(var(--spacing-xl) / 2);
    align-items: flex-start;
}

.info-section {
    margin-bottom: calc(var(--spacing-xl) / 2);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.2px;
}

.profile-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.profile-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: left;
    padding: 12px 16px 12px 0;
    vertical-align: top;
    width: 180px;
}

.profile-table td {
    padding: 12px 0;
    color: var(--text-primary);
    font-size: 15px;
    vertical-align: top;
}

.profile-table tr {
    border-bottom: 1px solid var(--border-color);
}

.profile-table tr:last-child {
    border-bottom: none;
}

.profile-additional {
    margin-top: calc(var(--spacing-xl) / 2);
}

.profile-contacts {
    margin-top: calc(var(--spacing-xl) / 2);
}

/* Контакты и социальные сети - две колонки */
.contacts-layout {
    display: flex;
    gap: var(--spacing-lg);
    align-items: flex-start; /* Выравнивание по верхнему краю */
}

.contacts-layout .contacts-fields-col .contacts-section-title,
.contacts-fields-col .contacts-visibility-title {
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
}

.contacts-fields-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.contacts-section-title {
    margin-bottom: var(--spacing-md);
    margin-top: 0;
    padding-top: 0;
}

.contacts-visibility-col {
    flex: 0 0 220px;
    min-width: 200px;
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start; /* Выравнивание по верхнему краю */
}

.contacts-visibility-col.field-edit {
    display: flex !important;
}

.contacts-visibility-title {
    text-align: left;
    width: 100%;
    margin-bottom: var(--spacing-md);
    margin-top: 0;
    padding-top: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    align-self: flex-start;
}

.contacts-table {
    margin-bottom: 0;
}

.contact-edit-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.contact-edit-cell .form-control,
.contact-edit-cell .d-flex {
    flex: 1;
    min-width: 0;
}

.contact-visibility-inline {
    flex-shrink: 0;
}

.contact-visibility-inline .form-check-label {
    display: none;
}

.contact-row {
    min-height: 48px;
}

.contact-row th,
.contact-row td {
    vertical-align: middle;
    padding: 12px 0;
}

.contact-visibility-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 0;
    align-items: center; /* Центрируем чекбоксы относительно заголовка */
}

.contact-checkbox-row {
    min-height: 48px; /* Такая же минимальная высота, как у строк таблицы */
    display: flex;
    align-items: center;
    justify-content: center; /* Центрируем чекбоксы по горизонтали */
    margin-bottom: 0;
    padding: 12px 0;
    width: 100%;
}

.contact-checkbox-row .form-check-input {
    margin-top: 0;
    margin-right: 0;
    cursor: pointer;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 2.5px solid var(--primary-color) !important;
    border-radius: 4px;
}

.contact-checkbox-row .form-check-input:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.contact-checkbox-row .form-check-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(27, 54, 93, 0.2) !important;
}

.contact-checkbox-row .form-check-label {
    display: none; /* Скрываем текст, оставляем только чекбокс */
}

/* Стили для чекбоксов в профиле (работа и другие) */
.profile-table .form-check-input,
.profile-container .form-check-input {
    border: 2.5px solid var(--primary-color) !important;
    border-radius: 4px;
    cursor: pointer;
}

.profile-table .form-check-input:checked,
.profile-container .form-check-input:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.profile-table .form-check-input:focus,
.profile-container .form-check-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(27, 54, 93, 0.2) !important;
}

.preferred-contact-method {
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-md);
}

.preferred-contact-method .form-check {
    margin-bottom: var(--spacing-xs);
}

@media (max-width: 768px) {
    .contacts-fields-col .contacts-visibility-title {
        font-size: 12px;
    }
    
    .contact-row {
        height: auto;
    }
}

.additional-fields {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.additional-fields strong {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 15px;
}

.additional-fields .field-view {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    display: block;
    margin-top: var(--spacing-xs);
}

.points-badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(27, 54, 93, 0.2);
}

/* ============================================
   Формы - Apple-style floating labels
   ============================================ */

.form-control, .form-select {
    border: 1px solid var(--ciic-color-gray);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 15px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--bg-white);
    color: var(--text-primary);
    font-family: 'Jost', 'Futura', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.form-control:focus, .form-select:focus {
    border-color: var(--ciic-color-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(60, 64, 198, 0.1);
}

.form-control::placeholder {
    color: var(--text-light);
    opacity: 0.6;
}

/* Чекбоксы и радио — синий #3C40C6 для checked */
.form-check-input {
    border: 1.5px solid var(--ciic-color-gray);
    border-radius: 4px;
}

.form-check-input:checked {
    background-color: var(--ciic-color-blue);
    border-color: var(--ciic-color-blue);
}

.form-check-input:focus {
    border-color: var(--ciic-color-blue);
    box-shadow: 0 0 0 0.2rem rgba(60, 64, 198, 0.15);
}

.form-check-input:focus-visible {
    outline: 2px solid var(--ciic-color-blue);
    outline-offset: 2px;
}

/* ============================================
   Таблицы - современный стиль
   ============================================ */

/* Таблицы — Apple-like, без тяжёлых теней */
.table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin-bottom: 0;
    background-color: var(--bg-white);
}

.table thead th {
    background-color: var(--bg-white);
    color: var(--ciic-color-gray);
    font-weight: var(--font-weight-semibold);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(187, 187, 188, 0.3);
    border-top: none;
}

.table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(187, 187, 188, 0.3);
    color: var(--text-primary);
    font-size: 15px;
}

.table tbody tr {
    transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.table tbody tr:hover {
    background-color: rgba(60, 64, 198, 0.03);
}

.table tbody tr.table-row-active,
.table tbody tr.is-active {
    box-shadow: -3px 0 0 var(--ciic-color-blue) inset;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--bg-white);
}

.table-striped tbody tr:nth-of-type(odd):hover {
    background-color: rgba(60, 64, 198, 0.03);
}

.rating-table tbody tr {
    transition: all 0.2s ease;
}

.rating-table tbody tr:hover {
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--primary-color);
}

.rating-table a {
    color: var(--primary-color) !important;
}

/* ============================================
   Badges - современные значки
   ============================================ */

.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.bg-success {
    background-color: var(--secondary-color) !important;
    color: white !important;
}

.bg-secondary {
    background-color: var(--accent-olive) !important;
    color: white !important;
}

/* ЦМВС: сохраняем акцент только при необходимости через модификатор */
.table--brand-header thead th {
    background-color: var(--ciic-color-blue);
    color: #FFFFFF;
}

.bg-info {
    background-color: var(--accent-sand) !important;
    color: var(--text-primary) !important;
}

/* ============================================
   Карточки проектов - улучшенный стиль
   ============================================ */

.projects-list .card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.projects-list .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: var(--primary-color);
}

.projects-list .card-title a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    transition: color 0.2s ease;
}

.projects-list .card-title a:hover {
    color: var(--primary-hover);
}

/* ============================================
   Список мероприятий - улучшенный стиль
   ============================================ */

.event-item {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-lg);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-white);
}

.event-item:hover {
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

.event-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.event-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================
   Адаптивность - Mobile First
   ============================================ */

@media (max-width: 768px) {
    .card-header {
        padding: var(--spacing-md);
    }
    
    .card-body {
        padding: var(--spacing-md);
    }
    
    .btn-primary, .btn-outline-primary {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    h1, .h1 {
        font-size: 28px;
    }
    
    h2, .h2 {
        font-size: 24px;
    }
    
    h3, .h3 {
        font-size: 20px;
    }
    
    .table thead th,
    .table tbody td {
        padding: 12px 8px;
        font-size: 14px;
    }
    
    .projects-list .card-title a {
        font-size: 16px;
    }
    
    .profile-layout {
        flex-direction: column;
    }
    
    .profile-name {
        font-size: 24px;
    }
}

/* ============================================
   Формы входа и регистрации
   ============================================ */

.row.justify-content-center {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

/* ============================================
   Алерты - современный стиль
   ============================================ */

.alert {
    border-radius: 12px;
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    font-size: 15px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.alert-success {
    background-color: rgba(60, 64, 198, 0.08);
    color: var(--ciic-color-blue);
    border-left: 4px solid var(--ciic-color-blue);
}

.alert-danger {
    background-color: rgba(255, 63, 52, 0.08);
    color: var(--ciic-color-red);
    border-left: 4px solid var(--ciic-color-red);
}

.alert-info {
    background-color: rgba(60, 64, 198, 0.08);
    color: var(--ciic-color-blue);
    border-left: 4px solid var(--ciic-color-blue);
}

/* ============================================
   Пагинация - современный стиль
   ============================================ */

.pagination {
    margin-top: var(--spacing-xl);
    gap: var(--spacing-xs);
}

.page-link {
    border: 1px solid rgba(187, 187, 188, 0.7);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-size: 15px;
}

.page-link:hover {
    background-color: rgba(60, 64, 198, 0.06);
    border-color: var(--ciic-color-blue);
    color: var(--ciic-color-blue);
    transform: translateY(-1px);
}

.page-item.active .page-link {
    background-color: var(--ciic-color-blue);
    border-color: var(--ciic-color-blue);
    color: #FFFFFF;
}

/* ============================================
   Список участников - улучшенный стиль
   ============================================ */

.participants-table {
    margin-top: var(--spacing-lg);
}

.participants-table tbody tr {
    transition: all 0.2s ease;
}

.participants-table tbody tr:hover {
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--primary-color);
}

.participants-table a {
    color: var(--primary-color) !important;
}

/* Адаптивность для формы регистрации */
@media (max-width: 768px) {
    .register-form-container {
        max-width: 100% !important;
        padding: 0 15px;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .register-form-container {
        max-width: 95% !important;
    }
}

@media (min-width: 1201px) {
    .register-form-container {
        max-width: 1800px;
    }
}

/* ============================================
   Плашка "Амбассадор"
   ============================================ */

.ambassador-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--ciic-color-blue), #5054d4);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(27, 54, 93, 0.25);
    white-space: nowrap;
    letter-spacing: 0.02em;
    cursor: default;
    transition: all 0.2s ease;
}

.ambassador-badge i {
    font-size: 14px;
    color: #ffffff;
}

.ambassador-badge:hover {
    box-shadow: 0 3px 6px rgba(27, 54, 93, 0.3);
    transform: translateY(-1px);
}

.ambassador-badge:active {
    transform: translateY(0);
}

/* ============================================
   Accessibility & motion
   ============================================ */

:focus-visible {
    outline: 2px solid var(--ciic-color-blue);
    outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--ciic-color-blue);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(60, 64, 198, 0.25);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Навигация (вкладки)
   ============================================ */

.nav-tabs {
    border-bottom: 1px solid rgba(187, 187, 188, 0.3);
    gap: var(--spacing-sm);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-secondary);
    padding: 10px 16px;
    font-weight: var(--font-weight-regular);
    opacity: 0.6;
    transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    border-radius: var(--radius-sm);
}

.nav-tabs .nav-link:hover {
    opacity: 1;
    color: var(--ciic-color-text);
}

.nav-tabs .nav-link.active {
    color: var(--ciic-color-text);
    font-weight: var(--font-weight-semibold);
    opacity: 1;
    border-bottom: 2px solid var(--ciic-color-blue);
    background: transparent;
}

/* ============================================
   Tabulator / DataGrid — стили под брендбук ЦМВС
   ============================================ */

.tabulator {
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    overflow: visible;
    background: var(--bg-white);
}

.tabulator .tabulator-header {
    background: var(--bg-white);
    border-bottom: 1px solid rgba(187, 187, 188, 0.3);
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
    padding: 12px 16px;
}

.tabulator .tabulator-header .tabulator-col {
    border-right: 1px solid rgba(187, 187, 188, 0.45);
    cursor: grab;
    user-select: none;
}
.tabulator .tabulator-header .tabulator-col.tabulator-moving {
    cursor: grabbing;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-title {
    color: var(--ciic-color-gray);
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: normal !important;
    word-break: break-word;
    line-height: 1.3;
    min-width: 0;
}

.tabulator .tabulator-header-filter {
    padding: 0.2rem 0.25rem !important;
    min-height: auto !important;
    vertical-align: middle !important;
}

.tabulator-header-filter input {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    border: 1px solid var(--ciic-color-gray);
    border-radius: var(--radius-sm);
}

.tabulator .tabulator-header-filter input:focus {
    border-color: var(--ciic-color-blue);
    box-shadow: 0 0 0 0.2rem rgba(60, 64, 198, 0.1);
}

.tabulator .tabulator-header .tabulator-col:not(.tabulator-col-group) {
    position: relative;
}

.tabulator .tabulator-header .tabulator-col:not(.tabulator-col-group) .tabulator-col-content {
    padding-bottom: 0;
    padding-right: 2.25rem;
    min-width: 0;
}

.tabulator .tabulator-header .tabulator-col .tabulator-header-filter {
    position: absolute !important;
    top: 50% !important;
    right: 4px !important;
    margin: 0 !important;
    transform: translateY(-50%);
    width: auto !important;
    min-height: 0 !important;
    flex-shrink: 0;
}

.datagrid-filter-btn {
    border: none !important;
    background: rgba(187, 187, 188, 0.15) !important;
    padding: 6px 4px 6px 8px !important;
    border-radius: var(--radius-sm) !important;
    cursor: pointer;
    color: var(--ciic-color-text);
    transition: background 0.2s ease;
}

.datagrid-filter-btn:hover {
    background: rgba(187, 187, 188, 0.25) !important;
}

.tabulator .tabulator-header,
.tabulator .tabulator-header .tabulator-col,
.tabulator .tabulator-header-filter {
    overflow: visible !important;
}

.tabulator .tabulator-row {
    transition: background-color 0.16s ease;
}

.tabulator .tabulator-row:hover {
    background-color: rgba(60, 64, 198, 0.03) !important;
}

.tabulator .tabulator-row.tabulator-row-selected {
    background-color: rgba(60, 64, 198, 0.06) !important;
    box-shadow: 3px 0 0 var(--ciic-color-blue) inset;
}

.tabulator .tabulator-cell {
    border-right: 1px solid rgba(187, 187, 188, 0.45);
    padding: 8px 14px;
    white-space: normal !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.35;
    min-height: 2.7em; /* не меньше 2 строк при line-height 1.35 */
    box-sizing: border-box;
}

.tabulator .tabulator-row {
    min-height: 2.7em;
    position: relative;
}

.tabulator .dg-cell {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.tabulator .dg-clamp {
    -webkit-line-clamp: 2;
}

.tabulator .tabulator-row.dg-row-expanded .dg-cell {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
}

.tabulator .dg-row-resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    cursor: ns-resize;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.tabulator .tabulator-row:hover .dg-row-resize-handle {
    opacity: 1;
}

.tabulator .dg-row-resize-handle::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 3px;
    background: rgba(60, 64, 198, 0.4);
    border-radius: 2px;
}

.tabulator .tabulator-cell a {
    white-space: normal !important;
    word-break: break-word;
}

.tabulator .tabulator-placeholder {
    color: var(--text-secondary);
    font-size: 14px;
}

.tabulator .tabulator-placeholder span {
    opacity: 0.7;
}

/* ============================================
   Empty states
   ============================================ */

.empty-state {
    text-align: center;
    padding: var(--spacing-xxl) var(--spacing-xl);
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--ciic-color-gray);
    opacity: 0.5;
    margin-bottom: var(--spacing-lg);
}

.empty-state-title {
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 0 var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.empty-state .btn {
    margin-top: var(--spacing-sm);
}

/* ============================================
   Skeleton / loading
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, rgba(187, 187, 188, 0.15) 25%, rgba(187, 187, 188, 0.25) 50%, rgba(187, 187, 188, 0.15) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
        background: rgba(187, 187, 188, 0.2);
    }
}

.skeleton-text {
    height: 1em;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* ============================================
   Toast-уведомления
   ============================================ */

.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-width: 400px;
}

.toast-ciic {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-soft);
    padding: 14px 18px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: opacity 0.3s ease;
}

.toast-ciic.toast-success {
    background: var(--ciic-color-blue);
    color: #FFFFFF;
}

.toast-ciic.toast-error {
    background: var(--ciic-color-red);
    color: #FFFFFF;
}

.toast-ciic.toast-info {
    background: var(--bg-white);
    color: var(--ciic-color-text);
    border: 1px solid var(--ciic-color-gray);
}

/* ============================================
   Bulk actions / панель массовых действий
   ============================================ */

.bulk-actions-bar {
    position: sticky;
    top: 0;
    padding: var(--spacing-md) var(--spacing-lg);
    background: rgba(60, 64, 198, 0.06);
    border-bottom: 1px solid rgba(187, 187, 188, 0.3);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    z-index: 100;
}

.bulk-actions-bar .btn {
    flex-shrink: 0;
}

/* ============================================
   Утилиты
   ============================================ */

.auth-page-wrapper {
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
}

.auth-form-col {
    max-width: 900px;
}

.auth-logo {
    max-width: 50px;
    max-height: 50px;
}

.icon-success-lg {
    font-size: 64px;
    color: var(--ciic-color-blue);
}

.dg-dropdown-menu {
    min-width: 220px;
    max-height: 400px;
    overflow-y: auto;
}

.datagrid-table-wrapper {
    min-height: 300px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .tabulator .tabulator-cell {
        padding: 6px 10px;
        font-size: 0.82rem;
    }

    .tabulator .tabulator-header .tabulator-col .tabulator-col-content {
        padding: 8px 10px;
    }

    .tabulator .tabulator-header .tabulator-col .tabulator-col-title {
        font-size: 11px;
    }
}

.photo-placeholder {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(187, 187, 188, 0.15);
    border-radius: var(--radius-md);
}

.photo-placeholder i {
    font-size: 5rem;
    color: var(--ciic-color-gray);
    opacity: 0.5;
}

.obj-fit-cover {
    object-fit: cover;
}

.photo-detail-max {
    max-height: 300px;
}

.project-link {
    color: var(--ciic-color-blue);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
}

.project-link:hover {
    color: var(--primary-hover);
}

.text-pre-wrap {
    white-space: pre-wrap;
}

/* ============================================
   Карточка профиля (режим просмотра / редактирования как в ВК, Facebook)
   ============================================ */

/* Фиксированный размер и скруглённая рамка фото */
.profile-photo-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    min-width: 200px;
    min-height: 200px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-light, #f5f5f5);
    flex-shrink: 0;
}

.profile-photo-wrapper .obj-fit-cover {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.profile-photo-wrapper .photo-placeholder {
    color: var(--text-secondary, #6c757d);
    font-size: 5rem;
}

/* Оверлей «Изменить фото» — только в режиме редактирования */
.photo-upload-overlay {
    cursor: pointer;
    display: none;
    transition: opacity 0.2s ease;
}

.photo-upload-overlay.visible {
    display: flex !important;
}

/* Режим просмотра: данные как текст */
.profile-card-view .profile-field-label {
    font-weight: 500;
    color: var(--text-secondary, #6c757d);
    margin-bottom: 0.25rem;
}

.profile-card-view .profile-field-value {
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 1rem;
}

.field-view {
    display: inline-block;
    min-height: 24px;
}

.field-edit {
    display: none;
    max-width: 100%;
}

.profile-edit-mode .field-view {
    display: none;
}

.profile-edit-mode .field-edit {
    display: block;
}

.profile-edit-mode .field-edit.d-inline {
    display: inline-block;
}

/* Поле выбора фото — скрыто вне режима редактирования, внутри блока фото в режиме редактирования */
.photo-input-wrapper {
    display: none !important;
}
.profile-form.profile-edit-mode .photo-input-wrapper {
    display: block !important;
}

.input-file-hidden {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

/* Кнопки: в режиме просмотра — только «Редактировать», в режиме редактирования — «Сохранить» и «Отменить» */
.profile-actions .btn-edit-show { display: inline-flex; }
.profile-actions .btn-save-show,
.profile-actions .btn-cancel-show { display: none; }
.profile-actions.profile-edit-mode .btn-edit-show { display: none; }
.profile-actions.profile-edit-mode .btn-save-show,
.profile-actions.profile-edit-mode .btn-cancel-show { display: inline-flex; }

/* Карточка профиля: отступы и вид как в соцсетях */
.profile-card-body { padding: 1.5rem 1.5rem 1.25rem; }
.profile-name { font-size: 1.35rem; font-weight: 600; color: var(--text-primary, #1a1a1a); }
.profile-dl { font-size: 0.95rem; }
.profile-dl dt { font-weight: 500; color: var(--text-secondary, #6c757d); width: auto; padding-right: 1rem; }
.profile-dl dd { margin-bottom: 0.85rem; }
.profile-dl .field-view { color: var(--text-primary, #1a1a1a); }
.profile-dl .field-edit { margin-bottom: 0; }
.profile-dl small.field-edit { font-size: 0.8rem; margin-top: 0.25rem; display: block; }
.profile-dl dd:last-of-type { margin-bottom: 0; }

/* ============================================
   Глобальный поиск
   ============================================ */

.top-bar-search-form {
    display: flex;
    align-items: center;
}

.top-bar-search-input {
    width: 200px;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: 0.85rem;
    background: var(--bg-main, #f2f2f7);
    border-color: var(--border-color);
    color: var(--text-primary);
    transition: width 0.3s ease, background 0.2s ease, border-color 0.2s ease;
}

.top-bar-search-input::placeholder {
    color: var(--text-light);
}

.top-bar-search-input:focus {
    width: 280px;
    background: var(--bg-white);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 2px rgba(60, 64, 198, 0.15);
}

.top-bar-search-btn {
    border-color: var(--border-color);
    color: var(--text-secondary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.top-bar-search-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.search-form-main .form-control-lg {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.search-form-main .btn-lg {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.search-category-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.search-results-list {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.search-result-item {
    border-left: 3px solid transparent;
    transition: border-color 0.2s ease, background 0.15s ease;
    padding: 0.75rem 1rem;
}

.search-result-item:hover {
    border-left-color: var(--primary-color);
    background: var(--bg-light);
}

.search-result-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.search-result-subtitle {
    font-size: 0.825rem;
    margin-top: 0.15rem;
}

/* Поле поиска в разделе: уменьшить пробел сверху, ровный отступ снизу */
.datagrid-section-search {
    margin-top: -1.5rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .top-bar-search-form {
        display: none;
    }
}
