/* ===== СТИЛИ ДЛЯ ВКЛАДКИ ФУНКЦИОНАЛЬНАЯ ЗРЕЛОСТЬ ===== */

/* Специфичные стили для критических вопросов */
.critical-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.critical-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.critical-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

.critical-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.critical-card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.critical-card-title {
    flex: 1;
}

.critical-card-title h3 {
    margin: 0 0 0.25rem 0;
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
}

.critical-card-title p {
    margin: 0;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
}

.critical-card-status {
    font-size: 1.2rem;
    font-weight: 700;
}

.critical-card-description {
    margin-bottom: 1.25rem;
}

.critical-card-description p {
    margin: 0;
    color: #4b5563;
    line-height: 1.5;
    font-size: 0.9rem;
}

.critical-card-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Адаптивность для критических карточек */
@media (max-width: 768px) {
    .critical-cards-grid {
        grid-template-columns: 1fr;
    }

    .critical-card-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Управление графиками */
.control-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.control-header h4 {
    color: #1f2937;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.control-header p {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

.chart-controls {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    max-width: 100%;
    overflow: hidden;
}

/* Группы переключателей */
.toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
    align-items: center;
    width: 100%;
    padding: 0;
}

/* Убрано - не нужно для Grid */

.toggle-separator {
    width: 100%;
    text-align: center;
    margin: 1rem 0;
    padding: 0.5rem 0;
}

.toggle-separator span {
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}

/* Упрощенные переключатели без плашек */
.toggle-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    background: transparent;
    border: none;
    flex: 1;
    position: relative;
    z-index: 1;
    box-shadow: none;
    box-sizing: border-box;
    overflow: visible;
    min-height: auto;
    width: 100%;
    transition: opacity 0.2s ease;
}

.toggle-switch:hover .toggle-content {
    opacity: 0.8;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider ~ .toggle-content {
    opacity: 1;
}

.employees-toggle input[type="checkbox"]:checked + .toggle-slider ~ .toggle-content {
    opacity: 1;
}

.directors-toggle input[type="checkbox"]:checked + .toggle-slider ~ .toggle-content {
    opacity: 1;
}

.combined-toggle input[type="checkbox"]:checked + .toggle-slider ~ .toggle-content {
    opacity: 1;
}

.special-toggle .toggle-content {
    opacity: 0.7;
}

.special-toggle input[type="checkbox"]:checked + .toggle-slider ~ .toggle-content {
    opacity: 1;
}

.toggle-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border-radius: 0;
    min-width: auto;
    margin-right: 0.25rem;
}

.toggle-text {
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.toggle-text strong {
    display: inline;
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 0.5rem;
    line-height: 1.2;
    white-space: nowrap;
}

.toggle-text small {
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1.3;
    white-space: nowrap;
    display: inline;
}

/* Специфичные переключатели для maturity */
#maturity .toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin: 0;
    width: 100%;
    position: relative;
    z-index: 1;
    justify-content: flex-start;
}

#maturity .toggle-switch input[type="checkbox"] {
    display: none;
}

#maturity .toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 24px;
    transition: background 0.3s ease;
    border: none;
    flex-shrink: 0;
    margin-right: 0.75rem;
    z-index: 2;
}

#maturity .toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#maturity .toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background: #3b82f6;
}

#maturity .toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
}

#maturity .employees-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: #10b981;
}

#maturity .directors-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: #eab308;
}

#maturity .combined-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: #3b82f6;
}

#maturity .april-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: #8b5cf6;
}

/* Специфичные стили для апреля */
#maturity .april-toggle .toggle-label {
    color: #7c3aed;
    font-weight: 600;
}

#maturity .april-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: #7c3aed;
}

/* Специфичные стили для контейнеров графиков в maturity */
#maturity .chart-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

#maturity .chart-toggles {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    width: 100%;
}

.nps-toggles {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

/* Дубликат удален - используем основной стиль выше */

#maturity .toggle-switch input[type="checkbox"] {
    display: none;
}

#maturity .toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: #d1d5db;
    border-radius: 24px;
    transition: background 0.3s ease;
    border: none;
}

#maturity .toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#maturity .toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background: #3b82f6;
}

#maturity .toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(26px);
}

