/* Design System & Variables */
:root {
    --primary-color: #55b399;
    --primary-hover: #439a82;
    --primary-light: #e6f6f2;
    
    --bg-app: #f4f6f8;
    --bg-card: #ffffff;
    
    --text-main: #2d3748;
    --text-muted: #718096;
    --text-light: #a0aec0;
    
    --border-color: #e2e8f0;
    --border-focus: #55b399;
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Montserrat', 'Inter', sans-serif;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --transition: all 0.2s ease-in-out;
}

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

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header Section */
.dashboard-header {
    background: var(--bg-card);
    padding: 20px 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.logo-area h1 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.theme-toggle-area {
    display: flex;
    align-items: center;
}

.data-status {
    background-color: var(--primary-light);
    color: var(--primary-hover);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

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

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.kpi-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
}

.kpi-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon-wrapper svg {
    width: 26px;
    height: 26px;
}

/* Color variations for KPI cards */
.kpi-icon-wrapper.blue { background-color: #ebf8ff; color: #3182ce; }
.kpi-icon-wrapper.orange { background-color: #fffaf0; color: #dd6b20; }
.kpi-icon-wrapper.green { background-color: #f0fff4; color: #38a169; }
.kpi-icon-wrapper.purple { background-color: #faf5ff; color: #805ad5; }

.kpi-details h3 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.kpi-context {
    font-size: 11px;
    color: var(--text-light);
    display: block;
    margin-top: 2px;
}

/* Filters Card */
.filters-card {
    background: var(--bg-card);
    padding: 24px 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.filters-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.filter-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.filters-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    flex-grow: 1;
}

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

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.filter-group select,
.filter-group input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: #fafbfd;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
    border-color: var(--border-focus);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(85, 179, 153, 0.15);
}

/* Search input wrapper with clear button */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper input {
    padding-right: 32px;
}

.clear-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-light);
    cursor: pointer;
    display: none;
    transition: var(--transition);
}

.clear-btn:hover {
    color: var(--text-main);
}

/* Range Sliders styling */
.range-slider-container {
    position: relative;
    height: 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.range-slider-container input[type="range"] {
    position: absolute;
    pointer-events: none;
    -webkit-appearance: none;
    width: 100%;
    background: none;
    height: 4px;
    outline: none;
    margin: 0;
}

/* Double slider tracks and thumbs */
.range-slider-container input[type="range"]::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.range-slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: var(--primary-hover);
}

/* Make second slider run above the first one */
#filter-year-max {
    z-index: 2;
}

/* Single slider background line (custom simulation) */
.range-slider-container::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 5px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    z-index: 0;
}

/* Visual layout and spacing for year ranges */
#year-range-display {
    color: var(--primary-hover);
    font-weight: 700;
}

/* Buttons */
.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.btn-secondary:hover {
    background-color: #f7fafc;
    border-color: var(--text-light);
    color: var(--text-main);
}

.btn-secondary.small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Dashboard Grid for Charts */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid var(--border-color);
}

.chart-card.span-2 {
    grid-column: span 2;
}

.chart-card.span-all {
    grid-column: 1 / -1;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px dashed #edf2f7;
    padding-bottom: 14px;
}

.chart-title-area h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.2px;
    font-family: var(--font-heading);
}

.chart-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.chart-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Toggle Switch Styling */
.toggle-group {
    background-color: #f1f5f9;
    border-radius: var(--radius-md);
    padding: 3px;
    display: flex;
    border: 1px solid #e2e8f0;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.toggle-btn.active {
    background-color: #ffffff;
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Chart Container & Vega Styling */
.chart-container {
    width: 100%;
    min-height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Donut chart containers — stretch so the HTML layout fills naturally */
.chart-container.donut-container {
    display: block;
    align-items: unset;
    justify-content: unset;
    min-height: 260px;
    height: auto;
    overflow: visible;
}

/* Treemap containers — stretch layout so wrapper gets real pixel dimensions */
.chart-container.treemap-container {
    display: block;
    align-items: unset;
    justify-content: unset;
    padding: 0;
    min-height: 460px;
    height: 460px;
}

.chart-container.large-chart {
    min-height: 400px;
}

/* Elegant thin scrollbar for donut legend */
.donut-legend {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}
.donut-legend::-webkit-scrollbar { width: 4px; }
.donut-legend::-webkit-scrollbar-track { background: transparent; }
.donut-legend::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 2px; }

/* Custom styles inside the charts (Vega embed overlays) */
.vega-actions-wrapper {
    z-index: 10;
}

.vega-actions a {
    color: var(--text-muted) !important;
    font-family: var(--font-main) !important;
}

/* Footer styling */
.dashboard-footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-light);
    font-size: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 12px;
}

