body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Стили для fieldset и legend в фильтрах */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
    min-width: 0;
}

fieldset legend {
    float: none;
    width: auto;
    padding: 0;
    margin-bottom: 0.5rem;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

/* Общие стили для контейнеров */
.login-container, .settings-container {
    margin: 50px auto;
    padding: 30px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-container {
    max-width: 500px;
    margin: 100px auto;
    text-align: center;
}

.settings-container {
    max-width: 800px;
}

/* Заголовки */
h1, .settings-container h3 {
    margin-bottom: 30px;
    color: #0d6efd;
}

.dashboard-card {
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.metric-value {
    font-size: 24px;
    font-weight: bold;
    color: #0d6efd;
}

.metric-label {
    color: #6c757d;
    font-size: 14px;
}

.portfolio-section {
    border-left: 3px solid #e9ecef;
    padding-left: 15px;
    margin-bottom: 20px;
}

.portfolio-section:last-child {
    border-left-color: #28a745;
    background-color: #f8fff9;
    padding: 15px;
    border-radius: 5px;
}

.positive-value {
    color: #28a745;
}

.negative-value {
    color: #dc3545;
}

.last-updated {
    font-size: 12px;
    color: #6c757d;
}

/* Стили для элемента переключения графиков */
.chart-toggle {
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
}

.chart-toggle:hover {
    color: #0d6efd;
}

.chart-toggle::after {
    content: "↺";
    margin-left: 8px;
    font-size: 0.8em;
    opacity: 0.7;
}

/* Стили для кликабельных ячеек */
.nkd-cell {
    cursor: pointer;
    color: #0d6efd;
}

.nkd-cell:hover {
    text-decoration: underline;
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

/* Стили для плавного перехода при загрузке данных */
#coupons-table tbody {
    transition: opacity 0.3s ease;
}

#coupons-table tbody.loading {
    opacity: 0.7;
}

/* Фиксированная высота для контейнеров с данными */
#upcoming-coupons-container, #upcoming-maturities-container {
    transition: min-height 0.3s ease;
}

/* Стили для таблицы купонных выплат с ограниченной высотой */
.coupon-table-container {
    position: relative;
}

.coupon-table-body {
    display: block;
    max-height: 400px; /* Высота примерно на 15 строк */
    overflow-y: auto;
}

#coupons-table thead, 
#coupons-table tbody tr, 
#coupons-table tfoot {
    display: table;
    width: 100%;
    table-layout: fixed;
}

#coupons-table thead {
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 1;
}

#coupons-table tfoot {
    position: sticky;
    bottom: 0;
    background-color: #e2e3e5; /* Цвет для table-secondary */
    z-index: 1;
}

/* Стили для сортируемых заголовков таблицы */
.sortable-header {
    cursor: pointer !important;
    user-select: none;
    position: relative;
    padding: 8px 10px !important; /* Немного увеличиваем отступы */
    transition: background-color 0.2s, color 0.2s;
    background-color: rgba(13, 110, 253, 0.05);
    border: 1px solid rgba(13, 110, 253, 0.2) !important;
    font-size: 14px; /* Идеальный размер сортируемых заголовков */
    white-space: nowrap; /* Запрещаем перенос строк */
}

.sortable-header:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.sortable-header.active {
    background-color: rgba(13, 110, 253, 0.15);
    color: #0d6efd;
    font-weight: 600;
}

.sort-indicator {
    display: none; /* Скрываем стрелочки для экономии места */
}

.sortable-header:hover .sort-indicator {
    opacity: 1;
}

.sort-indicator.asc::after {
    content: "▲";
    color: #0d6efd;
}

.sort-indicator.desc::after {
    content: "▼";
    color: #0d6efd;
}

.sort-indicator.none::after {
    content: "⇅";
    color: #6c757d;
}

/* Адаптация стилей таблицы для сортировки */
.table th {
    position: relative;
    border-bottom: 2px solid #dee2e6;
}

.table th.sortable-header {
    white-space: nowrap;
}

/* Удалены старые стили #bonds-table - теперь используется search-table класс с Bootstrap */

