:root {
    --primary: #0099a8;
    --primary-light: rgba(0, 153, 168, 0.2);
    --bg-color: #f5f5f7;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --border-color: rgba(0, 0, 0, 0.05);
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.08);
}

@font-face {
    font-family: 'Ezarion';
    src: local('Ezarion Light'), local('Ezarion-Light'), url('fonts/Ezarion-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Ezarion';
    src: local('Ezarion Regular'), local('Ezarion-Regular'), url('fonts/Ezarion-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Ezarion';
    src: local('Ezarion Italic'), local('Ezarion-Italic'), url('fonts/Ezarion-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: 'Ezarion';
    src: local('Ezarion Medium'), local('Ezarion-Medium'), url('fonts/Ezarion-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Ezarion';
    src: local('Ezarion Medium Italic'), local('Ezarion-MediumItalic'), url('fonts/Ezarion-MediumItalic.ttf') format('truetype');
    font-weight: 500;
    font-style: italic;
}

@font-face {
    font-family: 'Ezarion';
    src: local('Ezarion SemiBold'), local('Ezarion-SemiBold'), url('fonts/Ezarion-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Ezarion';
    src: local('Ezarion SemiBold Italic'), local('Ezarion-SemiBoldItalic'), url('fonts/Ezarion-SemiBoldItalic.ttf') format('truetype');
    font-weight: 600;
    font-style: italic;
}

@font-face {
    font-family: 'Ezarion';
    src: local('Ezarion Bold'), local('Ezarion-Bold'), url('fonts/Ezarion-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Ezarion';
    src: local('Ezarion Bold Italic'), local('Ezarion-BoldItalic'), url('fonts/Ezarion-BoldItalic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
}

@font-face {
    font-family: 'Ezarion';
    src: local('Ezarion ExtraBold'), local('Ezarion-ExtraBold'), url('fonts/Ezarion-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
}

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

body {
    font-family: 'Ezarion', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.dashboard-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 30px;
}

/* Скляний Хедер */
.top-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 20px 0;
    margin-bottom: 32px;
    background: rgba(245, 245, 247, 0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #0099a8, #00d4e8);
    border-radius: 10px;
}

.brand h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.4px;
    color: var(--text-main);
    line-height: 1.15;
    margin: 0;
}

/* ── Заглушка "Станом на" ── */
.date-stub {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.date-stub-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Заглушка "Станом на" — кастомні стилі (компактні) ── */
.date-select {
    position: relative;
    user-select: none;
    display: inline-block;
}

#date-select-month .date-select-trigger,
#opp-date-select-month .date-select-trigger {
    width: 110px;
}

#date-select-year .date-select-trigger,
#opp-date-select-year .date-select-trigger {
    width: 75px;
}

.date-select-trigger {
    background-color: #e8e8ed;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0 24px 2px 10px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2386868B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.date-select-trigger:hover {
    background-color: #d2d2d7;
}

.date-select.active .date-select-trigger {
    background-color: #ffffff;
    box-shadow: 0 0 0 3px var(--primary-light);
    border-color: var(--primary);
    transform: scale(1.02);
}

/* Компактний випадаючий список для дат */
.date-select .dropdown-content {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.10);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.95);
    transform-origin: top left;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    overflow: hidden;
    padding: 4px;
}

.date-select.active .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.date-select .dropdown-list {
    padding-right: 0;
}

.date-option {
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #424245;
    transition: background 0.15s ease;
    white-space: nowrap;
    text-align: left;
}

.date-option:hover {
    background: rgba(0, 0, 0, 0.04);
}

.date-option.selected {
    color: var(--primary);
    font-weight: 600;
    background: rgba(0, 153, 168, 0.07);
}

.date-option.disabled {
    color: #a1a1a6;
    opacity: 0.40;
    cursor: default;
    pointer-events: none;
    user-select: none;
}


/* Фільтри */
/* Кастомні фільтри (Apple Style) */
.filters-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    z-index: 100;
    flex: 1;
    justify-content: flex-end;
    max-width: 500px;
    /* Оптимальна ширина для балансу */
}

#select-faculty,
#opp-select-faculty {
    flex: 1 1 100%;
}

#select-degree,
#select-form,
#select-year,
#opp-select-degree,
#opp-select-form,
#opp-select-branch {
    flex: 1 1 0;
    min-width: 0;
}

/* Мобільна адаптація фільтрів */
@media (max-width: 768px) {
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 20px;
    }

    .filters-container {
        max-width: 100%;
        width: 100%;
        justify-content: flex-start;
    }

    .dropdown-content {
        width: calc(100vw - 40px) !important;
        max-width: none !important;
        left: 0 !important;
    }

    .date-stub {
        gap: 6px;
    }
}

