/* ============================================================
   Bio Competitions — Основные стили
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--gray-900);
    background: var(--gray-50);
    line-height: 1.6;
}

/* --- Header --- */
.header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav { display: flex; align-items: center; gap: 1rem; }

.nav a {
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    transition: background 0.15s;
}
.nav a:hover { background: var(--gray-100); }
.nav a.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

.nav-user {
    font-size: 0.85rem;
    color: var(--gray-500);
    padding: 0.2rem 0.5rem;
}

/* Навигация — раскрывающийся список */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

.nav-arrow {
    transition: transform 0.2s;
}

.nav-dropdown.is-open .nav-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.4rem;
    z-index: 100;
}

.nav-dropdown.is-open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: var(--gray-50);
}

.nav-dropdown-menu a.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* --- Search Hero --- */
.search-hero {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    padding: 3rem 1.5rem;
    text-align: center;
    color: #fff;
}

.search-hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.search-hero p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.search-box {
    max-width: 700px;
    margin: 0 auto;
}

.search-input-wrap {
    position: relative;
    margin-bottom: 1rem;
}

.search-input-wrap input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s;
}

.search-input-wrap input:focus {
    border-color: var(--primary);
}

.search-input-wrap .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
    pointer-events: none;
}

/* --- Filters --- */
.filters-panel {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.filters-panel h3 {
    font-size: 0.9rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

/* Широкие поля — на всю ширину или 2/3 */
.filter-group.wide {
    grid-column: span 2;
}

.filter-group.full-width {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .filter-group.wide,
    .filter-group.full-width {
        grid-column: span 1;
    }
}

.filter-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.875rem;
    background: #fff;
    outline: none;
}

/* --- Autocomplete --- */
.autocomplete-wrap {
    position: relative;
}

.autocomplete-input {
    width: 100%;
    padding: 0.45rem 0.625rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.875rem;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.autocomplete-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Multi-select tags */
.ac-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.35rem 0.5rem;
    min-height: 36px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: #fff;
    cursor: text;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ac-tags:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.ac-tags .ac-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.45rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-tags .ac-tag .ac-tag-remove {
    cursor: pointer;
    opacity: 0.6;
    font-size: 1rem;
    line-height: 1;
    margin-left: 0.15rem;
    flex-shrink: 0;
}

.ac-tags .ac-tag .ac-tag-remove:hover {
    opacity: 1;
}

.ac-tags .ac-input {
    flex: 1;
    min-width: 120px;
    border: none;
    outline: none;
    font-size: 0.875rem;
    padding: 0.2rem 0;
    background: transparent;
}

/* Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.06);
    display: none;
}

.autocomplete-dropdown.is-open {
    display: block;
}

.autocomplete-dropdown .ac-item {
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    font-size: 0.84rem;
    border-bottom: 1px solid var(--gray-50);
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    transition: background 0.1s;
}

.autocomplete-dropdown .ac-item:last-child {
    border-bottom: none;
}

.autocomplete-dropdown .ac-item:hover,
.autocomplete-dropdown .ac-item.is-active {
    background: var(--primary-light);
}

.autocomplete-dropdown .ac-item .ac-code {
    font-weight: 700;
    color: var(--primary-dark);
    white-space: nowrap;
    flex-shrink: 0;
}

.autocomplete-dropdown .ac-item .ac-name {
    color: var(--gray-700);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-dropdown .ac-empty {
    padding: 0.85rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.85rem;
}

/* Multi-select hint */
.ac-hint {
    font-size: 0.72rem;
    color: var(--gray-500);
    margin-top: 0.2rem;
    font-style: italic;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.filters-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

/* --- Results --- */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.results-header h2 { font-size: 1.1rem; }

.results-count {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* --- Program Card --- */
.program-card {
    position: relative;
    background: #fff;
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--primary);
    transition: box-shadow 0.2s, transform 0.15s;
    cursor: pointer;
}

/* --- Unified University Select --- */
.uni-select-wrap {
    position: relative;
}

.uni-input {
    width: 100%;
    padding: 0.45rem 2rem 0.45rem 0.625rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.875rem;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

/* Стрелка раскрытия */
.uni-select-wrap::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--gray-500);
    pointer-events: none;
    transition: transform 0.2s;
}

.uni-select-wrap.is-open::after {
    transform: translateY(-50%) rotate(180deg);
}

.uni-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.uni-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    display: none;
}

.uni-dropdown.is-open {
    display: block;
}

.uni-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.84rem;
    border-bottom: 1px solid var(--gray-50);
    transition: background 0.1s;
}

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