/* Компактные заголовки */
#bonds-table th {
    font-size: 14px; /* Идеальный размер заголовков */
    font-weight: 600;
    line-height: 1.4;
}

/* Адаптивность для мобильных */
@media (max-width: 1200px) {
    #bonds-table {
        font-size: 14px; /* Идеальный размер для мобильных */
    }
    #bonds-table th,
    #bonds-table td {
        padding: 5px 7px !important;
    }
    #bonds-table th {
        font-size: 13px; /* Идеальный размер заголовков на мобильных */
    }
}

/* Убираем отладочные стили - больше не нужны */

/* Стили для отображения валют и ключевой ставки */
.currency-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #212529;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

.key-rate-badge {
    background-color: #5a287d; /* Фиолетовый цвет для ключевой ставки */
    color: white;
}

/* Стили для страницы настроек */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

.help-text {
    font-size: 14px;
    color: #6c757d;
    margin-top: 5px;
}

.settings-section {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

/* Улучшение стилей для карточек информации о лимитах API */
.card-header.bg-info {
    background-color: #0d6efd !important;
    color: white;
}

/* Улучшенный стиль для кнопок на странице настроек */
.settings-container .btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.settings-container .btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.settings-container .btn-outline-primary {
    border-color: #0d6efd;
    color: #0d6efd;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.settings-container .btn-outline-primary:hover {
    background-color: #0d6efd;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.settings-container .btn-outline-info {
    border-color: #17a2b8;
    color: #17a2b8;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.settings-container .btn-outline-info:hover {
    background-color: #17a2b8;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Анимация для загрузки состояния проверки соединения */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.text-info {
    animation: pulse 1.5s infinite;
}

/* Улучшение внешнего вида формы */
.form-select, .form-control {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #ced4da;
    transition: all 0.3s ease;
}

.form-select:focus, .form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Улучшения для блока информации о лимитах API */
.card.border-info {
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card.border-info:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 15px 20px;
}

.card-body {
    padding: 20px;
}

/* Стили для Яндекс.Метрики */
.yandex-metrika-noscript {
    position: absolute;
    left: -9999px;
}

/* Стили для ссылок на меры защиты */
.inner_links .support-measures {
    color: red;
}

/* Стили для аккордеона в таблице облигаций */
.bond-details-row {
    display: none;
    background-color: #f8f9fa;
}

.bond-details-row.show {
    display: table-row;
}

.bond-details-collapse {
    padding: 15px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin: 10px;
}

.bond-details-btn {
    background: none;
    border: none;
    text-align: left;
    padding: 0;
    cursor: pointer;
    color: #0d6efd;
    display: flex;
    align-items: center;
    font-weight: normal;
    width: 100%;
    transition: all 0.3s ease;
}

.bond-details-btn:hover {
    color: #0a58ca;
}

/* Принудительно убираем любые треугольники/стрелки из кнопки ISIN */
.bond-details-btn::after,
.bond-details-btn::before {
    display: none !important;
    content: none !important;
}

.bond-details-btn .chevron,
.bond-details-btn .caret,
.bond-details-btn .arrow,
.bond-details-btn .triangle {
    display: none !important;
}

/* Дополнительная очистка для любых возможных стилей треугольника */
.bond-details-btn {
    background: none !important;
    border: none !important;
    text-align: left !important;
    padding: 0 !important;
    cursor: pointer !important;
    color: #0d6efd !important;
    display: flex !important;
    align-items: center !important;
    font-weight: normal !important;
    width: 100% !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.bond-details-btn:focus,
.bond-details-btn:active {
    outline: none !important;
    box-shadow: none !important;
    background: none !important;
    border: none !important;
}

/* Chevron стили убраны - треугольник удален для экономии места
.bond-details-btn .chevron {
    transition: transform 0.3s ease;
    margin-left: 5px;
}

.bond-details-btn.expanded .chevron {
    transform: rotate(180deg);
}
*/

.bond-details-section {
    margin-bottom: 15px;
}

.bond-details-section h6 {
    margin-bottom: 10px;
    color: #495057;
    font-weight: 600;
}

.bond-details-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 равных колонок */
    gap: 10px;
}

.bond-details-item {
    padding: 8px;
}

.bond-details-item-wide {
    grid-column: span 2; /* Занимает 2 колонки из сетки */
    padding: 8px;
}

.bond-details-item .label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.bond-details-item .value {
    font-weight: 500;
    color: #212529;
}

/* Стили для фильтров облигаций */
.bond-filters {
    background-color: #fff;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.bond-filters .form-select {
    min-width: 180px;
    max-width: 250px;
    border-color: #dee2e6;
    background-color: #fff;
    font-size: 0.875rem;
    padding: 0.5rem 2.25rem 0.5rem 0.75rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.bond-filters .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.bond-filters .btn-outline-secondary {
    border-color: #dee2e6;
    color: #6c757d;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.bond-filters .btn-outline-secondary:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.bond-filters .btn-outline-secondary i {
    transition: transform 0.3s ease;
}

.bond-filters .btn-outline-secondary:hover i {
    transform: rotate(90deg);
}

.filter-info {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* Адаптивные стили для фильтров */
@media (max-width: 768px) {
    .bond-filters .form-select {
        min-width: 100%;
        max-width: 100%;
    }
    
    .bond-filters .d-flex {
        gap: 0.75rem !important;
    }
    
    .bond-filters .btn-outline-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 576px) {
    .bond-filters .d-flex {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px !important;
    }
    
    .bond-filters select, 
    .bond-filters button {
        width: 100%;
        max-width: none;
    }
}

/* Средние экраны */
@media (min-width: 577px) and (max-width: 992px) {
    .bond-filters select {
        min-width: 130px;
        max-width: 160px;
    }
}

.bond-filters .form-select option:disabled {
    color: #adb5bd;
    font-style: italic;
    background-color: #f8f9fa;
}

/* Стили для графика купонных выплат по месяцам */
#monthlyCouponsChart {
    height: 300px;
    max-height: 300px;
    cursor: pointer;
}

.dashboard-card canvas {
    margin-top: 15px;
}

/* Улучшенный стиль для карточек с графиками */
.dashboard-card h5 {
    color: #333;
    margin-bottom: 0;
}

/* Стили для фильтра месячных выплат */
.month-filter-info {
    border-left: 4px solid #0d6efd;
}

.reset-month-filter {
    white-space: nowrap;
} 

/* Стили для новой современной шапки дашборда */
.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 32px 32px 24px 32px;
}

.header-title-section {
    flex: 1;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: white;
    letter-spacing: -0.5px;
}

.header-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
}

