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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

.header {
    background: linear-gradient(135deg, #7DD3FC 0%, #10B981 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    position: sticky;
    top: 0;
    flex-shrink: 0;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.year-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.year-selector label {
    font-weight: 500;
}

.year-selector select {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

.year-selector select:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.year-selector select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.show-all-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-left: 0.5rem;
}

.show-all-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}

.show-all-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.compare-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.compare-year-select {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
    min-width: 150px;
}

.compare-year-select:hover:not(:disabled) {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.compare-year-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.compare-year-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.compare-years-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.compare-years-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}

.compare-years-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.analysis-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.field-select {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
    min-width: 200px;
}

.field-select:hover:not(:disabled) {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.field-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.field-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.analyze-btn,
.reset-colors-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.analyze-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}

.analyze-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reset-colors-btn {
    background: rgba(255, 193, 7, 0.3);
}

.reset-colors-btn:hover:not(:disabled) {
    background: rgba(255, 193, 7, 0.4);
}

.reset-colors-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.main-content {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
}

#map {
    flex: 1;
    width: 100%;
    height: 100%;
}

.data-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 400px;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.data-panel.hidden {
    transform: translateX(100%);
}

.data-panel-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #7DD3FC 0%, #10B981 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-panel-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.data-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.data-content .placeholder {
    text-align: center;
    color: #999;
    margin-top: 2rem;
    font-style: italic;
}

.data-table {
    width: 100%;
}

.data-table h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    border-bottom: 2px solid #14B8A6;
    padding-bottom: 0.5rem;
}

.data-section {
    margin-bottom: 2rem;
}

.data-section h4 {
    color: #555;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.data-section table {
    width: 100%;
    border-collapse: collapse;
}

.data-section table tr {
    border-bottom: 1px solid #eee;
}

.data-section table tr:last-child {
    border-bottom: none;
}

.data-section table td {
    padding: 0.75rem 0.5rem;
    color: #666;
}

.data-section table td:first-child {
    font-weight: 500;
    color: #444;
    width: 60%;
}

.data-section table td:last-child {
    text-align: right;
    font-family: 'Courier New', monospace;
    color: #333;
}

.no-data {
    text-align: center;
    color: #999;
    margin-top: 2rem;
    font-style: italic;
}

.error {
    color: #d32f2f;
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    background: #ffebee;
    border-radius: 4px;
}

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

.data-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.data-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.data-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Таблица всех данных снизу */
.all-data-table {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 50vh;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 999;
    transition: transform 0.3s ease, right 0.3s ease;
}

.all-data-table.hidden {
    transform: translateY(100%);
}

.all-data-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #7DD3FC 0%, #10B981 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.all-data-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.all-data-content {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    padding: 1rem;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.all-data-table-wrapper {
    width: 100%;
    position: relative;
    min-width: max-content;
    /* Не добавляем overflow здесь - прокрутка должна быть на уровне .all-data-content */
}

.all-data-table-content {
    width: 100%;
    min-width: max-content;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    table-layout: auto;
    /* Таблица может быть шире контейнера благодаря min-width: max-content */
}

.all-data-table-content thead {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f5f5f5;
}

.all-data-table-content thead tr {
    background: #f5f5f5;
}

.all-data-table-content thead tr:first-child {
    position: sticky;
    top: 0;
    z-index: 102;
    background: #f5f5f5;
}

