/* ==========================================================================
   MIND Masters Playful & Gamified Design System (Tino/Anastasia Golovko Style)
   ========================================================================== */

/* 1. Переменные (Design Tokens) */
:root {
    /* Backgrounds & Canvas */
    --bg-primary: #FFFFFF;       /* White background */
    --bg-secondary: #F7F8FA;     /* Light gray sidebar/details */
    --bg-card: #FFFFFF;          /* Pure white card backgrounds */
    --border-color: #E2E5EA;     /* Thin gray border */
    
    /* Text */
    --text-primary: #1B1D28;     /* Deep slate-charcoal */
    --text-secondary: #565A6E;   /* Slate-grey for description text */
    --text-muted: #8F94A8;       /* Light slate-grey for minor notes */
    
    /* Corporate Color Accents */
    --primary: #263E60;          /* Deep Navy Blue */
    --primary-light: rgba(38, 62, 96, 0.08); /* Light translucent navy */
    --primary-dark: #1a2d47;
    --secondary: #EA1010;        /* Coral/Red */
    --secondary-hover: #c20e0e;
    --cyan: #3B82F6;             /* Info blue */
    
    /* Corporate System Colors */
    --success: #22C55E;          /* Success green */
    --success-bg: #F0FDF4;
    --warning: #F59E0B;          /* Warning orange */
    --warning-bg: #FFFBEB;
    --danger: #EF4444;           /* Danger red */
    --danger-bg: #FEF2F2;
    
    /* Dimensions */
    --sidebar-width: 260px;
    --header-height: 70px;
    
    /* Transitions & Physics */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    
    /* Corporate Smooth Shadows */
    --card-shadow: 0 4px 12px rgba(0,0,0,0.05);
    --card-shadow-hover: 0 8px 24px rgba(0,0,0,0.08);
    --btn-shadow: none;
    --btn-shadow-hover: 0 2px 6px rgba(0,0,0,0.06);
}