.last-updated-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.last-updated-value {
    font-size: 0.85rem;
    color: white;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.last-updated-bold {
    font-weight: 600;
}

.last-updated-normal {
    font-weight: 400;
}

.header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.last-updated-section {
    display: flex;
    align-items: flex-end;
    margin-right: 0; /* Выровнять по правому краю, как кнопки */
}

.last-updated-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px; /* Выровнять по высоте с валютными блоками */
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}



.action-buttons {
    display: flex;
    gap: 12px;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.action-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.header-bottom {
    background: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 20px 32px;
    backdrop-filter: blur(20px);
}

.market-info {
    display: flex;
    gap: 48px;
    align-items: center;
}

.market-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.market-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.8);
}

.currency-rates {
    display: flex;
    gap: 16px;
}

.currency-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 16px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    min-width: 80px;
}

.currency-code {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2px;
}

.currency-rate {
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.key-rate {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    text-align: center;
    cursor: help;
}

.key-rate-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 24px;
        padding: 24px 20px 20px 20px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    
    .action-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .btn-action {
        flex: 1;
        justify-content: center;
    }
    
    .header-bottom {
        padding: 16px 20px;
    }
    
    .market-info {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    
    .currency-rates {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .currency-item {
        min-width: 70px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.75rem;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .currency-rates {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 6px;
    }
} 

/* === ЗАКРЕПЛЕНИЕ ОБЛИГАЦИЙ === */

/* Кнопка закрепления (звёздочка) */
.bond-pin-btn {
    background: none;
    border: none;
    padding: 4px 6px;
    margin: 0;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #6c757d;
    transition: all 0.2s ease;
    border-radius: 3px;
}

.bond-pin-btn:hover {
    color: #ffc107;
    background-color: rgba(255, 193, 7, 0.1);
    transform: scale(1.1);
}

/* Закреплённая звёздочка */
.bond-pin-btn.pinned {
    color: #ffc107;
    background-color: rgba(255, 193, 7, 0.15);
}

.bond-pin-btn.pinned:hover {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.1);
}

/* Иконка звёздочки */
.pin-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

.bond-pin-btn.pinned .pin-icon {
    transform: scale(1.1);
}

/* Стили для закреплённых строк */
.bond-row-pinned {
    background-color: rgba(255, 193, 7, 0.05) !important;
    border-left: 3px solid #ffc107;
}

.bond-row-pinned:hover {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

/* Счётчик закреплённых облигаций */
.pinned-bonds-counter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background-color: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    font-size: 11px;
    color: #856404;
    margin-left: 10px;
}

.pinned-bonds-counter .pin-count {
    font-weight: 600;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .bond-pin-btn {
        font-size: 14px;
        padding: 3px 5px;
    }
    
    .pinned-bonds-counter {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* === КОНЕЦ БЛОКА ЗАКРЕПЛЕНИЯ === */ 

/* Ширина колонок таблицы поиска */
.search-table .col-isin { width: 13%; }
.search-table .col-name { width: 26%; }
.search-table .col-sector { width: 9%; }
.search-table .col-currency { width: 7%; }
.search-table .col-maturity { width: 9%; }
.search-table .col-amortization { width: 6%; }
.search-table .col-nominal { width: 9%; }
.search-table .col-coupons { width: 6%; }
.search-table .col-price { width: 7%; }
.search-table .col-price-percent { width: 6%; }
.search-table .col-price-rub { width: 7%; }
.search-table .col-ytm { width: 6%; }
.search-table .col-aci { width: 5%; }

/* Стили для таблицы дашборда (используется тот же search-table класс) */
.search-table .col-isin { 
    width: 140px; 
    min-width: 140px; 
    max-width: 140px; 
}
.search-table .col-name { width: 20%; }
.search-table .col-quantity { width: 6%; }
.search-table .col-value { width: 8%; }
.search-table .col-coupon-type { width: 5%; }
.search-table .col-coupon-rate { width: 7%; }
.search-table .col-coupon-size { width: 6%; }
.search-table .col-nkd { width: 5%; }
.search-table .col-coupon-payment { width: 7%; }
.search-table .col-payments-per-year { width: 6%; }
.search-table .col-yearly-coupon-sum { width: 8%; }
.search-table .col-offer { width: 14%; }
.search-table .col-duration { width: 7%; }

/* Запрет переноса текста в колонке оферты */
.search-table .col-offer {
    white-space: nowrap;
}

/* Фиксированная ширина для ISIN колонки */
.search-table th.col-isin,
.search-table td:first-child {
    width: 170px;
    min-width: 170px;
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Стили для кликабельного ISIN */
.isin-clickable {
    cursor: pointer;
}

.isin-clickable:hover {
    text-decoration: underline;
    color: #0d6efd !important;
}

/* Стили для анимации мигания строки */
@keyframes highlight-blink {
    0% { background-color: transparent; }
    25% { background-color: rgba(255, 193, 7, 0.3); }
    50% { background-color: rgba(255, 193, 7, 0.6); }
    75% { background-color: rgba(255, 193, 7, 0.3); }
    100% { background-color: transparent; }
}

.bond-row-highlight {
    animation: highlight-blink 2s ease-in-out;
}

/* Стили для кликабельных ISIN в блоках погашений и купонов */
.maturity-isin-clickable,
.coupon-isin-clickable {
    cursor: pointer;
    color: #0d6efd;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 2px 4px;
    border-radius: 3px;
}

.maturity-isin-clickable:hover,
.coupon-isin-clickable:hover {
    background-color: rgba(13, 110, 253, 0.1);
    text-decoration: underline;
    color: #0a58ca;
}

/* Стили для страницы поиска */
.search-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.search-filters-header h5 {
    color: #333;
    font-weight: 600;
    margin: 0;
}

.search-filters-actions .btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 16px;
}

.search-results-header h5 {
    color: #333;
    font-weight: 600;
    margin: 0;
}

.search-results-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.results-info-block {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-badge {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(13, 110, 253, 0.2);
}

.search-stats {
    margin-top: 8px;
}

/* Компактные стили для фильтров */
.compact-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px; /* более плотное выравнивание по горизонтали */
    align-items: center;
}

.compact-checkbox-group .form-check {
    margin-bottom: 0;
    margin-right: 0;
}

.compact-checkbox-group .form-check-label {
    font-size: 13px;
    padding-left: 3px;
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
}

/* Специальная группа для типа облигации: уменьшаем межэлементные отступы */
.bond-type-group {
    gap: 4px 8px;
}
.bond-type-group .form-check {
    margin-right: 0;
}
.bond-type-group .form-check-label {
    padding-left: 2px;
}

/* Стили для радиокнопок */
.btn-group-sm .btn {
    font-size: 12px;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.btn-group-sm .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group-sm .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.btn-group-sm .btn:not(:first-child):not(:last-child) {
    border-radius: 0;
}

/* Удалены стили принудительного однострочного выравнивания фильтров */

/* Компактные лейблы */
#searchForm .form-label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #495057;
}

/* Компактные элементы управления */
.form-control-sm, .form-select-sm {
    font-size: 13px;
    padding: 0.25rem 0.5rem;
}

/* Улучшенные отступы */
#searchForm .row {
    margin-bottom: 8px;
}

#searchForm .row:last-child {
    margin-bottom: 0;
}

/* Компактная кнопка сброса */
#clearFilters {
    font-size: 13px;
    padding: 0.4rem 0.5rem;
    border-radius: 0.375rem;
}

/* Выравнивание кнопки по высоте с полем ввода */
.align-items-end {
    padding-bottom: 4px;
}

/* Кнопка очистки поля поиска */
#clearSearchBtn {
    border: 1px solid #ced4da;
    color: #6c757d;
    background: transparent;
    transition: all 0.15s ease-in-out;
    display: none;
}