.dashboard-footer p {
    margin: 0;
}

.footer-method-link {
    color: var(--primary-hover);
    font-weight: 600;
    text-decoration: none;
}

.footer-method-link:hover {
    text-decoration: underline;
}

/* Produção Científica Table Styles */
.table-card-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.table-filter-bar {
    display: flex;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

#table-filter-input,
#table-inst-filter-input,
#table-country-filter-input,
#table-source-filter-input,
#table-author-filter-input,
#table-fn-filter-input {
    flex-grow: 1;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    outline: none;
    transition: var(--transition);
}

#table-filter-input:focus,
#table-inst-filter-input:focus,
#table-country-filter-input:focus,
#table-source-filter-input:focus,
#table-author-filter-input:focus,
#table-fn-filter-input:focus {
    border-color: #0069c0;
    box-shadow: 0 0 0 2px rgba(0, 105, 192, 0.15);
}

.table-filter-btn {
    background-color: #0069c0;
    border: 1px solid #0069c0;
    color: #ffffff;
    padding: 0 16px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.table-filter-btn:hover {
    background-color: #00569e;
    border-color: #00569e;
}

.table-filter-btn svg.search-icon {
    width: 16px;
    height: 16px;
}

.table-scroll-container {
    max-height: 380px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #ffffff;
}

/* Custom Table scrollbar */
.table-scroll-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-scroll-container::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--radius-full);
}

.table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--text-main);
    text-align: left;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #ffffff;
    box-shadow: 0 1px 0 var(--border-color);
}

.data-table th {
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    background-color: #f8fafc;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.data-table th.sortable:hover {
    background-color: #f1f5f9;
    color: #000000;
}

.data-table th:first-child,
.data-table td:first-child {
    padding-left: 20px;
}

.data-table th:last-child,
.data-table td:last-child {
    padding-right: 20px;
}

.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #edf2f7;
    transition: var(--transition);
}

.data-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.data-table tbody tr:hover {
    background-color: #f1f5f9;
}

/* Table columns alignments */
.data-table th#th-rank,
.data-table th#th-inst-rank,
.data-table td.cell-rank {
    width: 60px;
    text-align: left;
}

.data-table th#th-count,
.data-table th#th-inst-count,
.data-table td.cell-count {
    width: 120px;
    text-align: right;
    font-weight: 500;
}

.data-table td.cell-source {
    color: #2b6cb0;
    font-weight: 500;
}

.sort-indicator {
    font-size: 10px;
    margin-left: 4px;
    color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-card.span-2,
    .chart-card.span-all {
        grid-column: span 1;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .theme-toggle-area {
        align-self: flex-end;
    }
}

@media (max-width: 576px) {
    .app-container {
        padding: 12px 10px;
        gap: 16px;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-card {
        padding: 16px;
    }
    
    .kpi-card {
        padding: 16px;
    }
}

/* Active Filters Bar styling */
.active-filters-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    margin-top: -8px;
    margin-bottom: 8px;
}

.active-filters-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-grow: 1;
}

.filter-tag {
    background-color: var(--primary-light);
    color: var(--primary-hover);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(85, 179, 153, 0.2);
    transition: var(--transition);
}

.filter-tag:hover {
    background-color: #d1f0e8;
}

.remove-filter-btn {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: bold;
    color: var(--primary-hover);
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
}

