/* ============= МЕНЮ ============= */
/* Активный пункт меню */
.sidebar-menu .nav-item.active,
.sidebar-menu .nav-item.active > a,
.sidebar-menu .nav-item.active .link-title,
.sidebar-menu .sidebar-menu-link.active,
.sidebar-menu .sidebar-menu-link.active .link-title,
.sidebar-menu li.active,
.sidebar-menu li.active a,
.sidebar-menu li.active span {
    color: #ffffff;
    background: #003e66;
}

/* Hover в меню */
.sidebar-menu .nav-item:hover,
.sidebar-menu .nav-item:hover > a,
.sidebar-menu .nav-item:hover .link-title,
.sidebar-menu .sidebar-menu-link:hover,
.sidebar-menu .sidebar-menu-link:hover .link-title {
    color: #ffffff;
}

/* ============= КРУЖОЧЕК РЕГИОНА ============= */
button[style*="background"],
button[style*="border-radius: 50"],
.region-toggle,
.district-toggle,
span[style*="border-radius: 50%"],
span[style*="border-radius:50%"],
div[style*="border-radius: 50%"],
div[style*="border-radius:50%"] {
    background: #00c5f4;
    color: #ffffff;
}

/* Если это кнопка */
button.toggle-district,
button.district-indicator {
    background: #00c5f4;
    color: #ffffff;
    border: none;
}

/* ============= ТАБЛИЦЫ ============= */
table thead,
table thead th,
table thead td,
thead,
th {
    background: #003e66;
    color: #ffffff;
}

/* ============= ЗАГОЛОВКИ СТРАНИЦ ============= */
h1[style*="background"],
.page-header[style*="background"],
div[style*="background: #003"],
div[style*="background:#003"],
div[style*="background-color: #003"],
div[style*="background-color:#003"] {
    color: #ffffff;
}

h1[style*="background"] *,
.page-header[style*="background"] *,
div[style*="background: #003"] *,
div[style*="background:#003"] * {
    color: #ffffff;
}

/* ============= УНИВЕРСАЛЬНОЕ ПРАВИЛО ============= */
*[style*="background-color: rgb(0, 62, 102)"],
*[style*="background-color: rgb(0,62,102)"],
*[style*="background-color:#003e66"],
*[style*="background:#003e66"],
*[style*="background-color: #003e66"],
*[style*="background: #003e66"] {
    color: #ffffff;
}

*[style*="background-color: rgb(0, 62, 102)"] *,
*[style*="background-color:#003e66"] *,
*[style*="background:#003e66"] * {
    color: #ffffff;
}

/* ============= ТИПОГРАФИКА ============= */
/* 
 * Основная типографика теперь в temp.css через CSS переменные.
 * Здесь только специфичные переопределения для компонентов.
 */