.custom-select {
    position: relative;
    user-select: none;
}

.select-trigger {
    background-color: #e8e8ed;
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 0 36px 0 16px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    font-size: 0.90rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2386868B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    width: 100%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    min-width: 0;
}

.select-trigger-text {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: left;
    line-height: 1.2;
    /* line-height: 1 обрізає descenders кирилиці (у, и, р) через overflow: hidden — змінено на 1.2 */
}

#select-year .select-trigger,
#select-year .dropdown-content,
#opp-select-branch .select-trigger,
#opp-select-branch .dropdown-content {
    letter-spacing: -0.4px;
}

.opp-filters-container .select-trigger {
    padding-bottom: 0;
}

.select-trigger:hover {
    background-color: #d2d2d7;
}

.custom-select.active .select-trigger {
    background-color: #ffffff;
    box-shadow: 0 0 0 3px var(--primary-light);
    border-color: var(--primary);
    transform: scale(1.02);
}

.dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 100%;
    width: max-content;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transform-origin: top right;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    overflow: hidden;
    padding: 8px;
}

.custom-select.active .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-list {
    max-height: 350px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Стилізація скролбару для випадаючого списку */
.dropdown-list::-webkit-scrollbar {
    width: 5px;
}

.dropdown-list::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.dropdown-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 6px;
    padding-bottom: 4px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    gap: 12px;
    white-space: nowrap;
}

.checkbox-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.checkbox-item.disabled-option {
    opacity: 0.35;
    pointer-events: none;
}

.checkbox-item input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 1.5px solid #d2d2d7;
    border-radius: 6px;
    /* Більш м'які кути */
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f5f5f7;
    /* Світлий фон як в iOS */
}

.checkbox-item:active .checkmark {
    transform: scale(0.92);
    /* Ефект натискання */
}

.checkbox-item input:checked+.checkmark {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 180, 196, 0.25);
}

.checkbox-item input:checked+.checkmark::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2.5px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(1);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Пружиниста поява */
}

.checkbox-item input:not(:checked)+.checkmark::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2.5px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    /* Ховаємо галочку в центр */
}

.label-text {
    font-size: 0.88rem;
    color: #424245;
    /* М'якший темно-сірий */
    font-weight: 500;
    flex-grow: 1;
    transition: all 0.2s ease;
}

.checkbox-item input:checked~.label-text {
    color: var(--primary);
    font-weight: 600;
    transform: translateX(2px);
    /* Легке зміщення при виборі */
}

.checkbox-item.all-option .label-text {
    font-weight: 700;
}

/* Картки статистики */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.opp-summary {
    grid-template-columns: repeat(4, 1fr);
}

.stat-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-width: 0;
    height: 112px;
    box-sizing: border-box;
}

.stat-subtext {
    position: absolute;
    bottom: 5px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Скляний блік для преміальності */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    opacity: 0.5;
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.stat-card.accent {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 250, 250, 0.8));
    border: 1px solid rgba(0, 153, 168, 0.2);
    box-shadow: 0 8px 30px rgba(0, 153, 168, 0.08);
}

.stat-card.accent .stat-label {
    color: var(--primary);
    font-weight: 700;
}

.stat-card.accent .stat-value {
    color: var(--text-main);
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    z-index: 1;
    white-space: nowrap;
}

.stat-value {
    font-size: 2.6rem;
    font-weight: 600;
    letter-spacing: -1.2px;
    line-height: 1;
    z-index: 1;
    background: linear-gradient(90deg, #1d1d1f, #434347);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Графіки */
.charts-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 20px;
    min-width: 0;
    /* Fix flex overflow */
}

.opp-charts {
    grid-template-columns: 1fr 1fr;
}

.chart-card,
.table-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0, 0, 0, 0.03);
    min-width: 0;
    /* Fix flex overflow */
}

.chart-card h3,
.table-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.canvas-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ===== ТРЕМАП (МОЗАЇКА) ===== */
.treemap-outer-container {
    position: relative;
    width: 100%;
    background: #f5f5f7;
    border-radius: 16px;
    overflow: hidden;
    border: none;
}

.treemap-tile {
    position: absolute;
    box-sizing: border-box;
    cursor: pointer;
    overflow: visible;
    z-index: 1;
    transition: z-index 0.25s step-start;
}