.clear-all-btn {
    background: none;
    border: none;
    color: #e53e3e;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: var(--transition);
}

.clear-all-btn:hover {
    color: #c53030;
}

/* Pagination Styling */
.table-pagination a, 
.table-pagination span {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.table-pagination a:hover {
    background-color: var(--primary-light);
    color: var(--primary-hover);
}

.table-pagination span.active {
    background-color: var(--primary-light);
    color: var(--primary-hover);
    border: 1px solid rgba(85, 179, 153, 0.4);
}

.table-pagination span.dots {
    cursor: default;
    padding: 4px 2px;
}

.export-link:hover {
    text-decoration: underline !important;
    opacity: 0.8;
}

/* Chart level clear buttons */
.chart-clear-btn {
    background-color: var(--primary-light);
    color: var(--primary-hover);
    border: 1px solid rgba(85, 179, 153, 0.2);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.chart-clear-btn:hover {
    background-color: #d1f0e8;
    border-color: var(--primary-hover);
}

/* ─── Gender Citations Panel ─────────────────────────────────────────────── */
.gender-citations-panel {
    padding: 4px 0 8px;
}

.gcb-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 900px) {
    .gcb-wrap { grid-template-columns: 1fr; }
}

.gcb-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.gcb-row {
    margin-bottom: 16px;
}

.gcb-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-main);
}

.gcb-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gcb-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.gcb-bar-outer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gcb-bar-track {
    flex: 1;
    height: 20px;
    background: #f1f5f9;
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.gcb-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 4px;
}

.gcb-mean {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    min-width: 95px;
    text-align: right;
    flex-shrink: 0;
}

/* Reference line */
.gcb-ref-line-wrap {
    margin-top: 8px;
    opacity: 0.65;
}

.gcb-ref-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-style: italic;
}

.gcb-ref-bar {
    height: 4px;
    background: repeating-linear-gradient(
        90deg, #718096 0, #718096 6px, transparent 6px, transparent 12px
    );
    border-radius: 2px;
}

/* Stats Section */
.gcb-sig-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid;
}

.gcb-sig-badge.sig-high {
    background: #f0fff4;
    color: #276749;
    border-color: rgba(39, 103, 73, 0.2);
}

.gcb-sig-badge.sig-medium {
    background: #fffbeb;
    color: #7b5c00;
    border-color: rgba(123, 92, 0, 0.2);
}

.gcb-sig-badge.sig-low {
    background: #fff5f5;
    color: #c53030;
    border-color: rgba(197, 48, 48, 0.2);
}

.gcb-sig-badge.sig-none {
    background: #f7fafc;
    color: var(--text-muted);
    border-color: var(--border-color);
}

.gcb-stars {
    font-size: 16px;
    flex-shrink: 0;
}

.gcb-explain {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.gcb-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.gcb-stat-item {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gcb-stat-val {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-heading);
}

.gcb-stat-key {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}

.gcb-footnote {
    font-size: 10px;
    color: var(--text-light);
    line-height: 1.5;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    font-style: italic;
}

/* ─── Indexing Note Card ─────────────────────────────────────────────────── */
.indexing-note-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fff9f0 100%);
    border: 1px solid rgba(214, 158, 46, 0.3) !important;
    box-shadow: 0 2px 8px rgba(214, 158, 46, 0.08) !important;
}

.indexing-note-inner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 4px 0;
}

.indexing-note-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(214, 158, 46, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b7791f;
}

.indexing-note-icon svg {
    width: 20px;
    height: 20px;
}

.indexing-note-content h3 {
    font-size: 14px;
    font-weight: 700;
    color: #7b4f12;
    margin-bottom: 8px;
    font-family: var(--font-heading);
}

.indexing-note-content p {
    font-size: 13px;
    color: #744210;
    line-height: 1.65;
    margin-bottom: 14px;
}

.indexing-note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.note-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    border: 1px solid;
}

