@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* Zero-margin body & root container reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    background: #F8FAFC !important;
    font-family: var(--font-sans) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.011em;
}

#react-entry-point,
#_dash-app-content,
#_dash-loading,
.scorebook-root-container {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    font-family: var(--font-sans) !important;
}

.scorebook-app-layout {
    display: flex !important;
    flex-direction: row !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #F8FAFC !important;
}

button,
input,
optgroup,
select,
textarea,
.form-control,
.form-select,
.btn,
.nav-link,
.custom-tab,
.Select,
.Select-control,
.Select-placeholder,
.Select-value,
.Select-input {
    font-family: var(--font-sans) !important;
}

/* Custom styles for Publications Filter */

/* Compact dropdown styling */
.compact-dropdown .Select-control {
    min-height: 36px !important;
    height: 36px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.compact-dropdown .Select-value-label,
.compact-dropdown .Select-input,
.compact-dropdown .Select-placeholder {
    font-size: 13px !important;
    line-height: 1.4;
    padding: 4px 8px;
}

/* Dropdown text overflow handling */
.dash-dropdown .Select-value-label,
.dash-dropdown .Select-menu-outer .Select-option {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Dropdown menu positioning and z-index for overflow */
.dash-dropdown .Select-menu-outer {
    z-index: 1050 !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Dropdown container width */
.dash-dropdown {
    width: 100% !important;
    position: relative;
}

/* Compact year slider styling */
.compact-year-slider {
    margin-top: 8px !important;
    margin-bottom: 20px !important;
}

.compact-year-slider .rc-slider {
    height: 8px;
}

.compact-year-slider .rc-slider-rail {
    height: 6px;
    background-color: #E2E8F0;
}

.compact-year-slider .rc-slider-track {
    height: 6px;
    background-color: #4F46E5;
}

.compact-year-slider .rc-slider-handle {
    width: 16px;
    height: 16px;
    margin-top: -5px;
    border: 2px solid #4F46E5;
    background-color: #FFFFFF;
}

.compact-year-slider .rc-slider-mark-text {
    font-size: 10px !important;
    color: #64748B;
    margin-top: 5px;
}

/* Filter container styling */
.publications-filter-section {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    padding: 16px 20px !important;
    margin-bottom: 20px !important;
    position: relative !important;
    z-index: 50 !important;
    overflow: visible !important;
}

/* Filter content container with overflow visible for dropdown overlay */
.publications-filter-section #filter-content,
.publications-filter-section [id*="filter-content"] {
    overflow: visible !important;
}

/* Filter toggle button styling */
.publications-filter-section .btn-link {
    color: #007bff !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.publications-filter-section .btn-link:hover {
    color: #0056b3 !important;
    text-decoration: none !important;
}

.publications-filter-section .btn-link:focus {
    box-shadow: none;
    outline: none;
}

/* Filter summary styling */
.publications-filter-section .text-muted {
    font-style: italic;
    opacity: 0.8;
}

/* Smooth icon transitions */
.publications-filter-section .btn-link i {
    transition: transform 0.2s ease;
}

/* Filter header improvements */
.publications-filter-section .d-flex.justify-content-between {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Collapsed state improvements */
.publications-filter-section.collapsed {
    padding: 15px 20px;
}

.publications-filter-section .d-flex.justify-content-between.collapsed {
    border-bottom: none;
    margin-bottom: 0;
}

/* Filter icons spacing */
.publications-filter-section .btn-link i.fa-filter {
    color: #6c757d;
    opacity: 0.8;
}

/* Compact label styling */
.filter-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.3;
}

/* Dropdown option styling for long text */
.dash-dropdown .Select-option {
    padding: 8px 12px;
    line-height: 1.4;
    font-size: 13px;
    word-wrap: break-word;
    white-space: normal;
    max-height: 44px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-dropdown .Select-option:hover {
    background-color: #e9ecef;
}

/* Trends chart improvements */
.trends-chart-grid {
    margin-bottom: 2rem;
}

.trends-chart-grid .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trends-chart-grid .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Chart container improvements */
.trends-chart-grid .card-body {
    padding: 1rem;
}

.trends-chart-grid .card-body .js-plotly-plot {
    width: 100% !important;
}

/* Responsive chart adjustments */
@media (max-width: 768px) {
    .trends-chart-grid .col-lg-6 {
        margin-bottom: 1rem;
    }

    .trends-chart-grid .card-body {
        padding: 0.75rem;
    }
}

/* Responsive adjustments for better layout */
@media (max-width: 768px) {
    .publications-filter-section {
        padding: 16px;
        margin-bottom: 20px !important;
    }

    .dash-dropdown .Select-value-label,
    .dash-dropdown .Select-menu-outer .Select-option {
        font-size: 12px;
    }

    .filter-label {
        font-size: 12px;
    }

    .compact-dropdown .Select-control {
        min-height: 34px !important;
        height: 34px;
    }
}

/* Ensure filter container allows dropdown overlays and proper spacing */
.publications-filter-section {
    overflow: visible !important;
    clear: both;
    display: block;
    width: 100%;
}

/* Ensure content below filters has proper spacing */
.publications-filter-section+* {
    margin-top: 0 !important;
    clear: both;
}

/* Button styling */
.btn-sm {
    font-size: 12px;
    padding: 4px 8px;
    line-height: 1.2;
}

/* Ensure dropdowns appear above scorecards */
.dash-dropdown .Select-menu-outer {
    z-index: 1050 !important;
}

/* Fix for Bootstrap row spacing in filter layout */
.publications-filter-section .row {
    margin-left: -12px;
    margin-right: -12px;
}

.publications-filter-section .row>* {
    padding-left: 12px;
    padding-right: 12px;
}

/* Additional styling can be added here as needed */

/* Subtle download icon styling */
.download-icon-subtle:hover {
    opacity: 1 !important;
    color: #6b7280 !important;
    transform: translateY(-1px);
}

.download-icon-subtle:active {
    transform: translateY(0);
}

/* Collaborations Top-N dropdown readability inside themed card headers */
.collaborations-topn-dropdown .Select-control,
.collaborations-topn-dropdown .Select-menu-outer,
.collaborations-topn-dropdown .Select-menu {
    background-color: #ffffff !important;
}

.collaborations-topn-dropdown .Select-value-label,
.collaborations-topn-dropdown .Select-placeholder,
.collaborations-topn-dropdown .Select-option {
    color: #1f2937 !important;
}

/* Collaborations controls should stay above KPI cards, but below global filter dropdowns */
#collaborations-controls-card {
    position: relative;
    z-index: 5;
    overflow: visible !important;
}

#collaborations-controls-card .dash-dropdown,
#collaborations-controls-card .dash-dropdown>div,
#collaborations-controls-card .Select,
#collaborations-controls-card .Select-control,
#collaborations-controls-card .Select-menu-outer,
#collaborations-controls-card .Select-menu {
    overflow: visible !important;
}

#collaborations-controls-card .Select-menu-outer,
#collaborations-controls-card .Select-menu {
    z-index: 1200 !important;
}

/* Keep global filter dropdowns above collaborations controls */
.publications-filter-section .Select-menu-outer,
.publications-filter-section .Select-menu {
    z-index: 1500 !important;
}

/* Keep KPI row below dropdown menus */
#collaborations-kpi-container {
    position: relative;
    z-index: 1;
}