.treemap-tile-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-sizing: border-box;
    border: 1px solid #ffffff;
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.25s ease;
    z-index: 1;
}

.treemap-tile:hover {
    z-index: 10;
    transition: z-index 0s;
}

.treemap-tile:hover .treemap-tile-bg {
    filter: brightness(0.92);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: scale(1.045);
    border-color: #ffffff;
}

.treemap-tile-inner {
    padding: 10px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.tile-name {
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tile-name-centered,
.tile-name-branch {
    font-family: inherit;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    text-align: center;
}

.tile-code {
    font-family: inherit;
    letter-spacing: -0.5px;
}

.tile-count {
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    opacity: 0.95;
    align-self: flex-end;
    margin-top: 4px;
    background: rgba(0, 0, 0, 0.18);
    padding: 2px 6px;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
}

.tile-count-br {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    opacity: 0.75;
}

.tile-count-centered {
    font-variant-numeric: tabular-nums;
    text-align: center;
    width: 100%;
}

.tile-subtitle {
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Кнопка "Назад" для мозаїки */
#opp-treemap-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background-color: #ffffff;
    color: var(--text-main, #1d1d1f);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

#opp-treemap-back-btn svg {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#opp-treemap-back-btn:hover {
    background-color: #f5f5f7 !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

#opp-treemap-back-btn:hover svg {
    transform: translateX(-3px);
}

#opp-treemap-back-btn:active {
    transform: scale(0.97);
}

.card-header-flex {
    min-height: 38px;
}

/* ===== ПРЕМІАЛЬНА ТАБЛИЦЯ ===== */
.table-responsive {
    overflow-x: auto;
    border-radius: 16px;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

table {
    width: 100%;
    table-layout: fixed;
    /* KEY: однакова ширина всіх колонок */
    border-collapse: separate;
    border-spacing: 0;
    min-width: 560px;
}

/* Заголовок — sticky + скляний ефект */
thead tr {
    position: sticky;
    top: 0;
    z-index: 2;
}

/* Колонка підрозділу — 26% ширини */
th:first-child {
    width: 26%;
    text-align: left;
    padding: 10px 10px 10px 8px;
}

/* Решта 7 колонок ділять 74% порівну — браузер сам розраховує */
th {
    padding: 10px 4px;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1.5px solid var(--border-color);
    white-space: nowrap;
    text-align: center;
}

/* Рядки */
tbody tr {
    transition: background 0.18s ease;
}

tbody tr:hover {
    background: rgba(0, 180, 196, 0.05);
}

/* Всі клітинки — рівні відступи */
td {
    padding: 5px 4px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

td:first-child {
    text-align: left;
    padding-left: 8px;
    padding-right: 10px;
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Назва підрозділу — максимум 3 рядки */
.faculty-name {
    font-size: 0.80rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Адаптивні квадрати ───────────────────────────────────────
   width: calc(100% - 10px) — займає майже всю ширину клітинки td
   aspect-ratio: 1          — висота = ширина → квадрат
   Розмір автоматично змінюється зі шириною таблиці
*/
.heat-cell-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 10px);
    /* адаптивна ширина */
    aspect-ratio: 1;
    /* квадрат */
    margin: 0 auto;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    font-weight: 700;
    font-size: 0.82rem;
    transition: transform 0.15s ease, filter 0.15s ease;
    cursor: pointer;
}

.heat-cell-inner:not(.heat-cell-empty):hover {
    transform: scale(1.08);
    filter: brightness(1.07);
}

.heat-cell-inner:not(.heat-cell-empty):active {
    transform: scale(0.95);
    transition: transform 0.08s ease;
}

/* Порожні квадрати */
.heat-cell-empty {
    background: rgba(0, 0, 0, 0.04) !important;
    cursor: default !important;
    color: #c5cad0 !important;
    font-weight: 400;
    font-size: 1rem;
}

/* ── Кольорові акценти груп (Виправлено баг рендерингу через ::before) ── */
th[data-group] {
    position: relative;
    /* Необхідно для абсолютного позиціонування лінії */
}

th[data-group]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    pointer-events: none;
    /* Щоб лінія не перекривала події миші */
}

th[data-group="total"]::before {
    background: rgba(0, 180, 196, 0.60);
}

th[data-group="form"]::before {
    background: rgba(245, 158, 11, 0.60);
}

th[data-group="degree"]::before {
    background: rgba(139, 92, 246, 0.60);
}

/* ── Роздільники між групами ── */
#matrix-table th:nth-child(3),
#matrix-table td:nth-child(3),
#matrix-table th:nth-child(5),
#matrix-table td:nth-child(5) {
    border-left: 1.5px solid rgba(0, 0, 0, 0.08) !important;
}

th[data-group="total"].group-hover {
    background: rgba(0, 180, 196, 0.10) !important;
}

th[data-group="form"].group-hover {
    background: rgba(245, 158, 11, 0.10) !important;
}

th[data-group="degree"].group-hover {
    background: rgba(139, 92, 246, 0.10) !important;
}

td[data-group="total"].group-hover {
    background: rgba(0, 180, 196, 0.05) !important;
}

td[data-group="form"].group-hover {
    background: rgba(245, 158, 11, 0.06) !important;
}

td[data-group="degree"].group-hover {
    background: rgba(139, 92, 246, 0.06) !important;
}

th[data-group].group-hover {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}


/* ── Кастомний тултіп (стиль Chart.js) ─────────────────── */
#col-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 10px 14px;
    min-width: 120px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

#col-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

#col-tooltip-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1d1d1f;
    letter-spacing: -0.01em;
    margin-bottom: 3px;
}

#col-tooltip-body {
    font-size: 0.72rem;
    font-weight: 500;
    color: #86868b;
}

