/* ========== CSS ПЕРЕМЕННЫЕ ========== */
:root {
    /* Цвета */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #f0f0f0;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --info-color: #2196f3;
    
    /* Фоны */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f5f5f5;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    /* Текст */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --text-inverse: #ffffff;
    
    /* Границы */
    --border-color: #e0e0e0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    /* Тени */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.2);
    
    /* Анимации */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Отступы */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Размеры для touch */
    --touch-target: 44px;
}

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

html {
    height: 100%;
    overflow-y: auto;
}

body {
    font-family: 'Times New Roman', Times, serif;
    font-size: 13px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100%;
    position: relative;
}

/* Применяем Times New Roman ко всем элементам */
* {
    font-family: 'Times New Roman', Times, serif;
}

/* Исключаем страницу авторизации из изменения шрифта */
.login-page,
.login-page * {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif !important;
}

/* Заголовки используют размеры из раздела администрации */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Times New Roman', Times, serif;
}

h1 {
    font-size: 24px;
    font-weight: 700;
}

h2 {
    font-size: 24px;
    font-weight: 700;
}

h3 {
    font-size: 20px;
    font-weight: 600;
}

/* Оптимизация производительности анимаций */
* {
    will-change: auto;
}

.btn,
.main-section-btn,
.modal,
.room-card,
.question-item {
    will-change: transform, box-shadow;
}

/* Плавная прокрутка */
html {
    scroll-behavior: smooth;
    height: 100%;
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    animation: fadeIn var(--transition-slow);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

header {
    background: var(--primary-gradient);
    color: var(--text-inverse);
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    /* Анимация убрана для стабильности */
}

header h1 {
    margin-bottom: var(--spacing-md);
    font-size: 24px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-family: 'Times New Roman', Times, serif;
}

.address-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.address-selector label {
    font-weight: 500;
}

.address-selector select {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
}

.address-selector button {
    padding: 8px 16px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.address-selector button:hover {
    background: #f0f0f0;
}

/* Главные разделы */
.main-sections {
    display: flex;
    gap: 4px;
    margin-bottom: var(--spacing-lg);
    background: var(--bg-primary);
    padding: 8px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
}

.main-section-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    /* transition убран для стабильности */
    text-transform: uppercase;
    position: relative;
    white-space: nowrap;
    flex: 0 0 auto;
}

.main-section-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary-color);
    /* Упрощенная анимация без переходов */
}

.main-section-btn:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.main-section-btn.active {
    color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.main-section-btn.active::after {
    width: 100%;
    transition: none; /* Убираем переход для стабильности */
}

.main-section-content {
    display: none;
}

.main-section-content.active {
    display: block;
}

/* Панель выбора дома */
.house-selector-bar {
    background: var(--bg-primary);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base);
}

.house-selector-bar:hover {
    box-shadow: var(--shadow-md);
}

.house-selector-bar .address-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.house-selector-bar .address-selector label {
    font-weight: 500;
    color: #333;
}

.house-selector-bar .address-selector select {
    flex: 1;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.house-selector-bar .address-selector button {
    padding: 8px 16px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.house-selector-bar .address-selector button:hover {
    background: #0b7dda;
}

/* Подразделы в разделе "Дома" */
.sub-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.sub-tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    text-transform: uppercase;
}

.sub-tab-btn:hover {
    color: #667eea;
}

.sub-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

/* Информация о доме */
.house-info-panel {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-base);
}

.house-info-panel:hover {
    box-shadow: var(--shadow-lg);
}

.house-info-panel h3 {
    margin-bottom: 20px;
    color: #333;
}

.info-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #2196F3;
}

.info-card h4 {
    margin-bottom: 10px;
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
}

.info-card p {
    margin: 8px 0;
    color: #333;
}

/* Таблица собраний для дома */
.meetings-table-container {
    overflow-x: auto;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-base);
    -webkit-overflow-scrolling: touch;
}

.meetings-table-container:hover {
    box-shadow: var(--shadow-lg);
}

.house-meetings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.house-meetings-table thead {
    background: #f5f5f5;
}

.house-meetings-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

.house-meetings-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    color: #666;
}

.house-meetings-table tbody tr {
    transition: all var(--transition-fast);
}

.house-meetings-table tbody tr:hover {
    background-color: #f9f9f9;
    transform: translateX(2px);
    box-shadow: -2px 0 0 var(--primary-color);
}

/* Вкладки для детального просмотра собрания */
.meeting-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    background: #f8f9fa;
    padding: 0;
}

.meeting-tab-btn {
    padding: 12px 24px;
    background: var(--bg-primary);
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-base);
    text-transform: uppercase;
    position: relative;
    min-height: var(--touch-target);
}

.meeting-tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--info-color);
    transition: width var(--transition-base);
}

.meeting-tab-btn:hover {
    color: var(--info-color);
    background: var(--bg-secondary);
}

.meeting-tab-btn.active {
    color: var(--info-color);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.meeting-tab-btn.active::after {
    width: 100%;
}

.meeting-tab-content {
    display: none;
    min-height: 300px;
}

.meeting-tab-content.active {
    display: block;
}

.meeting-info-panel {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-base);
}

.meeting-info-panel:hover {
    box-shadow: var(--shadow-lg);
}

.meeting-info-panel h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.info-field {
    margin-bottom: 15px;
}

.info-field label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
    font-weight: 500;
    text-transform: uppercase;
}

.info-value {
    font-size: 13px;
    color: #333;
    padding: 8px 0;
}

.question-item {
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid var(--info-color);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.question-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    border-left-width: 6px;
}

/* Стили для кнопок действий с вопросами */
.question-action-btn {
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.question-action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.question-action-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.question-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.question-edit-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.question-edit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
}

.question-move-up-btn {
    background: linear-gradient(135deg, #2196F3 0%, #1976d2 100%);
    color: white;
}

.question-move-up-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
}

.question-move-down-btn {
    background: linear-gradient(135deg, #2196F3 0%, #1976d2 100%);
    color: white;
}

.question-move-down-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
}

.question-delete-btn {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.question-delete-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
}