/* 2. Базовые сбросы (Resets) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* 3. Утилиты & Градиенты */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-gradient-blue {
    background: linear-gradient(135deg, #7F8FFE, #4D64FE);
}

.bg-gradient-purple {
    background: linear-gradient(135deg, #9F85FF, #7B56FE);
}

.bg-gradient-cyan {
    background: linear-gradient(135deg, #3DC8CA, #1AA3A6);
}

.bg-gradient-navy {
    background: linear-gradient(135deg, var(--primary), #3b5c8f) !important;
}

.bg-gradient-red {
    background: linear-gradient(135deg, var(--secondary), #ff4d4d) !important;
}

.bg-gradient-green-success {
    background: linear-gradient(135deg, var(--success), #4ade80) !important;
}

.bg-gradient-amber {
    background: linear-gradient(135deg, var(--warning), #fbbf24) !important;
}

.hide {
    display: none !important;
}

.scroll-y {
    overflow-y: auto;
}

/* Стилизация скроллбара (Light Slate theme) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(27, 29, 40, 0.03);
}

::-webkit-scrollbar-thumb {
    background: rgba(27, 29, 40, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(27, 29, 40, 0.3);
}

/* 4. Сетка макета (Layout Grid) */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Боковая панель (Sidebar) */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 2px solid var(--border-color);
}

.logo-icon {
    font-size: 24px;
    margin-right: 12px;
    display: flex;
    align-items: center;
}

.logo-icon img {
    height: 32px;
    width: 32px;
    object-fit: cover;
    object-position: left;
}

.logo-text h2 {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.logo-text h2 span {
    color: var(--primary);
}

.logo-text p {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: -2px;
}

.sidebar-menu {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition-fast);
    gap: 12px;
    border: 1px solid transparent;
}

.menu-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    transition: var(--transition-fast);
}

.menu-item:hover {
    color: var(--text-primary);
    background-color: var(--primary-light);
}

.menu-item.active {
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: none;
}

.menu-item.active i {
    color: #fff;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 2px solid var(--border-color);
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pulse-green {
    background-color: var(--success);
    border: 1px solid var(--border-color);
    box-shadow: 0 0 6px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(86, 197, 150, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(86, 197, 150, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(86, 197, 150, 0); }
}

/* Основной контейнер контента */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Шапка контента */
.content-header {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 5;
}

.header-search {
    display: flex;
    align-items: center;
    background-color: #FFFFFF;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 6px 16px;
    width: 320px;
    gap: 10px;
    transition: var(--transition-fast);
}

.header-search:focus-within {
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0px var(--border-color);
}

.header-search i {
    color: var(--text-primary);
    font-size: 14px;
}

.header-search input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    width: 100%;
    outline: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 2px solid var(--border-color);
    padding-left: 20px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
}

.user-info h4 {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.user-info p {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* 5. Компоненты Flat Playful (Glass Panel Replacement) */
.glass-panel {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-normal);
}

.glass-panel:hover {
    border-color: var(--border-color);
}

.card-glow:hover {
    transform: translate(-4px, -4px);
    box-shadow: var(--card-shadow-hover);
}

/* Вкладки */
.tab-content-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-header {
    margin-bottom: 28px;
}

.panel-header h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.panel-header p {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
}

/* Кнопки (Tactile Lift Action) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    box-shadow: var(--btn-shadow);
    transition: var(--transition-fast);
    gap: 8px;
    outline: none;
    text-decoration: none;
    background-color: #fff;
    color: var(--text-primary);
}

.btn-primary {
    background: var(--primary);
    color: #FFF;
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: none;
    box-shadow: var(--btn-shadow-hover);
}

.btn-primary:active {
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: #FFFFFF;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    transform: none;
    box-shadow: var(--btn-shadow-hover);
}

.btn-secondary:active {
    transform: none;
    box-shadow: none;
}

.btn-icon {
    padding: 8px 14px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11.5px;
    border-radius: 6px;
}

/* Формы (Thick outlined controls) */
.form-control {
    background-color: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    box-shadow: none;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary);
    transform: none;
    box-shadow: 0 0 0 3px rgba(38, 62, 96, 0.1);
}

/* 6. Страница: Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 24px;
    gap: 20px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    box-shadow: 2px 2px 0px var(--border-color);
}

.stat-details .stat-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 2px;
}

.stat-details h3 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
}

.dashboard-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.flex-2 { flex: 2; min-width: 320px; }
.flex-3 { flex: 3; min-width: 400px; }

.grid-card {
    display: flex;
    flex-direction: column;
    height: 380px;
}

.grid-card .card-header {
    padding: 20px 24px;
    border-bottom: 2px solid var(--border-color);
    background-color: #F7F3EB;
    border-radius: 14px 14px 0 0;
}

.grid-card .card-header h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.grid-card .card-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    background-color: #FFFFFF;
    border-radius: 0 0 14px 14px;
}

/* Список источников */
.sources-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.source-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.source-info {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 2px;
}

.source-name {
    color: var(--text-primary);
}

.source-count {
    color: var(--text-secondary);
}

.source-bar-track {
    height: 12px;
    background-color: #EEEEEB;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    width: 100%;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 4px;
}

.source-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Beautiful dynamic gradients for sources distribution bar chart */
.source-item:nth-child(5n+1) .source-bar-fill {
    background: linear-gradient(90deg, var(--primary) 0%, var(--cyan) 100%);
}
.source-item:nth-child(5n+2) .source-bar-fill {
    background: linear-gradient(90deg, var(--secondary) 0%, #ff4d4d 100%);
}
.source-item:nth-child(5n+3) .source-bar-fill {
    background: linear-gradient(90deg, var(--success) 0%, #4ade80 100%);
}
.source-item:nth-child(5n+4) .source-bar-fill {
    background: linear-gradient(90deg, var(--warning) 0%, #fbbf24 100%);
}
.source-item:nth-child(5n+5) .source-bar-fill {
    background: linear-gradient(90deg, #8B5CF6 0%, #A78BFA 100%);
}

/* Timeline логов */
.logs-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-item {
    display: flex;
    gap: 16px;
    position: relative;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 20px;
    bottom: -22px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    z-index: 1;
    margin-top: 2px;
    box-shadow: 1px 1px 0px var(--border-color);
}

.timeline-dot.success { background-color: var(--success); }
.timeline-dot.failed { background-color: var(--danger); }

.timeline-content {
    flex: 1;
}

.timeline-time {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.timeline-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.timeline-desc {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* 7. Таблицы и фильтры */
.filters-bar {
    display: flex;
    gap: 12px;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 24px;
    background-color: #FFFFFF;
    border-radius: 16px;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    text-align: left;
}

.data-table th {
    padding: 16px 24px;
    font-weight: 800;
    color: var(--text-primary);
    background-color: #F7F3EB;
    border-bottom: 2px solid var(--border-color);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table th:first-child {
    border-top-left-radius: 14px;
}
.data-table th:last-child {
    border-top-right-radius: 14px;
}

.data-table td {
    padding: 16px 24px;
    border-bottom: 2px solid rgba(27, 29, 40, 0.08);
    vertical-align: middle;
    background-color: #FFFFFF;
    color: var(--text-primary);
}

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

.data-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 14px;
}
.data-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 14px;
}

.data-table tbody tr {
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.data-table tbody tr:hover td {
    background-color: rgba(234, 16, 16, 0.03); /* Soft signature red tint */
}

.data-table tbody tr:hover td:first-child {
    box-shadow: inset 4px 0 0 0 var(--secondary); /* Red indicator bar on the left */
}

.data-table tbody tr.selected td {
    background-color: rgba(38, 62, 96, 0.08) !important;
    color: var(--primary) !important;
    font-weight: 600;
    border-bottom-color: rgba(38, 62, 96, 0.2);
}

.data-table tbody tr.selected td:first-child {
    box-shadow: inset 4px 0 0 0 var(--secondary) !important;
}

/* Бейджи и Оценки */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    border: 2px solid var(--border-color);
    box-shadow: 1px 1px 0px var(--border-color);
}

.badge-source { background-color: var(--primary-light); color: var(--text-primary); }
.badge-type { background-color: #E6F7FF; color: var(--text-primary); }

.star-rating {
    color: var(--warning);
    display: flex;
    gap: 3px;
    font-size: 14px;
    text-shadow: 1px 1px 0px var(--border-color);
}

.star-rating.empty {
    color: var(--text-muted);
}

/* Пагинация */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    gap: 8px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background-color: #FFFFFF;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: 1px 1px 0px var(--border-color);
    transition: var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
    background-color: var(--bg-primary);
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0px var(--border-color);
}

.page-btn.active {
    background: var(--primary);
    color: #FFF;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* 8. Карточки экспертов */
.experts-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.expert-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 320px;
    height: auto;
    position: relative;
    background-color: #FFFFFF;
}

.expert-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.expert-avatar-circle {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--warning));
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 0px var(--border-color);
}

.expert-meta h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.expert-meta p {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.expert-card-body {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.expert-info-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.expert-info-row i {
    color: var(--primary);
    width: 16px;
    text-align: center;
}

.expert-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.expert-tag {
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-primary);
}

.expert-card-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* 9. Мэтчинг (Matchmaker) */
.matchmaker-container {
    display: flex;
    gap: 24px;
    height: calc(100vh - 200px);
}

.matchmaker-sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: 100%;
}

.matchmaker-sidebar h3 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 14px;
}

.matchmaker-sidebar .search-box {
    display: flex;
    align-items: center;
    background-color: #FFFFFF;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 12px;
    gap: 10px;
    margin-bottom: 16px;
    box-shadow: 2px 2px 0px var(--border-color);
}

.matchmaker-sidebar .search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 12px;
    width: 100%;
}

.matchmaker-sidebar .search-box i {
    color: var(--text-secondary);
}

.matchmaker-opp-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.matchmaker-opp-item {
    padding: 14px;
    border-radius: 12px;
    background-color: #FFFFFF;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.matchmaker-opp-item:hover {
    background-color: rgba(234, 16, 16, 0.03); /* Soft signature red tint */
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 16, 16, 0.08);
}

.matchmaker-opp-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: #FFFFFF !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(38, 62, 96, 0.25);
}

.matchmaker-opp-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
    transition: color var(--transition-fast);
}

.matchmaker-opp-item.active .matchmaker-opp-title {
    color: #FFFFFF !important;
}

.matchmaker-opp-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.matchmaker-opp-item.active .matchmaker-opp-meta span {
    color: rgba(255, 255, 255, 0.8) !important;
}

.matchmaker-results-area {
    flex: 1;
    height: 100%;
    overflow-y: auto;
}

/* Состояния */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--primary);
    text-shadow: 2px 2px 0px var(--border-color);
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 13px;
    max-width: 380px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Анимация ИИ-загрузчика */
.ai-loader {
    width: 60px;
    height: 60px;
    position: relative;
    margin: 0 auto 24px;
}

.double-bounce1, .double-bounce2 {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--primary);
    border: 2px solid var(--border-color);
    opacity: 0.6;
    position: absolute;
    top: 0;
    left: 0;
    animation: sk-bounce 2.0s infinite ease-in-out;
}

.double-bounce2 {
    background-color: var(--secondary);
    animation-delay: -1.0s;
}

@keyframes sk-bounce {
    0%, 100% { transform: scale(0.0); }
    50% { transform: scale(1.0); }
}

.match-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.opportunity-summary-card {
    padding: 24px;
    position: relative;
    background-color: #FFFFFF;
}

.opp-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: var(--primary-light);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 8px;
    box-shadow: 1px 1px 0px var(--border-color);
}

.opportunity-summary-card h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
    max-width: 80%;
    color: var(--text-primary);
}