/* Анімації */
.animate-on-load {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.staggered-1 {
    animation-delay: 0.0s;
}

.staggered-2 {
    animation-delay: 0.1s;
}

.staggered-3 {
    animation-delay: 0.2s;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.refresh-anim {
    animation: quickFade 0.4s ease forwards;
}

@keyframes quickFade {
    0% {
        opacity: 0.5;
        transform: scale(0.99);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Адаптивність */
@media (max-width: 800px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .opp-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-grid .stat-card:first-child {
        grid-column: 1 / -1;
    }

    .opp-summary .stat-card:first-child {
        grid-column: auto;
    }
}

@media (max-width: 500px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .opp-summary {
        grid-template-columns: 1fr;
    }

    .summary-grid .stat-card:first-child {
        grid-column: auto;
    }
}

/* ── Тултіп для груп у матриці ── */
.matrix-tooltip {
    position: absolute;
    pointer-events: auto;
    /* Дозволяємо клікати та скролити */
    z-index: 2000;
    width: 260px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(25px) saturate(210%);
    -webkit-backdrop-filter: blur(25px) saturate(210%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), 0 20px 48px rgba(0, 153, 168, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    padding: 12px 14px;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.96);
    transform-origin: top left;
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    box-sizing: border-box;
}

.matrix-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.tooltip-title-block {
    flex: 1;
}

.tooltip-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
}

.tooltip-subtitle {
    display: block;
    font-size: 0.70rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-top: 2px;
}

.tooltip-close {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    margin-left: 8px;
    padding: 0;
    transform: scale(1);
}

.tooltip-close:hover {
    background: rgba(0, 0, 0, 0.10);
    color: var(--text-main);
    transform: scale(1.08);
}

.tooltip-close:active {
    transform: scale(0.92);
}

.tooltip-close svg {
    width: 10px;
    height: 10px;
}

.tooltip-thead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
    padding: 0 6px 6px;
    margin-bottom: 4px;
}

.tooltip-row:not(.tooltip-thead) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.74rem;
    padding: 4px 6px;
    margin: 1.5px 0;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.tooltip-row:not(.tooltip-thead):hover {
    background: rgba(0, 153, 168, 0.05);
}

.tooltip-group {
    font-weight: 600;
    color: #3a3a3c;
    line-height: 1.2;
    word-break: break-word;
    padding-right: 8px;
}

.tooltip-count {
    font-weight: 700;
    color: var(--primary);
    background: rgba(0, 153, 168, 0.08);
    border: 1px solid rgba(0, 153, 168, 0.12);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 0.72rem;
    min-width: 30px;
    text-align: center;
    box-sizing: border-box;
}

.tooltip-scroll {
    max-height: 240px;
    overflow-y: auto;
    padding-right: 2px;
}

/* Красивий скролбар для тултіпу */
.tooltip-scroll::-webkit-scrollbar {
    width: 4px;
}

.tooltip-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.tooltip-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.tooltip-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   ОСВІТНІ ПРОГРАМИ (ОП / ОПП) ДАШБОРД
   ========================================================================== */

.dashboard-divider {
    height: 1px;
    margin: 20px 0 0;
    position: relative;
    z-index: 101;
    background: linear-gradient(90deg,
            rgba(60, 60, 67, 0.04) 0%,
            rgba(60, 60, 67, 0.16) 15%,
            rgba(0, 153, 168, 0.7) 35%,
            rgba(0, 153, 168, 0.7) 65%,
            rgba(60, 60, 67, 0.16) 85%,
            rgba(60, 60, 67, 0.04) 100%);
}

.dashboard-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    transform: translateY(-50%);
    background: linear-gradient(90deg,
            rgba(60, 60, 67, 0) 0%,
            rgba(60, 60, 67, 0.04) 15%,
            rgba(0, 153, 168, 0.12) 30%,
            rgba(0, 153, 168, 0.45) 42%,
            rgba(0, 153, 168, 0.45) 58%,
            rgba(0, 153, 168, 0.12) 70%,
            rgba(60, 60, 67, 0.04) 85%,
            rgba(60, 60, 67, 0) 100%);
    filter: blur(1.5px);
    pointer-events: none;
}

.opp-section-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.opp-section-container .top-header {
    margin-bottom: 0;
}

.opp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 20px;
}

