* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 1. Body больше не имеет фиксированной высоты */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto;
    overflow-y: auto; /* Скроллим всю страницу */
}

/* ==================== АВТОРИЗАЦИЯ ==================== */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: url('src/рисунок3.svg') center/cover no-repeat fixed;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 250px;
}

.auth-container {
    width: 400px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 3px solid #37A9CE;
    overflow: hidden;
}

.auth-form {
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    color: #37A9CE;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
}

.auth-header p {
    color: #666;
    font-size: 14px;
}

.auth-field {
    margin-bottom: 20px;
}

.auth-field label {
    display: flex;
    align-items: center;
    color: #37A9CE;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.auth-field label i {
    margin-right: 8px;
}

.auth-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E7F7FF;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.auth-input:focus {
    outline: none;
    border-color: #37A9CE;
    background: white;
    box-shadow: 0 0 0 3px rgba(55, 169, 206, 0.2);
}

.auth-error {
    background: #ffe5e5;
    border: 1px solid #ffcccc;
    color: #d32f2f;
    padding: 10px 12px;
    border-radius: 6px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    font-size: 13px;
    animation: shake 0.5s ease;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
}

.auth-btn {
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.auth-btn-primary {
    background: #37A9CE;
    color: white;
}

.auth-btn-primary:hover {
    background: #2d8fb0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(55, 169, 206, 0.4);
}

/* ==================== МЕНЮ ПОСЛЕ АВТОРИЗАЦИИ ==================== */
.main-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #37A9CE 0%, #2d8fb0 100%);
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.main-menu-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    width: 90%;
    max-width: 1000px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease;
    border: 3px solid #37A9CE;
}

.main-menu-header {
    text-align: center;
    margin-bottom: 40px;
}

.main-menu-header h2 {
    color: #37A9CE;
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.main-menu-header p {
    color: #666;
    font-size: 1.1rem;
    margin: 5px 0;
}

.main-menu-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.main-menu-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.main-menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: #37A9CE;
    background: #fff;
}

.main-menu-icon {
    font-size: 4rem;
    color: #37A9CE;
    margin-bottom: 20px;
}

.main-menu-card:hover .main-menu-icon {
    animation: pulse 1.5s infinite;
}

.main-menu-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #37A9CE;
    margin-bottom: 15px;
}

.main-menu-description {
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.main-menu-actions {
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

/* ==================== ЛИЧНЫЙ КАБИНЕТ ==================== */
.personal-cabinet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #37A9CE 0%, #2d8fb0 100%);
    z-index: 9996;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.personal-cabinet-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 3px solid #37A9CE;
    display: flex;
    flex-direction: column;
}

.personal-cabinet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #37A9CE;
}

.personal-cabinet-header h2 {
    color: #37A9CE;
    margin: 0;
    font-size: 28px;
}

.personal-cabinet-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.personal-info-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #37A9CE;
}

.personal-info-section h3 {
    color: #37A9CE;
    margin-bottom: 20px;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.info-item label {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.info-value {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #E7F7FF;
}

.tabs-section {
    margin-top: 30px;
}

.cabinet-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #37A9CE;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.cabinet-tab {
    padding: 12px 25px;
    background: #f8f9fa;
    border: 1px solid #37A9CE;
    border-radius: 6px;
    cursor: pointer;
    color: #37A9CE;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cabinet-tab:hover {
    background: #E7F7FF;
}

.cabinet-tab.active {
    background: #37A9CE;
    color: white;
}

.cabinet-tab-content {
    display: none;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #37A9CE;
    min-height: 400px;
}

.cabinet-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.cabinet-tab-content h4 {
    color: #37A9CE;
    margin-bottom: 20px;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cabinet-tab-content h5 {
    color: #2d8fb0;
    margin: 20px 0 10px 0;
    font-size: 18px;
}

.cabinet-tab-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.cabinet-tab-content ol,
.cabinet-tab-content ul {
    margin-left: 25px;
    margin-bottom: 20px;
}

.cabinet-tab-content li {
    margin-bottom: 10px;
    color: #333;
    line-height: 1.5;
}

.note-box,
.warning-box {
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.note-box {
    background: #E7F7FF;
    border: 1px solid #37A9CE;
}

.warning-box {
    background: #fff3e0;
    border: 1px solid #ff9800;
}

.note-box i {
    color: #37A9CE;
    font-size: 20px;
}

.warning-box i {
    color: #ff9800;
    font-size: 20px;
}

.schedule-table {
    display: flex;
    flex-direction: column;
    border: 1px solid #37A9CE;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

.schedule-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    border-bottom: 1px solid #E7F7FF;
}

.schedule-row.header {
    background: #37A9CE;
    color: white;
    font-weight: bold;
}

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

.schedule-cell {
    padding: 15px;
    border-right: 1px solid #E7F7FF;
    display: flex;
    align-items: center;
}

.schedule-row.header .schedule-cell {
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.schedule-cell:last-child {
    border-right: none;
}

/* ==================== ТИП КАРТЫ ==================== */
.card-type-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #37A9CE 0%, #2d8fb0 100%);
    z-index: 9996;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.card-type-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 3px solid #37A9CE;
    display: flex;
    flex-direction: column;
}

.card-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #37A9CE;
}

.card-type-header h2 {
    color: #37A9CE;
    margin: 0;
    font-size: 28px;
}

.card-type-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.card-image-container {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    align-items: center;
}

.card-image-placeholder {
    width: 300px;
    height: 200px;
    background: #f8f9fa;
    border: 3px solid #37A9CE;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-image-placeholder i {
    font-size: 80px;
    color: #37A9CE;
    margin-bottom: 15px;
}

.card-image-placeholder p {
    color: #666;
    font-size: 16px;
}

.card-image-description {
    flex: 1;
}

.card-image-description h4 {
    color: #37A9CE;
    margin-bottom: 15px;
    font-size: 22px;
}

.card-image-description p {
    color: #666;
    line-height: 1.6;
}

/* ==================== ВЫБОР МОДУЛЯ ==================== */
.module-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #37A9CE 0%, #2d8fb0 100%);
    z-index: 9995;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.module-selector-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease;
    border: 3px solid #37A9CE;
}

.module-selector-header {
    text-align: center;
    margin-bottom: 40px;
}

.module-selector-header h2 {
    color: #37A9CE;
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.module-selector-header p {
    color: #666;
    font-size: 1.1rem;
}

.module-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.module-card {
    width: 320px; /* Жестко фиксируем ширину */
    height: 380px; /* Жестко фиксируем высоту */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden; /* Обрезаем всё, что вылезает за пределы */
}
.module-card .module-description {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;

    -webkit-box-orient: vertical;
    margin-bottom: 15px;
}
.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: #37A9CE;
    background: #fff;
}

.module-card.active {
    border-color: #2d8fb0;
    background: #E7F7FF;
}

.module-icon {
    font-size: 3.5rem;
    color: #37A9CE;
    margin-bottom: 20px;
}

.module-card:hover .module-icon {
    animation: pulse 1.5s infinite;
}

.module-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #37A9CE;
    margin-bottom: 15px;
}