/* Reserve space before KPI callback paints to reduce initial layout jump/flicker */
#collaborations-kpi-container:empty {
    min-height: 300px;
}

/* Reports filter readability and dropdown layering */
.reports-filter-card {
    overflow: visible !important;
}

.reports-filter-card .dash-dropdown,
.reports-filter-card .dash-dropdown>div,
.reports-filter-card .Select,
.reports-filter-card .Select-control,
.reports-filter-card .Select-menu-outer,
.reports-filter-card .Select-menu {
    overflow: visible !important;
}

.reports-filter-card .Select-menu-outer,
.reports-filter-card .Select-menu {
    z-index: 4000 !important;
    max-height: 280px;
}

.reports-filter-card .Select-control {
    min-height: 44px;
}

.reports-filter-card .Select-value-label,
.reports-filter-card .Select-placeholder,
.reports-filter-card .Select-option {
    font-size: 15px !important;
    line-height: 1.35 !important;
}

.reports-filter-card .Select-option {
    white-space: normal !important;
    max-height: none !important;
    padding-top: 10px;
    padding-bottom: 10px;
}

.reports-catalog-card {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.06) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    overflow: visible !important;
}

.reports-catalog-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1) !important;
}

.reports-catalog-card .reports-catalog-header {
    background: #ffffff !important;
    border-bottom: 1px solid #eef2f7 !important;
    border-top-left-radius: 14px !important;
    border-top-right-radius: 14px !important;
    padding: 1rem 1.25rem !important;
}