.note-tag.amber {
    background: rgba(214, 158, 46, 0.12);
    color: #7b5c00;
    border-color: rgba(214, 158, 46, 0.35);
}

.note-tag.green {
    background: rgba(72, 187, 120, 0.1);
    color: #276749;
    border-color: rgba(72, 187, 120, 0.3);
}

.note-tag.blue {
    background: rgba(66, 153, 225, 0.1);
    color: #1a5276;
    border-color: rgba(66, 153, 225, 0.3);
}

/* ─── Gender Method Card ─────────────────────────────────────────────────── */
.gender-method-card {
    background: linear-gradient(135deg, #effaf7 0%, #f4fbff 100%);
    border: 1px solid rgba(66, 153, 225, 0.28) !important;
    box-shadow: 0 3px 12px rgba(49, 130, 206, 0.09) !important;
}

.gender-method-inner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 4px 0;
}

.gender-method-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #24755f;
    background: rgba(85, 179, 153, 0.16);
}

.gender-method-icon svg {
    width: 21px;
    height: 21px;
}

.gender-method-content h3 {
    margin: 0 0 8px;
    color: #1f5f50;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
}

.gender-method-content > p {
    margin: 0 0 14px;
    color: #285d52;
    font-size: 13px;
    line-height: 1.65;
}

.gender-method-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.gender-method-step {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    min-height: 66px;
    padding: 10px;
    border: 1px solid rgba(85, 179, 153, 0.2);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.68);
    color: #3d5d56;
    font-size: 11px;
    line-height: 1.5;
}

.method-step-number {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #398b77;
    font-size: 11px;
    font-weight: 700;
}

.gender-method-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.gender-method-tag {
    padding: 4px 10px;
    border: 1px solid;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
}

.gender-method-tag.verified {
    color: #276749;
    background: rgba(72, 187, 120, 0.12);
    border-color: rgba(72, 187, 120, 0.35);
}

.gender-method-tag.neutral {
    color: #2b6cb0;
    background: rgba(66, 153, 225, 0.1);
    border-color: rgba(66, 153, 225, 0.3);
}

@media (max-width: 800px) {
    .gender-method-steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .gender-method-inner {
        gap: 12px;
    }

    .gender-method-icon {
        width: 34px;
        height: 34px;
    }

    .gender-method-content h3 {
        font-size: 13px;
    }
}

/* ─── Gender Citations Panel v2 (gcb2) ───────────────────────────────────── */
.gcb2-root { display: flex; flex-direction: column; gap: 0; }

/* Banner de resumo topo */
.gcb2-banner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    background: linear-gradient(135deg, #f0f4ff 0%, #f8f0fb 100%);
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    padding: 20px 28px;
    margin-bottom: 24px;
    align-items: center;
}
.gcb2-banner-item { text-align: center; }
.gcb2-banner-val {
    font-size: 36px;
    font-weight: 800;
    font-family: var(--font-heading);
    line-height: 1.1;
}
.gcb2-banner-key { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.gcb2-banner-sub { font-size: 11px; color: var(--text-light); margin-top: 4px; }

.gcb2-banner-vs {
    text-align: center;
    padding: 0 32px;
    border-left: 1px dashed #cbd5e0;
    border-right: 1px dashed #cbd5e0;
}
.gcb2-banner-diff {
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-heading);
    line-height: 1;
}
.gcb2-banner-diff.diff-pos { color: #3182ce; }
.gcb2-banner-diff.diff-neg { color: #e53e3e; }
.gcb2-banner-diff-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.gcb2-banner-pct {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    background: #edf2f7;
    color: var(--text-muted);
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

/* Body: 2 colunas */
.gcb2-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}
@media (max-width: 960px) { .gcb2-body { grid-template-columns: 1fr; } }

/* Título de coluna */
.gcb2-col-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.gcb2-col-sub {
    font-size: 10px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-light);
}

/* Linhas de barra */
.gcb2-row { margin-bottom: 18px; }
.gcb2-row-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    flex-wrap: wrap;
}
.gcb2-color-pill {
    width: 12px; height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}