.opp-meta-row {
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 16px;
}

.opp-meta-row strong {
    color: var(--text-primary);
}

.opportunity-summary-card p {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.matching-header-actions {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 2px solid var(--border-color);
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.section-title-row h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.section-title-row span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Карточки совпадений */
.matching-experts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.match-expert-card {
    padding: 24px;
    display: flex;
    gap: 20px;
    background-color: #FFFFFF;
}

.match-score-radial {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    border: 2px solid var(--border-color);
    box-shadow: 2px 2px 0px var(--border-color);
}

.score-high { background-color: var(--success-bg); color: var(--success); }
.score-medium { background-color: var(--warning-bg); color: var(--text-primary); }
.score-low { background-color: var(--danger-bg); color: var(--danger); }

.match-expert-info {
    flex: 1;
}

.match-expert-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.match-expert-name-row h4 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.match-role-badge {
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.match-expert-details {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.match-reasoning {
    background-color: var(--bg-primary);
    border-left: 4px solid var(--primary);
    border-top: 2px solid var(--border-color);
    border-right: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 0 10px 10px 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.05);
}

.match-grid-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.match-pros h5, .match-cons h5 {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.match-pros h5 i { color: var(--success); margin-right: 4px; }
.match-cons h5 i { color: var(--danger); margin-right: 4px; }

.match-pros ul, .match-cons ul {
    list-style: none;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-secondary);
}

.match-pros li::before {
    content: "•";
    color: var(--success);
    margin-right: 6px;
    font-weight: bold;
}

.match-cons li::before {
    content: "•";
    color: var(--danger);
    margin-right: 6px;
    font-weight: bold;
}

/* 10. Модальные окна (Modals) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(27, 29, 40, 0.4);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    width: 680px;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background-color: #FFFFFF;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 8px 8px 0px #1B1D28;
    animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScale {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 2px solid var(--border-color);
    background-color: #F7F3EB;
    border-radius: 18px 18px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-close-modal:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.modal-body {
    padding: 24px;
    flex: 1;
    background-color: #FFFFFF;
    border-radius: 0 0 18px 18px;
}

/* Стилизация контента в модалках */
.modal-section {
    margin-bottom: 24px;
}

.modal-section h4 {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 4px;
}

.modal-section p {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-secondary);
    font-weight: 600;
}

.modal-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.info-item label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-secondary);
    display: block;
}