/* Заголовки виджетов - используем переменные */
.info-item .head-item h3,
.item-header .item-title {
    font-size: var(--h3-size, 18px);
    font-weight: var(--font-weight-semibold, 600);
    text-transform: uppercase;
    color: var(--color-primary, #003d68);
}

/* Заголовки таблиц */
.table-title,
.files-table thead th {
    font-size: var(--font-size-sm, 13px);
    font-weight: var(--font-weight-semibold, 600);
}

/* Контент таблиц */
.files-table tbody td,
.data-table td {
    font-size: var(--font-size-base, 14px);
}

/* Мелкий текст в фильтрах и лейблах */
.filter-label,
.form-label-small {
    font-size: var(--font-size-xs, 11px);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--color-text-muted, #72777a);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============= ВИДЖЕТ КУРС ЕВРО ============= */
.current-course,
.exchange-rate,
.currency-rate {
    font-size: 4.8rem;
    font-weight: 700;
    line-height: 1;
    color: #003d68;
}

/* Если класс другой - универсальное правило */
div[style*="КУРС ЕВРО"] + div,
h3:contains("КУРС ЕВРО") ~ div,
.info-item .item-body > div:first-child {
    font-size: 4.8rem;
    font-weight: 700;
}
/* ============= МОБИЛЬНАЯ АДАПТАЦИЯ БОКОВОГО МЕНЮ ============= */

/* Кнопка открытия меню (гамбургер) */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 10001;
    width: 40px;
    height: 40px;
    background: #003d68;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Затемнение фона при открытом меню */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
}

/* Мобильная адаптация */
@media screen and (max-width: 768px) {
    /* Показываем кнопку гамбургер */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Показываем оверлей когда нужно */
    .mobile-menu-overlay {
        display: block;
        pointer-events: none;
    }
    
    .mobile-menu-overlay.active {
        pointer-events: auto;
    }
    
    /* Скрываем боковое меню по умолчанию */
    .sidebar {
        position: fixed !important;
        left: -280px !important;
        top: 0 !important;
        height: 100vh;
        width: 260px;
        z-index: 9999 !important;
        transition: left 0.3s ease !important;
        overflow-y: auto !important;
        background: #fff;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    /* Показываем меню когда активно */
    .sidebar.mobile-open {
        left: 0 !important;
    }
    
    /* Отступ для логотипа чтобы не перекрывался кнопкой */
    .sidebar .sidebar-logo {
        padding-top: 10px;
    }
    
    /* Перемещаем кнопку закрытия когда меню открыто */
    .mobile-menu-toggle.active {
        left: 220px;
        background: transparent;
        box-shadow: none;
    }
    
    .mobile-menu-toggle.active span {
        background: #003d68;
    }
    /* Пункты меню должны быть видны */
    .sidebar .sidebar-inner {
        display: block !important;
        visibility: visible !important;
        opacity: 1;
    }
    
    .sidebar .sidebar-menu,
    .sidebar .nav-menu,
    .sidebar nav,
    .sidebar ul {
        display: block !important;
        visibility: visible !important;
        opacity: 1;
    }
    
    .sidebar .nav-item,
    .sidebar .menu-item,
    .sidebar li {
        display: block !important;
        visibility: visible !important;
    }
    
    /* Основной контент на всю ширину */
    .page-content {
        margin-left: 0;
        padding-left: 10px;
        padding-right: 10px;
        width: 100%;
        max-width: 100%;
    }
    
/* Отступ сверху для хедера */
    .page-header {
        padding-top: 50px;
        position: relative !important;
    }
    
    /* Скрываем имя пользователя на мобильных */
    .page-header .nav-right,
    .page-header .user-info,
    .page-header .user-name,
    .page-header .user {
        display: none !important;
    }
    
    /* Убираем фиксированную позицию у хедера */
    .page-header .container-h {
        position: relative !important;
    }
    
    .page-header .container-h {
        padding-left: 50px;
    }
    
    /* Блокируем скролл body когда меню открыто */
    body.menu-open {
        overflow: hidden !important;
    }
}

/* Очень маленькие экраны */
@media screen and (max-width: 400px) {
    .sidebar.mobile-open {
        width: 85vw;
    }
    
    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .mobile-menu-toggle span {
        width: 20px;
    }
}
/* ============= МОБИЛЬНАЯ АДАПТАЦИЯ БЛОКА СВОЕВРЕМЕННОСТИ ============= */

/* По умолчанию мобильные карточки скрыты */
.reporting-mobile-cards {
    display: none;
}

@media screen and (max-width: 768px) {
    /* Заголовок блока */
    .reporting-monitor-header {
        flex-direction: column;
        padding: 14px 16px;
        gap: 12px;
        text-align: center;
    }
    
    .reporting-monitor-header .header-left {
        flex-direction: column;
        gap: 8px;
        font-size: 15px;
    }
    
    .upload-report-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
    
    .upload-dropdown {
        width: 100%;
    }
    
    .upload-dropdown-content {
        left: 0;
        right: 0;
        min-width: auto;
    }
    
    /* Скрываем таблицу на мобильных */
    .reporting-monitor-body {
        display: none !important;
    }
    
    /* Показываем мобильные карточки */
    .reporting-mobile-cards {
        display: block !important;
        padding: 12px;
    }
    
    .reporting-mobile-card {
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 10px;
        margin-bottom: 12px;
        overflow: hidden;
    }
    
    .reporting-mobile-card-header {
        background: #003d68;
        color: #fff;
        padding: 12px 16px;
        font-weight: 600;
        font-size: 14px;
        text-align: center;
    }
    
    .reporting-mobile-card-body {
        padding: 0;
    }
    
    .reporting-mobile-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        border-bottom: 1px solid #f0f0f0;
        font-size: 13px;
    }
    
    .reporting-mobile-row:last-child {
        border-bottom: none;
    }
    
    .reporting-mobile-label {
        color: #666;
        font-weight: 500;
        flex: 1;
    }
    
    .reporting-mobile-values {
        display: flex;
        gap: 16px;
        align-items: center;
    }
    
    .reporting-mobile-value {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        min-width: 70px;
    }
    
    .reporting-mobile-value-label {
        font-size: 10px;
        color: #888;
        text-transform: uppercase;
    }
    
    .reporting-mobile-value .report-status {
        flex-direction: column;
        gap: 2px;
    }
    
    .reporting-mobile-value .report-status .date {
        font-size: 11px;
    }
    
    /* Легенда */
    .reporting-legend {
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
    }
    
    .legend-item {
        justify-content: flex-start;
    }
    
    /* Секция файлов */
    .files-section-header {
        padding: 14px 16px;
    }
    
    .files-section-title {
        font-size: 15px;
    }
    
    /* Сообщение Cislink */
    .cislink-message {
        margin: 12px;
        padding: 14px 16px;
        font-size: 13px;
    }
    
    /* Основной контент */
    .content > .inner {
        padding: 10px;
    }
}

@media screen and (max-width: 480px) {
    .reporting-mobile-values {
        gap: 10px;
    }
    
    .reporting-mobile-value {
        min-width: 60px;
    }
    
    .reporting-mobile-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .reporting-mobile-values {
        width: 100%;
        justify-content: space-around;
    }
}
/* ============= МОБИЛЬНАЯ АДАПТАЦИЯ СТРАНИЦЫ ЗАГРУЗКИ ОТЧЕТОВ ============= */

@media screen and (max-width: 768px) {
    /* Заголовок страницы */
    .inner-header {
        padding: 15px 10px;
    }
    
    .inner-header-top {
        flex-direction: column;
        gap: 10px;
        text-align: left;
    }
    
    .inner-header-top .page-icon {
        margin: 0 auto;
    }
    
    .inner-header-top .h1 {
        font-size: 18px;
        line-height: 1.3;
    }
    
    /* Уведомления */
    .alert {
        padding: 12px 14px;
        margin-bottom: 15px;
        font-size: 13px;
    }
    
    .alert h4 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .alert p {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .alert ul {
        padding-left: 16px;
        font-size: 12px;
    }
    
    /* Таблица требований - преобразуем в карточки */
    .alert-info table {
        display: block;
        width: 100%;
    }
    
    .alert-info table thead {
        display: none;
    }
    
    .alert-info table tbody {
        display: block;
        width: 100%;
    }
    
    .alert-info table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #b6d4fe;
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 12px;
    }
    
    .alert-info table tbody td {
        display: block;
        padding: 4px 0;
        border: none;
        text-align: left;
    }
    
    .alert-info table tbody td:first-child {
        font-weight: 600;
        color: #084298;
        font-size: 14px;
        padding-bottom: 8px;
        border-bottom: 1px solid #e0e0e0;
        margin-bottom: 8px;
    }
    
    .alert-info table tbody td:nth-child(2)::before {
        content: "Обязательность: ";
        font-weight: 500;
        color: #666;
    }
    
    .alert-info table tbody td:nth-child(3)::before {
        content: "Правила: ";
        font-weight: 500;
        color: #666;
    }
    
    /* Форма загрузки */
    .card {
        padding: 15px;
        margin: 0;
    }
    
    .inputs-group {
        margin-bottom: 15px;
    }
    
    .input-wrapper {
        width: 100%;
    }
    
    .input-wrapper.small--wrapper {
        max-width: 100%;
    }
    
    .input-wrapper label {
        font-size: 13px;
        margin-bottom: 6px;
        display: block;
    }
    
    .input-wrapper input[type="file"] {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        border: 2px dashed #ccc;
        border-radius: 8px;
        background: #f9f9f9;
    }
    
    .input-wrapper select {
        width: 100%;
        padding: 12px 14px;
        font-size: 14px;
        border-radius: 8px;
        border: 1px solid #ddd;
        background: #fff;
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* Кнопка отправки */
    .submit-wrapper {
        margin-top: 20px;
    }
    
    .submit-wrapper .button {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 8px;
    }
    
    /* Ссылка на шаблон */
    .link-in-label {
        display: inline-block;
        margin-top: 4px;
    }
    
    /* Алерт об ошибке */
    #alert-danger-exist h3 {
        font-size: 15px;
    }
    
    #alert-danger-exist p {
        font-size: 13px;
    }
}