.report-toggle-area {
    cursor: pointer;
    user-select: none;
    color: #111827 !important;
}

/* ==========================================================================
   ScoreBook 3.0 / Researgence Theme Sidebar & Brand Header
   ========================================================================== */

/* App Header (Flush against sidebar, 64px height, pushes user chip to far right) */
.app-header {
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    width: 100% !important;
    background: #FFFFFF !important;
    border-bottom: 1px solid #E2E8F0 !important;
    padding: 0 16px 0 20px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
    z-index: 30 !important;
}

.header-client-logo-wrapper {
    height: 44px;
    max-width: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-client-logo-img {
    height: 40px;
    max-height: 44px;
    width: auto;
    max-width: 170px;
    object-fit: contain;
    display: block;
}

.header-university-title {
    font-size: 15px;
    font-weight: 700 !important;
    color: #0F172A !important;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.header-page-tagline {
    font-size: 11.5px;
    color: #64748B !important;
    font-weight: 500;
    line-height: 1.2;
}

/* Scorebook 3.0 Sidebar Container (Flex child 1: 280px / Collapsed: 80px) */
.sidebar-container {
    position: relative !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    flex: 0 0 280px !important;
    height: 100vh !important;
    max-height: 100vh !important;
    flex-shrink: 0 !important;
    background: #FFFFFF !important;
    border-right: 1px solid #E2E8F0 !important;
    z-index: 40 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.22s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.22s cubic-bezier(0.4, 0, 0.2, 1), flex-basis 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.sidebar-container.sidebar-collapsed {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    flex: 0 0 80px !important;
}

/* Sidebar Header (64px height matching app-header exactly) */
.sidebar-header {
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    padding: 0 14px !important;
    margin: 0 !important;
    border-bottom: 1px solid #E2E8F0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: #FFFFFF !important;
    flex-shrink: 0 !important;
}

.sidebar-collapsed .sidebar-header {
    justify-content: center !important;
    padding: 0 10px !important;
}

/* Researgence Logo Badge with Indigo Gradient */
.sidebar-brand-logo-card {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4F46E5 0%, #4338CA 100%) !important;
    border: 1px solid #4338CA !important;
    border-radius: 12px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.25) !important;
    flex-shrink: 0;
}

.sidebar-brand-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.sidebar-brand-title {
    font-size: 13.5px;
    font-weight: 700 !important;
    line-height: 1.2;
    color: #0F172A !important;
}

.sidebar-brand-sub {
    font-size: 10px;
    line-height: 1.1;
    color: #64748B !important;
    font-weight: 500;
}

.sidebar-toggle-button {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B !important;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sidebar-toggle-button:hover {
    background: #F8FAFC !important;
    color: #0F172A !important;
    border-color: #CBD5E1 !important;
}

.sidebar-collapsed .sidebar-toggle-button {
    display: none;
}

/* Sidebar Navigation Scroll Area */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 10px;
    background: #FFFFFF !important;
    scrollbar-width: thin;
    scrollbar-color: #E2E8F0 transparent;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #E2E8F0;
    border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #CBD5E1;
}

.sidebar-group {
    margin-bottom: 10px;
}

.sidebar-section-header {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    color: #94A3B8 !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 12px 4px 12px;
    margin: 0 !important;
}

.sidebar-collapsed .sidebar-brand-text,
.sidebar-collapsed .sidebar-section-header,
.sidebar-collapsed .sidebar-nav-text,
.sidebar-collapsed .sidebar-user-info {
    display: none !important;
}

/* Scorebook 3.0 Item Styling (Expanded) */
.sidebar-nav-link {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    color: #475569 !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    margin-bottom: 2px !important;
    border: 1px solid transparent !important;
    transition: all 0.15s ease;
    box-sizing: border-box !important;
}

.sidebar-icon-box {
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    flex-shrink: 0 !important;
    color: #64748B !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: color 0.15s ease;
}

.sidebar-icon-box i,
.sidebar-nav-link i {
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    text-align: center !important;
    line-height: 1 !important;
    font-size: inherit !important;
}

.sidebar-nav-text {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.3 !important;
    color: inherit !important;
}

.sidebar-nav-link:hover {
    background: #F1F5F9 !important;
    color: #0F172A !important;
    border-color: transparent !important;
}

.sidebar-nav-link:hover .sidebar-icon-box {
    color: #0F172A !important;
}

/* Scorebook 3.0 Active Style: bg-indigo-50/90, text-indigo-700, border-indigo-200/80 */
.sidebar-nav-link.active {
    background: #EEF2FF !important;
    color: #4338CA !important;
    font-weight: 700 !important;
    border: 1px solid #C7D2FE !important;
    box-shadow: 0 1px 2px rgba(99, 102, 241, 0.08) !important;
}

.sidebar-nav-link.active .sidebar-icon-box {
    color: #4F46E5 !important;
}

.sidebar-nav-link.active .sidebar-nav-text {
    color: #4338CA !important;
    font-weight: 700 !important;
}

/* ==========================================================================
   Scorebook 3.0 Exact Collapsed State (w-20 / 80px)
   ========================================================================== */
.sidebar-collapsed .sidebar-content {
    padding: 10px 8px !important;
}

.sidebar-collapsed .sidebar-group {
    margin-bottom: 8px !important;
    position: relative;
}

/* Subtle group divider in collapsed mode like Scorebook 3.0 */
.sidebar-collapsed .sidebar-group:not(:last-child)::after {
    content: '';
    display: block;
    width: 36px;
    height: 1px;
    background: #F1F5F9;
    margin: 8px auto 0 auto;
}

.sidebar-collapsed .sidebar-nav-link {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    margin: 4px auto !important;
    justify-content: center !important;
    border-radius: 12px !important;
    gap: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.sidebar-collapsed .sidebar-icon-box {
    width: 22px !important;
    height: 22px !important;
    font-size: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.sidebar-collapsed .sidebar-nav-link:hover {
    background: #F1F5F9 !important;
    color: #0F172A !important;
}

.sidebar-collapsed .sidebar-nav-link.active {
    background: #EEF2FF !important;
    border: 1px solid #C7D2FE !important;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.12) !important;
}

.sidebar-collapsed .sidebar-nav-link.active .sidebar-icon-box {
    color: #4F46E5 !important;
}

/* Sidebar Expand Action in Collapsed Bottom */
.sidebar-expand-container {
    display: none;
    border-top: 1px solid #E2E8F0;
    padding: 6px 0;
    background: #FFFFFF;
}

.sidebar-collapsed .sidebar-expand-container {
    display: flex;
    justify-content: center;
}

.sidebar-expand-button {
    width: 44px;
    height: 38px;
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569 !important;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sidebar-expand-button:hover {
    background: #EEF2FF !important;
    color: #4338CA !important;
    border-color: #C7D2FE !important;
}

/* Header User Profile Persona Chip (Right end of header) */
.header-user-profile-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.header-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 10px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    max-width: 420px;
    transition: all 0.15s ease;
}

.header-user-chip:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

.header-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    color: #4F46E5;
}

.header-avatar-circle i {
    color: #4F46E5;
}

.header-user-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.header-user-name {
    font-size: 13px;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.25;
}

.header-user-dept {
    font-size: 11px;
    color: #64748B;
    font-weight: 500;
    line-height: 1.2;
    margin-top: 1.5px;
}

/* Main Content Area & Scroll Container */
.main-content-wrapper {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    background: #F8FAFC !important;
    margin: 0 !important;
    padding: 0 !important;
}

.page-content-scroll {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 24px !important;
    background: #F8FAFC !important;
}

/* ==========================================================================
   Modern shadcn-style Publications Filter Component
   ========================================================================== */
.publications-filter-section {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    padding: 16px 20px !important;
    margin-bottom: 20px !important;
    position: relative;
    z-index: 20;
}

.filter-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.filter-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4F46E5;
    font-size: 13px;
    flex-shrink: 0;
}

.filter-title-text {
    font-size: 14.5px;
    font-weight: 700;
    color: #0F172A;
    letter-spacing: -0.01em;
}

.filter-active-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    line-height: 1.3;
}