.info-item span {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Лоадер спиннер */
.loading-spinner {
    border: 3px solid rgba(27, 29, 40, 0.05);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 30px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Общий адаптив */
@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 2px solid var(--border-color);
    }
    .sidebar-header {
        height: 60px;
    }
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding: 10px 16px;
        height: auto;
    }
    .menu-item {
        padding: 8px 12px;
        white-space: nowrap;
    }
    .main-content {
        height: calc(100vh - 120px);
    }
    .matchmaker-container {
        flex-direction: column;
        height: auto;
    }
    .matchmaker-sidebar {
        width: 100%;
        height: 250px;
    }
}

/* ==========================================================================
   Phase 11 Features Styling (Localization, Filters, Toggles)
   ========================================================================== */

.view-toggles .btn-icon.active {
    background-color: var(--primary) !important;
    color: #FFFFFF !important;
    transform: translate(-2px, -2px);
    box-shadow: var(--btn-shadow-hover);
}

.filters-bar-dates input[type="date"] {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 4px 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    outline: none;
    color: var(--text-primary);
    box-shadow: 1px 1px 0px var(--border-color);
    transition: var(--transition-fast);
}

.filters-bar-dates input[type="date"]:focus {
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0px var(--border-color);
}

#btn-lang-toggle {
    border-color: var(--border-color);
    background-color: var(--warning-bg);
}

#btn-lang-toggle:hover {
    background-color: var(--warning);
}

.export-actions .btn {
    padding: 8px 14px;
    font-size: 12.5px;
    box-shadow: 2px 2px 0px var(--border-color);
}