.opp-brand h2 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
    line-height: 1.15;
    margin: 0 0 6px 0;
}

.opp-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

/* Пошук в реєстрі ОП */
.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.table-card-header h3 {
    margin-bottom: 0;
}

.search-container {
    position: relative;
    width: 300px;
}

#opp-search-input {
    width: 100%;
    padding: 10px 16px 10px 38px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background-color: #f5f5f7;
    color: var(--text-main);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#opp-search-input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s ease;
}

#opp-search-input:focus+.search-icon {
    color: var(--primary);
}

/* Статуси акредитації ОП */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge.success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.badge.warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.badge.secondary {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.2);
}

/* Опції форм навчання у таблиці ОП */
.form-badge-container {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
}

.form-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-main);
}

/* Спеціальний адаптив та стилі для таблиці ОП */
#opp-table th,
#opp-table td {
    text-align: left;
    vertical-align: middle;
    line-height: 1.35;
    box-sizing: border-box;
}

#opp-table th {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1.5px solid var(--border-color);
}

#opp-table td {
    padding: 6px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}



#opp-table tbody tr:hover {
    background-color: rgba(0, 180, 196, 0.02);
}

#opp-table tbody tr.active-row {
    background-color: rgba(0, 180, 196, 0.05) !important;
}

/* Стовпчики: 45% - 30% - 10% - 15% */
#opp-table th:first-child,
#opp-table td:first-child {
    width: 45%;
}

#opp-table th:nth-child(2),
#opp-table td:nth-child(2) {
    width: 30%;
}

#opp-table th:nth-child(3),
#opp-table td:nth-child(3) {
    width: 10%;
    text-align: center;
}

#opp-table th:nth-child(4),
#opp-table td:nth-child(4) {
    width: 15%;
    text-align: center;
}

/* Фіксована висота контенту для стабільності таблиці та вертикальне центрування */
#opp-table tbody tr {
    cursor: pointer;
    transition: background-color 0.18s ease;
    height: 60px;
    /* Більш компактна фіксована висота рядка */
}

#opp-table tbody tr.active-row td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04) !important;
}

.opp-table-name {
    font-weight: 600;
    font-size: 12.5px;
    color: var(--text-main);
    line-height: 1.28;
    max-height: 48px;
    /* До 3 рядків */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.opp-table-specialty {
    font-size: 11.5px;
    color: #424245;
    line-height: 1.28;
    max-height: 48px;
    /* До 3 рядків */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* Поповер деталей рядка ОП */
.opp-row-popover {
    position: absolute;
    left: 36px;
    right: 36px;
    height: 170px;
    background: #ffffff;
    /* Повністю суцільний білий для уникнення артефактів накладання */
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 10;
    overflow: hidden;
    pointer-events: auto;
    transition: top 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.22s ease;
    opacity: 0;
}

.opp-row-popover.show {
    opacity: 1;
}

.popover-inner {
    padding: 16px 20px;
    display: flex !important;
    align-items: stretch !important;
    gap: 24px;
    height: 100%;
    box-sizing: border-box;
    position: relative;
    opacity: 0;
    transition: opacity 0.25s ease 0.12s;
    /* Преміальна затримка для появи контенту */
}

.opp-row-popover.show .popover-inner {
    opacity: 1;
}

.popover-decor-line {
    position: absolute;
    left: 6px;
    top: 16px;
    bottom: 16px;
    width: 4px;
    border-radius: 4px;
    z-index: 2;
}

/* Стовпчики поповеру */
.popover-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.popover-col-left {
    flex: 1.7;
    padding-left: 10px;
    justify-content: center !important;
    align-self: center !important;
}

.popover-col-mid {
    flex: 1.1;
    padding: 0 20px;
    justify-content: center !important;
    align-self: center !important;
}

.popover-col-right {
    flex: 0.4;
    justify-content: center !important;
    align-self: center !important;
}

/* Елементи деталей */
.popover-branch-text {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    line-height: 1.2;
}

.popover-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 3px 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popover-subtitle-en {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-style: italic;
}

.popover-meta {
    font-size: 12px;
    color: #424245;
    line-height: 1.35;
}

.popover-meta strong {
    color: var(--text-muted);
    font-weight: 500;
    margin-right: 4px;
}

.popover-faculty-full {
    font-weight: 600;
    color: #007a87;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.popover-faculty-short {
    color: var(--text-muted);
    font-size: 11px;
}

/* Статистична картка */
.popover-stat-box {
    text-align: center;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 10px 18px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    min-width: 100px;
}

.popover-stat-val {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.popover-stat-lbl {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 3px;
}

/* Кнопка закриття */
.opp-popover-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.03);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #86868b;
    cursor: pointer;
    transition: background 0.15s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 12;
    transform: scale(1);
}

.opp-popover-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-main);
    transform: scale(1.08);
}