.gcb2-row-label { font-size: 13px; font-weight: 600; color: var(--text-main); }
.gcb2-row-n { font-size: 11px; color: var(--text-muted); }
.gcb2-row-note {
    font-size: 10px; color: #d97706;
    background: #fffbeb; border: 1px solid rgba(217,119,6,0.2);
    padding: 1px 7px; border-radius: var(--radius-full);
}

.gcb2-track-wrap { display: flex; align-items: center; gap: 12px; }
.gcb2-track {
    flex: 1;
    height: 22px;
    background: #f1f5f9;
    border-radius: var(--radius-full);
    overflow: visible;
    position: relative;
}
.gcb2-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}
.gcb2-br-marker {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    background: #718096;
    border-radius: 1px;
    z-index: 2;
    opacity: 0.5;
}
.gcb2-br-marker::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -3px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #718096;
    opacity: 0.6;
}

.gcb2-track-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 90px;
    flex-shrink: 0;
}
.gcb2-mean-val { font-size: 15px; font-weight: 800; color: var(--text-main); line-height: 1.1; }
.gcb2-mean-unit { font-size: 10px; color: var(--text-muted); }
.gcb2-sd { font-size: 10px; color: var(--text-light); margin-top: 1px; }

.gcb2-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    opacity: 0.6;
}
.gcb2-legend-marker {
    width: 20px; height: 2px;
    background: repeating-linear-gradient(90deg, #718096 0, #718096 4px, transparent 4px, transparent 8px);
    flex-shrink: 0;
}
.gcb2-legend-text { font-size: 10px; color: var(--text-muted); font-style: italic; }

/* Bloco de significância */
.gcb2-sig-block {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 700;
}
.gcb2-sig-block.sig-high   { background: #f0fff4; color: #276749; border-color: rgba(39,103,73,.2); }
.gcb2-sig-block.sig-medium { background: #fffbeb; color: #7b5c00; border-color: rgba(123,92,0,.2); }
.gcb2-sig-block.sig-low    { background: #fff5f5; color: #c53030; border-color: rgba(197,48,48,.2); }
.gcb2-sig-block.sig-none   { background: #f7fafc; color: var(--text-muted); border-color: var(--border-color); }

.gcb2-sig-dots { display: flex; gap: 5px; flex-shrink: 0; }
.gcb2-dot-sig  { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Grid de métricas explicadas */
.gcb2-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.gcb2-metric {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
}
.gcb2-metric-val {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    font-family: var(--font-heading);
    line-height: 1.1;
    margin-bottom: 3px;
}
.gcb2-metric-val.gcb2-ic { font-size: 13px; }
.gcb2-metric-name {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.gcb2-metric-desc {
    font-size: 10px;
    color: var(--text-light);
    line-height: 1.5;
}

/* Interpretação */
.gcb2-interpretation {
    background: linear-gradient(135deg, #ebf8ff 0%, #f0fff4 100%);
    border: 1px solid #bee3f8;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 12px;
}
.gcb2-interp-title {
    font-size: 11px;
    font-weight: 700;
    color: #2b6cb0;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.gcb2-interpretation p {
    font-size: 12px;
    color: #2d3748;
    line-height: 1.65;
    margin: 0;
}

.gcb2-footnote {
    font-size: 10px;
    color: var(--text-light);
    line-height: 1.5;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    font-style: italic;
}


/* ORCID ao lado do nome na tabela de autores */
.orcid-link {
    margin-left: 8px;
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
}
.orcid-link::before {
    content: "iD";
    display: inline-block;
    margin-right: 4px;
    padding: 0 3px;
    border-radius: 50%;
    background: #A6CE39;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    line-height: 13px;
    vertical-align: 1px;
}
.orcid-link:hover {
    color: #4a7c0b;
    text-decoration: underline;
}

/* Listagem das publicações */
.publications-table-container {
    max-height: none;
    overflow-x: auto;
}
.publications-table {
    table-layout: fixed;
    min-width: 900px;
}
.publications-table th.col-pub-title { width: 38%; }
.publications-table th.col-pub-authors { width: 22%; }
.publications-table th.col-pub-source { width: 16%; }
.publications-table th.col-pub-year { width: 70px; text-align: center; }
.publications-table th.col-pub-doi { width: 18%; }
.publications-table td {
    vertical-align: top;
    line-height: 1.45;
}
.publications-table td.cell-pub-title a {
    color: var(--text-main);
    font-weight: 600;
    text-decoration: none;
}
.publications-table td.cell-pub-title a:hover {
    color: #2b6cb0;
    text-decoration: underline;
}
.publications-table td.cell-pub-authors,
.publications-table td.cell-pub-source {
    color: var(--text-muted);
    font-size: 12px;
}
.publications-table td.cell-pub-year {
    text-align: center;
}
.publications-table td.cell-pub-doi {
    font-size: 12px;
    word-break: break-all;
}
.publications-table td.cell-pub-doi a {
    color: #2b6cb0;
    text-decoration: none;
}
.publications-table td.cell-pub-doi a:hover {
    text-decoration: underline;
}
.publications-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 10px;
    flex-wrap: wrap;
}
.publications-count-info {
    font-size: 12px;
    color: var(--text-muted);
}
.publications-footer .table-pagination {
    display: flex;
    gap: 4px;
    align-items: center;
    user-select: none;
}
.table-pagination span.disabled {
    opacity: 0.35;
    cursor: default;
}

/* Checkbox "Mostrar valores" nos gráficos */
.show-values-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    margin-right: 8px;
}
.show-values-toggle input {
    accent-color: #55b399;
    cursor: pointer;
    margin: 0;
}

/* Linha superior: card do total de publicações + filtros */
.top-row {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 24px;
    align-items: stretch;
}
.top-row .kpi-grid {
    grid-template-columns: 1fr;
}
.top-row .kpi-card {
    height: 100%;
    box-sizing: border-box;
}
.top-row .filters-card {
    padding: 18px 24px;
}
.top-row .filters-header {
    margin-bottom: 14px;
    padding-bottom: 10px;
}
.top-row .filters-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 992px) {
    .top-row {
        grid-template-columns: 1fr;
    }
    .top-row .filters-grid {
        grid-template-columns: 1fr;
    }
}

/* Gráfico de ODS: altura definida pelo número de barras */
.chart-container.sdg-container {
    display: block;
    height: auto;
    min-height: 0;
}

/* ─── Ampliar gráficos e tabelas ─────────────────────────────────────────── */
.chart-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.chart-expand-btn svg {
    width: 14px;
    height: 14px;
}
.chart-expand-btn:hover,
.chart-expand-btn:focus-visible {
    color: var(--primary-hover);
    border-color: rgba(85, 179, 153, 0.5);
    background: var(--primary-light);
    outline: none;
}
.chart-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}
.chart-modal-overlay.open {
    display: flex;
}
.chart-modal {
    width: min(1500px, 100%);
    height: 100%;
    display: flex;
}
body.modal-open {
    overflow: hidden;
}
.chart-card-placeholder {
    visibility: hidden;
}
.chart-card.is-expanded {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
}
.chart-card.is-expanded .chart-header h2 {
    font-size: 20px;
}
.chart-card.is-expanded > .chart-container,
.chart-card.is-expanded > .table-card-content {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
}
.chart-card.is-expanded > .chart-container.treemap-container {
    height: auto;
    min-height: 0;
}
.chart-card.is-expanded > .chart-container.donut-container,
.chart-card.is-expanded > .chart-container.sdg-container {
    overflow-y: auto;
    display: flex;
    align-items: center;
}
.chart-card.is-expanded > .chart-container.sdg-container {
    display: block;
}
.chart-card.is-expanded .table-scroll-container {
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
}
.chart-card.is-expanded .data-table {
    font-size: 14px;
}
@media (max-width: 768px) {
    .chart-modal-overlay {
        padding: 8px;
    }
}

/* Tabela de conferência: primeiros nomes por gênero */
.fn-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.fn-toolbar .table-filter-bar {
    flex: 0 1 360px;
}
.fn-table th:nth-child(5), .fn-table th:nth-child(6), .fn-table th:nth-child(7) {
    text-align: right;
}
.fn-table td.cell-fn-name {
    font-weight: 600;
    letter-spacing: 0.02em;
}
.fn-table td.cell-fn-note {
    color: var(--text-muted);
    font-size: 12px;
}
.gender-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 7px;
    vertical-align: 0;
}
.fn-toolbar #table-fn-filter-input {
    width: 100%;
    border-right: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
}

/* ─── Botões do cabeçalho ─────────────────────────────────────────────────── */
.header-nav {
    display: flex;
    gap: 10px;
}
.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}
.header-btn svg {
    width: 16px;
    height: 16px;
    color: var(--primary-hover);
}
.header-btn:hover,
.header-btn:focus-visible {
    border-color: rgba(85, 179, 153, 0.5);
    background: var(--primary-light);
    color: var(--primary-hover);
    outline: none;
}

/* ─── Página de metodologia ───────────────────────────────────────────────── */
.method-page {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 36px 48px 44px;
    max-width: 920px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    color: var(--text-main);
    line-height: 1.7;
    font-size: 15.5px;
}
.method-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding-bottom: 20px;
    margin-bottom: 8px;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 13px;
}
.method-toc-title {
    width: 100%;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.method-toc a {
    color: #2b6cb0;
    text-decoration: none;
}
.method-toc a:hover {
    text-decoration: underline;
}
.method-section {
    padding-top: 22px;
    scroll-margin-top: 16px;
}
.method-section h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--text-main);
}
.method-section p {
    margin: 0 0 14px;
}
.method-section ul {
    margin: 0 0 14px;
    padding-left: 22px;
}
.method-section li {
    margin-bottom: 8px;
}
.method-section a {
    color: #2b6cb0;
}
.method-section code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: #f1f5f9;
    padding: 1px 5px;
    border-radius: 4px;
}
.method-link {
    font-weight: 600;
}
.query-block {
    position: relative;
    margin: 6px 0 16px;
}
.query-block pre {
    margin: 0;
    padding: 18px 20px;
    background: #0f2537;
    color: #e2f3ee;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.55;
}
.query-block pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}
.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: #e2f3ee;
    cursor: pointer;
}
.copy-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}
.method-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 6px 0 14px;
}
.method-stats > div {
    background: var(--primary-light);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}