.export-actions .btn:hover {
    box-shadow: 3px 3px 0px var(--border-color);
}

/* Стили для компактного отображения экспертов в виде списка */
.expert-compact-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    border: 2px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
    margin-right: 12px;
    box-shadow: 1px 1px 0px var(--border-color);
    flex-shrink: 0;
}

.expert-compact-name-container {
    display: flex;
    align-items: center;
}

.expert-compact-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
}

.expert-compact-position {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
}

.expert-compact-email {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
}

.expert-compact-phone {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
}

.expert-compact-location {
    font-size: 12.5px;
    font-weight: 600;
}

.expert-compact-education {
    font-size: 12px;
    font-weight: 500;
}

/* ==========================================================================
   Login Portal Styles
   ========================================================================== */
.login-container {
    position: fixed;
    inset: 0;
    background: var(--primary);
    background: radial-gradient(circle at 30% 30%, var(--primary-dark), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    font-family: 'Montserrat', sans-serif;
}

.login-card {
    background: #1c2d46;
    border-radius: 16px;
    width: 420px;
    max-width: 100%;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.login-logo {
    height: 50px;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 24px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.login-card h2 {
    font-size: 22px;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 8px;
}

.login-card p {
    font-size: 13px;
    color: #A2B0C4;
    font-weight: 500;
    margin-bottom: 28px;
}

.login-form-group {
    text-align: left;
    margin-bottom: 20px;
}

.login-form-group label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #A2B0C4;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.login-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
    transition: all 0.15s ease;
}

.login-form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.login-form-group input:focus {
    border-color: var(--secondary);
    background: rgba(255, 255, 255, 0.12);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--secondary);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease;
    margin-top: 10px;
}

.login-btn:hover {
    background-color: var(--secondary-hover);
}

.login-error {
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #FECACA;
    margin-bottom: 20px;
    display: none;
}

.login-card .demo-credentials {
    margin-top: 24px;
    font-size: 11px;
    color: #8B9BB4;
    line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.login-card .demo-credentials code {
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
}

/* ==========================================================================
   Expert Portal Layout Styles
   ========================================================================== */
.site-header {
    background: var(--primary);
    position: relative;
    font-family: 'Montserrat', sans-serif;
}
.header-top {
    max-width: 1280px; margin: 0 auto; padding: 12px 16px;
    display: flex; justify-content: space-between; align-items: center;
}
.header-left { display: flex; align-items: center; gap: 20px; }
.lang-switch {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 6px 12px; border-radius: 6px;
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3);
    color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
}
.lang-switch:hover { background: #fff; color: var(--primary); }
.header-contact { color: #fff; font-size: 13px; font-weight: 600; text-transform: uppercase; cursor: pointer; text-decoration: none; }
.header-contact:hover { color: var(--secondary); }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-nav { display: flex; gap: 4px; }
.header-nav a {
    color: #fff; text-decoration: underline; font-size: 15px; font-weight: 500;
    padding: 8px 12px; border-radius: 6px; transition: all 0.2s;
}
.header-nav a:hover { background: rgba(255,255,255,0.1); }
.header-nav a.active { background: #fff; color: var(--primary); text-decoration: none; font-weight: 700; }
.header-bottom {
    max-width: 1280px; margin: 0 auto; padding: 16px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.header-logo img { height: 48px; }
.header-search-expert {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.15); border-radius: 8px;
    padding: 10px 16px; flex: 1; max-width: 480px;
    position: relative; z-index: 10; cursor: text;
}
.header-search-expert input {
    border: none; outline: none; background: transparent;
    color: #fff; font: inherit; font-size: 14px; width: 100%;
    cursor: text; position: relative; z-index: 11;
}
.header-search-expert input::placeholder { color: rgba(255,255,255,0.7); text-align: right; text-transform: uppercase; font-size: 13px; }
.header-search-expert i { color: rgba(255,255,255,0.7); }

/* ===== MIND MASTERS SUB-HEADER ===== */
.masters-bar {
    background: #EEEEEB; border-bottom: 1px solid var(--border-color);
}
.masters-bar-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 16px;
    display: flex; align-items: center; justify-content: space-between;
}
.masters-tabs { display: flex; gap: 0; }
.masters-tabs a {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 20px; font-size: 13px; font-weight: 700;
    color: var(--text-secondary); text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s; text-transform: uppercase; letter-spacing: 0.5px;
}
.masters-tabs a:hover { color: var(--text-primary); background: rgba(0,0,0,0.03); }
.masters-tabs a.active { color: var(--secondary); border-bottom-color: var(--secondary); }
.masters-tabs a i { font-size: 14px; }
.masters-user {
    display: flex; align-items: center; gap: 10px; padding: 8px 0;
}
.masters-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary); color: #fff; font-weight: 800; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
}
.masters-user-meta { font-size: 12px; }
.masters-user-meta strong { display: block; font-weight: 700; }
.masters-user-meta span { color: var(--text-muted); font-weight: 500; }

/* ===== MAIN ===== */
.expert-main-area { max-width: 1280px; margin: 0 auto; padding: 32px 16px; overflow-y: auto; flex: 1; }

/* ===== STATS ROW ===== */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-box {
    background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 12px;
    padding: 20px; display: flex; align-items: center; gap: 14px;
}
.stat-icon-circle {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #fff; flex-shrink: 0;
}
.stat-icon-circle.navy { background: var(--primary); }
.stat-icon-circle.red { background: var(--secondary); }
.stat-icon-circle.green { background: var(--success); }
.stat-icon-circle.blue { background: var(--cyan); }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 26px; font-weight: 900; line-height: 1; }