.filter-active-pill-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.filter-pill-tag {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 600;
    color: #4338CA;
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    border-radius: 6px;
    padding: 2.5px 8px;
    line-height: 1.25;
    white-space: nowrap;
}

.filter-pill-tag-muted {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 500;
    color: #64748B;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 2.5px 8px;
    line-height: 1.25;
}

.filter-section-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #64748B !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    margin-bottom: 8px !important;
    display: block;
}

.filter-toggle-btn {
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px !important;
    padding: 0 12px !important;
    height: 32px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-toggle-btn:hover {
    background: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
    color: #0F172A !important;
}

.btn-filter-reset {
    background: transparent !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px !important;
    padding: 0 12px !important;
    height: 32px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #64748B !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-filter-reset:hover {
    background: #FEF2F2 !important;
    border-color: #FECDD3 !important;
    color: #DC2626 !important;
}

/* Modern Dropdown Control & Overlay */
.compact-dropdown {
    position: relative !important;
    overflow: visible !important;
}

.compact-dropdown.is-open {
    z-index: 99999 !important;
}

.compact-dropdown .Select {
    overflow: visible !important;
}

.compact-dropdown .Select-control {
    min-height: 38px !important;
    height: 38px !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px !important;
    background: #FFFFFF !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
    overflow: visible !important;
}

.compact-dropdown .Select-control:hover {
    border-color: #CBD5E1 !important;
}

.compact-dropdown.is-focused .Select-control,
.compact-dropdown.is-open .Select-control {
    border-color: #4F46E5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12) !important;
}

.compact-dropdown .Select-value-label,
.compact-dropdown .Select-input,
.compact-dropdown .Select-placeholder {
    font-size: 13px !important;
    line-height: 1.4 !important;
    color: #0F172A !important;
    padding: 6px 10px !important;
}

.compact-dropdown .Select-placeholder {
    color: #94A3B8 !important;
}

.compact-dropdown .Select-menu-outer,
.dash-dropdown .Select-menu-outer,
.publications-filter-section .Select-menu-outer {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    border: 1px solid #CBD5E1 !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    background: #FFFFFF !important;
    z-index: 99999 !important;
    margin-top: 4px !important;
    padding: 4px !important;
    max-height: 280px !important;
    overflow-y: auto !important;
}

.compact-dropdown .Select-menu,
.dash-dropdown .Select-menu,
.publications-filter-section .Select-menu {
    max-height: 270px !important;
    overflow-y: auto !important;
}

.compact-dropdown .Select-option,
.dash-dropdown .Select-option {
    border-radius: 6px !important;
    padding: 7px 10px !important;
    font-size: 12.5px !important;
    color: #1E293B !important;
    transition: background 0.1s ease !important;
}

.compact-dropdown .Select-option:hover,
.compact-dropdown .Select-option.is-focused,
.dash-dropdown .Select-option:hover,
.dash-dropdown .Select-option.is-focused {
    background-color: #EEF2FF !important;
    color: #4338CA !important;
}

.compact-dropdown .Select-option.is-selected,
.dash-dropdown .Select-option.is-selected {
    background-color: #4F46E5 !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
}

/* Modern Range Slider - Indigo 600 (#4F46E5) Tokens */
.compact-year-slider .rc-slider-track {
    background-color: #4F46E5 !important;
    height: 5px !important;
}

.compact-year-slider .rc-slider-rail {
    background-color: #E2E8F0 !important;
    height: 5px !important;
}

.compact-year-slider .rc-slider-handle {
    border: 2px solid #4F46E5 !important;
    background-color: #FFFFFF !important;
    width: 16px !important;
    height: 16px !important;
    margin-top: -6px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
}

.compact-year-slider .rc-slider-handle:hover,
.compact-year-slider .rc-slider-handle:active {
    border-color: #4338CA !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2) !important;
}

.compact-year-slider .rc-slider-dot {
    border-color: #CBD5E1 !important;
    background-color: #FFFFFF !important;
    width: 7px !important;
    height: 7px !important;
    bottom: -1px !important;
}

.compact-year-slider .rc-slider-dot-active {
    border-color: #4F46E5 !important;
}

/* Mantine RangeSlider Component - Publication Timeframe */
.dmc-year-slider .mantine-RangeSlider-bar,
.dmc-year-slider .mantine-Slider-bar {
    background-color: #4F46E5 !important;
}

.dmc-year-slider .mantine-RangeSlider-thumb,
.dmc-year-slider .mantine-Slider-thumb {
    border: 2px solid #4F46E5 !important;
    background-color: #FFFFFF !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.15s ease !important;
}

.dmc-year-slider .mantine-RangeSlider-thumb:hover,
.dmc-year-slider .mantine-RangeSlider-thumb:active,
.dmc-year-slider .mantine-Slider-thumb:hover,
.dmc-year-slider .mantine-Slider-thumb:active {
    border-color: #4338CA !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2) !important;
}

.dmc-year-slider .mantine-RangeSlider-track,
.dmc-year-slider .mantine-Slider-track {
    background-color: #E2E8F0 !important;
}

.dmc-year-slider .mantine-RangeSlider-mark,
.dmc-year-slider .mantine-Slider-mark {
    border-color: #CBD5E1 !important;
    background-color: #FFFFFF !important;
}

.dmc-year-slider .mantine-RangeSlider-markFilled,
.dmc-year-slider .mantine-Slider-markFilled {
    border-color: #4F46E5 !important;
    background-color: #4F46E5 !important;
}

.dmc-year-slider .mantine-RangeSlider-markLabel,
.dmc-year-slider .mantine-Slider-markLabel {
    color: #64748B !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    font-family: var(--font-sans) !important;
    margin-top: 6px !important;
}

.dmc-year-slider .mantine-RangeSlider-label,
.dmc-year-slider .mantine-Slider-label {
    background-color: #4F46E5 !important;
    color: #FFFFFF !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
}

/* ECharts Tooltip and Canvas Pointer Safety */
.echarts-tooltip {
    pointer-events: none !important;
    z-index: 99999999 !important;
}

.echarts-geomap-container,
.echarts-collab-barchart-container,
.echarts-donut-chart-container,
.echarts-treemap-container,
.echarts-barchart-container,
.echarts-trend-line-container,
.echarts-citation-chart-container {
    position: relative;
    overflow: visible;
}

.echarts-geomap-container canvas,
.echarts-collab-barchart-container canvas,
.echarts-donut-chart-container canvas,
.echarts-treemap-container canvas,
.echarts-barchart-container canvas,
.echarts-trend-line-container canvas,
.echarts-citation-chart-container canvas {
    pointer-events: auto !important;
    cursor: default;
}

/* ==========================================================================
   Mantine SegmentedControl High-Contrast & Responsive Styling
   ========================================================================== */
.mantine-SegmentedControl-root {
    background-color: #F1F5F9 !important;
    border: 1px solid #CBD5E1 !important;
    border-radius: 8px !important;
    padding: 3px !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.mantine-SegmentedControl-indicator {
    background-color: #4F46E5 !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 3px 0 rgba(79, 70, 229, 0.3), 0 1px 2px -1px rgba(79, 70, 229, 0.2) !important;
}

.mantine-SegmentedControl-control {
    border: none !important;
}

.mantine-SegmentedControl-label {
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    font-family: var(--font-sans) !important;
    white-space: nowrap !important;
    padding: 5px 10px !important;
    line-height: 1.2 !important;
    transition: color 0.15s ease, font-weight 0.15s ease !important;
}

.mantine-SegmentedControl-label:hover {
    color: #0F172A !important;
}

.mantine-SegmentedControl-labelActive,
.mantine-SegmentedControl-controlActive .mantine-SegmentedControl-label,
.mantine-SegmentedControl-label[data-active="true"],
.mantine-SegmentedControl-input:checked + .mantine-SegmentedControl-label {
    background-color: #4F46E5 !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 3px 0 rgba(79, 70, 229, 0.3), 0 1px 2px -1px rgba(79, 70, 229, 0.2) !important;
}

/* ==========================================================================
   Hex Indexing Interactive Tooltip Stacking & Hover Styling
   ========================================================================== */
.mantine-Tooltip-tooltip,
.mantine-Tooltip-root,
.mantine-Tooltip-body {
    z-index: 999999 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3) !important;
}

.hex-indexing-icon {
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.hex-indexing-icon:hover {
    transform: scale(1.15);
    opacity: 1 !important;
}

/* ==========================================================================
   Download Spinner & Real-Time Loading Feedback
   ========================================================================== */
.btn-download-loading {
    pointer-events: none !important;
    opacity: 0.85 !important;
    animation: downloadPulse 1.2s infinite ease-in-out;
}

@keyframes downloadPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.12);
    }
}

.download-prep-badge {
    display: inline-flex;
    align-items: center;
    background: #EEF2FF;
    color: #4F46E5;
    border: 1px solid #C7D2FE;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    margin-top: 4px;
    animation: fadeIn 0.2s ease;
}

.download-done-badge {
    display: inline-flex;
    align-items: center;
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    margin-top: 4px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}