.uni-item:hover,
.uni-item.is-active {
    background: var(--primary-light);
}

.uni-item.is-active {
    font-weight: 600;
}

.uni-empty {
    padding: 0.75rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.85rem;
}

/* University filter: autocomplete + select */
.filter-group #filterUniversity {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    max-height: 200px;
    overflow-y: auto;
}

.program-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

/* Бейджи */
.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge--year {
    background: var(--gray-100);
    color: var(--gray-700);
}

.badge--place {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-weight: 700;
}

.badge--place svg {
    flex-shrink: 0;
}

.badge--top5 {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.badge--top5 svg {
    width: 13px;
    height: 13px;
    color: #f59e0b;
}

.badge--level {
    background: #dbeafe;
    color: #1e40af;
}

.badge--bio {
    background: #dcfce7;
    color: #166534;
}

.badge--eco {
    background: #fef9c3;
    color: #854d0e;
}

/* Направление подготовки */
.card-spec-line {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

.spec-code-badge {
    display: inline-block;
    padding: 0.12rem 0.4rem;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 0.78rem;
    color: var(--gray-700);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-weight: 600;
    margin-right: 0.3rem;
}

.spec-name {
    color: var(--gray-600);
    font-weight: 500;
}

/* Название ОП */
.program-card h3 {
    font-size: 1.05rem;
    margin: 0.3rem 0 0.5rem;
    color: var(--gray-900);
    line-height: 1.35;
}

.program-card:hover h3 {
    color: var(--primary);
}

/* Секция компетенций */
.card-comps-section {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-100);
}

.comp-row {
    font-size: 0.83rem;
    color: var(--gray-700);
    line-height: 1.45;
    padding: 0.25rem 0 0.25rem 0.6rem;
    border-left: 3px solid var(--gray-200);
    margin-bottom: 0.2rem;
}

.comp-row--hidden {
    display: none;
}

.program-card:hover .comp-row {
    border-left-color: var(--primary-light);
}

.comp-toggle {
    display: inline-block;
    margin: 0.3rem 0 0.3rem 0.6rem;
    padding: 0.25rem 0.7rem;
    background: none;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.comp-toggle:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.comp-more-detail {
    font-size: 0.76rem;
    color: var(--gray-500);
    font-style: italic;
    padding-left: 0.6rem;
    margin-top: 0.25rem;
}

/* Футер карточки */
.card-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-100);
    font-size: 0.82rem;
    color: var(--gray-500);
}

.footer-left {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
}

.footer-uni {
    font-weight: 600;
    color: var(--gray-700);
}

.footer-region {
    opacity: 0.85;
}

/* --- Skill Clusters (Навыки) --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.75rem;
}

.skill-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    border-left: 4px solid var(--skill-color, var(--primary));
    transition: box-shadow 0.15s;
}

.skill-card:hover {
    box-shadow: var(--shadow);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.skill-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.skill-count {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 600;
}

.skill-comps {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 400px;
    overflow-y: auto;
}

.skill-comp {
    display: flex;
    gap: 0.5rem;
    font-size: 0.82rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    background: var(--gray-50);
}

.skill-comp:hover {
    background: var(--gray-100);
}

.skill-comp-code {
    font-weight: 700;
    color: var(--gray-700);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    flex-shrink: 0;
    min-width: 42px;
    padding-top: 0.1rem;
}

.skill-comp-desc {
    color: var(--gray-700);
    line-height: 1.45;
    flex: 1;
}

/* --- Skills Filter Chips --- */
.skills-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-top: 0.25rem;
}