.opp-popover-close:active {
    transform: scale(0.92);
}

.opp-popover-close svg {
    width: 10px;
    height: 10px;
}

#opp-table .badge,
.opp-row-popover .badge,
#opp-table .form-badge,
.opp-row-popover .form-badge {
    display: inline-block;
    vertical-align: baseline;
    padding: 0 1px 2px 1px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: inherit;
    border-radius: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Акредитована */
#opp-table .badge.success,
.opp-row-popover .badge.success {
    color: #0099a8 !important;
    border-bottom: 2px solid rgba(0, 153, 168, 0.3) !important;
}

/* Неакредитована */
#opp-table .badge.secondary,
.opp-row-popover .badge.secondary {
    color: #64748b !important;
    border-bottom: 2px solid rgba(100, 116, 139, 0.3) !important;
}

/* Форми навчання */
#opp-table .form-badge,
.opp-row-popover .form-badge {
    color: #475569 !important;
    border-bottom: 2px solid rgba(0, 0, 0, 0.15) !important;
}

/* Круговий індикатор для здобувачів */
.opp-student-gauge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(0, 153, 168, 0.15);
    border-top-color: #00a2b1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #00a2b1;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}


/* Пагінація реєстру ОП */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding: 0 12px;
    border-top: none;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 1px;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none !important;
    background: transparent !important;
    font-family: inherit;
    font-weight: 600;
    font-size: 11.5px;
    color: #5c5c60;
    cursor: pointer;
    position: relative;
    border-radius: 6px;
    transition: all 0.15s ease;
    user-select: none;
    box-shadow: none !important;
}

.pag-btn:hover {
    background: rgba(0, 0, 0, 0.03) !important;
    color: var(--text-main);
}

.pag-btn::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 6px;
    right: 6px;
    height: 2.5px;
    border-radius: 2px;
    background: linear-gradient(to right, var(--primary), rgba(0, 180, 196, 0.6));
    box-shadow: 0 0 8px rgba(0, 180, 196, 0.35);
    transform: scaleX(0);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.pag-btn.active {
    color: var(--primary) !important;
    background: rgba(0, 180, 196, 0.05) !important;
    font-weight: 700;
}

.pag-btn.active::after {
    transform: scaleX(1);
}

.pag-btn[disabled] {
    opacity: 0.25;
    pointer-events: none;
}

.pag-btn.prev-btn svg,
.pag-btn.next-btn svg {
    transition: transform 0.15s ease;
}

.pag-btn.prev-btn:hover svg {
    transform: translateX(-1px);
}

.pag-btn.next-btn:hover svg {
    transform: translateX(1px);
}

.pag-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: var(--text-muted);
    font-size: 11.5px;
    user-select: none;
    font-weight: 600;
}

@media (max-width: 900px) {
    .opp-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .opp-filters-container {
        width: 100%;
    }

    .search-container {
        width: 100%;
    }

    /* Адаптив для поповера на малих екранах */
    .opp-row-popover {
        height: auto;
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .popover-col-mid {
        border-left: none;
        border-right: none;
        padding: 12px 0;
    }
}

/* Плейсхолдерні рядки для фіксованої висоти таблиці ОП */
#opp-table tbody tr.opp-table-placeholder-row {
    cursor: default;
    pointer-events: none;
    background-color: #fafafa;
}