/* ===== TWO-COLUMN LAYOUT ===== */
.two-col { display: grid; grid-template-columns: 5fr 2fr; gap: 24px; }
.section-heading {
    font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 16px; color: var(--primary);
    display: flex; align-items: center; gap: 8px;
}
.section-heading i { color: var(--secondary); }

/* ===== MATCH LIST ===== */
.m-list { display: flex; flex-direction: column; gap: 10px; }
.m-card {
    background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 12px;
    padding: 16px 20px; display: flex; align-items: center; gap: 16px;
    cursor: pointer; transition: all 0.15s;
}
.m-card:hover { border-color: var(--primary); background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.m-score {
    width: 50px; height: 50px; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-weight: 900; font-size: 15px; flex-shrink: 0; border: 2.5px solid;
}
.m-score small { font-size: 8px; font-weight: 700; text-transform: uppercase; margin-top: -2px; }
.sc-high { border-color: var(--success); color: #166534; background: var(--success-bg); }
.sc-med { border-color: var(--warning); color: #92400e; background: var(--warning-bg); }
.sc-low { border-color: var(--danger); color: #991b1b; background: var(--danger-bg); }
.m-body { flex: 1; min-width: 0; }
.m-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-meta { display: flex; gap: 14px; flex-wrap: wrap; }
.m-meta span { font-size: 11px; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
.m-meta i { font-size: 10px; color: var(--text-muted); }
.m-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ===== BADGES ===== */
.dl-badge {
    font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px;
    white-space: nowrap; display: inline-flex; align-items: center; gap: 3px;
}
.dl-badge i { font-size: 9px; }
.dl-urgent { background: var(--danger-bg); color: #991b1b; border: 1px solid #FECACA; }
.dl-soon { background: var(--warning-bg); color: #92400e; border: 1px solid #FDE68A; }
.dl-ok { background: var(--success-bg); color: #166534; border: 1px solid #BBF7D0; }
.dl-far { background: var(--primary-light); color: var(--primary); border: 1px solid #BFDBFE; }
.tag { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--bg-secondary); border: 1px solid var(--border-color); color: var(--text-secondary); }
.tag-src { background: var(--primary); color: #fff; border-color: var(--primary); }
.tag-type { background: var(--primary-light); color: var(--primary); border-color: #BFDBFE; }

/* ===== BUTTONS EXPERT ===== */
.btn-red { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.btn-red:hover { background: var(--secondary-hover); border-color: var(--secondary-hover); }
.btn-ghost { border: none; background: transparent; color: var(--secondary); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-ghost:hover { background: var(--danger-bg); border-radius: 8px; padding: 6px 12px; }
.interest-done {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 700; color: var(--success);
    padding: 5px 12px; border-radius: 8px; background: var(--success-bg);
    border: 1px solid #BBF7D0;
}

/* ===== TIMELINE ===== */
.tl { display: flex; flex-direction: column; }
.tl-month-label {
    font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
    color: var(--secondary); padding: 14px 0 6px;
}
.tl-row {
    display: flex; align-items: flex-start; gap: 12px; padding: 8px 0;
    border-left: 2px solid var(--border-color); margin-left: 6px; padding-left: 14px;
    position: relative;
}
.tl-row::before {
    content: ''; position: absolute; left: -5px; top: 12px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #fff; border: 2px solid var(--border-color);
}
.tl-row.urgent::before { background: var(--danger); border-color: var(--danger); }
.tl-row.soon::before { background: var(--warning); border-color: var(--warning); }
.tl-day { font-size: 13px; font-weight: 800; min-width: 28px; }
.tl-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.tl-label strong { color: var(--text-primary); font-weight: 700; }

/* ===== CATALOG ===== */
.catalog-bar {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
    padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
    border: 1px solid var(--border-color); background: #fff; cursor: pointer; transition: all 0.15s;
    color: var(--text-secondary);
}
.pill:hover { border-color: var(--primary); color: var(--text-primary); }
.pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.search-input-expert {
    display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--border-color); border-radius: 8px;
    padding: 8px 14px; width: 280px; background: var(--bg-secondary);
}
.search-input-expert input { border: none; outline: none; font: inherit; font-size: 13px; font-weight: 500; width: 100%; background: transparent; }
.search-input-expert i { color: var(--text-muted); font-size: 14px; }
.g-list { display: flex; flex-direction: column; gap: 12px; }
.g-card {
    background: #fff; border: 1px solid var(--border-color); border-radius: 12px;
    padding: 20px 24px; display: grid; grid-template-columns: 54px 1fr auto;
    gap: 18px; align-items: start; transition: all 0.15s;
}
.g-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(0,0,0,0.05); }
.g-ring {
    width: 50px; height: 50px; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-weight: 900; font-size: 14px; flex-shrink: 0; border: 2.5px solid;
}
.g-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.g-desc { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.g-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.g-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 130px; }

/* ===== PROFILE ===== */
.p-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.p-header {
    grid-column: 1 / -1; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-radius: 16px;
    padding: 32px; display: flex; gap: 24px; align-items: center; color: #fff;
    box-shadow: 0 6px 20px rgba(38, 62, 96, 0.15);
}
.p-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.4);
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 24px; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.p-info h2 { font-size: 22px; font-weight: 800; color: #fff; }
.p-info .p-role { font-size: 13.5px; opacity: 0.85; font-weight: 500; margin-bottom: 8px; color: #fff; }
.p-info .p-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.p-info .p-tags .ptag { font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 4px; background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.25); }
.p-card {
    background: #FFFFFF; border: 1px solid var(--border-color); border-radius: 16px; padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.p-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(38, 62, 96, 0.07);
}
.p-card h3 { font-size: 13.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--primary); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.p-card h3 i { color: var(--secondary); font-size: 14px; }
.skill-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    font-size: 11px; font-weight: 600; padding: 5px 12px; border-radius: 20px;
    background: #fff; border: 1px solid var(--border-color); color: var(--text-primary);
}
.bar-group { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { font-size: 12px; font-weight: 600; width: 150px; color: var(--text-secondary); }
.bar-track { flex: 1; height: 10px; background: #fff; border: 1px solid var(--border-color); border-radius: 20px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 20px; }
.bar-val { font-size: 12px; font-weight: 800; width: 28px; text-align: right; }
.pub-line { padding: 10px 0; border-bottom: 1px solid var(--border-color); font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.pub-line:last-child { border-bottom: none; }
.pub-line strong { color: var(--text-primary); font-weight: 700; }

/* ===== ORCID ===== */
.orcid-card {
    grid-column: 1 / -1; background: #fff; border: 2px solid #A6CE39;
    border-radius: 16px; padding: 24px 28px;
    box-shadow: 0 4px 12px rgba(166,206,57,0.06);
}
.orcid-card h3 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--primary); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.orcid-logo { display: inline-block; width: 20px; height: 20px; background: #A6CE39; border-radius: 50%; position: relative; flex-shrink: 0; }
.orcid-logo::after { content: 'iD'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 9px; font-weight: 900; font-family: 'Montserrat', sans-serif; }
.orcid-desc { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-bottom: 14px; }
.orcid-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.orcid-input {
    flex: 1; min-width: 240px; max-width: 380px;
    display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--border-color); border-radius: 8px;
    padding: 9px 14px; background: var(--bg-secondary);
    transition: border-color 0.15s;
}
.orcid-input:focus-within { border-color: #A6CE39; }
.orcid-input input { border: none; outline: none; font: inherit; font-size: 13px; font-weight: 600; width: 100%; background: transparent; letter-spacing: 0.5px; }
.orcid-input input::placeholder { font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.orcid-prefix { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.btn-orcid { background: #A6CE39; color: #fff; border-color: #A6CE39; font-weight: 700; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; }
.btn-orcid:hover { background: #94b832; border-color: #94b832; }
.orcid-status { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.orcid-status.loading { color: var(--text-muted); }
.orcid-status.success { color: #166534; }
.orcid-status.error { color: #991b1b; }
.orcid-spinner { width: 14px; height: 14px; border: 2px solid var(--border-color); border-top-color: #A6CE39; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.orcid-imported { display: none; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-color); }
.orcid-imported.show { display: block; }
.orcid-imported-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.orcid-imp-section h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; letter-spacing: 0.5px; }
.orcid-imp-item { font-size: 12px; color: var(--text-secondary); padding: 4px 0; font-weight: 500; }
.orcid-imp-item strong { color: var(--text-primary); font-weight: 700; }
.orcid-pub-item { font-size: 12px; color: var(--text-secondary); padding: 6px 0; border-bottom: 1px solid var(--border-color); font-weight: 500; }
.orcid-pub-item:last-child { border-bottom: none; }
.orcid-pub-item strong { color: var(--text-primary); font-weight: 700; }
.orcid-pub-item .pub-year { font-size: 10px; font-weight: 700; color: var(--primary); background: var(--bg-secondary); border: 1px solid var(--border-color); padding: 1px 6px; border-radius: 3px; margin-right: 6px; }
.orcid-connected { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: #166534; background: var(--success-bg); border: 1px solid #BBF7D0; padding: 3px 10px; border-radius: 4px; }

/* ===== MODAL BG ===== */
.modal-bg-expert {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 500; display: none; align-items: center; justify-content: center;
}
.modal-bg-expert.active { display: flex; }

/* ===== TOAST ===== */
#toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
    background: var(--primary); color: #fff; padding: 12px 24px; border-radius: 10px;
    font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px;
    z-index: 60000; transition: transform 0.3s ease; box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
#toast i { color: var(--success); font-size: 16px; }

/* ===== FOOTER ===== */
.site-footer {
    background: var(--primary); padding: 32px 0; margin-top: 60px;
    font-family: 'Montserrat', sans-serif;
}
.footer-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 16px;
    display: flex; justify-content: space-between; align-items: center;
    color: rgba(255,255,255,0.7); font-size: 12px; font-weight: 500;
}
.footer-inner a { color: #fff; text-decoration: underline; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
    .p-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .stats-row { grid-template-columns: 1fr; }
    .masters-bar-inner { flex-direction: column; gap: 0; }
    .masters-tabs { overflow-x: auto; width: 100%; }
    .masters-tabs a { font-size: 11px; padding: 12px 14px; white-space: nowrap; }
}

/* Scheduler Toggle Button Status */
#btn-toggle-scheduler.disabled {
    opacity: 0.65;
    background-color: var(--bg-secondary) !important;
    color: var(--text-muted) !important;
    border-style: dashed !important;
}
#btn-toggle-scheduler.disabled i {
    color: var(--text-muted) !important;
}

/* Active chat expert item styling */
.chat-expert-item.active-chat {
    background: #e1e7ef !important;
    border-left: 4px solid var(--primary) !important;
}

/* Responsive Empty State Styling */
.empty-history-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    color: var(--text-secondary);
    text-align: center;
    padding: 30px;
    animation: fadeIn 0.4s ease;
    box-sizing: border-box;
    width: 100%;
}

.empty-history-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.empty-history-circle i {
    font-size: 80px;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.empty-history-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    transition: all 0.3s ease;
}

.empty-history-desc {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 480px;
    line-height: 1.6;
    margin: 0;
    transition: all 0.3s ease;
}

/* Responsive Scaling for Small/Short viewports */
@media (max-height: 720px), (max-width: 768px) {
    .empty-history-circle {
        width: 120px;
        height: 120px;
        margin-bottom: 16px;
    }
    .empty-history-circle i {
        font-size: 50px;
    }
    .empty-history-title {
        font-size: 20px;
        margin-bottom: 8px;
    }
    .empty-history-desc {
        font-size: 14px;
        max-width: 340px;
    }
}

@media (max-height: 580px) {
    .empty-history-circle {
        width: 90px;
        height: 90px;
        margin-bottom: 10px;
    }
    .empty-history-circle i {
        font-size: 40px;
    }
    .empty-history-title {
        font-size: 18px;
        margin-bottom: 6px;
    }
    .empty-history-desc {
        font-size: 13px;
        max-width: 280px;
    }
}