.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    border: 1.5px solid var(--gray-300);
    border-radius: 999px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.skill-chip input[type="checkbox"] {
    display: none;
}

.chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chip-color, var(--gray-400));
    opacity: 0.5;
    transition: opacity 0.15s;
}

.skill-chip:has(input:checked) {
    border-color: var(--chip-color, var(--primary));
    background: rgba(59, 130, 246, 0.08);
}

.skill-chip:has(input:checked) .chip-dot {
    opacity: 1;
}

.chip-label {
    font-weight: 500;
    color: var(--gray-700);
}

.chip-count {
    font-size: 0.7rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.05rem 0.3rem;
    border-radius: 999px;
}

.tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: var(--gray-100);
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--gray-700);
}

.tag--level {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 500;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
}

.pagination button,
.pagination span {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--gray-300);
    background: #fff;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.pagination button:hover:not(.active):not(:disabled) {
    background: var(--gray-100);
}

.pagination .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination:disabled {
    opacity: 0.5;
    cursor: default;
}

/* --- Detail Page --- */
.detail-header {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.detail-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.detail-section {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.detail-section h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.competency-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.competency-code {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary);
}

.competency-desc {
    font-size: 0.9rem;
    color: var(--gray-700);
    margin-top: 0.15rem;
}

/* --- Дерево компетенций --- */
.competency-tree {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.competency-node {
    position: relative;
    padding: 0.75rem 0.75rem 0.75rem 12px;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
}

.competency-node:last-child { border-bottom: none; }

/* Детализированные компетенции — явное выделение */
.competency-node--child {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.06), transparent) !important;
    border-left: 3px dashed rgba(59, 130, 246, 0.4) !important;
    padding-left: 16px !important;
}

/* Вертикальная линия для вложенных */
.competency-children {
    position: relative;
    margin-top: 0.25rem;
    margin-left: 1.25rem;
    padding-left: 0.75rem;
    border-left: 2px dashed var(--gray-200);
}

/* Заголовок компетенции — кликабелен для раскрытия детализации */
.competency-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: background 0.15s;
}

.competency-header:hover {
    background: rgba(59, 130, 246, 0.08);
}

.competency-header .competency-code {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--primary-dark);
}

.competency-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
}

/* Индикатор раскрытия/сворачивания */
.competency-toggle {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.25rem;
    color: var(--gray-400);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.competency-node.is-collapsed .competency-toggle {
    transform: rotate(-90deg);
}

.competency-node .competency-desc {
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.5;
}

/* Детализированные компетенции — визуально отличаем */
.competency-node--child .competency-header {
    background: rgba(59, 130, 246, 0.08);
}

.competency-node--child .competency-code {
    color: var(--primary);
    font-size: 0.8rem;
}

.competency-node--child .competency-desc {
    font-size: 0.8rem;
    color: var(--gray-600);
}

/* Бейдж «расшифровка» */
.competency-detail-badge {
    font-size: 0.62rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    margin-left: 0.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--gray-200);
}

/* Для autocomplete — тип компетенции */
.autocomplete-dropdown .ac-item .ac-type {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary-dark);
    flex-shrink: 0;
}

/* Для autocomplete — родитель компетенции (детализированные) */
.autocomplete-dropdown .ac-item .ac-type[style*="rgba(59, 130, 246"] {
    background: rgba(59, 130, 246, 0.15) !important;
    color: var(--primary) !important;
}

/* Детализированные компетенции в карточках */
.comp-row--child {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.08), transparent) !important;
    padding-left: 1rem !important;
    border-left: 3px dashed rgba(59, 130, 246, 0.4) !important;
    font-size: 0.78rem !important;
    color: var(--gray-600) !important;
    margin-left: 0.5rem;
}

.comp-row--child .comp-badge {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.65rem;
    padding: 0.08rem 0.25rem;
    margin-right: 0.3rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ============================================================
   AUTH SCREEN
   ============================================================ */
.auth-screen {
    display: flex;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.auth-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

.auth-particle {
    position: absolute;
    border-radius: 50%;
    background: #3b82f6;
    filter: blur(60px);
}

/* Левая панель — брендинг (светлая) */
.auth-brand {
    flex: 1;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--gray-900);
}

.auth-brand-inner {
    max-width: 480px;
}

.auth-logo {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.4));
}