.module-description {
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.module-hint {
    color: #37A9CE;
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 10px;
}

.module-selector-actions {
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ==================== СЕЛЕКТОР ЧАТОВ ==================== */
.chat-module-selector {
    display: flex;
    background: #37A9CE;
    padding: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    justify-content: center;
}

.chat-module-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    width: 100%;
    margin: 0 5px;
}

.chat-module-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-module-btn.active {
    background: white;
    color: #37A9CE;
    font-weight: 500;
}

.chat-module-btn i {
    font-size: 14px;
}

/* ==================== ОСНОВНОЙ ИНТЕРФЕЙС ==================== */
.main-interface {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto; /* Позволяем расти */
    overflow-y: visible; /* Убираем скрытие */
}

.main-interface-after-auth {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    z-index: 9998;
    overflow: hidden;
}

.main-interface-after-auth .container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto;
    overflow-y: visible;
}

.main-interface-after-auth .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #37A9CE;
    color: white;
    padding: 0 20px;
    height: 70px;
    border-bottom: 2px solid #2d8fb0;
    flex-shrink: 0;
}

.main-interface-after-auth .system-info h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: white;
}

.main-interface-after-auth .user-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-top: 5px;
}

.main-interface-after-auth .header-user-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.main-interface-after-auth .btn-user {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
}

.main-interface-after-auth .btn-user:hover {
    background: rgba(255, 255, 255, 0.25);
}

.main-interface-after-auth .user-name-short {
    font-weight: 500;
}

.main-interface-after-auth .btn-messages {
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 15px;
}