@media screen and (max-width: 400px) {
    .inner-header-top .h1 {
        font-size: 16px;
    }
    
    .alert-info table tbody td:first-child {
        font-size: 13px;
    }
    
    .input-wrapper select,
    .input-wrapper input[type="file"] {
        font-size: 13px;
    }
}
/* ============= МОБИЛЬНАЯ АДАПТАЦИЯ ПРОМО-ПОРТАЛА ============= */

@media screen and (max-width: 768px) {
    /* Заголовок страницы промо */
    .inner-header-top.top--button {
        flex-direction: column;
        text-align: left;
        gap: 10px;
    }
    
    .inner-header-top.top--button .page-icon {
        margin: 0 auto;
    }
    
    /* Данные менеджера */
    .manager-data {
        font-size: 13px;
        text-align: center;
        line-height: 1.6;
    }
    
    /* Таблица запросов - преобразуем в карточки */
    .data-table .table,
    .data-table .patients-table,
    .data-table .sorting-table {
        display: block;
        width: 100%;
    }
    
    .data-table .table thead,
    .data-table .patients-table thead {
        display: none;
    }
    
    .data-table .table tbody,
    .data-table .patients-table tbody {
        display: block;
        width: 100%;
    }
    
    .data-table .table tbody tr,
    .data-table .patients-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 10px;
        margin-bottom: 12px;
        padding: 16px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    .data-table .table tbody td,
    .data-table .patients-table tbody td {
        display: block;
        padding: 8px 0;
        border: none;
        text-align: left;
    }
    
    /* Первая колонка - название запроса */
    .data-table .table tbody td:first-child,
    .data-table .patients-table tbody td:first-child {
        font-weight: 600;
        color: #003d68;
        font-size: 15px;
        padding-bottom: 12px;
        border-bottom: 1px solid #eee;
        margin-bottom: 8px;
    }
    
    /* Вторая колонка - содержимое */
    .data-table .table tbody td:nth-child(2),
    .data-table .patients-table tbody td:nth-child(2) {
        font-size: 13px;
        color: #555;
        line-height: 1.5;
    }
    
    .data-table .table tbody td:nth-child(2)::before,
    .data-table .patients-table tbody td:nth-child(2)::before {
        content: "Содержимое: ";
        font-weight: 600;
        color: #333;
        display: block;
        margin-bottom: 4px;
    }
    
    /* Третья колонка - статус */
    .data-table .table tbody td:nth-child(3),
    .data-table .patients-table tbody td:nth-child(3) {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #eee;
    }
    
    .data-table .table tbody td:nth-child(3)::before,
    .data-table .patients-table tbody td:nth-child(3)::before {
        content: "Статус: ";
        font-weight: 600;
        color: #333;
    }
    
    /* Пагинация */
    .data-table .pagination {
        padding: 16px;
        text-align: center;
    }
    
    .data-table .pagination a,
    .data-table .pagination span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        height: 40px;
        padding: 8px 12px;
        font-size: 14px;
        border-radius: 8px;
        margin: 4px;
    }
    
    /* Колонки на мобильных */
    .row .col-md-6 {
        width: 100%;
        padding: 0;
    }
}

