/* ===== СТИЛИ ДАШБОРДА И КАРТОЧЕК ===== */

/* Удалено - теперь используется унифицированное выравнивание из base.css */

/* Удалено - используется стандартное выравнивание */

/* Удалено - используется базовое выравнивание */

/* Убеждаемся что заголовки имеют правильные отступы */
#committee-overview h2,
#committee-meetings h2,
#committee-workgroups h2,
h2.committee-overview {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #1e3c72;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Исправление сетки для детализации комитетов */
#committee-meetings > div[style*="grid"] {
    max-width: 100%;
    box-sizing: border-box;
}

/* Специфичные исправления для элементов, которые могут выходить за границы */
.timeline-grid,
.working-groups,
#committee-meetings > div[style*="display: grid"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

/* Стили для timeline-сетки */
.timeline-grid {
    display: grid;
    grid-template-columns: 2fr repeat(7, 1fr);
    gap: 8px;
    margin: 20px 0;
    font-size: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.timeline-header {
    font-weight: bold;
    text-align: center;
    padding: 8px 4px;
    background: #f0f4ff;
    border-radius: 5px;
    min-width: 80px;
    font-size: 11px;
}

.timeline-row {
    padding: 8px;
    border-left: 3px solid #3b82f6;
    background: #f9fbff;
    border-radius: 3px;
    min-width: 200px;
    font-size: 11px;
    line-height: 1.3;
}

.timeline-cell {
    padding: 6px 4px;
    text-align: center;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 3px;
    font-size: 10px;
    min-width: 80px;
    line-height: 1.2;
}

.highlight-cell {
    background: rgba(59, 130, 246, 0.3);
    font-weight: 500;
    color: #1e40af;
}

.section-row {
    background: linear-gradient(135deg, #4a90b8 0%, #2c5282 100%);
    color: white;
    font-weight: bold;
    padding: 10px 8px;
    text-align: left;
    font-size: 11px;
}

/* Рабочие группы */
.working-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
    max-width: 100%;
    box-sizing: border-box;
}

.group-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.group-card h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* Сетка встреч комитетов */
.committee-meetings-grid {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.committee-meeting-section {
    margin-bottom: 2rem;
}

.committee-meeting-section h3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Встречи и собрания */
.meeting-item {
    background: white;
    margin: 15px 0;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.meeting-title {
    font-weight: bold;
    color: #1e3c72;
    font-size: 1.1rem;
}

.meeting-speaker {
    color: #666;
    font-style: italic;
}

.meeting-description {
    color: #555;
    line-height: 1.5;
    margin-bottom: 10px;
}

.meeting-result {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid #28a745;
    color: #333;
    line-height: 1.4;
}

/* Сетка карточек */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Специальная сетка для рабочих групп - фиксированные колонки */
#committee-workgroups .cards-grid.workgroup-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Адаптивность для рабочих групп */
@media (max-width: 1200px) {
    #committee-workgroups .cards-grid.workgroup-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #committee-workgroups .cards-grid.workgroup-row {
        grid-template-columns: 1fr;
    }
}

/* Основные карточки */
.card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Цветовые схемы карточек */
.card.success { border-left-color: #10b981; }
.card.info { border-left-color: #3b82f6; }
.card.warning { border-left-color: #f59e0b; }
.card.danger { border-left-color: #ef4444; }
.card.secondary { border-left-color: #6b7280; }
.card.purple { border-left-color: #8b5cf6; }
.card.primary { border-left-color: #6366f1; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Специальные стили для карточек рабочих групп */
#committee-workgroups .card-title {
    font-size: 1rem;
    text-transform: none;
    color: #374151;
    margin: 0;
}

#committee-workgroups .card-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    margin: 0.5rem 0;
}

#committee-workgroups .card-description {
    margin: 1rem 0;
}

#committee-workgroups .card-description p {
    color: #4b5563;
    line-height: 1.5;
    margin: 0;
}

/* Обеспечиваем одинаковую высоту карточек */
#committee-workgroups .card {
    display: flex;
    flex-direction: column;
    min-height: 220px;
}

#committee-workgroups .workgroup-criteria {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Стили для заголовка страницы рабочих групп */
#committee-workgroups .page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    margin: -2rem -1rem 2rem -1rem;
    border-radius: 0 0 16px 16px;
    text-align: center;
}

#committee-workgroups .page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

#committee-workgroups .page-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 300;
}

.card-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

/* Иконки карточек по цветам */
.card.success .card-icon { background: #10b981; }
.card.info .card-icon { background: #3b82f6; }
.card.warning .card-icon { background: #f59e0b; }
.card.danger .card-icon { background: #ef4444; }
.card.secondary .card-icon { background: #6b7280; }
.card.purple .card-icon { background: #8b5cf6; }
.card.primary .card-icon { background: #6366f1; }

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}

.card-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Фильтры протоколов */
.protocol-filters {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #6b7280;
}

.protocol-tab {
    font-family: inherit;
    font-size: 0.95rem;
    border: none;
    outline: none;
}

.protocol-tab:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.protocol-tab.active {
    background: #3b82f6 !important;
    color: white !important;
}

.protocol-tab:not(.active) {
    background: white !important;
    color: #3b82f6 !important;
}

.protocol-tab:not(.active):hover {
    background: #eff6ff !important;
}

/* Контейнеры для графиков */
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.chart-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1rem;
    text-align: center;
    font-style: italic;
}

/* Heatmap стили */
.heatmap-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.heatmap {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.heatmap th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    padding: 0.75rem 0.5rem;
    text-align: center;
    border: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.heatmap th:first-child {
    text-align: left;
    background: #f1f5f9;
    position: sticky;
    left: 0;
    z-index: 11;
}

.heatmap td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
}

.heatmap td:first-child {
    text-align: left;
    background: #fafbfc;
    position: sticky;
    left: 0;
    z-index: 5;
    font-weight: 500;
}

/* ===== АДАПТИВНЫЕ СТИЛИ ДЛЯ ДАШБОРДА ===== */

/* Адаптивность для планшетов */
@media (max-width: 1024px) {
    .timeline-grid {
        grid-template-columns: 1.5fr repeat(7, 0.8fr);
        gap: 6px;
        font-size: 11px;
        overflow-x: auto;
    }
    
    .timeline-header {
        padding: 6px 3px;
        font-size: 10px;
        min-width: 60px;
    }
    
    .timeline-row {
        padding: 6px;
        font-size: 10px;
        min-width: 150px;
    }
    
    .timeline-cell {
        padding: 4px 3px;
        font-size: 9px;
        min-width: 60px;
    }
}

/* Адаптивность для смартфонов */
@media (max-width: 768px) {
    .timeline-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .timeline-header {
        display: none;
    }
    
    .timeline-header:first-child {
        display: block;
        text-align: left;
        padding: 10px;
        background: #1e40af;
        color: white;
        font-size: 14px;
    }
    
    .timeline-row {
        min-width: auto;
        font-size: 13px;
    }
    
    .timeline-cell {
        display: none;
    }
    
    .timeline-cell.highlight-cell {
        display: block;
        margin-top: 8px;
        padding: 8px;
        font-size: 12px;
        text-align: left;
        min-width: auto;
    }
}

/* ===== СТИЛИ ВКЛАДКИ УДОВЛЕТВОРЕННОСТИ ===== */

/* Основная статистика */
.satisfaction-overview {
    margin-bottom: 2rem;
}

.satisfaction-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.satisfaction-stats .stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3b82f6;
    text-align: center;
}

.satisfaction-stats .stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.satisfaction-stats .stat-value.large {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
}

/* Графики */
.satisfaction-charts {
    margin-top: 2rem;
}

.chart-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-half {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-full {
    width: 100%;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-wrapper {
    position: relative;
    height: 450px;
    margin-top: 1rem;
}

/* Специальная высота для графика по кварталам */
.satisfaction-charts .chart-half .chart-wrapper {
    height: 500px;
}

/* Увеличенная высота для radar-графика сравнения по вопросам */
.satisfaction-charts .chart-full .chart-wrapper {
    height: 560px;
}

.satisfaction-charts h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

/* Таблица детализации */
.satisfaction-table-container {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.satisfaction-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9rem;
}

.satisfaction-table th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.satisfaction-table td {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.satisfaction-table .org-name {
    font-weight: 500;
    color: #1e3c72;
    max-width: 300px;
}

.satisfaction-table .score-cell {
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
}

.satisfaction-table .change-cell {
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.satisfaction-table .change-cell.trend-up {
    color: #10b981;
}

.satisfaction-table .change-cell.trend-down {
    color: #ef4444;
}

.satisfaction-table .change-cell.trend-neutral {
    color: #6b7280;
}

.satisfaction-table .best-cell {
    color: #10b981;
    font-weight: 500;
    font-size: 0.85rem;
}

.satisfaction-table .worst-cell {
    color: #ef4444;
    font-weight: 500;
    font-size: 0.85rem;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .chart-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .satisfaction-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-wrapper {
        height: 300px;
    }
    
.satisfaction-charts .chart-full .chart-wrapper {
    height: 600px;
}

/* Специальная высота для radar-графика */
#satisfactionQuestionsChart {
    height: 100% !important;
}

/* Улучшенный контейнер для radar-графика */
.satisfaction-charts .chart-full:has(#satisfactionQuestionsChart) .chart-wrapper {
    height: 560px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
    
    .satisfaction-table th,
    .satisfaction-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .satisfaction-table .org-name {
        max-width: 200px;
    }
}

/* ========================================
   СТИЛИ ДЛЯ ПЕЧАТИ В PDF
   ======================================== */

@media print {
    /* Скрываем элементы навигации при печати */
    .header,
    .tabs,
    .tab,
    .protocol-filters,
    .print-controls,
    .print-button {
        display: none !important;
    }
    
    /* Оптимизируем контейнер для печати */
    .container {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }
    
    /* Показываем только активную вкладку satisfaction */
    .tab-content {
        display: none !important;
    }
    
    #satisfaction.tab-content {
        display: block !important;
        margin: 0 !important;
        padding: 20px !important;
        page-break-inside: avoid;
    }
    
    /* Оптимизируем заголовок для печати */
    .chart-container .chart-title {
        font-size: 24px !important;
        margin-bottom: 10px !important;
        text-align: center !important;
        color: #000 !important;
    }
    
    .chart-container .chart-subtitle {
        font-size: 14px !important;
        margin-bottom: 20px !important;
        text-align: center !important;
        color: #666 !important;
    }
    
    /* Статистические карточки для печати */
    .satisfaction-overview {
        margin-bottom: 30px !important;
        page-break-inside: avoid;
    }
    
    .satisfaction-stats {
        display: flex !important;
        justify-content: space-around !important;
        margin-bottom: 20px !important;
    }
    
    .satisfaction-stats .stat-card {
        text-align: center !important;
        border: 1px solid #ddd !important;
        border-radius: 8px !important;
        padding: 15px !important;
        background: #f9f9f9 !important;
        box-shadow: none !important;
        flex: 1 !important;
        margin: 0 10px !important;
    }
    
    .satisfaction-stats .stat-label {
        font-size: 12px !important;
        color: #666 !important;
        margin-bottom: 8px !important;
    }
    
    .satisfaction-stats .stat-value.large {
        font-size: 28px !important;
        font-weight: bold !important;
        color: #000 !important;
    }
    
    /* Графики для печати */
    .satisfaction-charts {
        margin-top: 30px !important;
    }
    
    .chart-row {
        margin-bottom: 40px !important;
        page-break-inside: avoid;
    }
    
    .chart-full {
        width: 100% !important;
        margin-bottom: 30px !important;
    }
    
    .chart-full h3 {
        font-size: 18px !important;
        margin-bottom: 15px !important;
        text-align: center !important;
        color: #000 !important;
        border-bottom: 2px solid #10b981 !important;
        padding-bottom: 8px !important;
    }
    
    .chart-wrapper {
        height: 400px !important;
        margin-bottom: 20px !important;
        border: 1px solid #ddd !important;
        border-radius: 8px !important;
        padding: 15px !important;
        background: white !important;
    }
    
    /* Специальные стили для radar-графика */
    #satisfactionQuestionsChart {
        height: 450px !important;
    }
    
    /* Таблица для печати */
    .satisfaction-table-container {
        margin-top: 40px !important;
        page-break-inside: avoid;
    }
    
    .satisfaction-table-container h3 {
        font-size: 18px !important;
        margin-bottom: 15px !important;
        text-align: center !important;
        color: #000 !important;
        border-bottom: 2px solid #10b981 !important;
        padding-bottom: 8px !important;
    }
    
    .satisfaction-table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 20px !important;
        font-size: 12px !important;
        background: white !important;
    }
    
    .satisfaction-table th,
    .satisfaction-table td {
        border: 1px solid #ddd !important;
        padding: 8px !important;
        text-align: left !important;
        color: #000 !important;
    }
    
    .satisfaction-table th {
        background-color: #f5f5f5 !important;
        font-weight: bold !important;
        font-size: 11px !important;
    }
    
    .satisfaction-table .org-name {
        max-width: 200px !important;
        word-wrap: break-word !important;
        font-size: 11px !important;
    }
    
    .satisfaction-table .score-cell {
        text-align: center !important;
        font-weight: bold !important;
        min-width: 50px !important;
    }
    
    .satisfaction-table .change-cell {
        text-align: center !important;
        font-weight: bold !important;
        min-width: 60px !important;
    }
    
    .satisfaction-table .change-cell.trend-up {
        color: #059669 !important;
    }
    
    .satisfaction-table .change-cell.trend-down {
        color: #dc2626 !important;
    }
    
    .satisfaction-table .change-cell.trend-neutral {
        color: #6b7280 !important;
    }
    
    /* Разрывы страниц */
    .chart-row:nth-child(2) {
        page-break-before: always;
    }
    
    .satisfaction-table-container {
        page-break-before: always;
    }
    
    /* Убираем лишние отступы */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    /* Оптимизация цветов для черно-белой печати */
    .chart-container,
    .satisfaction-charts,
    .satisfaction-overview {
        background: white !important;
        color: black !important;
    }
}