.main-interface-after-auth .btn-messages .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff5252;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-interface-after-auth .main-content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Левая панель с вкладками на главной */
.sidebar-tabs {
    width: 250px;
    background: white;
    border-right: 2px solid #37A9CE;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-tabs .sidebar-header {
    padding: 20px;
    background: #37A9CE;
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.tab-items {
    padding: 20px 0;
    flex: 1;
}

.tab-item {
    padding: 16px 20px;
    cursor: pointer;
    border-left: 4px solid transparent;
    border-right: 1px solid #E7F7FF;
    font-size: 15px;
    transition: all 0.2s ease;
    color: #37A9CE;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2px;
}

.tab-item:hover {
    background-color: #E7F7FF;
    color: #37A9CE;
}

.tab-item.active {
    background: #37A9CE;
    color: white;
    border-left: 4px solid white;
    font-weight: bold;
}

.tab-item i {
    width: 20px;
    text-align: center;
}

.content-area {
    flex: 1;
    background: #f5f5f5;
    padding: 20px;
    overflow-y: auto;
}

/* Верхняя панель (шапка) */
.header {
    display: flex;
    background: #37A9CE;
    color: white;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    height: 70px;
    flex-shrink: 0;
    z-index: 100;
}

.header-section {
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.header-section:last-child {
    border-right: none;
    flex-grow: 1;
    justify-content: flex-end;
    gap: 10px;
}

.header-module {
    flex-grow: 1;
    justify-content: flex-start;
}

.module-info {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.module-label {
    font-weight: 600;
    font-size: 14px;
}

.module-name {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 1px;
}

.version-info {
    font-size: 12px;
    opacity: 0.9;
    margin-left: 20px;
}

.header-user {
    flex-grow: 1;
    justify-content: center;
    gap: 20px;
}

.user-status,
.user-info,
.update-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

.status-label,
.user-label {
    font-weight: 600;
}

.status-active {
    color: white;
    font-weight: 500;
}

.status-active::before {
    content: '●';
    margin-right: 6px;
    font-size: 16px;
    color: #ffffff;
}

.btn-small {
    background: #37A9CE;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-small:hover {
    background: #2d8fb0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(55, 169, 206, 0.4);
}

.btn-logout {
    background: #d32f2f;
    border: none;
}

.btn-logout:hover {
    background: #b71c1c;
}

/* Модульный переключатель */
.module-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-arrow-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-arrow-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Основной контейнер */
.container {
    display: flex;
    flex: 1;
    overflow: hidden;
    background-color: #D9F0FE;
    position: relative;
}

/* Левое меню (Разделы модуля) */
.sidebar {
    width: 200px;
    background: #ffffff;
    border-right: 2px solid #37A9CE;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: calc(100vh - 70px);
    position: relative;
    z-index: 10;
}

.sidebar-header {
    padding: 15px 20px;
    background: #37A9CE;
    color: white;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.menu-items {
    padding: 10px 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.menu-item {
    padding: 16px 20px;
    cursor: pointer;
    border-bottom: 1px solid #37A9CE;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #37A9CE;
    text-align: left;
    position: relative;
    font-weight: 500;
    background: #ffffff;
    border-left: 3px solid transparent;
    border-right: 1px solid #37A9CE;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.menu-item:hover {
    background-color: #E7F7FF;
    color: #37A9CE;
}

.menu-item.active {
    background: #37A9CE;
    color: white;
    font-weight: bold;
    border-left: 4px solid #ffffff;
}

.menu-item.active::before {
    content: '▶';
    position: relative;
    right: 15px;
    color: white;
    font-size: 12px;
}
.menu-item.active::after {
    position: absolute;
    right: 5px; /* если нужно ближе или дальше от края  */
    top: 50%;
    transform: translateY(-50%);
}
.menu-item.spacer {
    height: 20px;
    background: transparent;
    border: none;
    cursor: default;
    border-right: 1px solid #37A9CE;
}

#votingMenuItem {
    background: #37A9CE;
    color: white;
    font-weight: bold;
    border-left: 4px solid #ffffff;
    text-align: center;
    padding: 16px 20px;
    margin-top: auto;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    overflow-y: visible !important; 
    height: auto !important; 
    padding: 20px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #37A9CE;
    background-color: #D9F0FE;
    flex-shrink: 0;
}

.content-header h2 {
    color: #37A9CE;
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}
.content-body {
    background: white;
    padding: 25px;
    border-radius: 4px;
    border: 1px solid #37A9CE;
    height: auto !important; /* Убираем жесткий фикс */
    overflow-y: visible !important; /* Убираем внутренний скролл */
}


.info-box {
    background: #E7F7FF;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #37A9CE;
    margin-top: 20px;
    font-weight: bold;
    color: #37A9CE;
    overflow: hidden;
}

/* ==================== СТИЛИ ДЛЯ НОВЫХ ЭЛЕМЕНТОВ ==================== */

/* Контейнер вкладок */
.tab-content {
    display: none;
    padding: 20px;
    background: white;
    border-radius: 8px;
    min-height: 0;
    overflow-y: auto;
    flex: 1;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.tab-content h3 {
    color: #37A9CE;
    margin-bottom: 20px;
    font-size: 22px;
    border-bottom: 2px solid #37A9CE;
    padding-bottom: 10px;
}

.tab-content h4 {
    color: #37A9CE;
    margin: 15px 0 10px 0;
    font-size: 18px;
}

.tab-content p {
    color: #333;
    line-height: 1.6;
    margin-bottom: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.tab-content ul, .tab-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.tab-content li {
    margin-bottom: 12px;
    color: #333;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}


.blocks-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px;
    
    /* ВОТ ЭТИ СТРОКИ ДЕЛАЮТ СКРОЛЛ, КАК В ПРЕДЛОЖЕНИЯХ */
    max-height: 70vh;        /* Ограничиваем высоту, чтобы не уходила вниз */
    overflow-y: auto;        /* Включаем прокрутку */
    align-content: start;    /* Прижимаем к верху */
}
.block-card {
    background: #f8f9fa;
    border: 2px solid #37A9CE;
    border-radius: 10px;
    padding: 20px;
    height: 250px;           /* Верни фиксированную высоту */
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}
/* Добавьте эти новые правила */
.block-card h4 {
    color: #37A9CE;
    margin-bottom: 10px;
    font-size: 18px;
    word-wrap: break-word;
    flex-shrink: 0; /* Заголовок не сжимается */
}

.block-card p, .block-card ul {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-y: auto; /* Добавляем вертикальный скролл */
    flex: 1; /* Текст занимает всё оставшееся место */
    padding-right: 5px; /* Отступ для скроллбара */
}

/* Стилизация скроллбара внутри карточки */
.block-card p::-webkit-scrollbar, .block-card ul::-webkit-scrollbar {
    width: 4px;
}
.block-card p::-webkit-scrollbar-thumb, .block-card ul::-webkit-scrollbar-thumb {
    background: #37A9CE;
    border-radius: 4px;
}
.block-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(55, 169, 206, 0.3);
    background: #E7F7FF;
}



/* Справочники */
.references-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #37A9CE;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.reference-tab {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #37A9CE;
    border-radius: 6px;
    cursor: pointer;
    color: #37A9CE;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.reference-tab:hover {
    background: #E7F7FF;
}

.reference-tab.active {
    background: #37A9CE;
    color: white;
}

.reference-content {
    display: none;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    max-height: 500px;
}

.reference-content.active {
    display: block;
}

/* ==================== СТИЛИ ДЛЯ НОВЫХ ЭЛЕМЕНТОВ PDF ==================== */

/* PDF секция */
.pdf-section {
    margin-top: 20px;
    overflow-y: auto;
    max-height: 700px;
}

.pdf-section h4 {
    color: #37A9CE;
    margin-bottom: 15px;
    font-size: 18px;
}

/* PDF формы */
.pdf-forms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 25px 0;
    overflow-y: auto;
    padding-right: 5px;
}

.pdf-form-card {
    padding: 25px;
    background: #f8f9fa;
    border: 2px solid #37A9CE;
    border-radius: 10px;
    transition: all 0.3s ease;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.pdf-form-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(55, 169, 206, 0.25);
    background: #E7F7FF;
}

.pdf-form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #37A9CE;
}

.pdf-form-card i {
    font-size: 42px;
    color: #37A9CE;
    margin-bottom: 15px;
    text-align: center;
}

.pdf-form-card h4 {
    color: #37A9CE;
    margin-bottom: 12px;
    font-size: 17px;
    text-align: center;
    word-wrap: break-word;
}

.pdf-form-card p {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    text-align: center;
    flex-grow: 1;
    word-wrap: break-word;
}

.form-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 15px 0;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #E7F7FF;
}

.form-details span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 13px;
    word-wrap: break-word;
}

.form-details i {
    font-size: 14px;
    color: #37A9CE;
    margin: 0;
}

.pdf-form-card .btn-small {
    width: 100%;
    justify-content: center;
    margin-top: auto;
    padding: 10px;
    font-size: 14px;
}

/* ==================== СТИЛИ ДЛЯ ФЛК ==================== */

.flk-section {
    margin-top: 20px;
    overflow-y: auto;
    max-height: 700px;
}

.flk-description {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #37A9CE;
    margin-bottom: 25px;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    overflow: hidden;
}

.flk-rules {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 30px;
    overflow-y: auto;
    max-height: 600px;
}

.flk-rule {
    padding: 25px;
    background: #f8f9fa;
    border: 2px solid #37A9CE;
    border-radius: 10px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.flk-rule:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(55, 169, 206, 0.2);
}

.flk-rule h4 {
    color: #37A9CE;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #37A9CE;
    font-size: 18px;
    word-wrap: break-word;
}

.flk-rule ul {
    margin-left: 20px;
}

.flk-rule li {
    margin-bottom: 15px;
    color: #333;
    line-height: 1.6;
    padding-left: 8px;
    position: relative;
    word-wrap: break-word;
}

.flk-rule li strong {
    color: #2d8fb0;
}

/* ==================== ЧАТ - ФИКСИРОВАННАЯ ВЫСОТА ==================== */
.chat-panel {
    width: 400px;
    background: white;
    border-left: 2px solid #37A9CE;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: calc(100vh - 70px);
    position: relative;
    z-index: 20;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #37A9CE;
    color: white;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.chat-header span {
    font-weight: bold;
    font-size: 16px;
}

.chat-search {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-search-input {
    width: 150px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 13px;
}

.chat-search-input:focus {
    outline: none;
    border-color: white;
    background: rgba(255, 255, 255, 0.3);
}

.chat-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.chat-search-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.chat-search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #ffffff;
    border-bottom: 1px solid #37A9CE;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.message.system {
    justify-content: center;
    background: #ffffff;
    color: #37A9CE;
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid #37A9CE;
    font-size: 13px;
    font-style: italic;
}

.message.user,
.message.admin {
    justify-content: flex-start;
}

.message.user .message-bubble,
.message.admin .message-bubble {
    background: #E7F7FF;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #37A9CE;
    max-width: 250px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
}

.message.admin .message-bubble {
    background: #37A9CE;
    color: white;
    border-color: #2d8fb0;
}

.message-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #E7F7FF;
}