@media screen and (max-width: 400px) {
    .data-table .table tbody td:first-child,
    .data-table .patients-table tbody td:first-child {
        font-size: 14px;
    }
    
    .data-table .table tbody td:nth-child(2),
    .data-table .patients-table tbody td:nth-child(2) {
        font-size: 12px;
    }
}
/* ============= МОБИЛЬНАЯ АДАПТАЦИЯ УЧЕБНЫХ МЕРОПРИЯТИЙ ============= */

@media screen and (max-width: 768px) {
    /* Заголовок страницы */
    .inner-header-top.justify-between {
        flex-direction: column;
        gap: 15px;
        text-align: left;
    }
    
    .inner-header-top .group {
        flex-direction: column;
        gap: 10px;
    }
    
    .inner-header-top .group .page-icon {
        margin: 0 auto;
    }
    
    .inner-header-top .add-item {
        width: 100%;
    }
    
    .button-add-item {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
    
    /* Фильтры */
    .table-filters {
        flex-direction: column;
        gap: 12px;
    }
    
    .table-filters .filter-group {
        width: 100%;
    }
    
    .table-filters select {
        width: 100%;
        min-width: auto;
        padding: 12px 14px;
    }
    
    .btn-reset-filters {
        width: 100%;
        padding: 12px 16px;
    }
    
    /* DataTables на мобильных */
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length {
        width: 100%;
        text-align: left;
        margin-bottom: 12px;
    }
    
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
        padding: 12px;
    }
    
    .dataTables_wrapper .dataTables_filter label {
        display: block;
        width: 100%;
    }
    
    .dataTables_wrapper .dataTables_length select {
        padding: 10px 12px;
    }
    
    .dataTables_wrapper .dataTables_info {
        text-align: center;
        font-size: 12px;
    }
    
    .dataTables_wrapper .dataTables_paginate {
        text-align: center;
        padding-top: 12px;
    }
    
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 8px 12px;
        margin: 4px;
        font-size: 14px;
    }
    
    /* Таблица мероприятий - преобразуем в карточки (ТОЛЬКО #trainings-table) */
    #trainings-table {
        display: block !important;
        width: 100%;
    }
    
    #trainings-table thead {
        display: none !important;
    }
    
    #trainings-table tbody {
        display: block !important;
        width: 100%;
    }
    
    #trainings-table tbody tr {
        display: block !important;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 10px;
        margin-bottom: 12px;
        padding: 16px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    #trainings-table tbody td {
        display: block !important;
        padding: 6px 0;
        border: none;
        text-align: left;
        font-size: 13px;
    }
    
    /* Статус - первая строка */
    #trainings-table tbody td:nth-child(1) {
        font-weight: 600;
        font-size: 14px;
        padding-bottom: 10px;
        margin-bottom: 10px;
        border-bottom: 1px solid #eee;
    }
    
    /* ID B24 */
    #trainings-table tbody td:nth-child(2)::before {
        content: "ID B24: ";
        font-weight: 600;
        color: #666;
    }
    
    /* Дата заявки */
    #trainings-table tbody td:nth-child(3)::before {
        content: "Дата заявки: ";
        font-weight: 600;
        color: #666;
    }
    
    /* Желаемая дата */
    #trainings-table tbody td:nth-child(4)::before {
        content: "Желаемая дата: ";
        font-weight: 600;
        color: #666;
    }
    
    /* Лектор */
    #trainings-table tbody td:nth-child(5)::before {
        content: "Лектор: ";
        font-weight: 600;
        color: #666;
    }
    
    /* Направление */
    #trainings-table tbody td:nth-child(6)::before {
        content: "Направление: ";
        font-weight: 600;
        color: #666;
    }
    
    /* Комментарий */
    #trainings-table tbody td:nth-child(7) {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #eee;
        font-size: 12px;
        color: #555;
    }
    
    #trainings-table tbody td:nth-child(7)::before {
        content: "Комментарий: ";
        font-weight: 600;
        color: #666;
        display: block;
        margin-bottom: 4px;
    }
    
    /* Модальное окно */
    .modal .modal-box {
        width: 95%;
        max-width: none;
        margin: 10px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal .modal-box .inner {
        padding: 20px 16px;
    }
    
    .modal .title-box h2 {
        font-size: 18px;
    }
    
    /* Формат мероприятия в модалке */
    .format-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .format-option {
        width: 100%;
        justify-content: center;
    }
    
    /* Поля формы в модалке */
    .add-events-form .input-wrapper {
        margin-bottom: 15px;
    }
    
    .add-events-form input,
    .add-events-form select,
    .add-events-form textarea {
        width: 100%;
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .add-events-form textarea {
        min-height: 100px;
    }
    
    .add-events-form .submit-wrapper .button {
        width: 100%;
        padding: 14px 20px;
    }
    
    /* Кнопка закрытия модалки */
    .modal .close {
        top: 12px !important;
        right: 12px !important;
        width: 32px;
        height: 32px;
    }
    
    /* Сообщение "нет заявок" */
    .tip-no-items {
        padding: 30px 20px;
    }
    
    .tip-no-items h2 {
        font-size: 16px;
    }
    
    /* jQuery UI Datepicker */
    .ui-datepicker {
        width: 280px;
        left: 50% !important;
        transform: translateX(-50%);
    }
}

@media screen and (max-width: 400px) {
    #trainings-table tbody td {
        font-size: 12px;
    }
    
    .ui-datepicker {
        width: 260px;
    }
    
    .modal .modal-box .inner {
        padding: 16px 12px;
    }
}