#opp-table tbody tr.opp-table-placeholder-row:hover {
    background-color: #fafafa;
}

#opp-table tbody tr.opp-table-placeholder-row td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.02) !important;
    vertical-align: middle;
}

.opp-table-skeleton-line {
    height: 10px;
    background: rgba(0, 0, 0, 0.035);
    border-radius: 4px;
}

@media (max-width: 768px) {
    #opp-search-input {
        font-size: 0.78rem !important;
        padding-left: 32px !important;
        padding-right: 12px !important;
    }

    .search-icon {
        left: 11px !important;
    }

    .pagination-container {
        margin-top: 14px !important;
    }

    .pagination-info {
        display: none !important;
    }

    .pagination-buttons {
        justify-content: center !important;
        width: 100% !important;
    }

    /* Адаптив для поповера деталей ОП на мобільних пристроях */
    .opp-row-popover {
        height: auto !important;
        border-radius: 16px !important;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08) !important;
        left: 36px !important;
        right: 36px !important;
    }

    .opp-row-popover .popover-inner {
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        height: auto !important;
        padding: 16px 16px 16px 22px !important;
    }

    .opp-row-popover .popover-col {
        width: 100% !important;
        flex: none !important;
        padding: 0 !important;
        align-self: stretch !important;
        justify-content: flex-start !important;
    }

    .opp-row-popover .popover-branch-text {
        font-size: 9px !important;
        margin-bottom: 4px !important;
    }

    .opp-row-popover .popover-title {
        font-size: 12.5px !important;
        font-weight: 600 !important;
        line-height: 1.15 !important;
        margin-bottom: 2px !important;
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
    }

    .opp-row-popover .popover-subtitle-en {
        font-size: 10px !important;
        margin-bottom: 4px !important;
        line-height: 1.25 !important;
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
    }

    /* Стовпчики Підрозділ та Рівень освіти йдуть зверху вниз */
    .opp-row-popover .popover-col-mid .popover-meta {
        margin-top: 6px !important;
        display: block !important;
    }

    /* Рядок з Формами навчання йде на одній лінії, вирівняний по базовій лінії тексту (baseline) */
    .opp-row-popover .popover-col-mid .popover-meta:last-child {
        display: flex !important;
        align-items: baseline !important;
        gap: 6px !important;
        margin-top: 6px !important;
    }

    .opp-row-popover .form-badge-container {
        display: inline-flex !important;
        align-items: baseline !important;
        gap: 6px !important;
    }

    .opp-row-popover .popover-faculty-full {
        font-size: 11px !important;
        line-height: 1.3 !important;
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
        margin-top: 2px !important;
    }

    .opp-row-popover .popover-col-right {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 16px !important;
        margin-top: 4px !important;
        border-top: 1px solid rgba(0, 0, 0, 0.04) !important;
        padding-top: 10px !important;
    }

    /* Здобувачі: в один рядок з круглим індикатором, центровано по вертикальній осі (middle/center) */
    .opp-row-popover .popover-col-right .popover-meta:first-child {
        margin-top: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .opp-row-popover .popover-col-right .popover-meta:first-child div {
        margin-top: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
    }

    /* Статус: в один рядок, вирівняний по базовій лінії тексту (baseline) */
    .opp-row-popover .popover-col-right .popover-meta:last-child {
        margin-top: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: baseline !important;
        gap: 6px !important;
    }

    .opp-row-popover .popover-col-right .popover-meta:last-child div {
        display: inline-flex !important;
        align-items: baseline !important;
    }

    /* Круговий індикатор здобувачів: центровано число всередині */
    .opp-row-popover .opp-student-gauge {
        width: 28px !important;
        height: 28px !important;
        font-size: 11px !important;
        line-height: 1 !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .opp-row-popover .popover-meta {
        font-size: 11px !important;
        line-height: 1.3 !important;
    }

    .opp-row-popover .badge,
    .opp-row-popover .form-badge {
        font-size: inherit !important;
        font-weight: 600 !important;
        line-height: inherit !important;
    }
}

/* ==========================================================================
   ВКЛАДКИ (TABS NAVIGATION)
   ========================================================================== */

.tabs-navigation {
    display: flex;
    justify-content: center;
    padding: 12px 0 0 0;
    /* Прибрали внутрішній відступ знизу */
    margin: 12px 0 0 0;
    /* 0px знизу, оскільки 20px відступу вже задано через padding-top хедера */
    position: relative;
    z-index: 100;
}

.tabs-nav-container {
    display: flex;
    width: 100%;
    /* Розтягуємо перемикач на всю ширину контенту фрейму */
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 99px;
    padding: 6px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
    position: relative;
    gap: 4px;
}

.tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 99px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    outline: none;
}

