/* Base styles - Reset, body, layout */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #e2e6ea;
    margin: 0;
    padding: 0;
    line-height: 1.4;
    overflow: hidden;
}

.container {
    max-width: 100%;
    margin: 0;
    background: transparent;
    padding: 0;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

.app-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.content-header {
    padding: 15px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.content-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.content-area {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.loading {
    display: none;
    text-align: center;
    color: #666;
}

.loading.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 400px;
}

.spinner {
    border: 5px solid #e0e0e0;
    border-top: 5px solid #1976d2;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

.loading p {
    font-size: 15px;
    color: #666;
    margin: 10px 0 0 0;
    animation: pulse 1.5s ease-in-out infinite;
}

.results {
    display: none;
}

.results.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#contractsContainer {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Скрытие секций фильтром — работает и в обычном режиме, и при печати */
.filter-hidden {
    display: none !important;
}

/* Контейнеры контрактов - оптимизация для перерисовки */
[id^="contract_"] {
    transition: opacity 0.15s ease-in-out;
    will-change: auto;
}

/* Стили для панели контрактов */
#contractsColumn::-webkit-scrollbar {
    width: 10px;
}

#contractsColumn::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#contractsColumn::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

#contractsColumn::-webkit-scrollbar-thumb:hover {
    background: #555;
}