/* ============= МОБИЛЬНАЯ АДАПТАЦИЯ ЗАКАЗОВ МАРКЕТПЛЕЙСА ============= */

@media screen and (max-width: 768px) {
    /* Заголовок страницы заказов */
    .marketplace-orders-table ~ .inner-header-top .group,
    .content:has(.marketplace-orders-table) .inner-header-top .group {
        flex-direction: column;
        text-align: left;
        gap: 10px;
    }
    
    /* Таблица заказов маркетплейса - преобразуем в карточки */
    .marketplace-orders-table {
        display: block !important;
        width: 100%;
    }
    
    .marketplace-orders-table thead {
        display: none !important;
    }
    
    .marketplace-orders-table tbody {
        display: block !important;
        width: 100%;
    }
    
    .marketplace-orders-table tbody tr {
        display: block !important;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 10px;
        margin-bottom: 12px;
        padding: 16px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    .marketplace-orders-table tbody td {
        display: block !important;
        padding: 8px 0;
        border: none;
        text-align: left;
        font-size: 14px;
    }
    
    /* Убираем ::before от других таблиц */
    .marketplace-orders-table tbody td::before {
        content: none !important;
    }
    
    /* ID заказа - первая строка */
    .marketplace-orders-table tbody td:nth-child(1) {
        font-weight: 700;
        color: #003d68;
        font-size: 16px;
        padding-bottom: 10px;
        margin-bottom: 10px;
        border-bottom: 1px solid #eee;
    }
    
    .marketplace-orders-table tbody td[data-label="ID"]::before {
        content: "Заказ #" !important;
        font-weight: 600;
    }
    
    /* Дата заказа */
    .marketplace-orders-table tbody td[data-label="Дата заказа"]::before {
        content: "Дата: " !important;
        font-weight: 600;
        color: #666;
    }
    
    /* Статус */
    .marketplace-orders-table tbody td[data-label="Статус"] {
        margin-top: 8px;
    }
    
    .marketplace-orders-table tbody td[data-label="Статус"]::before {
        content: "Статус: " !important;
        font-weight: 600;
        color: #666;
    }
    
    /* Кнопка "Подробнее" */
    .marketplace-orders-table tbody td.td-action {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #eee;
    }
    
    .marketplace-orders-table tbody td.td-action a,
    .marketplace-orders-table tbody td.td-action .btn-detail {
        display: inline-block;
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        background: #003d68;
        color: #fff;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
        transition: background 0.2s;
    }
    
    .marketplace-orders-table tbody td.td-action a:hover,
    .marketplace-orders-table tbody td.td-action .btn-detail:hover {
        background: #005a6e;
    }
}

@media screen and (max-width: 400px) {
    .marketplace-orders-table tbody td {
        font-size: 13px;
    }
    
    .marketplace-orders-table tbody td:nth-child(1) {
        font-size: 15px;
    }
}
/* ============= МОБИЛЬНАЯ АДАПТАЦИЯ СТРАНИЦЫ НОВОСТЕЙ ============= */

@media screen and (max-width: 768px) {
    /* Сетка новостей - 1 колонка на мобильных */
    .news-list {
        grid-template-columns: 1fr;
        grid-row-gap: 3rem;
        padding-bottom: 5rem;
    }
    
    /* Карточка новости */
    .events-card .event-header {
        height: 20rem;
        margin-bottom: 1rem;
    }
    
    .events-card .date {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }
    
    .events-card .title {
        font-size: 1.8rem;
        line-height: 1.3;
        margin-bottom: 0.6rem;
    }
    
    .events-card .descr {
        font-size: 1.4rem;
        margin-bottom: 2rem;
        line-height: 1.5;
    }
    
    .events-card .button {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
    }
    
    /* Заголовок страницы */
    .inner-header-top .page-icon + .h1 {
        font-size: 18px;
        line-height: 1.3;
    }
}

@media screen and (max-width: 480px) {
    .events-card .event-header {
        height: 18rem;
    }
    
    .events-card .title {
        font-size: 1.6rem;
    }
    
    .events-card .descr {
        font-size: 1.3rem;
    }
}
/* ============= МОБИЛЬНАЯ АДАПТАЦИЯ СТРАНИЦЫ МОДЕРАЦИИ ОТЧЕТОВ ============= */

@media screen and (max-width: 768px) {
    /* Фильтры на странице модерации */
    #moderatorFilterForm .row {
        flex-direction: column;
        gap: 0;
    }
    
    #moderatorFilterForm .col-4,
    #moderatorFilterForm .col-3,
    #moderatorFilterForm .col-2 {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
    
    #moderatorFilterForm .inputs-group {
        margin-bottom: 12px;
    }
    
    #moderatorFilterForm .input-wrapper {
        width: 100%;
    }
    
    #moderatorFilterForm .input-wrapper label {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    #moderatorFilterForm .input-wrapper label .clean-filter-span,
    #moderatorFilterForm .input-wrapper label .clean-filter-span-select2 {
        font-size: 12px;
    }
    
    #moderatorFilterForm select,
    #moderatorFilterForm input[type="text"],
    #moderatorFilterForm .select2-container {
        width: 100%;
        padding: 12px 14px;
        font-size: 14px;
        border-radius: 8px;
        border: 1px solid #ddd;
    }
    
    #moderatorFilterForm .select2-container .select2-selection {
        min-height: 44px;
        padding: 8px 12px;
        border-radius: 8px;
    }
    
    #moderatorFilterForm .select2-container .select2-selection__rendered {
        line-height: 26px;
    }
    
    .filter-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    /* Таблица модерации - преобразуем в карточки */
    .moderator-reports-table .table {
        display: block !important;
        width: 100%;
    }
    
    .moderator-reports-table .table thead {
        display: none !important;
    }
    
    .moderator-reports-table .table tbody {
        display: block !important;
        width: 100%;
    }
    
    .moderator-reports-table .table tbody tr {
        display: block !important;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 10px;
        margin-bottom: 12px;
        padding: 16px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    .moderator-reports-table .table tbody td {
        display: block !important;
        padding: 8px 0;
        border: none;
        text-align: left;
        font-size: 14px;
    }
    
    /* Убираем стандартные ::before */
    .moderator-reports-table .table tbody td::before {
        content: none !important;
    }
    
    /* Дистрибьютор - заголовок карточки */
    .moderator-reports-table .table tbody td[data-label="Дистрибьютор"] {
        font-weight: 700;
        color: #003d68;
        font-size: 15px;
        padding-bottom: 12px;
        margin-bottom: 10px;
        border-bottom: 1px solid #eee;
    }
    
    .moderator-reports-table .table tbody td[data-label="Дистрибьютор"]::before {
        content: none !important;
    }
    
    /* Тип файла */
    .moderator-reports-table .table tbody td[data-label="Тип файла"]::before {
        content: "Тип файла: " !important;
        font-weight: 600;
        color: #666;
    }
    
    .moderator-reports-table .table tbody td[data-label="Тип файла"] a {
        color: #003d68;
        text-decoration: underline;
    }
    
    /* Период отчета */
    .moderator-reports-table .table tbody td[data-label="Период отчета"]::before {
        content: "Период: " !important;
        font-weight: 600;
        color: #666;
    }
    
    /* Дата загрузки */
    .moderator-reports-table .table tbody td[data-label="Дата загрузки"]::before {
        content: "Загружен: " !important;
        font-weight: 600;
        color: #666;
    }
    
    /* Статус */
    .moderator-reports-table .table tbody td[data-label="Статус"] {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #eee;
    }
    
    .moderator-reports-table .table tbody td[data-label="Статус"]::before {
        content: "Статус: " !important;
        font-weight: 600;
        color: #666;
    }
    
    /* Кнопки действий */
    .moderator-reports-table .table tbody td.td-actions {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #eee;
        display: flex !important;
        flex-direction: column;
        gap: 8px;
    }
    
    .moderator-reports-table .table tbody td.td-actions .button {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    /* Пагинация */
    .moderator-reports-table + .pagination,
    .data-table + .pagination {
        padding: 16px 0;
        text-align: center;
    }
    
    /* Модальные окна */
    #allowFileModal .modal-box,
    #rejectFileModal .modal-box {
        width: 95%;
        max-width: none;
        margin: 10px auto;
    }
    
    #allowFileModal .modal-box .inner,
    #rejectFileModal .modal-box .inner {
        padding: 20px 16px;
    }
    
    #rejectFileModal textarea {
        width: 100%;
        min-height: 120px;
        font-size: 14px;
    }
    
    .modals-buttons-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .modals-buttons-group .button {
        width: 100%;
        text-align: center;
    }
}