.message.admin .message-bubble::after {
    border-top: 10px solid #37A9CE;
}

.message-content {
    margin-bottom: 5px;
    font-weight: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-time {
    font-size: 12px;
    color: #666;
    text-align: right;
    margin-top: 5px;
}

/* Стили для сообщений */
.message.user.own {
    justify-content: flex-end;
}

.message.user.own .message-bubble {
    background: #E7F7FF;
    border: 1px solid #37A9CE;
    border-radius: 12px 12px 4px 12px;
}

.message.user.other .message-bubble {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px 12px 12px 4px;
}

.message-author {
    font-weight: 600;
    color: #37A9CE;
    margin-bottom: 6px;
    font-size: 13px;
}

.message-text {
    font-size: 14px;
    line-height: 1.45;
    color: #333;
    word-break: break-word;
}

.message-status {
    font-size: 10px;
    color: #4caf50;
    margin-top: 4px;
    text-align: right;
}

/* Кнопка ответа */
.message-actions-bar {
    position: absolute;
    bottom: -12px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    gap: 4px;
    background: white;
    border-radius: 20px;
    padding: 3px 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    border: 1px solid #e8e8e8;
    transform: translateY(5px);
}

.message-bubble:hover .message-actions-bar {
    opacity: 1;
    transform: translateY(0);
}

.message-reply-btn {
    background: none;
    border: none;
    color: #37A9CE;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.message-reply-btn:hover {
    background: #E7F7FF;
}

/* Блок ответа внутри сообщения */
.chat-reply-block {
    background: rgba(255, 255, 255, 0.6);
    border-left: 3px solid #37A9CE;
    border-radius: 4px;
    padding: 6px 10px;
    margin-bottom: 8px;
    font-size: 13px;
}

.message.user.own .chat-reply-block {
    background: rgba(55, 169, 206, 0.1);
    border-color: #2d8fb0;
}

.chat-reply-author {
    font-weight: bold;
    color: #37A9CE;
    margin-bottom: 2px;
    font-size: 12px;
}

.chat-reply-text {
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Превью ответа над полем ввода */
.reply-preview-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #E7F7FF;
    border-left: 3px solid #37A9CE;
    margin-bottom: 5px;
    border-radius: 4px;
}

.reply-preview-icon {
    color: #37A9CE;
    font-size: 14px;
}

.reply-preview-content {
    flex: 1;
    overflow: hidden;
}

.reply-preview-author {
    font-weight: bold;
    color: #37A9CE;
    font-size: 12px;
}

.reply-preview-text {
    color: #666;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-preview-close {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    transition: 0.2s;
}

.reply-preview-close:hover {
    color: #d32f2f;
}

/* Бейджи для модулей в чате */
.module-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #37A9CE;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-top: 5px;
    align-self: flex-start;
}

.message.admin .module-badge {
    background: #d32f2f;
}

.chat-input-container {
    padding: 10px 15px;
    background: white;
    border-top: 1px solid #37A9CE;
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    position: relative;
}

.chat-input-wrapper textarea {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #37A9CE;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
    color: #333;
    resize: none;
    font-family: inherit;
    min-height: 40px;
    max-height: 120px;
}

.chat-input-wrapper textarea:focus {
    outline: none;
    border-color: #2d8fb0;
    box-shadow: 0 0 0 2px rgba(55, 169, 206, 0.2);
}

.chat-input-actions {
    display: flex;
    gap: 5px;
}

.chat-action-btn {
    background: #37A9CE;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-action-btn:hover {
    background: #2d8fb0;
}

.send-btn {
    background: #37A9CE;
    color: white;
    border: none;
    padding: 14px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: #2d8fb0;
}

/* Стили для поиска в чате */
.chat-search-results {
    position: absolute;
    top: 80px;
    left: 15px;
    right: 15px;
    background: white;
    border: 2px solid #37A9CE;
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: none;
}

.chat-search-result {
    padding: 12px 15px;
    border-bottom: 1px solid #E7F7FF;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-search-result:hover {
    background: #E7F7FF;
}

.chat-search-result:last-child {
    border-bottom: none;
}

.chat-search-result .result-text {
    color: #333;
    font-size: 14px;
    margin-bottom: 5px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-search-result .result-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

/* Стили для дат в чате */
.chat-date-separator {
    text-align: center;
    margin: 15px 0;
    position: relative;
}

.chat-date-separator::before,
.chat-date-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #37A9CE;
    opacity: 0.3;
}

.chat-date-separator::before {
    left: 0;
}

.chat-date-separator::after {
    right: 0;
}

.chat-date-label {
    display: inline-block;
    padding: 5px 15px;
    background: #E7F7FF;
    border-radius: 15px;
    color: #37A9CE;
    font-size: 12px;
    font-weight: 500;
}

/* ==================== КАРТОЧКИ МОДУЛЕЙ НА ГЛАВНОЙ ==================== */
.module-cards-horizontal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.module-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    cursor: pointer;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(55, 169, 206, 0.25);
    border-color: #37A9CE;
    background: white;
}

.module-icon {
    font-size: 3.5rem;
    color: #37A9CE;
    margin-bottom: 20px;
}

.module-card:hover .module-icon {
    animation: pulse 1.5s infinite;
}

.module-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #37A9CE;
    margin-bottom: 15px;
}

.module-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.module-hint {
    color: #37A9CE;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 10px;
}

/* ==================== УПОМИНАНИЯ (СИНИЕ) ==================== */
.mention {
    display: inline-block;
    background: #E7F7FF;
    color: #0d47a1;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95em;
    margin: 0 2px;
    border: 1px solid transparent;
}

.mention:hover {
    background: #0d47a1;
    color: white;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(13, 71, 161, 0.3);
}

.mention-current-user {
    background: #fff3e0;
    color: #e65100;
    font-weight: bold;
    border-color: #ff9800;
}

.mention-current-user:hover {
    background: #ff9800;
    color: white;
}

