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

        html, body {
            height: 100%;
            overflow: hidden;
        }

        body {
            font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
            background: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%);
            color: #fff;
            display: flex;
            flex-direction: column;
            padding: 15px;
        }

        /* ШАПКА ДАШБОРДА */
        .header {
            background: rgba(255, 255, 255, 0.05);
            backdrop-filter: blur(10px);
            border-radius: 15px;
            padding: 20px 40px;
            margin-bottom: 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            flex-shrink: 0;
            flex-wrap: wrap;
            gap: 20px;
        }

        .header-stats {
            display: flex;
            flex: 1;
            min-width: 0;
            justify-content: space-between;
            align-items: center;
        }

        .header-item {
            text-align: center;
            flex: 1;
            min-width: 0;
            position: relative;
        }

        .header-item:not(:last-child)::after {
            content: '';
            position: absolute;
            right: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 1px;
            height: 60%;
            background: rgba(255, 255, 255, 0.2);
        }

        .header-label {
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: #a0aec0;
            margin-bottom: 8px;
        }

        .header-value {
            font-size: 26px;
            font-weight: 700;
            color: #fff;
        }

        .header-value.plan { color: #63b3ed; }
        .header-value.done { color: #68d391; }
        .header-value.left { color: #fc8181; }
        .header-value.percent { color: #f6e05e; }

        .header-value.percent::after {
            content: '%';
            font-size: 18px;
            margin-left: 3px;
        }

        /* ФИЛЬТР ПЕРИОДОВ */
        .period-filter {
            display: flex;
            max-width: 100%;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 10px;
            padding: 4px;
            gap: 4px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .period-btn {
            background: transparent;
            border: none;
            color: #a0aec0;
            padding: 8px 16px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .period-btn:hover {
            color: #fff;
            background: rgba(255, 255, 255, 0.05);
        }

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

        .period-btn.active::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            animation: shimmer-btn 2s infinite;
        }

        @keyframes shimmer-btn {
            0% { left: -100%; }
            100% { left: 100%; }
        }

        /* ОСНОВНАЯ ЧАСТЬ */
        .dashboard-container {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 10px;
        }

        .dashboard-grid {
            display: grid;
            width: 100%;
            max-width: 100%;
            grid-template-columns: repeat(4, 1fr);
            gap: 15px;
        }

        /* КАРТОЧКА СОТРУДНИКА */
        .employee-card {
            background: rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(10px);
            border-radius: 15px;
            padding: 20px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            position: relative;
            width: 100%;
            min-width: 0;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .employee-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
        }

        /* АНИМАЦИЯ НОВОГО ЛИДЕРА */
        .employee-card.new-leader {
            animation: leaderPulse 2s ease-in-out infinite;
            border: 2px solid #ffd700;
            box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), 0 12px 40px rgba(0, 0, 0, 0.4);
        }

        @keyframes leaderPulse {
            0%, 100% { 
                box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), 0 12px 40px rgba(0, 0, 0, 0.4);
                transform: translateY(-5px) scale(1.02);
            }
            50% { 
                box-shadow: 0 0 50px rgba(255, 215, 0, 0.8), 0 15px 50px rgba(0, 0, 0, 0.5);
                transform: translateY(-8px) scale(1.05);
            }
        }

        /* БЕЙДЖ НОВОГО ЛИДЕРА */
        .new-leader-badge {
            position: absolute;
            top: -10px;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
            color: #744210;
            padding: 5px 15px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 1px;
            box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5);
            z-index: 20;
            animation: badgeBounce 1s ease infinite;
            white-space: nowrap;
        }

        @keyframes badgeBounce {
            0%, 100% { transform: translateX(-50%) translateY(0); }
            50% { transform: translateX(-50%) translateY(-5px); }
        }

        /* РЕЙТИНГ - ВНУТРИ ГРАНИЦ КАРТОЧКИ */
        .rank-badge {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            font-weight: 700;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
            z-index: 10;
            border: 2px solid rgba(255, 255, 255, 0.3);
        }

        .rank-badge.gold {
            background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
            color: #744210;
        }

        .rank-badge.silver {
            background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
            color: #4a5568;
        }

        .rank-badge.bronze {
            background: linear-gradient(135deg, #cd7f32 0%, #daa520 100%);
            color: #744210;
        }

        .rank-badge.gold::before { content: '🏆'; }
        .rank-badge.silver::before { content: '🥈'; }
        .rank-badge.bronze::before { content: '🥉'; }

        /* ШАПКА КАРТОЧКИ */
        .card-header {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
            gap: 12px;
            padding-right: 45px;
        }

        .employee-photo {
            width: 60px;
            height: 60px;
            border-radius: 12px;
            object-fit: cover;
            border: 2px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            flex-shrink: 0;
            background: rgba(255, 255, 255, 0.1);
        }

        .employee-info {
            flex: 1;
            min-width: 0;
        }

        .employee-name {
            font-size: 15px;
            font-weight: 600;
            color: #fff;
            line-height: 1.3;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .employee-position {
            font-size: 11px;
            color: #a0aec0;
            margin-top: 3px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* МЕТРИКИ - ОДИН РЯД */
        .metrics-row {
            display: flex;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 10px;
        }

        .metric-item {
            background: rgba(0, 0, 0, 0.2);
            border-radius: 10px;
            padding: 10px 5px;
            text-align: center;
            flex: 1;
            min-width: 0;
            transition: background 0.3s ease;
        }

        .metric-item:hover {
            background: rgba(0, 0, 0, 0.3);
        }

        .metric-gauge {
            width: 60px;
            height: 60px;
            margin: 0 auto 8px;
            position: relative;
        }

        /* ЦВЕТА СЕКЦИЙ СПИДОМЕТРА */
        .gauge-red {
            fill: none;
            stroke: #fc8181;
            stroke-width: 6;
        }

        .gauge-yellow {
            fill: none;
            stroke: #f6e05e;
            stroke-width: 6;
        }

        .gauge-green {
            fill: none;
            stroke: #68d391;
            stroke-width: 6;
        }

        /* СТРЕЛКА - 17PX */
        .gauge-arrow {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 2px;
            height: 17px;
            background: #fff;
            transform-origin: bottom center;
            transform: translate(-50%, -100%) rotate(135deg);
            transition: transform 0.8s ease;
            border-radius: 1px;
            z-index: 5;
            box-shadow: 0 0 3px rgba(0,0,0,0.5);
        }

        .gauge-arrow::after {
            content: '';
            position: absolute;
            top: -3px;
            left: 50%;
            transform: translateX(-50%);
            border-left: 4px solid transparent;
            border-right: 4px solid transparent;
            border-bottom: 5px solid #fff;
        }

        /* ПОДПИСЬ С ПОКАЗАТЕЛЕМ */
        .metric-label {
            font-size: 11px;
            color: #fff;
            font-weight: 600;
            line-height: 1.2;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* БЛОК ПЛАНА - ПРОГРЕСС-БАР */
        .plan-container {
            background: rgba(0, 0, 0, 0.2);
            border-radius: 10px;
            padding: 12px;
        }

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

        .plan-title {
            font-size: 11px;
            color: #a0aec0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .plan-percent {
            font-size: 14px;
            font-weight: 700;
            color: #f6e05e;
        }

        /* ПРОГРЕСС-БАР - СЕРЫЙ ФОН */
        .progress-bar-bg {
            width: 100%;
            height: 8px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 4px;
            overflow: hidden;
            position: relative;
            margin-bottom: 8px;
        }

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

        .progress-bar-fill::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(90deg, 
                rgba(255,255,255,0) 0%, 
                rgba(255,255,255,0.3) 50%, 
                rgba(255,255,255,0) 100%);
            animation: shimmer 2s infinite;
        }

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

        /* Цвета прогресс-бара в зависимости от процента */
        .progress-low { background: linear-gradient(90deg, #fc8181 0%, #e53e3e 100%); }
        .progress-mid { background: linear-gradient(90deg, #f6e05e 0%, #d69e2e 100%); }
        .progress-high { background: linear-gradient(90deg, #68d391 0%, #38a169 100%); }

        /* БАЛЛЬНАЯ СИСТЕМА - КОМПАКТНЫЙ ГОРИЗОНТАЛЬНЫЙ БЛОК */
        .score-container {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
            border-radius: 10px;
            padding: 10px 12px;
            margin-top: 10px;
            border: 1px solid rgba(102, 126, 234, 0.2);
        }

        .score-main-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0;
        }

        /* Левая и правая колонки - равномерное распределение */
        .score-side {
            display: flex;
            flex-direction: row;
            justify-content: space-around;
            flex: 1;
            gap: 8px;
        }

        .score-side.left {
            justify-content: space-around;
        }

        .score-side.right {
            justify-content: space-around;
        }

        /* Отдельный показатель: плюсик и цифра на одной строке, подпись на второй */
        .score-detail-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            line-height: 1.2;
            text-align: center;
            flex: 1;
        }

        .score-detail-value {
            font-size: 14px;
            font-weight: 700;
            color: #fff;
            display: flex;
            align-items: center;
            gap: 2px;
        }

        /* Плюсик маленький, серый */
        .score-detail-value::before {
            content: '+';
            font-size: 11px;
            color: #a0aec0;
            font-weight: 400;
        }

        .score-detail-label {
            font-size: 10px;
            color: #a0aec0;
            text-transform: lowercase;
            line-height: 1;
        }

        /* Центральный блок с общим баллом - увеличенные отступы */
        .score-center {
            text-align: center;
            flex: 0 0 auto;
            padding: 0 20px;
            margin: 0 10px;
            border-left: 1px solid rgba(255, 255, 255, 0.1);
            border-right: 1px solid rgba(255, 255, 255, 0.1);
        }

        .score-label {
            font-size: 9px;
            color: #a0aec0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 2px;
        }

        .score-value {
            font-size: 22px;
            font-weight: 800;
            color: #f6e05e;
            text-shadow: 0 2px 8px rgba(246, 224, 94, 0.3);
            line-height: 1;
        }

        /* ИНДИКАТОР ЗАГРУЗКИ */
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(26, 31, 46, 0.95);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            backdrop-filter: blur(10px);
        }

        .loading-spinner {
            width: 60px;
            height: 60px;
            border: 4px solid rgba(255, 255, 255, 0.1);
            border-top-color: #63b3ed;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        .loading-text {
            margin-top: 20px;
            font-size: 16px;
            color: #a0aec0;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .hidden {
            display: none !important;
        }

        /* АДАПТИВНОСТЬ */
        @media (max-width: 1400px) {
            .dashboard-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        @media (max-width: 1200px) {
            .header {
                flex-direction: column;
                padding: 14px 16px;
                gap: 12px;
            }
            .header-stats {
                width: 100%;
                margin-bottom: 8px;
            }
            .header-item:not(:last-child)::after {
                display: none;
            }
        }

        @media (max-width: 1024px) {
            .dashboard-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            .header {
                padding: 12px 14px;
                gap: 10px;
            }
            .header-stats {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 8px 10px;
                width: 100%;
                margin-bottom: 6px;
            }
            .header-item {
                min-width: 0;
                margin-bottom: 0;
                padding: 2px 0;
            }
            .header-label {
                font-size: 11px;
                margin-bottom: 4px;
            }
            .header-value {
                font-size: 22px;
            }
            .header-value.percent::after {
                font-size: 15px;
            }

            /* На планшете центральный блок балла может раздувать ширину flex-контейнера */
            .score-center {
                padding: 0 12px;
                margin: 0 6px;
                min-width: 0;
                flex: 0 1 auto;
            }
        }

        @media (max-width: 640px) {
            .dashboard-grid {
                grid-template-columns: 1fr;
            }
            .header {
                padding: 10px 10px;
                gap: 8px;
            }
            .header-stats {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 6px 8px;
                width: 100%;
                margin-bottom: 4px;
            }
            .header-item {
                min-width: 0;
                margin-bottom: 0;
                padding: 1px 0;
            }
            .header-label {
                font-size: 10px;
                letter-spacing: 0.6px;
                margin-bottom: 3px;
            }
            .header-value {
                font-size: 18px;
            }
            .header-value.percent::after {
                font-size: 12px;
                margin-left: 2px;
            }
            .period-filter {
                justify-content: flex-start;
                overflow-x: auto;
                overflow-y: hidden;
                white-space: nowrap;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none;
            }
            .period-filter::-webkit-scrollbar { display: none; }
            .period-btn {
                flex: 0 0 auto;
                padding: 7px 12px;
                font-size: 12px;
            }
            .score-main-row {
                gap: 0;
            }
            .score-side {
                gap: 4px;
            }
            .score-detail-value {
                font-size: 12px;
            }
            .score-detail-value::before {
                font-size: 10px;
            }
            .score-detail-label {
                font-size: 9px;
            }
            .score-value {
                font-size: 18px;
            }
            .score-center {
                padding: 0 12px;
                margin: 0 5px;
            }
        }

        @media (max-width: 1180px) {
            /* На ~1150px карточки уже узкие для 4 метрик в одну строку */
            .metrics-row {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 8px;
            }

            .metric-item {
                padding: 9px 5px;
            }

            .metric-gauge {
                width: 56px !important;
                height: 56px !important;
                max-width: 100%;
            }

            .metric-gauge svg {
                width: 100%;
                height: 100%;
                display: block;
            }
        }

        @media (max-width: 800px) {
            /* На ~780px ещё сильнее ужимаем, сохраняя пропорции */
            .metrics-row {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 6px;
            }

            .metric-item {
                padding: 8px 4px;
            }

            .metric-gauge {
                width: 50px !important;
                height: 50px !important;
                max-width: 100%;
                margin: 0 auto 6px;
            }

            .metric-gauge svg {
                width: 100%;
                height: 100%;
                display: block;
            }

            .metric-label {
                font-size: 10px;
            }
        }

        /* ПРАКТИЧНЫЙ АДАПТИВ БЕЗ ИЗМЕНЕНИЯ HEADER */
        @media (min-width: 640px) and (max-width: 1024px) {
            .dashboard-container {
                padding: 6px;
            }

            .dashboard-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 10px;
            }

            .employee-card {
                padding: 12px;
            }

            .card-header {
                gap: 8px;
                margin-bottom: 10px;
                padding-right: 36px;
            }

            .employee-photo {
                width: 44px;
                height: 44px;
                border-radius: 10px;
            }

            .employee-name {
                font-size: 13px;
            }

            .employee-position {
                font-size: 10px;
            }

            .metrics-row {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 8px;
                margin-bottom: 10px;
            }

            .metric-item {
                padding: 8px 4px;
            }

            .metric-gauge {
                width: 48px !important;
                height: 48px !important;
                margin: 0 auto 5px;
            }

            .metric-label {
                font-size: 10px;
            }

            .plan-container {
                padding: 9px;
            }

            .score-container {
                padding: 8px 9px;
                margin-top: 8px;
            }

            .score-value {
                font-size: 18px;
            }
        }

        @media (min-width: 3000px) {
            .dashboard-container {
                max-width: 2200px;
                margin: 0 auto;
                padding: 10px 18px;
            }

            .dashboard-grid {
                grid-template-columns: repeat(4, minmax(0, 1fr));
                gap: 14px;
            }

            .employee-card {
                padding: 14px;
            }

            .card-header {
                margin-bottom: 10px;
                gap: 10px;
                padding-right: 38px;
            }

            .employee-photo {
                width: 48px;
                height: 48px;
            }

            .employee-name {
                font-size: 14px;
            }

            .employee-position {
                font-size: 10px;
            }

            .metrics-row {
                gap: 8px;
                margin-bottom: 10px;
            }

            .metric-item {
                padding: 8px 4px;
            }

            .metric-gauge {
                width: 50px;
                height: 50px;
                margin: 0 auto 6px;
            }

            .metric-label {
                font-size: 10px;
            }

            .plan-container {
                padding: 9px;
            }

            .score-container {
                padding: 8px 10px;
                margin-top: 8px;
            }
        }

        /* Скроллбар */
        .dashboard-container::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }

        .dashboard-container::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 4px;
        }

        .dashboard-container::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 4px;
        }

        /* Анимация */
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }

        .updating {
            animation: pulse 1.5s infinite;
        }

        /* ОШИБКА */
        .error-message {
            background: rgba(252, 129, 129, 0.2);
            border: 1px solid #fc8181;
            color: #fc8181;
            padding: 20px;
            border-radius: 10px;
            text-align: center;
            margin: 20px;
        }

        .refresh-btn {
            background: #63b3ed;
            color: #fff;
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            margin-top: 15px;
            font-size: 14px;
            transition: background 0.3s;
        }

        .refresh-btn:hover {
            background: #4299e1;
        }

        /* Анимация обновления карточек */
        .employee-card.updating {
            opacity: 0.7;
            pointer-events: none;
        }