/* Стили для формы основных сведений */
.form-section {
    margin-bottom: 20px;
}

.form-section-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.initiators-list {
    background: white;
}

.initiator-item {
    transition: background-color 0.2s;
}

.initiator-item:hover {
    background-color: #f0f0f0;
}

.initiator-item.selected {
    background-color: #e3f2fd;
    border-color: #2196F3 !important;
}

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

.form-group label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #2196F3;
}

.owner-select-item:hover {
    background-color: #f5f5f5;
}

/* Виды для раздела домов */
.meetings-list-view {
    display: block;
}

.meeting-detail-view {
    display: none;
}

.meeting-detail-view .meeting-tabs {
    margin-top: 20px;
}

/* Стили для реестра решений */
.decisions-registry-panel {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-base);
}

.decisions-registry-panel:hover {
    box-shadow: var(--shadow-lg);
}

.decisions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.decisions-summary {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.decisions-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-icon {
    width: 32px;
    height: 32px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.btn-icon:hover {
    background: #0b7dda;
}


.decisions-table-container {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.decisions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: white;
}

.decisions-table thead {
    background: #f5f5f5;
    position: sticky;
    top: 0;
    z-index: 10;
}

.decisions-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

.decisions-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    color: #666;
}

.decisions-table tbody tr:hover {
    background-color: #f9f9f9;
}

.decisions-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Стили для статусов */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge.status-voted {
    background-color: #4caf50;
    color: white;
}

.status-badge.status-abstain {
    background-color: #ff9800;
    color: white;
}

.status-badge.status-not-voted {
    background-color: #f5f5f5;
    color: #666;
}

/* Стили для кнопок голосования */
.voting-buttons {
    display: flex;
    gap: 4px;
    align-items: center;
}

.vote-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.vote-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.vote-btn.active {
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.vote-btn.vote-yes {
    background-color: #4caf50;
    color: white;
}

.vote-btn.vote-yes.active {
    background-color: #2e7d32;
}

.vote-btn.vote-no {
    background-color: #f44336;
    color: white;
}

.vote-btn.vote-no.active {
    background-color: #c62828;
}

.vote-btn.vote-abstain {
    background-color: #ff9800;
    color: white;
}

.vote-btn.vote-abstain.active {
    background-color: #f57c00;
}

/* Подсветка выбранной строки */
.decisions-table tbody tr.selected {
    background-color: #e8f5e9 !important;
}

/* Кнопка детального голосования */
.vote-detail-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 4px;
}

.vote-detail-btn:hover {
    background: #f5f5f5;
    border-color: #2196F3;
}

/* Модальное окно детального голосования */
.detailed-voting-modal {
    max-width: 800px;
    width: 90%;
}

.autofill-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.autofill-label {
    font-weight: 500;
    color: #333;
}

.autofill-buttons {
    display: flex;
    gap: 6px;
}

.autofill-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.2s;
}

.autofill-btn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.autofill-btn.autofill-yes {
    background-color: #4caf50;
    color: white;
}

.autofill-btn.autofill-no {
    background-color: #f44336;
    color: white;
}

.autofill-btn.autofill-abstain {
    background-color: #ff9800;
    color: white;
}

.autofill-btn.autofill-invalid {
    background-color: #9c27b0;
    color: white;
}

.autofill-btn.autofill-clear {
    background-color: #757575;
    color: white;
}

/* Секция сохранения голосов */
.save-votes-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    display: flex;
    justify-content: center;
}

.save-votes-btn {
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 200px;
}

.save-votes-btn:not(:disabled) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.save-votes-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.save-votes-btn:disabled {
    background-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

.save-votes-btn.has-changes {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6);
    }
}

/* Блок вопроса в детальном голосовании */
.questions-container {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

.question-voting-block {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.question-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.question-title-btn {
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 13px;
    cursor: default;
}

.question-help-icon {
    width: 24px;
    height: 24px;
    background: #2196F3;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    cursor: help;
}

.question-voting-buttons {
    display: flex;
    gap: 8px;
}

.question-vote-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.2s;
}

.question-vote-btn:hover {
    background: #f5f5f5;
    border-color: #2196F3;
}

.question-vote-btn.active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

.tab-content {
    display: none;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar input, .toolbar select, .toolbar button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.toolbar input {
    flex: 1;
    min-width: 200px;
}

.toolbar button {
    background: #667eea;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.toolbar button:hover {
    background: #5568d3;
}

.filters {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filters input, .filters select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.info-bar {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 13px;
}

.rooms-list {
    display: grid;
    gap: 10px;
}

.room-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.room-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.room-card:active {
    transform: translateY(0);
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.room-number {
    font-weight: 600;
    font-size: 14px;
    color: #667eea;
}

.room-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    font-size: 13px;
    color: #666;
}

.owner-list {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.owner-item {
    padding: 5px 0;
    font-size: 13px;
}

/* ========== МОДАЛЬНЫЕ ОКНА С АНИМАЦИЯМИ ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-md);
    animation: fadeIn var(--transition-base);
    overflow-y: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUp var(--transition-base);
    margin: auto;
}

.modal::-webkit-scrollbar {
    width: 8px;
}

.modal::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
}

.modal::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--border-radius-sm);
}

.modal::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.close-btn {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 36px;
    height: 36px;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    z-index: 10;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
    background: var(--error-color);
    color: white;
    transform: rotate(90deg) scale(1.1);
}

.close-btn:active {
    transform: rotate(90deg) scale(0.95);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    transition: all var(--transition-base);
    background: var(--bg-primary);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--primary-color);
}

.form-group input[type="file"] {
    padding: 6px;
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ========== СОВРЕМЕННЫЕ КНОПКИ С АНИМАЦИЯМИ ========== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    min-height: var(--touch-target);
    box-shadow: var(--shadow-sm);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-danger {
    background: var(--error-color);
    color: var(--text-inverse);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

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

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

.vote-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.vote-question {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.question-text {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.vote-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.vote-option {
    padding: 8px 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.vote-option:hover {
    border-color: #667eea;
}

.vote-option.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.vote-option.yes.selected {
    background: #96f596;
    border-color: #96f596;
    color: #333;
}

.vote-option.no.selected {
    background: #ff8787;
    border-color: #ff8787;
    color: #333;
}

.vote-option.abstain.selected {
    background: #fbfba5;
    border-color: #fbfba5;
    color: #333;
}

.vote-option.invalid.selected {
    background: #f5d0f4;
    border-color: #f5d0f4;
    color: #333;
}

.analytics-grid {
    display: grid;
    gap: 20px;
}

.stat-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.stat-card h3 {
    margin-bottom: 10px;
    color: #667eea;
}

.stat-value {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 5px;
}

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

.question-result {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #ddd;
}

.question-result.accepted {
    border-left-color: #4caf50;
}

.question-result.rejected {
    border-left-color: #f44336;
}

/* Стили для таблицы аналитики */
.analytics-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.analytics-table thead {
    background: #f8f9fa;
}

.analytics-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.analytics-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
    vertical-align: top;
}

.analytics-table tbody tr:hover {
    background: #f8f9fa;
}

.question-text-cell {
    min-width: 250px;
}

.question-metrics-labels {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    font-size: 10px;
    color: #666;
}

.question-metrics-labels span {
    line-height: 1.2;
}

.vote-cell {
    text-align: center;
    font-size: 12px;
}

.vote-cell > div {
    padding: 2px 0;
    line-height: 1.3;
}

.criterion-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #d4edda;
    color: #155724;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.decision-cell {
    min-width: 200px;
}

.decision-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.decision-status.accepted {
    background: #d4edda;
    color: #155724;
}

.decision-status.rejected {
    background: #f8d7da;
    color: #721c24;
}

.progress-bar-container {
    margin-top: 8px;
}

.progress-bar {
    position: relative;
    height: 30px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: visible;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    position: relative;
    transition: width 1.5s ease-out;
}

/* Анимация заполнения прогресс-бара */
.animated-progress {
    transition: width 1.5s ease-out;
}

/* Анимация переливания после заполнения */
.animated-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.5) 50%,
        transparent 100%
    );
    animation: shimmer 2.5s infinite;
    animation-delay: 1.6s;
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-dot {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px currentColor;
}