@media screen and (max-width: 480px) {
    .moderator-reports-table .table tbody td {
        font-size: 13px;
    }
    
    .moderator-reports-table .table tbody td[data-label="Дистрибьютор"] {
        font-size: 14px;
    }
    
    .moderator-reports-table .table tbody td.td-actions .button {
        padding: 10px 14px;
        font-size: 13px;
    }
}
/* ============= МОБИЛЬНАЯ АДАПТАЦИЯ СТРАНИЦЫ ПЛАН/ФАКТ БДО (МЕНЕДЖЕР) ============= */

@media screen and (max-width: 768px) {
    /* Заголовок страницы */
    .page-title {
        padding: 16px 20px;
        margin: -20px -15px 20px -15px;
        font-size: 18px;
    }
    
    /* Табы Sell-In / Sell-Out */
    .plan-type-tabs {
        flex-direction: column;
        gap: 0;
        border-bottom: none;
    }
    
    .plan-tab {
        padding: 12px 20px;
        text-align: center;
        border-bottom: 2px solid #e8eaed;
        margin-bottom: 0;
    }
    
    .plan-tab.active {
        border-bottom-color: #003d68;
        background: rgba(0,61,104,0.08);
    }
    
    /* Фильтры */
    .filters {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .filters-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-item {
        width: 100%;
    }
    
    .filter-item select {
        width: 100%;
        min-width: auto;
        padding: 12px 14px;
    }
    
    .filter-btn {
        width: 100%;
        padding: 14px 20px;
        margin-top: 8px;
    }
    
    /* Placeholder */
    .placeholder {
        padding: 40px 20px;
        font-size: 14px;
    }
    
    /* Блок округа */
    .district-block {
        margin-bottom: 16px;
    }
    
    .district-header {
        padding: 14px 16px;
    }
    
    .district-name {
        font-size: 14px;
    }
    
    .district-count {
        padding: 3px 10px;
        font-size: 12px;
    }
    
    /* Строка дистрибьютора */
    .dist-header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .dist-name {
        font-size: 14px;
        width: 100%;
    }
    
    .dist-quick-stats {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .stat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    /* Детали дистрибьютора - таблица */
    .dist-details {
        padding: 0 12px 16px 12px;
    }
    
    .details-table {
        display: block !important;
        width: 100%;
    }
    
    .details-table thead {
        display: none !important;
    }
    
    .details-table tbody {
        display: block !important;
        width: 100%;
    }
    
    .details-table tbody tr {
        display: block !important;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 12px;
    }
    
    .details-table tbody tr.total-row {
        background: #003d68;
        color: #fff;
    }
    
    .details-table tbody tr.total-row td {
        color: #fff;
    }
    
    .details-table tbody tr.total-row td strong {
        color: #fff;
    }
    
    .details-table tbody tr.year-row {
        background: #005a6e;
        color: #fff;
    }
    
    .details-table tbody tr.year-row td {
        color: #fff;
    }
    
    .details-table tbody tr.year-row td strong {
        color: #fff;
    }
    
    .details-table tbody td {
        display: block !important;
        padding: 6px 0;
        border: none;
        text-align: left;
        font-size: 14px;
    }
    
    .details-table tbody td:first-child {
        font-weight: 600;
        color: #003d68;
        font-size: 15px;
        padding-bottom: 8px;
        margin-bottom: 8px;
        border-bottom: 1px solid #eee;
    }
    
    .details-table tbody tr.total-row td:first-child,
    .details-table tbody tr.year-row td:first-child {
        color: #fff;
        border-bottom-color: rgba(255,255,255,0.2);
    }
    
    .details-table tbody td:nth-child(2)::before {
        content: "План: ";
        font-weight: 600;
        color: #666;
    }
    
    .details-table tbody td:nth-child(3)::before {
        content: "Факт: ";
        font-weight: 600;
        color: #666;
    }
    
    .details-table tbody td:nth-child(4)::before {
        content: "Выполнение: ";
        font-weight: 600;
        color: #666;
    }
    
    .details-table tbody tr.total-row td::before,
    .details-table tbody tr.year-row td::before {
        color: rgba(255,255,255,0.8);
    }
    
    .details-table .percent {
        font-size: 14px;
        padding: 4px 10px;
    }
}

@media screen and (max-width: 480px) {
    .page-title {
        font-size: 16px;
        padding: 14px 16px;
    }
    
    .plan-tab {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .district-header {
        padding: 12px 14px;
    }
    
    .district-name {
        font-size: 13px;
    }
    
    .dist-name {
        font-size: 13px;
    }
    
    .stat-value {
        font-size: 13px;
    }
    
    .details-table tbody td {
        font-size: 13px;
    }
    
    .details-table tbody td:first-child {
        font-size: 14px;
    }
}
/* ============= МОБИЛЬНАЯ АДАПТАЦИЯ СТРАНИЦЫ СВОЕВРЕМЕННОСТИ ОТЧЕТОВ ============= */

@media screen and (max-width: 768px) {
    /* Обертка страницы */
    .page-wrapper {
        max-width: 100%;
        overflow-x: hidden !important;
    }
    
    /* Шапка страницы */
    .page-wrapper .page-header {
        padding: 16px;
        margin: 0;
    }
    
    .page-wrapper .page-header h1 {
        font-size: 18px;
        line-height: 1.3;
        word-wrap: break-word;
    }
    
    /* Контейнер контента */
    .content-container {
        padding: 12px;
    }
    
    /* Фильтры */
    .filters-card {
        padding: 14px;
        margin-bottom: 16px;
        border-radius: 8px;
    }
    
    .filters-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-group {
        width: 100%;
        min-width: auto;
        flex: none;
    }
    
    .filter-label {
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .filter-select,
    .districts-selected-text {
        padding: 12px 14px;
        font-size: 14px;
        width: 100%;
    }
    
    .filter-btn {
        width: 100%;
        padding: 14px 20px;
        margin-top: 4px;
    }
    
    /* Dropdown округов */
    .districts-dropdown {
        max-height: 250px;
    }
    
    .district-option {
        padding: 12px 14px;
    }
    
    .district-option label {
        font-size: 14px;
    }
    
    /* Placeholder */
    .placeholder {
        padding: 40px 20px;
        font-size: 14px;
    }
    
    /* Карточка округа */
    .district-card {
        margin-bottom: 16px;
        border-radius: 8px;
        overflow: hidden !important;
    }
    
    .district-title {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .district-title-count {
        font-size: 12px;
    }
    
    /* Таблица - горизонтальный скролл */
    .reports-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0;
        margin: 0;
    }
    
    .reports-table {
        min-width: 800px;
        font-size: 11px;
    }
    
    /* Убираем sticky для мобильных - он плохо работает с горизонтальным скроллом */
    .reports-table th:first-child,
    .reports-table td:first-child {
        position: relative !important;
        left: auto !important;
        z-index: auto !important;
        box-shadow: none;
    }
    
    .reports-table thead th:first-child {
        z-index: auto !important;
    }
    
    /* Ячейка дистрибьютора */
    .distributor-cell {
        min-width: 140px;
        max-width: 140px;
        padding: 8px 10px;
    }
    
    .distributor-name {
        font-size: 11px;
        margin-bottom: 3px;
        line-height: 1.3;
    }
    
    .distributor-type {
        font-size: 9px;
        gap: 4px;
    }
    
    .type-dot {
        width: 6px;
        height: 6px;
    }
    
    /* Заголовки таблицы */
    .reports-table thead tr:first-child th {
        padding: 8px 4px;
        font-size: 10px;
    }
    
    .reports-table thead tr:nth-child(2) th {
        padding: 6px 3px;
        font-size: 8px;
    }
    
    .deadline-in-header {
        font-size: 7px;
        margin-top: 2px;
    }
    
    .reports-table thead tr:nth-child(3) th {
        padding: 5px 3px;
        font-size: 7px;
    }
    
    /* Ячейки отчетов */
    .report-cell {
        padding: 6px 3px;
        min-width: 55px;
        max-width: 55px;
    }
    
    .report-date {
        font-size: 9px;
        margin-bottom: 2px;
    }
    
    .report-status-icon {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
    
    .report-empty {
        font-size: 12px;
    }
    
    /* Легенда */
    .legend-card {
        padding: 12px 14px;
        margin-top: 16px;
    }
    
    .legend-title {
        font-size: 9px;
        margin-bottom: 10px;
    }
    
    .legend-items {
        flex-direction: column;
        gap: 8px;
    }
    
    .legend-item {
        gap: 8px;
    }
    
    .legend-item .report-status-icon {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
    
    .legend-item span:last-child {
        font-size: 12px;
    }
    
    /* Подсказка о скролле */
    .reports-table-wrapper::after {
        content: "← Прокрутите таблицу →";
        display: block;
        text-align: center;
        font-size: 11px;
        color: #72777a;
        padding: 8px;
        background: #f9fafb;
        border-top: 1px solid #e8eaed;
    }
}

@media screen and (max-width: 480px) {
    .page-wrapper .page-header h1 {
        font-size: 16px;
    }
    
    .distributor-cell {
        min-width: 120px;
        max-width: 120px;
        padding: 6px 8px;
    }
    
    .distributor-name {
        font-size: 10px;
    }
    
    .distributor-type {
        font-size: 8px;
    }
    
    .report-cell {
        min-width: 50px;
        max-width: 50px;
        padding: 5px 2px;
    }
    
    .report-date {
        font-size: 8px;
    }
    
    .report-status-icon {
        width: 14px;
        height: 14px;
        font-size: 9px;
    }
    
    .reports-table thead tr:first-child th {
        font-size: 9px;
    }
    
    .reports-table thead tr:nth-child(2) th {
        font-size: 7px;
    }
    
    .deadline-in-header {
        font-size: 6px;
    }
    
    .reports-table thead tr:nth-child(3) th {
        font-size: 6px;
    }
}

/* ========================================
   CISLink Banner - мобильная адаптация
   Версия: 1.0 | 09.02.2026
   ======================================== */

@media screen and (max-width: 768px) {
    .cislink-banner {
        padding: var(--spacing-md, 16px);
    }

    .cislink-banner__content {
        flex-direction: column;
        gap: var(--spacing-md, 16px);
    }

    .cislink-banner__icon {
        width: 40px;
        height: 40px;
    }

    .cislink-banner__icon svg {
        width: 32px;
        height: 32px;
    }

    .cislink-banner__text {
        padding-right: 20px;
    }

    .cislink-banner__title {
        font-size: var(--font-size-base, 14px);
    }

    .cislink-banner__description {
        font-size: var(--font-size-sm, 12px);
    }

    .cislink-banner__action {
        width: 100%;
    }

    .cislink-banner__btn {
        width: 100%;
        justify-content: center;
        padding: 11px 20px;
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .cislink-banner {
        padding: 12px;
    }

    .cislink-banner__icon {
        display: none;
    }

    .cislink-banner__text {
        padding-right: 16px;
    }

    .cislink-banner__title {
        font-size: 13px;
    }

    .cislink-banner__description {
        font-size: 11px;
    }
}