.auth-brand h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 0.75rem;
    background: linear-gradient(135deg, #1e293b, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-brand p {
    font-size: 1.1rem;
    opacity: 0.8;
    margin: 0 0 2.5rem;
    line-height: 1.6;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    color: var(--gray-800);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.auth-feature-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* Правая панель — форма (тёмная) */
.auth-form-wrap {
    flex: 1;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.auth-form-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.auth-form-card.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(2px); }
}

.auth-form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.4rem;
}

.auth-form-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin: 0;
}

/* Поля формы */
.auth-field {
    margin-bottom: 1.25rem;
}

.auth-field label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.4rem;
}

.auth-field-icon {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.5);
}

.auth-field input {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.auth-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.auth-field input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Пароль с кнопкой показа */
.auth-password-wrap {
    position: relative;
}

.auth-password-wrap input {
    padding-right: 3rem;
}

.auth-toggle-pw {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.15s, background 0.15s;
}

.auth-toggle-pw:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
}

.auth-toggle-pw svg {
    width: 18px;
    height: 18px;
}

/* Ошибка */
.auth-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.85rem;
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

.auth-error svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Кнопка входа */
.auth-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    position: relative;
    overflow: hidden;
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.auth-submit:active:not(:disabled) {
    transform: translateY(0);
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-submit .btn-arrow {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.auth-submit:hover:not(:disabled) .btn-arrow {
    transform: translateX(3px);
}

/* Прелоадер кнопки */
.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Футер формы */
.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

/* Анимация загрузки */
.auth-submit.is-loading {
    padding: 0.85rem 1.5rem;
}

.auth-submit.is-loading .btn-text,
.auth-submit.is-loading .btn-arrow {
    display: none;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Анимация тряски при ошибке */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* Фон с частицами */
.auth-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-particle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    filter: blur(40px);
}

/* Адаптив */
@media (max-width: 768px) {
    .auth-screen {
        flex-direction: column;
    }

    .auth-brand {
        padding: 2rem;
    }

    .auth-brand-inner {
        max-width: 100%;
    }

    .auth-brand h1 {
        font-size: 1.75rem;
    }

    .auth-form-card {
        padding: 1.5rem;
    }

    .auth-logo img {
        width: 120px !important;
    }
}

.auth-footer p {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin: 0;
}

/* ============================================================
   ADMIN UNIVERSITIES
   ============================================================ */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.admin-filters {
    margin-bottom: 1rem;
}

.admin-search {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.admin-table-wrap {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th {
    background: var(--gray-50);
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-500);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.admin-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.admin-table td:not(.cell-actions) {
    vertical-align: top;
}

.admin-table .cell-name {
    font-weight: 500;
    color: var(--gray-900);
}

.admin-table .cell-actions {
    display: flex;
    gap: 0.35rem;
    justify-content: flex-end;
    align-items: flex-start;
    padding-top: 0.65rem;
}

.admin-table td a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.admin-table td a:hover {
    text-decoration: underline;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
    font-size: 0.95rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 550px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* ============================================================
   ADMIN STANDARDS
   ============================================================ */
.admin-subtitle {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin: 0.25rem 0 0;
}

.admin-search-wrap {
    position: relative;
    max-width: 400px;
}

.admin-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--gray-400);
    pointer-events: none;
}

.admin-search-wrap .admin-search {
    padding-left: 2.5rem;
}

.admin-search-info {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.4rem;
}

/* Код стандарта в таблице */
.std-code {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--gray-100);
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* Ссылка на стандарт */
.std-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.3rem;
}

.std-link:hover {
    text-decoration: underline;
}

/* Бейдж использования */
.usage-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--gray-100);
    color: var(--gray-600);
}

.usage-badge[title*="1 "],
.usage-badge[title*="2 "],
.usage-badge[title*="3 "],
.usage-badge[title*="4 "],
.usage-badge[title*="5 "] {
    background: #dbeafe;
    color: #1e40af;
}