.threshold-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ffc107;
    z-index: 10;
}

.threshold-label {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 11px;
    color: #666;
    font-weight: 600;
}

.current-value-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 11px;
    color: #666;
    font-weight: 600;
}

.max-value-label {
    position: absolute;
    bottom: -20px;
    right: 0;
    font-size: 11px;
    color: #666;
}

/* Секция кворума */
.quorum-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.quorum-stats {
    display: flex;
    gap: 30px;
    margin-top: 15px;
}

.quorum-stat-item {
    display: flex;
    gap: 10px;
    align-items: center;
}

.quorum-stat-item span {
    color: #666;
    font-size: 13px;
}

.quorum-stat-item strong {
    color: #333;
    font-size: 13px;
}

.quorum-stat-item.quorum-warning strong {
    color: #f44336;
}

.quorum-warning-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding: 12px 16px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
    font-size: 13px;
}

.warning-icon {
    font-size: 16px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

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

.empty-state::before {
    content: "📋";
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

/* Новый интерфейс для помещений */
.search-filters-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-section {
    flex: 1;
    min-width: 200px;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.filters-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.checkbox-filter {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
}

.checkbox-filter input[type="checkbox"] {
    cursor: pointer;
}

.btn-all-filters {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.btn-all-filters:hover {
    background: #f0f0f0;
}

.action-buttons-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-apply-filters {
    width: 40px;
    height: 40px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.btn-apply-filters:hover {
    background: #45a049;
}

.btn-add-room {
    padding: 12px 24px;
    background: var(--info-color);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    min-height: var(--touch-target);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.btn-add-room:hover {
    background: #1976d2;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.advanced-filters {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    min-width: 200px;
}

.btn-clear-filters {
    padding: 8px 16px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-clear-filters:hover {
    background: #da190b;
}

.rooms-table-container {
    overflow-x: auto;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-base);
    -webkit-overflow-scrolling: touch;
}

.rooms-table-container:hover {
    box-shadow: var(--shadow-lg);
}

.rooms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.rooms-table thead {
    background: #f5f5f5;
}

.rooms-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

.rooms-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.rooms-table tbody tr {
    transition: all var(--transition-fast);
}

.rooms-table tbody tr {
    transition: all var(--transition-fast);
}

.rooms-table tbody tr:hover {
    background-color: #f9f9f9;
    transform: translateX(2px);
    box-shadow: -2px 0 0 var(--primary-color);
}

.rooms-table tbody tr.selected {
    background-color: #e8f5e9 !important;
}

.rooms-table tbody tr.selected:hover {
    background-color: #c8e6c9 !important;
}

.rooms-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.rooms-table .actions-cell {
    display: flex;
    gap: 5px;
}

.rooms-table .action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 13px;
    background: var(--primary-color);
    color: var(--text-inverse);
    transition: all var(--transition-base);
    min-width: var(--touch-target);
    min-height: var(--touch-target);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rooms-table .action-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.rooms-table .action-btn:active {
    transform: translateY(0);
}

.rooms-table .action-btn.delete {
    background: var(--error-color);
}

.rooms-table .action-btn.delete:hover {
    background: #d32f2f;
}

/* Стили для детального просмотра помещения */
.detail-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.detail-tab:hover {
    color: #2196F3;
}

.detail-tab.active {
    color: #2196F3;
    border-bottom-color: #2196F3;
    background-color: rgba(33, 150, 243, 0.1);
}

.detail-tab-content {
    min-height: 300px;
}

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

.detail-field label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
    font-weight: 500;
}

.detail-value {
    font-size: 13px;
    color: #333;
    padding: 4px 0;
    border-bottom: 1px dotted #ccc;
    flex: 1;
}

.edit-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #667eea;
    padding: 2px 4px;
}

.edit-icon-btn:hover {
    color: #5568d3;
}

.rights-table {
    font-size: 13px;
}

.rights-table th {
    font-weight: 600;
    color: #333;
}

.rights-table td {
    color: #666;
}

/* Стили для раздела документов */
.document-group {
    transition: box-shadow 0.3s ease;
}

.document-group:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.document-item {
    transition: all 0.2s ease;
}

.document-item:hover {
    background: #f0f0f0 !important;
    border-color: #2196F3 !important;
    transform: translateX(5px);
}

.document-item:active {
    transform: translateX(2px);
}

.document-item:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========== СОВРЕМЕННЫЙ ДИЗАЙН ========== */

/* Страница логина */
.login-page {
    min-height: 100vh;
    display: flex;
    background: #ffffff;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 60px 80px;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        /* Здания */
        linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, transparent 50%),
        /* Деревья */
        radial-gradient(circle at 20% 80%, rgba(118, 75, 162, 0.2) 0%, transparent 50%),
        /* Фонари */
        radial-gradient(circle at 80% 60%, rgba(102, 126, 234, 0.25) 0%, transparent 40%);
    opacity: 0.6;
    pointer-events: none;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 80px;
    position: relative;
    z-index: 1;
}

.login-logo-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(10px);
}

.login-logo-text {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.login-promo {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.login-promo-line {
    color: #ffffff;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #f8f9fa;
}

.login-card {
    background: white;
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 480px;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    margin-bottom: 40px;
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.login-form label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.login-form input {
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s;
    background: #f8f9fa;
    color: #333;
}

.login-form input::placeholder {
    color: #999;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 50px;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.password-toggle svg {
    display: block;
}

.field-error {
    color: #f44336;
    font-size: 12px;
    margin-top: 4px;
}

.login-forgot {
    margin-top: -8px;
    margin-bottom: 8px;
}

.forgot-password-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

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

.login-submit-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    border: none;
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.login-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4);
}

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

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid #fcc;
}

/* Современный хедер */
.app-header {
    background: var(--primary-gradient);
    color: var(--text-inverse);
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: visible;
    animation: slideDown var(--transition-base);
    z-index: 100;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-lg);
    position: relative;
    z-index: 1;
    overflow: visible;
}

.header-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    font-family: 'Times New Roman', Times, serif;
    flex: 1;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

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

.user-menu-container {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 4px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-menu-btn:hover {
    background: #f8f9fa;
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Открытие меню при наведении */
.user-menu-container:hover .user-menu-dropdown {
    display: block !important;
}

.user-menu-icon {
    width: 28px;
    height: 28px;
    transition: transform var(--transition-base);
    display: block;
    object-fit: contain;
}

.user-menu-btn:hover .user-menu-icon {
    transform: rotate(180deg);
}

.user-menu-btn:hover .user-menu-icon rect {
    fill: #764ba2;
}

/* Выбор организации */
.user-organization-selector {
    position: relative;
    margin-right: 6px;
}

.organization-display {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    min-width: 200px;
}

.organization-display span {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 14px;
}

/* Меню пользователя */
.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    z-index: 10000;
    overflow: hidden;
    display: none;
}

.user-menu-dropdown.show {
    display: block !important;
}

.user-menu-title {
    padding: 16px 16px 12px 16px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition-base);
    cursor: pointer;
    background: #f8f9fa;
    margin: 2px 8px;
    border-radius: 8px;
}

.user-menu-item:hover {
    background: #e9ecef;
}

.user-menu-item:active {
    background: #dee2e6;
}

.user-menu-icon-item {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.user-menu-item:last-child {
    color: var(--error-color);
    margin-top: 8px;
}

.user-menu-item:last-child:hover {
    background: #ffebee;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.4;
}

/* Раздел администрации */
.admin-container {
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 24px;
    font-family: 'Times New Roman', Times, serif;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
}

.admin-tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.admin-tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.admin-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e0e0;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Улучшенные кнопки */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Обновление существующих стилей для современного вида */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    min-height: 100vh;
}

.main-sections {
    background: white;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.main-section-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    animation: fadeIn var(--transition-base);
}

/* Бейдж статуса */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.inactive {
    background: #ffebee;
    color: #c62828;
}

.status-badge.admin {
    background: #e3f2fd;
    color: #1565c0;
}

.status-badge.user {
    background: #f3e5f5;
    color: #7b1fa2;
}

.status-badge.moderator {
    background: #fff3e0;
    color: #e65100;
}

/* Роль бейдж */
.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.role-badge.admin {
    background: #e3f2fd;
    color: #1565c0;
}

.role-badge.user {
    background: #f3e5f5;
    color: #7b1fa2;
}

.role-badge.moderator {
    background: #fff3e0;
    color: #e65100;
}

.role-badge.inspector {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Общий badge для категорий и других целей */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: #e0e0e0;
    color: #424242;
}

/* Toast уведомления */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.notification {
    min-width: 320px;
    max-width: 450px;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    /* Анимация убрана для стабильности */
    animation-fill-mode: both;
    position: relative;
    overflow: hidden;
}

.notification::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #667eea;
}