/* Бейджи упоминаний (синие) */
.mention-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 22px;
    height: 18px;
    padding: 0 5px;
    background: #0d47a1;
    color: white;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(13, 71, 161, 0.5);
    animation: mentionBadgePulse 1.5s infinite;
    z-index: 100;
    border: 1px solid white;
}

.mention-badge-module {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #0d47a1;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(13, 71, 161, 0.4);
    animation: mentionBadgePulse 1.5s infinite;
    border: 1px solid white;
}

.mention-badge-module i, .mention-badge i {
    font-size: 8px;
}

/* Красная точка для обычных сообщений */
.message-badge-module {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #f44336;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(244, 67, 54, 0.4);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes mentionBadgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(13, 71, 161, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 3px 12px rgba(13, 71, 161, 0.6);
    }
}

/* Контейнер должен быть прозрачным для кликов, чтобы клик по карточке работал */
.badge-container {
    position: absolute; 
    top: 10px; 
    right: 10px; 
    display: flex; 
    gap: 5px; 
    z-index: 100;
}

/* Бейджи НЕ должны иметь position: absolute, так как они в контейнере */
.message-badge-module, .mention-badge-module {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.message-badge-module { background: #f44336; }
.mention-badge-module { background: #2196f3; }

/* ==================== ВЫПАДАЮЩЕЕ МЕНЮ ПОЛЬЗОВАТЕЛЯ ==================== */
.user-dropdown {
    position: absolute;
    top: 70px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    border: 2px solid #37A9CE;
    width: 250px;
    z-index: 10000;
    overflow: hidden;
    display: none;
}

.user-dropdown .dropdown-header {
    padding: 20px;
    background: #37A9CE;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-dropdown .user-avatar {
    width: 50px;
    height: 50px;
    background: white;
    color: #37A9CE;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
}

.user-dropdown .user-info {
    flex: 1;
}

.user-dropdown .user-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 3px;
}

.user-dropdown .user-position {
    font-size: 14px;
    opacity: 0.9;
}

.user-dropdown .dropdown-menu {
    padding: 10px 0;
}

.user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    gap: 10px;
    transition: all 0.2s ease;
}

.user-dropdown .dropdown-item:hover {
    background: #E7F7FF;
    color: #37A9CE;
}

.user-dropdown .dropdown-item i {
    width: 20px;
    text-align: center;
    color: #37A9CE;
}

.user-dropdown .dropdown-divider {
    height: 1px;
    background: #E7F7FF;
    margin: 10px 0;
}

/* ==================== ТОСТ УПОМИНАНИЙ ==================== */
.mention-toast {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 14px 18px;
    min-width: 280px;
    max-width: 380px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    z-index: 10001;
    cursor: pointer;
    border-left: 4px solid #0d47a1;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mention-toast:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.mention-toast-icon {
    width: 36px;
    height: 36px;
    background: #0d47a1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mention-toast-icon i {
    color: white;
    font-size: 16px;
}

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

.mention-toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.mention-toast-text {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    word-break: break-word;
}

.mention-toast-close {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mention-toast-close:hover {
    color: #333;
    background: #f0f0f0;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== ТОСТ ИНФОРМАЦИИ О ПОЛЬЗОВАТЕЛЕ ==================== */
.user-info-toast {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 10002;
    opacity: 0;
    transform: translateX(120%) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid #37A9CE;
    min-width: 260px;
    max-width: 340px;
}

.user-info-toast.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.user-info-toast-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #37A9CE, #2d8fb0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-info-toast-icon i {
    color: white;
    font-size: 22px;
}

.user-info-toast-content {
    flex: 1;
    min-width: 0;
}

.user-info-toast-name {
    font-weight: 600;
    font-size: 15px;
    color: #2c3e50;
    margin-bottom: 4px;
    word-break: break-word;
}

.user-info-toast-region {
    font-size: 12px;
    color: #37A9CE;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ==================== ВЫПАДАЮЩИЙ СПИСОК ПОДСКАЗОК ==================== */
.suggestions-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid #37A9CE;
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    margin-bottom: 8px;
}

.suggestions-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.suggestions-dropdown-item:last-child {
    border-bottom: none;
}

.suggestions-dropdown-item:hover,
.suggestions-dropdown-item.selected {
    background: #E7F7FF;
}

.suggestions-dropdown-item i {
    font-size: 18px;
    color: #37A9CE;
    width: 24px;
    text-align: center;
}

.suggestions-dropdown-name {
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

/* ==================== СЕЛЕКТОР ЖАЛОБ ==================== */
.complaint-selector-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    background: #E7F7FF;
    border-bottom: 2px solid #37A9CE;
    margin-bottom: 20px;
    position: relative;
}

.complaint-nav-btn {
    background: white;
    border: 2px solid #37A9CE;
    color: #37A9CE;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.complaint-nav-btn:hover {
    background: #37A9CE;
    color: white;
    transform: scale(1.1);
}

.complaint-current {
    flex: 1;
    max-width: 500px;
    padding: 10px 15px;
    background: white;
    border: 2px solid #37A9CE;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    text-align: center;
    cursor: pointer;
    position: relative;
    padding-right: 35px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.complaint-current::after {
    content: '▼';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #37A9CE;
}

.complaint-dropdown {
    position: absolute;
    background: white;
    border: 2px solid #37A9CE;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    width: calc(100% - 30px);
    left: 15px;
    top: 70px;
}

.complaint-dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #E7F7FF;
    font-size: 14px;
    color: #333;
}

.complaint-dropdown-item:hover {
    background: #E7F7FF;
    color: #37A9CE;
}

.complaint-dropdown-item.active {
    background: #37A9CE;
    color: white;
}

/* ==================== ПОИСК В ЧАТЕ ==================== */
.search-nav-container {
    display: none;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    background: white;
    border-radius: 20px;
    padding: 2px 6px;
}

.search-counter {
    font-size: 12px;
    color: #1976d2;
    min-width: 40px;
    text-align: center;
    font-weight: 600;
}

.search-nav-btn {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    color: #2196f3;
    transition: all 0.2s;
}

.search-nav-btn:hover {
    background: #e3f2fd;
}

.search-highlight {
    background-color: #bbdefb;
    color: #0d47a1;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 500;
}

.message.current-search {
    background-color: rgba(33, 150, 243, 0.12);
    border-left: 4px solid #2196f3;
}

/* ==================== КНОПКА ПРОКРУТКИ ==================== */
.scroll-down-btn {
    position: absolute;
    bottom: 80px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #37A9CE 0%, #2c8ab0 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 100;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    pointer-events: none;
}

.scroll-down-btn.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.scroll-down-btn:hover {
    transform: scale(1.1);
}

/* ==================== ИНДИКАТОР ЗАГРУЗКИ ФАЙЛОВ ==================== */
.file-upload-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    border: 2px solid #37A9CE;
    min-width: 300px;
    display: none;
}

.indicator-content {
    text-align: center;
}

.indicator-content i {
    font-size: 48px;
    color: #37A9CE;
    margin-bottom: 15px;
}

.indicator-content .file-name {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
    word-break: break-word;
}

/* ==================== ПРЕДЛОЖЕНИЯ (ЗАГРУЗКА И СПИСОК) ==================== */
#offerDropArea {
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#offerDropArea:hover {
    background: #E7F7FF !important;
    border-color: #2d8fb0 !important;
}

