* {
    box-sizing: border-box;
}
body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    background-color: #f4f6f9;
    color: #333;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #1a2a3a;
    border-bottom: 2px solid #dbeaff;
    padding-bottom: 8px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 15px;
}

.table-responsive {
    overflow-x: auto;
}

.insider-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.insider-table th {
    background-color: #dbeaff;
    color: #003366;
    padding: 7px 8px;
    border: 1px solid #b8d3ff;
    text-align: left;
    font-weight: bold;
    white-space: nowrap;
}

.insider-table td {
    padding: 5px 8px;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.row-purchase {
    background-color: #eafaf1 !important;
}

.row-sale {
    background-color: #fdedec !important;
}
.insider-table tr.row-sale-oe {
    background-color: #ffffcc !important;
}

.insider-table tbody tr:hover {
    filter: brightness(0.96);
}

.text-right {
    text-align: right;
}

a {
    color: #0000cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.ticker-link {
    font-weight: bold;
    color: #000099;
}

.empty-state {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}
/* Компактная ширина для названия компании */
table.insider-table td.col-company,
table.insider-table th.col-company {
    max-width: 240px;
    width: 240px;
    white-space: normal; /* Разрешаем перенос длинных слов/названий */
    word-break: break-word; /* Переносим слишком длинные слова аккуратно */
}
/* Тултип для заголовков таблиц */
.section-title {
    background-color: #222;
    color: #fff;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background-color: #555;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    cursor: help;
    position: relative;
}

.tooltip-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 125%;
    left: 0;
    background-color: #111;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
    white-space: normal;
    width: 300px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    line-height: 1.4;
    border: 1px solid #444;
}

/* Базовый класс для всех заглавных плашек */
.section-title {
    padding: 9px 14px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 4px 4px 0 0;
    margin-top: 20px;
}

/* Ссылка внутри заголовка */
.section-title a.title-link {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.section-title a.title-link:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* Цветовые темы для каждого типа выборки */
.theme-cluster {
    background-color: #0d5c3a; /* Тёмно-изумрудный (Кластеры) */
    border-left: 4px solid #2ecc71;
}

.theme-buys {
    background-color: #1e4620; /* Лесной зелёный (Все покупки) */
    border-left: 4px solid #27ae60;
}

.theme-pennystocks {
    background-color: #4a3b00; /* Темно-янтарный (Дешевые акции) */
    border-left: 4px solid #f1c40f;
}

.theme-sales {
    background-color: #5c1d1d; /* Тёмно-красный (Продажи) */
    border-left: 4px solid #e74c3c;
}

.theme-stream {
    background-color: #2c3e50; /* Графитовый / Нейтральный поток */
    border-left: 4px solid #3498db;
}

/* Иконка тултипа */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    cursor: help;
    position: relative;
}

.tooltip-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 130%;
    right: 0;
    background-color: #1a1a1a;
    color: #f1f1f1;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
    white-space: normal;
    width: 280px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 1000;
    line-height: 1.4;
    border: 1px solid #444;
}
/* Базовый класс для плашки заголовка */
.section-title {
    padding: 9px 14px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    border-radius: 4px 4px 0 0;
    margin-top: 20px;
}

/* Контейнер-обертка: держит ссылку и иконку рядом */
.title-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Отступ между ссылкой и значком '?' */
    position: relative;
}

.section-title a.title-link {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.section-title a.title-link:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* Цветовые темы */
.theme-cluster { background-color: #0d5c3a; border-left: 4px solid #2ecc71; }
.theme-buys { background-color: #1e4620; border-left: 4px solid #27ae60; }
.theme-pennystocks { background-color: #4a3b00; border-left: 4px solid #f1c40f; }
.theme-sales { background-color: #5c1d1d; border-left: 4px solid #e74c3c; }
.theme-stream { background-color: #2c3e50; border-left: 4px solid #3498db; }

/* Иконка тултипа рядом с текстом */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    background-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    cursor: help;
    position: relative;
}

/* Выплывающее окно тултипа */
.tooltip-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 130%;
    left: 0; /* Всплывает ровно под иконкой/заголовком */
    background-color: #1a1a1a;
    color: #f1f1f1;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
    white-space: normal;
    width: 280px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 1000;
    line-height: 1.4;
    border: 1px solid #444;
}