.notification.success::before {
    background: #4caf50;
}

.notification.warning::before {
    background: #ff9800;
}

.notification.error::before {
    background: #f44336;
}

.notification.info::before {
    background: #2196f3;
}

.notification-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: bold;
}

.notification.success .notification-icon {
    background: #e8f5e9;
    color: #4caf50;
}

.notification.warning .notification-icon {
    background: #fff3e0;
    color: #ff9800;
}

.notification.error .notification-icon {
    background: #ffebee;
    color: #f44336;
}

.notification.info .notification-icon {
    background: #e3f2fd;
    color: #2196f3;
}

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

.notification-title {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
}

.notification-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Специальные стили для уведомления о подписке */
.notification.subscription-warning .notification-title {
    font-size: 16px;
    font-weight: 700;
}

.notification.subscription-warning .notification-message {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
}

.notification-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}

.notification-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* @keyframes slideInRight - убрано */

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ========== АДАПТИВНЫЙ ДИЗАЙН ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ ========== */

/* Планшеты (768px и меньше) */
@media (max-width: 768px) {
    /* Контейнер и отступы */
    .container {
        padding: 10px;
    }
    
    /* Хедер */
    .app-header {
        padding: 15px 20px;
        border-radius: 8px;
        margin-bottom: 15px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    
    .header-title {
        font-size: 16px;
        width: 100%;
        line-height: 1.3;
    }
    
    .header-user {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
    
    .app-header {
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .app-header::before {
        display: none; /* Отключаем анимацию на мобильных для производительности */
    }
    
    /* Навигация по разделам */
    .main-sections {
        flex-wrap: wrap;
        padding: var(--spacing-xs);
        gap: var(--spacing-xs);
    }
    
    .main-section-btn {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: 13px;
        flex: 1;
        min-width: calc(50% - var(--spacing-xs));
        border-radius: var(--border-radius-sm);
    }
    
    /* Подразделы */
    .sub-tabs {
        flex-wrap: wrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .sub-tab-btn {
        padding: 10px 16px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    /* Вкладки собрания */
    .meeting-tabs {
        flex-wrap: wrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .meeting-tab-btn {
        padding: 10px 16px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    /* Админские вкладки */
    .admin-tabs {
        flex-wrap: wrap;
        overflow-x: auto;
    }
    
    .admin-tab-btn {
        padding: 10px 16px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    /* Таблицы - скрываем на мобильных, показываем как карточки */
    .meetings-table-container,
    .rooms-table-container,
    .decisions-table-container,
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .house-meetings-table,
    .rooms-table,
    .decisions-table,
    .data-table,
    .analytics-table {
        font-size: 12px;
        min-width: 600px; /* Минимальная ширина для горизонтальной прокрутки */
    }
    
    .house-meetings-table th,
    .house-meetings-table td,
    .rooms-table th,
    .rooms-table td,
    .decisions-table th,
    .decisions-table td,
    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }
    
    /* Формы */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    #meetingMainInfoForm {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    /* Панели */
    .house-info-panel,
    .meeting-info-panel,
    .decisions-registry-panel {
        padding: 15px;
    }
    
    /* Кнопки */
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    /* Панель выбора дома */
    .house-selector-bar {
        padding: 12px 15px;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .house-selector-bar .address-selector {
        flex-direction: column;
        gap: 10px;
    }
    
    .house-selector-bar .address-selector select {
        max-width: 100%;
        width: 100%;
    }
    
    /* Фильтры */
    .search-filters-bar,
    .filters,
    .advanced-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-section,
    .filters-section {
        width: 100%;
    }
    
    .filter-select,
    .filter-input,
    .search-input {
        width: 100%;
        min-width: auto;
    }
    
    /* Модальные окна */
    .modal-overlay {
        padding: var(--spacing-sm);
        align-items: flex-start;
        padding-top: var(--spacing-lg);
    }
    
    .modal {
        padding: var(--spacing-lg);
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 40px);
        margin: 0;
        border-radius: var(--border-radius);
    }
    
    .close-btn {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .detailed-voting-modal {
        width: 95%;
    }
    
    /* Голосование */
    .voting-buttons {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .vote-btn {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    
    .question-voting-buttons {
        flex-direction: column;
    }
    
    .question-vote-btn {
        width: 100%;
    }
    
    /* Автозаполнение */
    .autofill-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .autofill-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .autofill-btn {
        padding: 10px 14px;
        font-size: 13px;
        flex: 1;
        min-width: calc(50% - 3px);
    }
    
    /* Информационные карточки */
    .info-card {
        padding: 15px;
    }
    
    /* Статистика */
    .quorum-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    /* Уведомления */
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .notification {
        min-width: auto;
        max-width: 100%;
    }
    
    /* Страница логина - мобильная версия */
    .login-page {
        flex-direction: column;
    }
    
    .login-left {
        padding: 40px 30px;
        min-height: 40vh;
    }
    
    .login-logo {
        margin-bottom: 40px;
    }
    
    .login-logo-text {
        font-size: 18px;
    }
    
    .login-promo-line {
        font-size: 28px;
    }
    
    .login-right {
        padding: 30px 20px;
        min-height: 60vh;
    }
    
    .login-card {
        padding: 32px 24px;
        max-width: 100%;
    }
    
    .login-title {
        font-size: 28px;
    }
    
    .login-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    /* @keyframes slideInRight - убрано */
    
    @keyframes fadeOut {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(-100px);
            opacity: 0;
        }
    }
    
    /* Страница логина */
    .login-card {
        padding: 30px 20px;
    }
    
    .login-title {
        font-size: 22px;
    }
    
    /* Администрация */
    .admin-container {
        padding: 15px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    /* Карточки домов - мобильная версия */
    .house-card {
        padding: 16px !important;
    }
    
    .house-card-actions {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .house-edit-btn,
    .house-delete-btn {
        width: 100%;
        justify-content: center;
    }
    
    .house-btn-text {
        display: none;
    }
    
    .house-btn-icon {
        display: inline-block !important;
        font-size: 18px;
    }
    
    .house-info-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}

/* Мобильные телефоны (480px и меньше) */
@media (max-width: 480px) {
    /* Контейнер */
    .container {
        padding: 8px;
    }
    
    /* Хедер */
    .app-header {
        padding: 12px 15px;
    }
    
    .header-title {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .user-name {
        font-size: 13px;
    }
    
    /* Навигация */
    .main-section-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-width: calc(50% - 4px);
    }
    
    .sub-tab-btn,
    .meeting-tab-btn,
    .admin-tab-btn {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    /* Таблицы - минимальные размеры */
    .house-meetings-table,
    .rooms-table,
    .decisions-table,
    .data-table,
    .analytics-table {
        font-size: 11px;
        min-width: 700px;
    }
    
    .house-meetings-table th,
    .house-meetings-table td,
    .rooms-table th,
    .rooms-table td,
    .decisions-table th,
    .decisions-table td,
    .data-table th,
    .data-table td {
        padding: 6px 4px;
    }
    
    /* Панели */
    .house-info-panel,
    .meeting-info-panel,
    .decisions-registry-panel,
    .admin-container {
        padding: 12px;
    }
    
    /* Кнопки */
    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .btn-add-room,
    .btn-primary {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Формы */
    .form-control {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* Модальные окна */
    .modal-overlay {
        padding: var(--spacing-xs);
        padding-top: var(--spacing-md);
    }
    
    .modal {
        padding: var(--spacing-md);
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 20px);
        margin: 0;
        border-radius: var(--border-radius-sm);
    }
    
    .close-btn {
        top: var(--spacing-xs);
        right: var(--spacing-xs);
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    /* Голосование */
    .vote-btn {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }
    
    /* Детальный вид собрания */
    .meeting-detail-view .house-selector-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .meeting-detail-view .house-selector-bar button {
        width: 100%;
    }
    
    #meetingDetailTitle {
        font-size: 14px;
        text-align: left !important;
        margin: 10px 0 !important;
    }
    
    /* Вопросы */
    .question-item {
        padding: 12px;
    }
    
    /* Страница логина */
    .login-card {
        padding: 25px 15px;
    }
    
    .login-title {
        font-size: 16px;
    }
    
    .login-subtitle {
        font-size: 13px;
    }
    
    .login-form input {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    /* Администрация */
    .section-title {
        font-size: 16px;
    }
    
    /* Информационные поля */
    .info-field {
        margin-bottom: 12px;
    }
    
    .info-value {
        font-size: 13px;
    }
    
    /* Карточки */
    .room-card {
        padding: 12px;
    }
    
    .room-number {
        font-size: 13px;
    }
    
    /* Статусные бейджи */
    .status-badge {
        padding: 3px 8px;
        font-size: 11px;
    }
    
    /* Прогресс бары */
    .progress-bar {
        height: 24px;
    }
    
    /* Действия в таблицах */
    .rooms-table .actions-cell {
        flex-direction: column;
        gap: 4px;
    }
    
    .rooms-table .action-btn {
        width: 100%;
        padding: 6px;
    }
    
    /* Детальное голосование */
    .questions-container {
        max-height: 50vh;
    }
    
    .question-voting-block {
        padding: 12px;
    }
    
    /* Голосование */
    .decisions-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .decisions-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    /* Уведомления */
    .notification {
        padding: 12px 16px;
    }
    
    .notification-title {
        font-size: 13px;
    }
    
    .notification-message {
        font-size: 13px;
    }
}

/* Большие мобильные (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    /* Оптимизация для средних экранов */
    .main-section-btn {
        min-width: calc(33.333% - 4px);
    }
    
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .autofill-btn {
        min-width: calc(33.333% - 4px);
    }
}

/* Очень маленькие экраны (до 360px) */
@media (max-width: 360px) {
    .container {
        padding: 5px;
    }
    
    .header-title {
        font-size: 14px;
    }
    
    .main-section-btn {
        padding: 8px 10px;
        font-size: 11px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .login-title {
        font-size: 16px;
    }
    
    .section-title {
        font-size: 16px;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .modal {
        max-height: 85vh;
    }
    
    .questions-container {
        max-height: 50vh;
    }
    
    .decisions-table-container {
        max-height: 50vh;
    }
}

/* Планшеты в портретной ориентации (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #meetingMainInfoForm {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }
    
    .house-meetings-table,
    .rooms-table,
    .decisions-table {
        font-size: 13px;
    }
    
    .main-section-btn {
        padding: 14px 20px;
        font-size: 13px;
    }
}

    /* Улучшение для touch-устройств */
@media (hover: none) and (pointer: coarse) {
    /* Увеличиваем области нажатия для touch */
    .btn,
    .main-section-btn,
    .sub-tab-btn,
    .meeting-tab-btn,
    .admin-tab-btn,
    .rooms-table .action-btn {
        min-height: var(--touch-target);
        min-width: var(--touch-target);
    }
    
    .vote-btn {
        min-width: var(--touch-target);
        min-height: var(--touch-target);
    }
    
    /* Улучшаем видимость активных элементов */
    .main-section-btn.active,
    .sub-tab-btn.active,
    .meeting-tab-btn.active {
        background: rgba(102, 126, 234, 0.15);
    }
    
    /* Улучшаем обратную связь при нажатии */
    .btn:active,
    .main-section-btn:active,
    .sub-tab-btn:active,
    .meeting-tab-btn:active {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

/* Дополнительные улучшения для мобильных устройств */
@media (max-width: 768px) {
    /* Предотвращаем увеличение шрифта на iOS при фокусе */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    textarea,
    select {
        font-size: 16px !important; /* Минимум 16px предотвращает зум на iOS */
    }
    
    /* Улучшаем скролл на мобильных */
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Улучшаем видимость элементов при нажатии */
    .btn:active,
    .main-section-btn:active,
    .sub-tab-btn:active,
    .meeting-tab-btn:active,
    .rooms-table .action-btn:active {
        opacity: 0.8;
        transform: scale(0.96);
    }
    
    /* Улучшаем работу с select на мобильных */
    select {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 40px;
    }
    
    /* Улучшаем отображение форм */
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    /* Улучшаем кнопки действий */
    .form-buttons {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .form-buttons .btn {
        width: 100%;
    }
    
    /* Улучшаем отображение таблиц с действиями */
    .house-meetings-table td:last-child,
    .rooms-table td:last-child {
        position: sticky;
        right: 0;
        background: white;
        box-shadow: -2px 0 4px rgba(0,0,0,0.1);
        z-index: 1;
    }
    
    /* Улучшаем информационные панели */
    .info-card h4 {
        font-size: 13px;
    }
    
    .info-card p {
        font-size: 13px;
        margin: 6px 0;
    }
    
    /* Улучшаем отображение заголовков */
    h2, h3 {
        font-size: 16px;
        line-height: 1.4;
    }
    
    h4 {
        font-size: 14px;
    }
    
    /* Улучшаем отображение списков */
    .initiators-list {
        min-height: 150px;
        max-height: 300px;
    }
    
    /* Улучшаем отображение кнопок с иконками */
    .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    /* Улучшаем отображение тулбара */
    .toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .toolbar input,
    .toolbar select,
    .toolbar button {
        width: 100%;
        margin: 0;
    }
    
    /* Улучшаем отображение фильтров голосования */
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-bar input,
    .filter-bar select,
    .filter-bar button {
        width: 100%;
        margin: 0;
    }
    
    /* Улучшаем отображение детального голосования */
    .question-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .question-title-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    /* Улучшаем отображение прогресс-баров */
    .progress-bar-container {
        margin-top: 10px;
    }
    
    .threshold-label,
    .current-value-label,
    .max-value-label {
        font-size: 10px;
    }
    
    /* Улучшаем отображение аналитики */
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    /* Улучшаем отображение результатов вопросов */
    .question-result {
        padding: 12px;
    }
    
    /* Улучшаем отображение кворума */
    .quorum-section {
        padding: 15px;
    }
    
    .quorum-warning-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    /* Улучшаем отображение документов */
    .document-item {
        padding: 12px;
        font-size: 13px;
    }
    
    /* Улучшаем отображение админки */
    .admin-tab-content .form-grid {
        grid-template-columns: 1fr;
    }
    
    /* Улучшаем отображение кнопок в админке */
    .admin-container .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Улучшаем отображение таблиц в админке */
    .data-table {
        font-size: 12px;
        min-width: 600px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
    
    /* Улучшаем отображение модальных окон с формами */
    .modal .form-group {
        margin-bottom: 15px;
    }
    
    /* Улучшаем отображение списка доступов */
    #accessListTable {
        overflow-x: auto;
    }
    
    /* Улучшаем отображение выбора инициаторов */
    .owner-select-item {
        padding: 12px;
        font-size: 13px;
    }
    
    /* Улучшаем отображение прав доступа */
    .rights-table {
        font-size: 12px;
        width: 100%;
        display: block;
        overflow-x: auto;
    }
    
    /* Улучшаем отображение детальных полей */
    .detail-field {
        margin-bottom: 15px;
    }
    
    .detail-value {
        font-size: 13px;
        word-break: break-word;
    }
    
    /* Улучшаем отображение пустых состояний */
    .empty-state {
        padding: 40px 15px;
        font-size: 13px;
    }
    
    /* Улучшаем отображение загрузки */
    .loading {
        padding: 30px 15px;
        font-size: 13px;
    }
}

/* Дополнительные улучшения для очень маленьких экранов */
@media (max-width: 360px) {
    /* Еще более компактные размеры */
    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .form-control {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .modal {
        padding: 12px;
    }
    
    .notification {
        padding: 10px 14px;
    }
    
    .notification-title {
        font-size: 13px;
    }
    
    .notification-message {
        font-size: 12px;
    }
}

/* ========== ЛИЧНЫЙ КАБИНЕТ ========== */
.profile-container {
    padding: 32px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 900px;
    margin: 0 auto;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.profile-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-card h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.info-row {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(224, 224, 224, 0.5);
    transition: background var(--transition-fast);
    border-radius: var(--border-radius-sm);
    margin-bottom: 4px;
}

.info-row:hover {
    background: rgba(102, 126, 234, 0.05);
}

.info-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 200px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label::after {
    content: ':';
    color: var(--text-tertiary);
}

.info-value {
    color: var(--text-primary);
    font-size: 13px;
    flex: 1;
    font-weight: 500;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-form .form-group {
    margin-bottom: 0;
}

.profile-form .form-group label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
    font-size: 13px;
}

.profile-form .form-control {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    transition: all var(--transition-base);
}

.profile-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.success-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    padding: 14px 18px;
    border-radius: var(--border-radius-sm);
    border: 1px solid #c3e6cb;
    font-size: 13px;
    margin-top: 10px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
    /* Анимация убрана для стабильности */
}

/* @keyframes slideIn - убрано */

/* Адаптивность для личного кабинета */
@media (max-width: 768px) {
    .profile-container {
        padding: 16px;
    }
    
    .profile-card {
        padding: 16px;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .info-label {
        min-width: auto;
        font-size: 13px;
    }
    
    .info-value {
        font-size: 13px;
    }
    
    .user-organization-selector {
        margin-right: 8px;
    }
    
    .organization-display {
        min-width: 150px;
        padding: 8px 12px;
    }
    
    .organization-display span:first-child {
        font-size: 12px;
    }
    
    .user-menu-dropdown {
        right: 0;
        left: auto;
        min-width: 200px;
    }
}

/* Стили для таблицы заказов */
.orders-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.orders-table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, #667eea 100%);
    color: white;
}

.orders-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.orders-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.orders-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.orders-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-primary);
}

.orders-table td:last-child {
    white-space: nowrap;
}

/* Стили для статусов заказов */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-in-progress {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-completed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-default {
    background: #e9ecef;
    color: #495057;
    border: 1px solid #dee2e6;
}

/* Кастомный скроллбар для всего приложения */
/* Кастомный скроллбар отключен */

/* Модальное окно тарифов */
.tariffs-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.tariffs-modal-content {
    background: #f8f9fa;
    border-radius: 16px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.tariffs-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    z-index: 10;
}

.tariffs-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.tariffs-modal-body {
    padding-top: 1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .tariffs-modal-content {
        padding: 1.5rem;
        max-height: 95vh;
    }
    
    .tariffs-cards-grid {
        grid-template-columns: 1fr !important;
    }
    
    .tariff-card.featured {
        transform: scale(1) !important;
    }
}

/* Стили для формы заказа тарифа */
#tariffOrderModal .form-group {
    margin-bottom: 1.5rem;
}

#tariffOrderModal label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

#tariffOrderModal input[type="text"],
#tariffOrderModal input[type="email"],
#tariffOrderModal input[type="tel"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

#tariffOrderModal input:focus {
    outline: none;
    border-color: #8C80F8;
}

#tariffOrderModal input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-right: 0.75rem;
}

#tariffOrderModal label:has(input[type="radio"]) {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff;
    margin-bottom: 0;
}

#tariffOrderModal label:has(input[type="radio"]:checked) {
    border-color: #8C80F8;
    background: #f8f7fc;
}

#tariffOrderModal label:has(input[type="radio"]:hover) {
    border-color: #8C80F8;
    box-shadow: 0 2px 8px rgba(140, 128, 248, 0.2);
}

#tariffOrderModal small {
    color: #666;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

#tariffOrderModal .error-message {
    background: #fee;
    color: #c33;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #fcc;
}

#tariffOrderModal button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Новости --- */
.news-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.news-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.news-filter {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    min-width: 180px;
    font-size: 0.95rem;
}

.news-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.news-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
    aspect-ratio: 1 / 1;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(81, 69, 205, 0.12);
}

.news-card-cover {
    width: 100%;
    flex: 1;
    min-height: 140px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f4f3ff, #fdfcff);
    background-size: cover;
    background-position: center;
}

.news-card-category {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.news-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f3f4ff;
    color: #5145cd;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.news-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1f2937;
    margin: 4px 0 2px;
}

.news-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #6b7280;
    font-size: 0.9rem;
    gap: 10px;
}

.news-card-excerpt {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-actions {
    margin-top: auto;
}

.news-read-btn {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d9dcff;
    background: linear-gradient(135deg, #f7f7ff, #eef0ff);
    color: #5145cd;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.news-read-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(81, 69, 205, 0.18);
}

.news-empty {
    text-align: center;
    padding: 24px;
    color: #777;
}

.news-detail {
    margin-top: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    position: relative;
}

.news-detail-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #f3f4ff;
    color: #5145cd;
    font-size: 18px;
    cursor: pointer;
}

.news-detail-category {
    margin-bottom: 8px;
}

.news-detail h3 {
    margin: 0 0 6px;
    font-size: 1.35rem;
}

.news-detail-meta {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.news-detail-cover img {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 12px;
}

.news-detail-content {
    color: #1f2937;
    line-height: 1.65;
    font-size: 1rem;
}

.news-detail-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 12px 0;
}

.news-detail-content video {
    max-width: 100%;
    border-radius: 12px;
    margin: 12px 0;
}

.news-detail-content a {
    color: #5145cd;
    text-decoration: underline;
}

.news-inline-attachment {
    color: #5145cd;
    font-weight: 600;
    text-decoration: underline;
}

.news-detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}

.news-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    padding: 16px;
}

.news-modal-card {
    background: #fff;
    border-radius: 16px;
    width: min(960px, 100%);
    max-height: calc(100vh - 60px);
    overflow: auto;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.14);
    position: relative;
}

.news-modal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #f3f4ff;
    color: #5145cd;
    font-size: 18px;
    cursor: pointer;
}

/* Адаптивность блока новостей */
@media (max-width: 1100px) {
    .news-cards-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 720px) {
    .news-cards-grid {
        grid-template-columns: repeat(1, minmax(220px, 1fr));
    }

    .news-modal-card {
        width: 100%;
        max-height: calc(100vh - 40px);
    }
}

.news-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.news-modal-body {
    padding: 16px 20px 8px;
}

.news-modal-footer {
    padding: 12px 20px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #e5e7eb;
}

/* Секция комментариев */
.news-comments-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid #e5e7eb;
}

.news-comments-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
}

.news-comments-list {
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.news-comments-empty {
    text-align: center;
    padding: 24px;
    color: #6b7280;
    font-size: 0.95rem;
}

.news-comment-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    position: relative;
}

.news-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.news-comment-author {
    font-weight: 700;
    color: #5145cd;
    font-size: 0.9rem;
}

.news-comment-date {
    color: #6b7280;
    font-size: 0.85rem;
}

.news-comment-content {
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.news-comment-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.7;
}

.news-comment-delete:hover {
    opacity: 1;
    background: #fecaca;
    transform: scale(1.1);
}

.news-comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.news-comment-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
}

.news-comment-textarea:focus {
    outline: none;
    border-color: #5145cd;
}

.news-comment-textarea::placeholder {
    color: #9ca3af;
}

.news-comment-error {
    text-align: center;
    padding: 16px;
    color: #dc2626;
    font-size: 0.9rem;
}

.news-modal-close {
    border: none;
    background: #f3f4ff;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 18px;
    cursor: pointer;
    color: #5145cd;
}

.news-form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.news-form-row .form-group {
    min-width: 220px;
}

.news-cover-control {
    display: flex;
    gap: 12px;
    align-items: center;
}

.news-cover-preview {
    flex: 1;
    min-height: 120px;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    background: #fafafa;
    padding: 10px;
}

.news-cover-preview img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
}

.news-editor-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.news-tool-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 700;
    color: #374151;
}

.news-tool-btn:hover {
    border-color: #8c80f8;
    color: #5145cd;
}

.news-editor {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    min-height: 220px;
    padding: 14px;
    background: #fafbff;
    overflow: auto;
}

.news-editor:focus {
    outline: 2px solid #8c80f8;
}

.news-editor-hint {
    color: #6b7280;
    font-size: 12px;
    display: block;
    margin-top: 6px;
}

/* ========== СТИЛИ ДЛЯ ОРГАНИЗАЦИЙ ========== */
.organizations-container {
    padding: var(--spacing-lg);
}

.organizations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.organization-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

.organization-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.organization-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
}

.organization-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.organization-card-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.organization-card-body {
    display: grid;
    gap: var(--spacing-sm);
}

.organization-card-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.organization-card-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.organization-card-value {
    font-size: 13px;
    color: var(--text-primary);
}

/* ========== СТИЛИ ДЛЯ ДОГОВОРОВ ========== */
.contracts-container {
    padding: var(--spacing-lg);
}

.contracts-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.contract-item {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border-left: 4px solid transparent;
}

.contract-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
    border-left-color: var(--primary-color);
}

.contract-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.contract-item-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.contract-item-meta {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-top: var(--spacing-sm);
    font-size: 12px;
    color: var(--text-secondary);
}

.contract-item-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.contract-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.contract-status-badge.draft {
    background: #fff3e0;
    color: #e65100;
}

.contract-status-badge.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.contract-status-badge.completed {
    background: #e3f2fd;
    color: #1565c0;
}

.contract-status-badge.cancelled {
    background: #ffebee;
    color: #c62828;
}

.news-detail video,
.news-detail img {
    max-width: 100%;
}
