#mkPeriodTitle {
    font-size: 2em;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 1rem;
}

.mk-yearly-analysis-card {
    margin-bottom: 2rem;
}

.mk-yearly-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.mk-yearly-header h3 {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--heading-color);
    margin: 0;
}

/* ИСПРАВЛЕННЫЙ МАКЕТ: ТАБЛИЦА СВЕРХУ, ГРАФИК СНИЗУ */
.mk-yearly-layout {
    display: flex;
    flex-direction: column; /* Вертикальное расположение */
    gap: 30px; 
    align-items: stretch;
    width: 100%;
}

.mk-yearly-table-container {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 15px;
    border: 1px solid var(--border-color);
    width: 100%; 
    max-width: 100%; /* Убрано ограничение 750px */
    overflow-x: auto;
}

.mk-metrics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
    min-width: 650px; /* Минимальная ширина чтобы колонки не слипались */
}

.mk-metrics-table th {
    text-align: left;
    padding: 12px 6px;
    color: #000000;
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
}

.mk-metrics-table td {
    padding: 8px 4px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    color: #000000;
    font-weight: 400;
    white-space: nowrap;
    vertical-align: middle;
}

.mk-metrics-table tr:last-child td {
    border-bottom: none;
}

.mk-metrics-table tr:hover td {
    background-color: rgba(0, 0, 0, 0.02);
}

.mk-metrics-table .month-name {
    font-weight: 700;
    color: #000000;
    padding-left: 8px;
}

/* Строки средних значений */
.mk-metrics-table tr.row-average td {
    border-top: 2px solid var(--border-color);
    font-weight: 600;
}

/* Строка итоговых значений */
.mk-metrics-table tr.row-total td {
    border-top: 1px solid var(--border-color);
    background-color: #f1f5f9;
    font-weight: 800;
    color: var(--heading-color);
}

.mk-metrics-table tr.row-total .month-name {
    color: var(--accent-color);
}


/* СТИЛИ ДЛЯ ПОДСВЕТКИ MIN/MAX ПОКАЗАТЕЛЕЙ */
.cell-min {
    background-color: #d1fae5; /* Светло-зеленый */
    color: #065f46 !important; /* Темно-зеленый текст */
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.cell-max {
    background-color: #fee2e2; /* Светло-красный */
    color: #991b1b !important; /* Темно-красный текст */
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

/* Новый стиль для средних значений */
.cell-avg {
    background-color: #fff7e6; /* Светло-оранжевый */
    color: #b45309 !important; /* Темно-оранжевый текст */
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}


/* Инвертируем цвета для колонки продаж (Продажи A+A), где больше - лучше */
.mk-metrics-table .val-sales .cell-min {
    background-color: #fee2e2; /* Светло-красный */
    color: #991b1b !important; /* Темно-красный текст */
}

.mk-metrics-table .val-sales .cell-max {
    background-color: #d1fae5; /* Светло-зеленый */
    color: #065f46 !important; /* Темно-зеленый текст */
}

.mk-yearly-chart-wrapper {
    width: 100%;
    position: relative;
}

.mk-yearly-chart-container {
    height: 400px;
    width: 100%;
}

.mk-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mk-header-left h3 {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 0.5rem;
}

.mk-hint-text {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.4;
    max-width: 700px;
}

.mk-stats-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.95em;
    color: var(--text-color);
}

.mk-stats-summary__main {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.mk-stats-summary b {
    color: var(--heading-color);
    font-size: 1.1em;
}

.mk-stats-summary__reconciliation {
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
}
.mk-stats-summary__reconciliation b {
    color: var(--accent-color);
}
.mk-stats-summary__reconciliation .from-total {
    color: #7f8c8d;
    font-size: 0.9em;
}

.mk-upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

#mkUploadStatus {
    font-size: 0.9em;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 12px;
    min-height: 28px;
    transition: background-color 0.3s, color 0.3s;
}
#mkUploadStatus.status-info { color: #7f8c8d; }
#mkUploadStatus.status-success { color: var(--success-color); background-color: var(--success-color-light); }
#mkUploadStatus.status-error { color: #e74c3c; background-color: #fdecea; }

.mk-call-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    min-height: 100px; 
    align-items: start;
}

.mk-call-list p {
    grid-column: 1 / -1; 
    padding: 20px;
    text-align: center;
    color: #7f8c8d;
    background-color: var(--bg-color);
    border-radius: 12px;
    border: 1px dashed var(--border-color);
}

.mk-call-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 15px;
    background: var(--bg-color);
    border-radius: 12px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: transform 0.1s ease, background 0.3s ease;
}

.mk-call-item.target {
    border-color: var(--success-color-light);
    background-color: #f6fffb;
}
.mk-call-item.non-target {
    border-color: #fdecea;
    background-color: #fff9f8;
}

.mk-call-item.discrepancy.target {
    background-image: repeating-linear-gradient(
        45deg,
        #f6fffb,
        #f6fffb 10px,
        #eefaf4 10px,
        #eefaf4 20px
    );
}

.mk-call-item.discrepancy.non-target {
    background-image: repeating-linear-gradient(
        45deg,
        #fff9f8,
        #fff9f8 10px,
        #fdecea 10px,
        #fdecea 20px
    );
}

.mk-call-item__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.mk-call-item__phone {
    font-family: monospace;
    font-size: 1.1em;
}

.mk-call-item__mk-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.mk-call-item__stickers {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap; 
}

.sticker {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    white-space: nowrap;
}

.sticker--mk {
    font-size: 0.55em;
    padding: 2px 6px;
    border-radius: 6px;
}

.sticker--source-auto { background-color: #8E44AD; color: white; }
.sticker--source-avito { background-color: #3498DB; color: white; }
.sticker--count { background-color: #f1c40f; color: #34495e; }

.sticker--mk-target {
    background-color: var(--success-color);
    color: white;
}
.sticker--mk-nontarget {
    background-color: #e74c3c;
    color: white;
}

.mk-filters-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1rem;
}
.mk-filters-panel .filter-btn {
    padding: 8px 18px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    background-color: var(--bg-color);
    border: 1px solid transparent;
    border-radius: 16px;
    transition: all 0.2s ease;
    font-size: 0.95em;
}
.mk-filters-panel .filter-btn.active {
    color: white;
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(74, 108, 253, 0.3);
}

.mk-filter-stats {
    background-color: #f0f3ff;
    border-left: 4px solid var(--accent-color);
    padding: 12px 20px;
    border-radius: 0 16px 16px 0;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 25px;
    font-size: 0.95em;
}
.mk-filter-stats.hidden { display: none; }
.mk-filter-stats b { color: var(--accent-color); }

/* --- ПАНЕЛЬ СВЕРКИ (RECONCILIATION PANEL) --- */
.reconciliation-panel {
    background-color: #CED3DC;
    border: 1px solid #E0E7FF;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(74, 108, 253, 0.06);
    corner-shape: continuous;
}

.reconciliation-panel-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.reconciliation-panel-header h3 {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 0.5rem;
}

.reconciliation-panel-header p {
    font-size: 0.9em;
    color: #475569; /* Текст темнее для лучшей читаемости на фоне #CED3DC */
    max-width: 600px;
}