#offerDropArea.drag-over {
    background: #d4edff !important;
    border-color: #0056b3 !important;
}

.file-preview {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #E7F7FF;
    gap: 10px;
}

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

.suggestion-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #E7F7FF;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #37A9CE;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E7F7FF;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ==================== ВКЛАДКА УПОМИНАНИЙ В ЛИЧНОМ КАБИНЕТЕ ==================== */
.mentions-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 5px;
}

.mention-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.mention-card:hover {
    background: #E7F7FF;
    border-color: #37A9CE;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mention-card.unread {
    background: #fff9e6;
    border-left: 4px solid #0d47a1;
}

.mention-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.mention-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #37A9CE;
    font-size: 14px;
}

.mention-author i {
    font-size: 16px;
}

.mention-module-badge {
    background: #e3f2fd;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    color: #1976d2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mention-date {
    font-size: 11px;
    color: #999;
}

.mention-text {
    font-size: 13px;
    color: #555;
    margin: 10px 0;
    padding-left: 32px;
    line-height: 1.5;
    font-style: italic;
}

.mention-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-left: 32px;
}

.mention-actions .btn-small {
    padding: 5px 12px;
    font-size: 12px;
}

.empty-mentions {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-mentions i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

.empty-mentions p {
    margin: 5px 0;
}

/* ==================== ГЛОБАЛЬНЫЙ TOAST ==================== */
.global-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10002;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 14px;
}

.global-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==================== ПРОФИЛЬ ПОЛЬЗОВАТЕЛЯ (МОДАЛКА) ==================== */
.user-profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.user-profile-modal-container {
    position: relative;
    width: 400px;
    max-width: 90%;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 2px solid #37A9CE;
}

.user-profile-header {
    background: linear-gradient(135deg, #37A9CE 0%, #2d8fb0 100%);
    padding: 30px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    color: white;
}

.user-profile-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    border: 3px solid white;
}

.user-profile-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.user-profile-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

.user-profile-body {
    padding: 25px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #E7F7FF;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #37A9CE;
}

.stat-label {
    font-size: 11px;
    color: #666;
}

.profile-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ==================== СТАТИСТИКА ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: #E7F7FF;
    border: 1px solid #37A9CE;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(55, 169, 206, 0.2);
}

.stat-card i {
    font-size: 2.5rem;
    color: #37A9CE;
    margin-bottom: 15px;
}

/* ==================== АНИМАЦИИ ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.message-highlight {
    animation: highlightFlash 1.5s ease-out;
}

@keyframes highlightFlash {
    0% {
        background-color: rgba(13, 71, 161, 0.3);
        box-shadow: 0 0 15px rgba(13, 71, 161, 0.3);
    }
    100% {
        background-color: transparent;
        box-shadow: none;
    }
}


/* Область текста внутри карточки со скроллом */
.block-card-body {
    flex: 1;
    overflow-y: auto;        /* Скролл внутри карточки */
    max-height: 150px;       /* Ограничиваем текст, чтобы он не растягивал карточку */
    padding-right: 5px;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

/* Стилизация скроллбара внутри карточки */
.block-card-body::-webkit-scrollbar {
    width: 4px;
}
.block-card-body::-webkit-scrollbar-thumb {
    background: #37A9CE;
    border-radius: 10px;
}

/* Режим редактирования */
.edit-field-group {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 10px;
}

.edit-field-group textarea {
    flex: 1;
    resize: none;
}
/* ==================== СКРОЛЛБАР ==================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #37A9CE;
    border-radius: 5px;
    border: 2px solid #f1f1f1;
}

::-webkit-scrollbar-thumb:hover {
    background: #2d8fb0;
}

/* Для Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #37A9CE #f1f1f1;
}
/*новое*/
/* Стили для синей собаки в шапке */
#messagesHeaderBtn {
    position: relative;
}

#messagesHeaderBtn .mention-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #0d47a1;
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(13, 71, 161, 0.4);
    z-index: 10;
    white-space: nowrap;
}

#messagesHeaderBtn .mention-badge i {
    font-size: 10px;
}

/* Анимация пульсации для синей собаки */
@keyframes mentionBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.mention-badge,
.mention-badge-module {
    animation: mentionBadgePulse 1.5s infinite;
}
#offerDropArea .drop-area-content {
    display: flex;
    flex-direction: column; /* Элементы в колонку */
    align-items: center;    /* Центрируем всё по горизонтали */
    justify-content: center;/* Центрируем по вертикали (если нужно) */
    width: 100%;
}

/* Убираем возможные лишние отступы у кнопки */
#offerBrowseFilesBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto; /* auto по бокам помогает при обычном выравнивании */
}
/* ================= КНОПКИ ГОЛОСОВАНИЯ ================= */
.voting-action-container {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #ccc;
}

.vote-btn {
    background: none;
    border: 2px solid transparent;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
}