.tab-btn-text {
    display: inline-block;
    position: relative;
    top: -1px;
    /* Оптична корекція кирилиці: зміщує текст вгору */
    transition: transform 0.25s ease;
}

.tab-btn:hover {
    color: #4a4a4d;
    /* Приємний темно-сірий колір при наведенні (як числові значення таблиці) */
}

.tab-btn.active {
    color: var(--primary) !important;
    /* Насичений бірюзовий для активного тексту на світлому склі */
}

/* Слайдер виділення (Світле бірюзове скло з м'яким німбом) */
.tab-slider {
    position: absolute;
    top: 6px;
    left: 6px;
    height: calc(100% - 12px);
    background: rgba(0, 153, 168, 0.07);
    border: 1px solid rgba(0, 153, 168, 0.28);
    border-radius: 99px;
    transition: all 0.32s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1;
    /* Поєднання внутрішнього 3D відблиску та витонченого зовнішнього світіння */
    box-shadow: 0 0 12px rgba(0, 153, 168, 0.16);
}

/* Status badge: corner notification style anchored to button top-right */
.tab-badge {
    position: absolute;
    top: 7px;
    right: 18px;
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #86868b;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1;
    white-space: nowrap;
}

.tab-badge::before {
    content: '';
    display: inline-block;
    width: 3.5px;
    height: 3.5px;
    background: #00b4c4;
    /* Світліший корпоративний бірюзовий */
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 180, 196, 0.75);
    animation: tealDotPulse 2s infinite ease-in-out;
    flex-shrink: 0;
}

@keyframes tealDotPulse {
    0% {
        opacity: 0.35;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.35;
    }
}

/* Контейнери вкладок */
.tab-panel {
    display: none;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.tab-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   СЬОГОДНІШНІЙ СКЕЛЕТНИЙ ПЛЕЙСХОЛДЕР ДЛЯ ВКЛАДКИ "ПРАЦІВНИКИ"
   ========================================================================== */

#tab-staff {
    position: relative;
    overflow: hidden;
}

.dashboard-skeleton {
    padding: 32px 24px;
    filter: blur(4px);
    opacity: 0.35;
    pointer-events: none;
    user-select: none;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Скелетні лінії */
.skeleton-line {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

/* Ефект shimmer (блиск-перелив) для всіх скелетних елементів */
.skeleton-line::after,
.skeleton-donut::after,
.skeleton-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: translateX(-100%);
    animation: skeleton-shimmer 1.8s infinite;
}

@keyframes skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* KPI сітка */
.skeleton-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.skeleton-kpi-card {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-kpi-card .skeleton-line.title {
    width: 60%;
    height: 12px;
}

.skeleton-kpi-card .skeleton-line.value {
    width: 40%;
    height: 24px;
    margin-top: 4px;
}

.skeleton-kpi-card .skeleton-line.subtext {
    width: 80%;
    height: 8px;
    margin-top: 4px;
}

/* Сітка графіків */
.skeleton-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.skeleton-chart-card {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 20px;
    padding: 24px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skeleton-chart-card .skeleton-line.header {
    width: 45%;
    height: 16px;
}

/* Кругова діаграма */
.skeleton-donut-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    height: 180px;
}

.skeleton-donut {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.05) 41%);
    position: relative;
    overflow: hidden;
}

.skeleton-donut-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.skeleton-line.legend-item {
    width: 70%;
    height: 10px;
}

/* Стовпчаста діаграма */
.skeleton-bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 180px;
    padding: 10px 0;
    border-bottom: 2px solid rgba(0, 0, 0, 0.03);
}

.skeleton-bar {
    width: 28px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 6px 6px 0 0;
    position: relative;
    overflow: hidden;
}

/* Оверлей з карткою "В розробці" */
.staff-coming-soon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    padding: 24px;
}

.staff-coming-soon-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    padding: 36px 44px;
    max-width: 580px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
}

.staff-coming-soon-text {
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: -0.2px;
    color: var(--text-muted);
}

.highlight-title {
    font-size: 16px;
    font-weight: 600;
    color: #4a4a4c;
}

.subtext-status {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-muted);
}

@media (max-width: 1024px) {
    .skeleton-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .skeleton-charts-grid {
        grid-template-columns: 1fr;
    }
}