.all-data-table-content thead tr:first-child th {
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

/* Вторая строка заголовков закрепляется под первой */
.all-data-table-content thead tr:first-child + tr {
    position: sticky;
    top: 0;
    z-index: 101;
    background: #f5f5f5;
}

.all-data-table-content thead tr:first-child + tr th {
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

/* Если есть только одна строка заголовков (таблица сравнения) */
.all-data-table-content thead tr:only-child {
    position: sticky;
    top: 0;
    z-index: 102;
    background: #f5f5f5;
}

.all-data-table-content thead tr:only-child th {
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

.all-data-table-content th {
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

.all-data-table-content th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.all-data-table-content th.sortable:hover {
    background-color: #e0e0e0;
}

.all-data-table-content thead th:first-child {
    position: sticky;
    left: 0;
    background: #f5f5f5;
    z-index: 13;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.all-data-table-content thead tr:first-child th:first-child {
    z-index: 14;
}

.all-data-table-content thead tr:last-child th:first-child {
    z-index: 13;
}

.all-data-table-content td {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
    color: #666;
}

.all-data-table-content td:first-child {
    position: sticky;
    left: 0;
    background: white;
    font-weight: 500;
    color: #444;
    z-index: 1;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.all-data-table-content tbody tr:hover {
    background: #f9f9f9;
}

.all-data-table-content tbody tr:hover td:first-child {
    background: #f9f9f9;
}

.all-data-table-content tbody tr.table-row-clickable:hover td:first-child {
    background: #e3f2fd !important;
}

.all-data-table-content tbody tr.table-row-clickable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.all-data-table-content tbody tr.table-row-clickable:hover {
    background: #e3f2fd !important;
}

.all-data-table-content tbody tr.table-row-clickable:hover td:first-child {
    background: #e3f2fd !important;
}

/* Стили для таблицы сравнения */
.compare-table-cell-positive {
    background-color: rgba(76, 175, 80, 0.1) !important;
}

.compare-table-cell-positive-strong {
    background-color: rgba(76, 175, 80, 0.3) !important;
}

.compare-table-cell-positive-very-strong {
    background-color: rgba(76, 175, 80, 0.5) !important;
}

.compare-table-cell-negative {
    background-color: rgba(244, 67, 54, 0.1) !important;
}

.compare-table-cell-negative-strong {
    background-color: rgba(244, 67, 54, 0.3) !important;
}

.compare-table-cell-negative-very-strong {
    background-color: rgba(244, 67, 54, 0.5) !important;
}

.compare-table-cell-neutral {
    background-color: rgba(158, 158, 158, 0.1) !important;
}

.all-data-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.all-data-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.all-data-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.all-data-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Разделитель между орошаемыми и осушенными показателями */
.all-data-table-content th.separator-right,
.all-data-table-content td.separator-right {
    border-right: 2px solid #666 !important;
    box-shadow: 1px 0 0 0 #666;
}

.all-data-table-content th.separator-left,
.all-data-table-content td.separator-left {
    border-left: 2px solid #666 !important;
    box-shadow: -1px 0 0 0 #666;
}

/* Адаптивность */
@media (max-width: 768px) {
    .data-panel {
        width: 100%;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .year-selector {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .show-all-btn {
        margin-left: 0;
        width: 100%;
    }
    
    .compare-controls {
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
        gap: 0.5rem;
    }
    
    .compare-year-select {
        width: 100%;
    }
    
    .compare-years-btn {
        width: 100%;
    }
    
    .analysis-controls {
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
        gap: 0.5rem;
    }
    
    .field-select {
        width: 100%;
    }
    
    .analyze-btn,
    .reset-colors-btn {
        width: 100%;
    }
    
    .all-data-table {
        max-height: 70vh;
    }
}

/* Панель слоев (слева) */
.layers-panel {
    position: absolute;
    left: 0;
    top: 0;
    width: 300px;
    height: 100%;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.layers-panel.hidden {
    transform: translateX(-100%);
}

/* Кнопка открытия панели слоев */
.toggle-layers-btn {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 1001;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #7DD3FC 0%, #10B981 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.toggle-layers-btn:hover {
    background: linear-gradient(135deg, #5EEAD4 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.toggle-layers-btn.hidden {
    display: none;
}

.layers-panel-header {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #7DD3FC 0%, #10B981 100%);
    color: white;
}

.layers-panel-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.melioration-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.melioration-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}

.melioration-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.layers-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.layer-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: move;
    user-select: none;
    transition: all 0.2s;
}

.layer-item:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.layer-item.dragging {
    opacity: 0.5;
    border-color: #14B8A6;
}

.layer-item.drag-over {
    border-top: 2px solid #14B8A6;
    margin-top: 2px;
}

.layer-drag-handle {
    color: #999;
    font-size: 1.2rem;
    cursor: grab;
    padding: 0.25rem;
    line-height: 1;
    user-select: none;
}

.layer-drag-handle:active {
    cursor: grabbing;
}

.layer-item:active .layer-drag-handle {
    cursor: grabbing;
}

.layer-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
}

.layer-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex: 1;
}

.layer-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}


.no-layers {
    text-align: center;
    color: #999;
    padding: 2rem;
}

/* Контекстное меню для слоев */
.layer-context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    min-width: 180px;
    padding: 0.25rem 0;
}

.context-menu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.context-menu-item:hover {
    background-color: #f0f0f0;
}

.context-menu-item-checkbox {
    padding: 0;
}

.context-menu-item-checkbox label {
    padding: 0.5rem 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.context-menu-item-checkbox label:hover {
    background-color: #f0f0f0;
}

.context-menu-item-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Панель объекта (справа) */
.object-panel {
    position: absolute;
    right: 0;
    top: 0;
    width: 400px;
    height: 100%;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.object-panel.hidden {
    transform: translateX(100%);
}

.object-panel-header {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #7DD3FC 0%, #10B981 100%);
    color: white;
}

.object-panel-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.object-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 0;
    position: relative;
}

.object-table-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    min-width: max-content;
}

.object-table-content {
    width: 100%;
    min-width: max-content;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.object-table-content thead {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f5f5f5;
}

.object-table-content thead tr {
    background: #f5f5f5;
}

.object-table-content thead tr th {
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
    background: #f5f5f5;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

.object-table-content thead th:first-child {
    position: sticky;
    left: 0;
    background: #f5f5f5;
    z-index: 101;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.object-table-content td {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
    color: #666;
}

.object-table-content td:first-child {
    position: sticky;
    left: 0;
    background: white;
    font-weight: 500;
    color: #444;
    z-index: 1;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.object-table-content tbody tr:hover {
    background: #f9f9f9;
}

.object-table-content tbody tr:hover td:first-child {
    background: #f9f9f9;
}

.object-table-content tbody tr.table-row-clickable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.object-table-content tbody tr.table-row-clickable:hover {
    background: #e3f2fd !important;
}

.object-table-content tbody tr.table-row-clickable:hover td:first-child {
    background: #e3f2fd !important;
}

.object-table-content tbody tr.table-row-clickable.selected {
    background: #bbdefb !important;
}

.object-table-content tbody tr.table-row-clickable.selected td:first-child {
    background: #bbdefb !important;
}

.object-data {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.object-field {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.field-name {
    font-weight: 600;
    color: #666;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.field-value {
    color: #333;
    font-size: 1rem;
}

/* Компактное отображение полей */
.object-data-compact {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    gap: 0.25rem;
}

.object-field-compact {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #e0e0e0;
    min-height: 1.5rem;
}

.object-field-compact:last-child {
    border-bottom: none;
}

.field-name-compact {
    font-weight: 600;
    color: #666;
    font-size: 0.85rem;
    flex: 0 0 auto;
    margin-right: 1rem;
}

.field-value-compact {
    color: #333;
    font-size: 0.85rem;
    text-align: right;
    flex: 1 1 auto;
    word-break: break-word;
}

/* Связанные объекты */
.related-objects-section {
    margin-top: 1rem;
    padding: 1rem;
    border-top: 2px solid #e0e0e0;
}

.related-objects-group {
    margin-bottom: 0.5rem;
}

.related-objects-header {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f5f5f5;
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.related-objects-header:hover {
    background: #e8e8e8;
}

.related-objects-title {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.related-objects-count {
    color: #666;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.related-objects-toggle {
    color: #666;
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.related-objects-list {
    padding: 0.5rem 0;
    max-height: 300px;
    overflow-y: auto;
}

.related-objects-list.hidden {
    display: none;
}

.related-object-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.related-object-item:hover,
.related-object-item.highlighted {
    background: #fff3e0;
}

.related-object-item:last-child {
    border-bottom: none;
}

/* Секция дополнительных данных */
.additional-data-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid #e0e0e0;
}

.additional-data-group {
    margin-bottom: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fafafa;
}

.additional-data-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #7DD3FC 0%, #10B981 100%);
    color: white;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.additional-data-header:hover {
    background: linear-gradient(135deg, #5EEAD4 0%, #059669 100%);
}

.additional-data-title {
    font-weight: 600;
    flex: 1;
    font-size: 0.95rem;
}

.additional-data-count {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    margin-right: 0.5rem;
    font-weight: 500;
}

.additional-data-toggle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.additional-data-content {
    padding: 0.75rem 1rem;
    background: white;
    max-height: 500px;
    overflow-y: auto;
}

.additional-data-content.hidden {
    display: none;
}

.additional-data-field {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.additional-data-field:last-child {
    border-bottom: none;
}

.additional-data-field-name {
    font-weight: 500;
    color: #555;
    min-width: 180px;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.additional-data-field-value {
    color: #333;
    flex: 1;
    text-align: right;
    font-size: 0.9rem;
}

.additional-data-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #14B8A6;
}

.additional-data-item:last-child {
    margin-bottom: 0;
}

.additional-data-item-header {
    font-weight: 600;
    color: #14B8A6;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #e0e0e0;
}

.additional-data-item-content {
    padding-left: 0.5rem;
}

.additional-data-item-content .additional-data-field {
    padding: 0.4rem 0;
    border-bottom: 1px solid #f5f5f5;
}

.additional-data-item-content .additional-data-field-name {
    min-width: 160px;
    font-size: 0.85rem;
}

.additional-data-item-content .additional-data-field-value {
    font-size: 0.85rem;
}