.like-btn:hover { color: #4caf50; }
.dislike-btn:hover { color: #f44336; }


/* ================= СТАТИСТИКА ГОЛОСОВАНИЯ ================= */
.voting-stats-container {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
}

.my-vote-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}
.my-vote-like { background: #e8f5e9; color: #2e7d32; border: 1px solid #4caf50; }
.my-vote-dislike { background: #ffebee; color: #c62828; border: 1px solid #f44336; }

.progress-bar-wrapper {
    width: 100%;
    height: 12px;
    background: #ffebee; /* Фон - дизлайки (красный) */
    border-radius: 6px;
    overflow: hidden;
    display: flex;
}

.progress-like-fill {
    height: 100%;
    background: #4caf50; /* Заполнение - лайки (зеленый) */
    transition: width 0.5s ease;
}

.stat-numbers {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-top: 5px;
    color: #666;
}



/* --- КНОПКИ ЛАЙК/ДИЗЛАЙК --- */
.universal-voting-container {
    margin-top: 40px;
    padding: 20px;
    border-top: 2px dashed #37A9CE;
    background: #fcfcfc;
}

.voting-action-container {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
}

.vote-btn {
    background: white;
    border: 2px solid #e0e0e0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* ==================== КНОПКИ ==================== */

/* Основные кнопки */
.btn-primary {
    background: #37A9CE;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary:hover {
    background: #2d8fb0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(55, 169, 206, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #b0bec5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Вторичные кнопки */
.btn-secondary {
    background: #f8f9fa;
    color: #37A9CE;
    border: 2px solid #37A9CE;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-secondary:hover {
    background: #E7F7FF;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(55, 169, 206, 0.2);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Маленькие кнопки (уже есть, но можно дополнить) */
.btn-small {
    background: #37A9CE;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: #2d8fb0;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(55, 169, 206, 0.3);
}

.btn-small:active {
    transform: translateY(0);
}

/* Кнопка-ссылка */
.btn-link {
    background: transparent;
    color: #37A9CE;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-link:hover {
    text-decoration: underline;
    color: #2d8fb0;
}

/* Кнопка опасного действия (красная) */
.btn-danger {
    background: #f44336;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

/* Маленькая красная кнопка */
.btn-small-danger {
    background: #f44336;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.btn-small-danger:hover {
    background: #d32f2f;
}

.vote-btn:hover { transform: scale(1.1); }
.like-btn.active-like { color: #4caf50; border-color: #4caf50; background: #e8f5e9; }
.dislike-btn.active-dislike { color: #f44336; border-color: #f44336; background: #ffebee; }

/* --- Статистика --- */
.stat-card {
    background: white;
    border: 1px solid #E7F7FF;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
/* Сообщения админа в общем чате */
.message.admin .message-bubble {
    background: #2c3e50 !important; /* Темно-синий/серый цвет админа */
    color: white !important;
    border-color: #1a252f !important;
}

.message.admin .message-author {
    color: #ecf0f1 !important;
}

.message.admin .message-time {
    color: #bdc3c7 !important;
}
.block-card .vote-btn {
    width: auto;
    height: auto;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 16px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    color: #666;
}

/* Цвета для активных лайков */
.vote-btn.active-like {
    color: #4caf50 !important;
    background: #e8f5e9 !important;
    border-color: #4caf50 !important;
}

/* Цвета для активных дизлайков */
.vote-btn.active-dislike {
    color: #f44336 !important;
    background: #ffebee !important;
    border-color: #f44336 !important;
}

.vote-btn:hover {
    background: #eee;
}
/* ==========================================================================
   МОДАЛЬНОЕ ОКНО ГОЛОСОВАНИЯ И ПРЕДЛОЖЕНИЙ (ЧИСТОВИК)
   ========================================================================== */

/* Темный размытый фон на весь экран */
.poll-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(15, 23, 42, 0.5) !important; /* Глубокий темный цвет */
    backdrop-filter: blur(5px) !important; /* Эффект матового стекла */
    z-index: 10006 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    animation: modalFadeIn 0.3s ease !important;
}

/* Сама белая карточка по центру */
.poll-modal-container {
    background: #ffffff !important;
    border-radius: 16px !important;
    width: 90% !important;
    max-width: 480px !important;
    padding: 35px 30px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25) !important;
    animation: modalPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    box-sizing: border-box !important;
}

/* Круглые большие иконки (Галочка / Крестик) */
.poll-modal-container .fa-check-circle {
    color: #4caf50 !important;
    text-shadow: 0 4px 15px rgba(76, 175, 80, 0.4) !important;
}
.poll-modal-container .fa-exclamation-circle {
    color: #f44336 !important;
    text-shadow: 0 4px 15px rgba(244, 67, 54, 0.4) !important;
}

/* Заголовки и текст в окне */
.poll-modal-container h3 {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-bottom: 10px !important;
}
.poll-modal-container p {
    font-size: 15px !important;
    line-height: 1.5 !important;
    color: #64748b !important;
}

/* Поле для ввода текста (textarea) */
.poll-modal-container .form-textarea {
    width: 100% !important;
    min-height: 120px !important;
    padding: 15px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    color: #334155 !important;
    background: #f8fafc !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
}
.poll-modal-container .form-textarea:focus {
    background: #ffffff !important;
    border-color: #37A9CE !important;
    box-shadow: 0 0 0 4px rgba(55, 169, 206, 0.15) !important;
    outline: none !important;
}

/* Зона прикрепления файла */
.poll-modal-container input[type="file"] {
    display: block !important;
    width: 100% !important;
    padding: 10px !important;
    font-size: 13px !important;
    color: #64748b !important;
    background: #ffffff !important;
    border: 1px dashed #cbd5e1 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: border-color 0.2s !important;
}
.poll-modal-container input[type="file"]:hover {
    border-color: #37A9CE !important;
}

/* ===== СТИЛИ ДЛЯ КНОПОК ===== */
.poll-modal-container button {
    padding: 12px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

/* Кнопка "Да, внести" (Синяя) */
#btn-yes-add {
    background: #37A9CE !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(55, 169, 206, 0.3) !important;
}
#btn-yes-add:hover {
    background: #2c8ba9 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(55, 169, 206, 0.4) !important;
}

/* Зеленая кнопка отправки (Для "ЗА") */
#btn-submit-feedback[style*="#4caf50"] {
    background: #4caf50 !important;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3) !important;
}
#btn-submit-feedback[style*="#4caf50"]:hover {
    background: #43a047 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4) !important;
}

/* Красная кнопка отправки (Для "ПРОТИВ") */
#btn-submit-feedback[style*="#f44336"] {
    background: #f44336 !important;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3) !important;
}
#btn-submit-feedback[style*="#f44336"]:hover {
    background: #e53935 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(244, 67, 54, 0.4) !important;
}

/* Серые кнопки отмены */
#btn-no-add, #btn-cancel-form {
    background: #e2e8f0 !important;
    color: #475569 !important;
}
#btn-no-add:hover, #btn-cancel-form:hover {
    background: #cbd5e1 !important;
    color: #1e293b !important;
}

/* ===== АНИМАЦИИ ПОЯВЛЕНИЯ ===== */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalPopIn {
    0% { opacity: 0; transform: scale(0.9) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}


/* Обычная картинка (в режиме просмотра) */
.resizable-image-wrapper {
    display: inline-block;
    position: relative;
    max-width: 100%;
    padding: 5px;
    background: #f9f9f9;
}

.resizable-image-wrapper img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Активный режим редактирования (добавляем маркеры) */
.editing-mode .resizable-image-wrapper {
    border: 1px dashed #37A9CE;
    resize: both; /* Появляется маркер растягивания */
    overflow: auto;
}
/* 1. Возвращаем строгую фиксацию экрана */
html, body {
    height: 100vh !important;
    overflow: hidden !important; /* Убираем скролл всей страницы */
    margin: 0;
}

/* 2. Контейнер должен заполнять экран */
.main-interface, .main-interface-after-auth, .main-content-container {
    height: 100vh !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}

/* 3. Основной контент-обертка */
.main-content {
    flex: 1;
    overflow: hidden; /* Запрещаем скролл всей странице */
    display: flex;
    flex-direction: column;
    height: calc(100vh - 70px); /* Высота экрана минус шапка */
}

/* 4. ВОТ ЭТО ДЕЛАЕТ СКРОЛЛ, КАК В ПРЕДЛОЖЕНИЯХ */
.content-body {
    background: white;
    padding: 25px;
    border-radius: 4px;
    border: 1px solid #37A9CE;
    flex: 1; 
    overflow-y: auto !important; /* ВКЛЮЧАЕМ СКРОЛЛ ВНУТРИ БЛОКА */
    max-height: calc(100vh - 150px); /* Ограничиваем по высоте экрана */
}

/* 5. Карточки блоков: возвращаем их в сетку, но без растягивания body */
.blocks-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px;
    align-content: start;
}

.block-card {
    height: 250px !important; /* Возвращаем фиксированную высоту */
    display: flex;
    flex-direction: column;
}

.block-card-body {
    flex: 1;
    overflow-y: auto !important; /* Скролл внутри карточки */
}
/* Красивый стиль для заголовка блока */
.block-title-display {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #37A9CE;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

/* Обертка для контента, чтобы текст не прилипал к краям */
.block-content-text {
    font-size: 16px;
    line-height: 1.8;
    color: #334155;
    text-align: justify; /* Ровный текст по краям выглядит профессиональнее */
}

/* Немного отступов для картинок внутри контента */
.block-content-text img {
    margin: 15px 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
/* Контейнер формы редактирования */
.edit-form-wrapper {
    background: #ffffff;
    padding: 25px;
    border: 2px solid #37A9CE;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* Общий стиль для всех полей ввода */
.edit-input-field {
    width: 100%;
    padding: 12px 15px;
    margin-top: 5px;
    margin-bottom: 20px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.2s;
}

.edit-input-field:focus {
    border-color: #37A9CE;
    box-shadow: 0 0 0 3px rgba(55, 169, 206, 0.15);
    outline: none;
}

/* Стиль лейблов */
.edit-form-label {
    font-weight: 600;
    color: #475569;
    font-size: 14px;
    display: block;
}
/*изменение размера*/
/* Убедимся, что картинка внутри обертки ведет себя послушно */
.resizable-image-wrapper {
    display: inline-block;
    position: relative;
    padding: 5px;
    background: #f9f9f9;
    border: 1px solid transparent;
    cursor: default;
}

/* В режиме редактирования, когда элемент выбран, 
   браузер сам отрисует рамку с точками для растягивания */
.resizable-image-wrapper img {
    display: block;
    max-width: 100%;
    height: auto;
    /* Убираем pointer-events, чтобы клик шел на картинку, а не на обертку */
    pointer-events: auto; 
}
/* Стили для подзаголовков (вкладок) внутри блока */
.sub-tabs-menu {
    display: flex;
    gap: 15px;
    border-bottom: 2px solid #E7F7FF;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.sub-tab-btn {
    padding: 8px 4px;
    border: none;
    background: none;
    color: #666;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    border-bottom: 3px solid transparent;
    transition: 0.2s ease;
}
.sub-tab-btn:hover { color: #37A9CE; }
.sub-tab-btn.active {
    color: #37A9CE;
    border-bottom-color: #37A9CE;
}
.sub-tab-pane {
    animation: fadeIn 0.3s ease;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}
/* ================= ЛИЧНЫЕ СООБЩЕНИЯ (ЛК) ================= */
.dm-container {
    display: flex;
    height: 600px;
    background: white;
    border: 1px solid #E7F7FF;
    border-radius: 8px;
    overflow: hidden;
}

.dm-sidebar {
    width: 300px;
    border-right: 1px solid #E7F7FF;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.dm-search {
    padding: 15px;
    border-bottom: 1px solid #E7F7FF;
}

.dm-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
}

.dm-contacts {
    flex: 1;
    overflow-y: auto;
}

.dm-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    cursor: pointer;
    transition: 0.2s;
    border-bottom: 1px solid #eee;
}

.dm-contact-item:hover, .dm-contact-item.active {
    background: #E7F7FF;
}

.dm-contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #37A9CE;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.dm-contact-info {
    flex: 1;
    overflow: hidden;
}

.dm-contact-name {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-contact-role {
    font-size: 11px;
    color: #888;
}

.dm-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.dm-chat-header {
    padding: 15px;
    border-bottom: 1px solid #E7F7FF;
    font-weight: bold;
    font-size: 16px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fdfdfd;
}

.dm-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f4f9fb;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dm-input-wrapper {
    padding: 15px;
    background: white;
    border-top: 1px solid #E7F7FF;
    display: flex;
    gap: 10px;
    align-items: center;
}

.dm-input-wrapper textarea {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    resize: none;
    height: 40px;
    outline: none;
    font-family: inherit;
}

.dm-input-wrapper button {
    background: #37A9CE;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
}

.dm-input-wrapper button:hover {
    background: #2b8ba8;
}
#backToTopicsBtn {
    position: static !important; /* Отключаем абсолютное позиционирование */
    margin-top: auto !important; /* Прижимаем к низу */
    margin-bottom: 20px !important;
}
/*пишем кнопку*/
/* Фиксированная оранжевая кнопка внизу слева */
.publish-all-btn-fixed {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    background: #ff9800;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(255, 152, 0, 0.4);
    transition: transform 0.2s, background 0.2s;
}

.publish-all-btn-fixed:hover {
    background: #e68900;
    transform: scale(1.05);
}

.publish-all-btn-fixed:disabled {
    background: #ccc;
    cursor: not-allowed;
}