/* ==================== INSTITUTIONAL SECTION ==================== */
.institutional-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 60px;
    right: 0;
    bottom: 0;
    background: #0a0a0a;
    z-index: 1050;
    overflow-y: auto;
    padding: 20px;
}

.institutional-overlay .institutional-container {
    max-width: 1400px;
    margin: 0 auto;
}

.institutional-overlay.visible {
    display: block;
}

.institutional-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.institutional-header h2 {
    color: #caa999;
    font-size: 24px;
    margin: 0;
}

.institutional-header .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.period-selector {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.period-selector:focus {
    outline: none;
    border-color: #caa999;
}



.insights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

/* Dark scrollbars */
.institutional-overlay ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.institutional-overlay ::-webkit-scrollbar-track {
    background: #1a1a1a;
}
.institutional-overlay ::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}
.institutional-overlay ::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ==================== FUND REPORTS SECTION ==================== */
.fund-reports-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 60px;
    right: 0;
    bottom: 0;
    background: #0a0a0a;
    z-index: 1050;
    overflow-y: auto;
    padding: 20px;
}
.fund-reports-overlay.visible {
    display: block;
}
.fund-reports-container {
    max-width: 1000px;
    margin: 0 auto;
}
.fund-reports-overlay ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.fund-reports-overlay ::-webkit-scrollbar-track {
    background: #1a1a1a;
}
.fund-reports-overlay ::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}
.fund-reports-overlay ::-webkit-scrollbar-thumb:hover {
    background: #555;
}
.fund-reports-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}
.fund-reports-header h2 {
    color: #caa999;
    font-size: 24px;
    margin: 0;
}
.fund-reports-header .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}
.fund-selector {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    min-width: 350px;
}
.fund-selector:focus {
    outline: none;
    border-color: #caa999;
}
.fr-download-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #caa999;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.fr-download-btn:hover {
    background: #caa999;
    color: #111;
}
.fr-download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.fund-report-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}
/* Fund Report Content Styles */
.fr-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.fr-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.fr-badge-style { background: rgba(138, 43, 226, 0.15); color: #a78bfa; }
.fr-badge-concentration { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.fr-badge-positions { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.fr-stats-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}
.fr-stat-item {
    background: #111;
    border: 1px solid #222;
    border-radius: 6px;
    padding: 12px 16px;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}
.fr-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}
.fr-stat-icon-green { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.fr-stat-icon-blue { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.fr-stat-icon-red { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.fr-stat-icon-purple { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.fr-stat-value { font-size: 18px; font-weight: 600; }
.fr-stat-label { color: #666; font-size: 11px; }
.fr-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}
.fr-card {
    background: #111;
    border: 1px solid #222;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}
.fr-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}
.fr-card-title { font-size: 16px; font-weight: 600; color: #caa999; }
.fr-card-subtitle { color: #666; font-size: 12px; }
.fr-card-body { padding: 16px; }
/* Help tooltip */
.fr-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #caa999;
    color: #caa999;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
    cursor: help;
    position: relative;
    vertical-align: middle;
}
.fr-help-icon:hover { background: #caa999; color: #111; }
.fr-help-tooltip {
    display: none;
    position: fixed;
    bottom: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 14px;
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    width: 320px;
    z-index: 9999;
    text-align: left;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.fr-help-icon:hover .fr-help-tooltip { display: block; }
.fr-help-tooltip strong { color: #caa999; }
.fr-help-tooltip ul { margin: 8px 0 0 0; padding-left: 16px; }
.fr-help-tooltip li { margin: 4px 0; }
.fr-dna-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.fr-dna-item {
    background: #1a1a1a;
    padding: 10px 12px;
    border-radius: 6px;
}
.fr-dna-label { color: #666; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.fr-dna-value { font-size: 16px; font-weight: 600; margin-top: 2px; }
.fr-sector-bar {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.fr-sector-name { width: 100px; font-size: 12px; color: #888; }
.fr-sector-bar-container {
    flex: 1;
    height: 16px;
    background: #1a1a1a;
    border-radius: 3px;
    overflow: hidden;
    margin: 0 10px;
}
.fr-sector-bar-fill { height: 100%; border-radius: 3px; }
.fr-sector-pct { width: 45px; text-align: right; font-size: 12px; color: #caa999; font-weight: 500; }

/* Derivatives Exposure */
.fr-deriv-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.fr-deriv-stat {
    background: #1a1a1a;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}
.fr-deriv-stat-label { font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }
.fr-deriv-stat-value { font-size: 20px; font-weight: 700; margin-top: 4px; }
.fr-deriv-stat-sub { font-size: 11px; color: #888; margin-top: 2px; }
.fr-sentiment-bar {
    height: 8px;
    background: linear-gradient(to right, #FF6B6B 0%, #FF6B6B 40%, #888 50%, #7CC3E4 60%, #7CC3E4 100%);
    border-radius: 4px;
    position: relative;
    margin: 12px 0;
}
.fr-sentiment-marker {
    position: absolute;
    top: -4px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.fr-sentiment-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #666;
}
.fr-intent-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}
.fr-intent-bullish { background: rgba(124, 195, 228, 0.2); color: #7CC3E4; }
.fr-intent-bearish { background: rgba(255, 107, 107, 0.2); color: #FF6B6B; }
.fr-intent-hedge { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.fr-intent-neutral { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }
.fr-intent-income { background: rgba(96, 165, 250, 0.2); color: #60a5fa; }

.fr-table {
    width: 100%;
    border-collapse: collapse;
}
.fr-table th {
    text-align: left;
    padding: 10px 12px;
    background: #1a1a1a;
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 500;
}
.fr-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #1a1a1a;
    font-size: 13px;
}
.fr-table tr:hover { background: #1a1a1a; }
.fr-table th:last-child, .fr-table td:last-child { text-align: right; }
.fr-ticker { color: #4a9eff; font-weight: 600; cursor: pointer; }
.fr-ticker:hover { text-decoration: underline; }
.fr-positive { color: #7cc3e4; }
.fr-negative { color: #FF6B6B; }
.fr-anomaly-icon { margin-left: 6px; cursor: help; }
.fr-tactic-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}
.fr-badge-high-conviction { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.fr-badge-new-position { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.fr-badge-doubling-down { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.fr-badge-thesis-broken { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.fr-tactics-section { margin-bottom: 16px; }
.fr-tactics-subtitle {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.fr-tactics-subtitle::before {
    content: '';
    width: 3px;
    height: 14px;
    border-radius: 2px;
}
.fr-tactics-conviction .fr-tactics-subtitle::before { background: #4ade80; }
.fr-tactics-adds .fr-tactics-subtitle::before { background: #60a5fa; }
.fr-tactics-exits .fr-tactics-subtitle::before { background: #f87171; }
.fr-gap-zone {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}
.fr-gap-discount { background: rgba(74, 222, 128, 0.12); color: #4ade80; }
.fr-gap-fair { background: rgba(250, 204, 21, 0.12); color: #facc15; }
.fr-gap-elevated { background: rgba(251, 146, 60, 0.12); color: #fb923c; }
.fr-gap-chasing { background: rgba(248, 113, 113, 0.12); color: #f87171; }
.fr-holdings-scroll { max-height: 400px; overflow-y: auto; }
.fr-holdings-rank { color: #555; font-size: 11px; width: 25px; }
@media (max-width: 768px) {
    .fr-grid-2 { grid-template-columns: 1fr; }
    .fr-stats-row { flex-wrap: wrap; }
    .fr-stat-item { min-width: calc(50% - 10px); }
}

.insight-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid #333;
    border-radius: 10px;
    padding: 15px;
}

.insight-card h3 {
    color: #4a9eff;
    font-size: 14px;
    margin: 0 0 10px 0;
}

.insight-card ul {
    margin: 0;
    padding-left: 18px;
    color: #ccc;
    font-size: 13px;
}

.insight-card li {
    margin-bottom: 5px;
}

.insight-card .warning {
    color: #ff9999;
    font-size: 11px;
    margin-top: 8px;
}

.pattern-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.pattern-tab {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #888;
    padding: 8px 20px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 13px;
}

.pattern-tab:hover {
    color: #caa999;
    border-color: #444;
}

.pattern-tab.active {
    background: #2a2a2a;
    color: #caa999;
    border-color: #caa999;
    border-bottom-color: #2a2a2a;
}

.pattern-content {
    background: #111;
    border: 1px solid #222;
    border-radius: 8px;
    overflow: hidden;
}

.pattern-stats {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #1a1a1a;
    border-bottom: 1px solid #222;
}

.pattern-stat {
    text-align: center;
}

.pattern-stat-value {
    color: #caa999;
    font-size: 22px;
    font-weight: bold;
}

.pattern-stat-label {
    color: #888;
    font-size: 11px;
}

.inst-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.inst-table th {
    background: #1a1a1a;
    color: #caa999;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.inst-table td {
    padding: 10px;
    border-bottom: 1px solid #222;
    color: #e0e0e0;
}

.inst-table tr:hover {
    background: #1a1a1a;
}
/* Pattern Section styles */
.pattern-section {
    background: #111;
    border: 1px solid #222;
    border-radius: 8px;
    margin-bottom: 25px;
    overflow: hidden;
}

.pattern-section h2 {
    color: #caa999;
    font-size: 18px;
    margin: 0;
    padding: 15px 20px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

.pattern-section .pattern-desc {
    color: #888;
    font-size: 13px;
    margin: 0;
    padding: 10px 20px;
    background: #151515;
    border-bottom: 1px solid #222;
}

.pattern-section .inst-table-wrapper {
    max-height: 500px;
    overflow-y: auto;
}

/* Sector section - no scroll, full height */
#sectorTable {
    max-height: none;
    overflow-y: visible;
}

.inst-table .ticker {
    font-weight: bold;
    color: #4a9eff;
    cursor: pointer;
}

.inst-table .ticker:hover {
    text-decoration: underline;
}

.inst-table .positive {
    color: #7cc3e4;
}

.inst-table .negative {
    color: #ff6b6b;
}

/* Column sort - click header to sort */
.inst-table th.col-sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.inst-table th.col-sortable:hover {
    background: #252525;
}

/* Column copy - click header to copy column */
.inst-table th.col-copyable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.inst-table th.col-copyable:hover {
    background: #252525;
}
.inst-table td.col-highlight {
    background: rgba(202,169,153,0.08);
    transition: background 0.3s;
}

.sector-badge {
    background: #2a2a2a;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: #999;
}

.sector-badge.private {
    background: #4a1a1a;
    color: #ff9999;
    border: 1px solid #7f1d1d;
}

.signal-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.signal-badge.squeeze {
    background: #7c2d12;
    color: #fbbf24;
}

.signal-badge.trend {
    background: #14532d;
    color: #4ade80;
}

.signal-badge.mature {
    background: #3a3a3a;
    color: #aaa;
}

.data-warning {
    cursor: help;
    color: #f59e0b;
}

.inst-loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

.inst-loading .spinner {
    border: 3px solid #333;
    border-top: 3px solid #caa999;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* ==================== END INSTITUTIONAL ==================== */