#clearSearchBtn:hover {
    color: #495057;
    border-color: #adb5bd;
    background: transparent;
}

#clearSearchBtn:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    border-color: #80bdff;
    outline: 0;
}

/* Адаптивность для страницы поиска */
@media (max-width: 768px) {
    .search-filters-header,
    .search-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .search-results-controls {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    
    .results-info-block {
        width: 100%;
        justify-content: center;
    }
    
    .compact-checkbox-group {
        gap: 6px;
    }
    
    .compact-checkbox-group .form-check-label {
        font-size: 12px;
    }
    
    .btn-group-sm .btn {
        font-size: 11px;
        padding: 0.2rem 0.4rem;
    }
    
    #searchForm .form-label {
        font-size: 12px;
    }
}

/* === СТИЛИ СОРТИРОВКИ === */

/* Сортируемые заголовки таблицы */
.sortable {
    user-select: none;
    transition: background-color 0.2s ease;
    position: relative;
}

.sortable:hover {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

/* Индикаторы сортировки */
.sort-indicator {
    margin-left: 5px;
    font-weight: bold;
    color: #0d6efd;
    min-width: 10px;
    display: inline-block;
}

.sort-indicator.sort-asc {
    color: #28a745;
}

.sort-indicator.sort-desc {
    color: #dc3545;
}

/* Активный заголовок сортировки */
.sortable[data-sort] {
    border: none;
}

.sortable.active {
    background-color: rgba(13, 110, 253, 0.1);
    font-weight: 600;
}

/* Стили для элементов без inline CSS */
.portfolio-select {
    min-width: 220px;
}

.portfolio-details-hidden {
    display: none;
}

.risk-analysis-item {
    line-height: 1.3;
}

.risk-analysis-span {
    max-width: 85%;
    vertical-align: top;
}

 