/* Контейнер таблиці */
.table-container {
    background: #ffffff;
    padding: 20px;
    border: 1px solid #94a3b8;
    border-radius: 4px;
    perspective: 1000px;
    width: 100%;
    box-sizing: border-box;
    min-height: 700px;
    display: flex;
    flex-direction: column;
    overflow-x: auto;
}

.expert-table {
    width: 100%;
    border-collapse: separate; 
    border-spacing: 0 4px; 
    font-family: 'Merriweather', serif;
    table-layout: fixed;
    margin-bottom: auto;
}

/* ШАПКА ТАБЛИЦІ (ПОКРАЩЕНИЙ ВІЗУАЛ) */
.expert-table thead th {
    /* Градієнтний фон */
    background: linear-gradient(to bottom, #f8fafc 0%, #e2e8f0 100%);
    color: #1e3a8a;
    padding: 16px 12px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em; /* Розрідження літер */
    
    /* Об'ємні межі */
    border-top: 1px solid #ffffff;
    border-left: 1px solid #cbd5e1;
    border-right: 1px solid #94a3b8;
    border-bottom: 4px solid #1e3a8a; /* Потовщена акцентна лінія */
    
    /* Складна тінь для об'єму */
    box-shadow: 
        inset 0 1px 0 rgba(255,255,255,0.8), 
        0 2px 4px rgba(0,0,0,0.1);
    
    text-align: center; 
    vertical-align: middle;
}

/* Окремі стилі вирівнювання для тексту в заголовках */
.expert-table thead th:nth-child(2),
.expert-table thead th:nth-child(4) {
    text-align: left;
}

/* НАЛАШТУВАННЯ ШИРИНИ КОЛОНОК */
.expert-table thead th:nth-child(1) { width: 40px; } 
.expert-table thead th:nth-child(2) { width: 25%; } 
.expert-table thead th:nth-child(3) { width: 60px; } 
.expert-table thead th:nth-child(4) { width: auto; } 

/* БАЗОВИЙ СТАН КОМІРОК */
.expert-table td {
    padding: 15px 12px;
    color: #1e293b;
    font-size: 15px;
    background-color: #ffffff;
    border-bottom: 2px solid #334155; 
    position: relative;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    vertical-align: middle; 
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Горизонтальне центрування для № та Індексів у тілі */
.col-num, .col-idx {
    text-align: center !important;
}

/* Ефекти при наведенні */
.clickable-row:hover td {
    background-color: #f1f5f9 !important;
    box-shadow: 0 5px 15px rgba(30, 58, 138, 0.1);
    z-index: 20;
}

.is-active {
    background-color: #f1f5f9 !important;
    box-shadow: 0 5px 15px rgba(30, 58, 138, 0.1);
}

.col-num { 
    font-weight: bold; 
    color: #64748b; 
    border-left: 1px solid #cbd5e1; 
    border-radius: 4px 0 0 4px; 
}

.col-idx { 
    font-weight: bold; 
    color: #1e3a8a; 
}

.expert-table td:last-child { 
    border-radius: 0 4px 4px 0; 
}

.clickable-row { cursor: pointer; }

/* ПАГІНАЦІЯ */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0 10px 0;
    margin-top: auto;
    gap: 8px;
}

.pagination-container button {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #1e3a8a;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 18px;
}

.pagination-container button:hover:not(:disabled) {
    background-color: #1e3a8a;
    color: white;
}

#pageNumbers { display: flex; gap: 5px; }
.page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

.page-num.active {
    background-color: #ffffff;
    color: #1e3a8a;
    border: 2px solid #1e3a8a;
}

/* Адаптація */
@media (max-width: 600px) {
    .col-idx { width: 45px; font-size: 13px; }
    .col-num { width: 30px; }
}