.usage-badge[title*="0"] {
    background: #f1f5f9;
    color: var(--gray-400);
}

/* Кнопки-иконки в таблице */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: var(--gray-100);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--gray-600);
    transition: background 0.15s, color 0.15s;
}

.btn-icon:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.btn-icon--danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1.25rem;
}

.pagination button {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--gray-200);
    background: #fff;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--gray-700);
}

.pagination button:hover:not(:disabled):not(.active) {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.pagination button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0 4px;
    color: var(--gray-400);
}

/* Пустое состояние */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--gray-500);
}

.empty-state svg {
    margin-bottom: 0.75rem;
}

.empty-state p {
    margin: 0;
}

/* ============================================================
   IMPROVED MODAL
   ============================================================ */
.modal-lg {
    max-width: 600px;
    padding: 0;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 8px;
    font-size: 1.25rem;
    color: var(--gray-500);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Формы в модалке */
.form-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.form-icon {
    width: 16px;
    height: 16px;
    color: var(--gray-400);
    flex-shrink: 0;
}

.form-hint {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin: 0.3rem 0 0;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* ============================================================
   ADMIN COMPETENCIES
   ============================================================ */
.type-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-right: 0.2rem;
}

.type-pk { background: #dbeafe; color: #1e40af; }
.type-uk { background: #dcfce7; color: #166534; }
.type-opk { background: #fef3c7; color: #92400e; }

/* ============================================================
   ADMIN RATINGS
   ============================================================ */

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .auth-screen {
        flex-direction: column;
    }

    .auth-brand {
        padding: 2rem 1.5rem;
        min-height: auto;
    }

    .auth-brand h1 {
        font-size: 1.75rem;
    }

    .auth-brand p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .auth-features {
        display: none;
    }

    .auth-form-wrap {
        padding: 1.5rem;
    }

    .auth-form-card {
        padding: 1.5rem;
    }
}

/* --- Old Login Form (keep for compatibility) --- */
.login-wrap {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.login-wrap h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.9rem;
}

.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

/* --- Admin Table --- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.admin-table th,
.admin-table td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.875rem;
}

.admin-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-500);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.admin-table tr:hover td {
    background: var(--gray-50);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal h2 {
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    color: #fff;
    font-size: 0.9rem;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast--success { background: var(--success); }
.toast--error { background: var(--danger); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- Loading --- */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-top: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
.region-map-card {
    background: white;
    border-radius: 20px;
    padding: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.region-info-panel {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #3b82f6;
} 
.skills-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.skill-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #1f2937;
}

/* Ссылки на программы (новая структура) */
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.related-item {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(147, 51, 234, 0.03));
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.related-item:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.06));
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}

.related-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.related-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: var(--gray-600);
}

.related-uni, .related-spec, .related-year {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.spec-highlight {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    font-size: 1.05rem;
}

.section-hint {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin: 0.25rem 0 1rem;
    font-style: italic;
}

/* Детализированные компетенции в карточках */
}
.region-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}
.summary-item {
    background: #eef2ff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #1f2937;
}
.region-universities ul {
    margin: 0.5rem 0 1rem 0;
    padding-left: 1rem;
}
.region-universities li {
    margin-bottom: 0.3rem;
    list-style-type: disc;
}
.region-universities h5, .region-skills h5 {
    margin: 0.5rem 0 0.3rem 0;
}
/* --- Responsive --- */
@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
    }
    .search-hero h1 { font-size: 1.5rem; }
    .program-meta { flex-direction: column; gap: 0.25rem; }

    .card-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Мобильное меню */
    .header-inner { flex-direction: column; height: auto; padding: 0.5rem 0; gap: 0.5rem; }
    .nav { flex-wrap: wrap; justify-content: center; gap: 0.3rem; }
    .nav a { font-size: 0.82rem; padding: 0.3rem 0.5rem; }
    .nav-user { display: none; }
    .nav-dropdown-menu { position: static; box-shadow: none; border: none; padding-left: 1rem; }
}