#maturity .toggle-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* Специфичные стили для апреля */
#maturity .april-toggle .toggle-label {
    color: #7c3aed;
    font-weight: 600;
}

#maturity .april-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: #7c3aed;
}

/* Легенда аббревиатур */
.abbreviations-legend {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.legend-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    text-align: center;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.5rem;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.legend-abbr {
    font-weight: bold;
    color: #3b82f6;
    min-width: 4rem;
    margin-right: 0.5rem;
}

.legend-full {
    color: #4b5563;
    flex: 1;
}

/* NPS контролы */
.nps-controls-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: start;
}

.nps-legend {
    flex: 1;
}

.nps-legend h5 {
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.nps-legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.nps-legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.nps-legend-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-color: #3b82f6;
}

.nps-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.nps-promoters .nps-color {
    background: #10b981;
}

.nps-passives .nps-color {
    background: #eab308;
}

.nps-detractors .nps-color {
    background: #ef4444;
}

.nps-text {
    flex: 1;
}

.nps-text strong {
    display: block;
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.nps-text small {
    color: #6b7280;
    font-size: 0.75rem;
}

.nps-toggle-section {
    min-width: 200px;
}

.export-nps-was-stalo-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    background: #10b981;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.1s ease;
}
.export-nps-was-stalo-btn:hover {
    background: #0d9668;
}
.export-nps-was-stalo-btn:active {
    transform: scale(0.98);
}

/* NPS интерпретация */
.nps-interpretation {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.nps-scale h4 {
    margin: 0 0 1rem 0;
    color: #374151;
    text-align: center;
}

.nps-scale-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.nps-scale-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.nps-scale-item.excellent {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.nps-scale-item.good {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.nps-scale-item.acceptable {
    background: linear-gradient(135deg, #eab308, #ca8a04);
    color: white;
}

.nps-scale-item.needs-improvement {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.nps-range {
    font-weight: bold;
    font-size: 1rem;
}

.nps-label {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Улучшенные фильтры тепловой карты */
.filter-header {
    text-align: center;
    margin-bottom: 1rem;
}

.filter-header h5 {
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.filter-header p {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 0;
}

.filter-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.filter-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 60px;
}

.filter-button:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.filter-button.active {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
    color: #1e40af;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.filter-button:active {
    transform: translateY(0);
}

.filter-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.filter-content {
    flex: 1;
}

.filter-content strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.filter-content small {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Легенда вопросов для тепловой карты */
#maturity .questions-legend {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

#maturity .questions-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.1rem;
}

#maturity .questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.75rem;
}

#maturity .question-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    font-size: 0.9rem;
    line-height: 1.4;
    transition: all 0.2s ease;
}

#maturity .question-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

#maturity .q-num {
    background: #3b82f6;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    min-width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Специфичные стили для аналитики участников в maturity */
#maturity .participants-analytics {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

#maturity .analytics-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

#maturity .analytics-header h3 {
    color: #1e40af;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

#maturity .analytics-header p {
    color: #64748b;
    font-size: 0.95rem;
}

#maturity .analytics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#maturity .analytics-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

#maturity .analytics-card.total {
    border-left: 4px solid #3b82f6;
}

#maturity .analytics-card.employees {
    border-left: 4px solid #10b981;
}

#maturity .analytics-card.directors {
    border-left: 4px solid #8b5cf6;
}

#maturity .analytics-card.branches {
    border-left: 4px solid #eab308;
}

#maturity .card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Дубликаты удалены - используем стили из components.css */

#maturity .branches-breakdown {
    background: white;
    border-radius: 8px;
    padding: 1rem;
}

#maturity .branches-breakdown h4 {
    color: #374151;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

#maturity .branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

#maturity .branch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
    transition: background-color 0.2s;
}

#maturity .branch-item:hover {
    background: #f1f5f9;
}

#maturity .branch-name {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

#maturity .branch-stats {
    font-size: 0.85rem;
    color: #64748b;
}

#maturity .branch-total {
    font-weight: 600;
    color: #1e40af;
}