.method-stats .stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-hover);
}
.method-stats .stat-label {
    font-size: 12px;
    color: var(--text-muted);
}
.method-note {
    font-size: 13px;
    color: var(--text-muted);
}
@media (max-width: 768px) {
    .method-page {
        padding: 24px 18px 30px;
    }
    .method-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.method-refs p {
    font-size: 14px;
}

/* Autoria (página de metodologia) */
.author-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.author-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fbfcfd;
    line-height: 1.45;
}
.author-card .author-name {
    font-weight: 700;
    font-size: 15.5px;
}
.author-card .author-degree,
.author-card .author-inst {
    font-size: 13px;
    color: var(--text-muted);
}
.author-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 6px;
    font-size: 12.5px;
}
.author-links .orcid-link {
    margin-left: 0;
    font-size: 12.5px;
}
.author-links .lattes-link {
    color: #2b6cb0;
    text-decoration: none;
}
.author-links .lattes-link:hover {
    text-decoration: underline;
}
@media (max-width: 640px) {
    .author-grid {
        grid-template-columns: 1fr;
    }
}

/* Seletor de análise: cards de outras análises ficam ocultos */
.chart-card.analysis-hidden {
    display: none;
}
#filter-analysis {
    font-weight: 600;
    color: var(--primary-hover);
    border-color: rgba(85, 179, 153, 0.5);
    background-color: var(--primary-light);
}
.fn-table td.cell-fn-base {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.gender-scope-toggle .toggle-btn {
    padding: 5px 10px;
}