/* Адаптивность для maturity компонента */
@media (max-width: 768px) {
    .control-header h4 {
        font-size: 1rem;
    }

    .toggle-group {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0;
        align-items: flex-start;
    }

    .toggle-content {
        padding: 0.25rem;
        gap: 0.4rem;
        min-height: auto;
    }

    .toggle-icon {
        font-size: 1.1rem;
        margin-right: 0.2rem;
    }

    .toggle-text strong {
        font-size: 0.85rem;
        white-space: normal;
        line-height: 1.1;
    }

    .toggle-text small {
        font-size: 0.7rem;
        white-space: normal;
        line-height: 1.2;
    }

    #maturity .toggle-switch {
        width: 100%;
        margin: 0;
    }

    .chart-controls {
        padding: 1.5rem;
        border-radius: 12px;
    }
}

/* Дополнительная адаптивность для очень маленьких экранов */
@media (max-width: 480px) {
    .chart-controls {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .toggle-group {
        gap: 0.5rem;
    }

    .toggle-content {
        padding: 0.2rem;
        gap: 0.3rem;
        min-height: auto;
    }

    .toggle-icon {
        font-size: 1rem;
        margin-right: 0.15rem;
    }

    .toggle-text strong {
        font-size: 0.8rem;
        line-height: 1.1;
    }

    .toggle-text small {
        font-size: 0.65rem;
        line-height: 1.1;
    }

    .control-header h4 {
        font-size: 0.9rem;
    }

    .control-header p {
        font-size: 0.8rem;
    }

    .nps-controls-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .nps-legend-items {
        grid-template-columns: 1fr;
    }

    .nps-toggle-section {
        min-width: auto;
    }

    .filter-buttons {
        grid-template-columns: 1fr;
    }

    .filter-button {
        min-height: 50px;
        padding: 0.75rem;
    }

    /* Дубликат удален - используем основной стиль выше */

    #maturity .analytics-cards {
        grid-template-columns: 1fr;
    }

    #maturity .questions-grid {
        grid-template-columns: 1fr;
    }

    #maturity .function-tabs-grid {
        grid-template-columns: 1fr;
    }

    #maturity .branches-grid {
        grid-template-columns: 1fr;
    }

    #maturity .nps-info {
        flex-direction: column;
        gap: 1rem;
    }

    #maturity .nps-scale-items {
        grid-template-columns: 1fr;
    }
}

/* Стили для вкладок функций */
#maturity .function-tabs-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
    border: 1px solid #e5e7eb;
}

#maturity .function-tabs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    min-height: 200px;
}

#maturity .function-tab {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 140px;
    text-decoration: none;
    color: inherit;
}

.function-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.function-tab:active {
    transform: translateY(0);
}

.function-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.function-tab-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
    line-height: 1.3;
    flex: 1;
    margin-right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.function-abbr {
    font-weight: 700;
    color: #3b82f6;
    font-size: 1.1rem;
    text-align: center;
    background: #f0f9ff;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #e0f2fe;
}

.function-name {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.2;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.function-tab-score {
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    color: white;
    text-align: center;
    min-width: 45px;
}

.function-tab-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #6b7280;
    gap: 0.5rem;
}

.function-tab-participants {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.function-tab-previous {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.7rem;
}

.function-tab-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    flex: 1;
    justify-content: flex-end;
}

/* Цветовые классы для оценок */
.score-excellent { background: #059669; }
.score-good { background: #16a34a; }
.score-medium { background: #ca8a04; }
.score-low { background: #ea580c; }
.score-critical { background: #dc2626; }

/* Индикаторы тенденций */
.trend-up { color: #059669; }
.trend-down { color: #dc2626; }
.trend-neutral { color: #6b7280; }

/* Легенда функций */
.function-legend {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.function-legend .legend-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.function-legend .legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.function-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.function-legend .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .questions-grid {
        grid-template-columns: 1fr;
    }
    
    /* Дубликат удален - используем основной стиль выше */
    
    .chart-controls {
        padding: 0.75rem;
    }
    
    .legend-grid {
        grid-template-columns: 1fr;
    }
    
    .nps-info {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .function-tabs-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .function-tab {
        padding: 0.75rem;
    }

    .function-tab-title {
        font-size: 0.9rem;
    }

    .function-legend .legend-items {
        flex-direction: column;
        gap: 0.5rem;
    }
}