/* =====================================================
   SGEO Dashboard - Main Styles
   ===================================================== */

:root {
    --bg-primary: #0a0b0d;
    --bg-secondary: #111216;
    --bg-tertiary: #16181d;
    --bg-card: #1a1c22;
    --bg-card-hover: #1f2128;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.45);
    --text-muted: rgba(255, 255, 255, 0.3);

    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);

    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme */
:root.light-theme {
    --bg-primary: #f5f6fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef0f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fc;
    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-medium: rgba(0, 0, 0, 0.12);
    --text-primary: #1a1c22;
    --text-secondary: rgba(26, 28, 34, 0.75);
    --text-tertiary: rgba(26, 28, 34, 0.55);
    --text-muted: rgba(26, 28, 34, 0.35);
    --accent-primary: #5558e3;
    --accent-secondary: #7c5cd6;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #2563eb;
}

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

body {
    font-family: 'Outfit', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Effects */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bg-gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.bg-gradient-orb:nth-child(1) {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    top: -200px;
    right: -100px;
}

.bg-gradient-orb:nth-child(2) {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation-delay: -10s;
}

.bg-gradient-orb:nth-child(3) {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.2) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
}

.bg-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 60px 60px;
    background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    opacity: 0.5;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(17, 18, 22, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-subtle);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-container {
    width: 42px;
    height: 42px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.logo-icon {
    font-size: 22px;
    font-weight: 800;
    color: white;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-base);
    position: relative;
    margin-bottom: 4px;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--accent-gradient);
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--accent-primary);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.nav-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 16px 12px;
}

.nav-submenu {
    display: none;
    padding-left: 32px;
}

.nav-submenu.open {
    display: block;
}

.expand-icon {
    width: 16px;
    height: 16px;
    margin-left: auto;
    transition: transform var(--transition-base);
}

.nav-item.expanded .expand-icon {
    transform: rotate(180deg);
}

.user-section {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-base);
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.06);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    overflow-x: hidden;
    min-width: 0;
}

/* Header */
.header {
    height: 72px;
    background: rgba(17, 18, 22, 0.6);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb-item {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-item:hover {
    color: var(--text-secondary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.header-btn svg {
    width: 20px;
    height: 20px;
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--success-bg);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    color: var(--success);
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Content */
.content {
    padding: 32px;
    max-width: 1600px;
    margin: 0 auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-subtitle {
    font-size: 15px;
    color: var(--text-tertiary);
}

.page-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    border: none;
    font-family: inherit;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* Tabs */
.tabs-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    width: fit-content;
}

.tab {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-base);
    background: transparent;
    border: none;
    font-family: inherit;
}

.tab:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.tab.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 24px;
    transition: all var(--transition-base);
}

.stat-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-2px);
}

.stat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-icon-container {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-container svg {
    width: 24px;
    height: 24px;
}

.stat-icon-container.blue {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
}

.stat-icon-container.green {
    background: var(--success-bg);
    color: var(--success);
}

.stat-icon-container.purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-secondary);
}

.stat-icon-container.orange {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.stat-trend svg {
    width: 14px;
    height: 14px;
}

.stat-trend.up {
    background: var(--success-bg);
    color: var(--success);
}

.stat-trend.down {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-content {
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-description {
    font-size: 12px;
    color: var(--text-muted);
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 24px;
}

.chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.chart-description {
    font-size: 13px;
    color: var(--text-tertiary);
}

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

.chart-action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.chart-action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.chart-action-btn svg {
    width: 16px;
    height: 16px;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Analysis Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.analysis-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 24px;
}

.analysis-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.analysis-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

.radar-container {
    height: 220px;
    position: relative;
    margin-bottom: 16px;
}

.pie-container {
    height: 200px;
    position: relative;
    margin-bottom: 16px;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

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

/* Sources Section */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.sources-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.source-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 24px;
}

.source-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.source-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

/* Accordion */
.accordion-section {
    margin-bottom: 32px;
}

.accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accordion-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.accordion-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.accordion-icon {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    transition: transform var(--transition-base);
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.accordion-body {
    padding: 0 24px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Tables */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 8px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.table td {
    padding: 10px 8px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

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

.table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* LLM Badges */
.llm-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.llm-badge.gpt { background: rgba(16, 163, 127, 0.15); color: #10a37f; }
.llm-badge.grok { background: rgba(0, 0, 0, 0.15); color: #fff; }
.llm-badge.gemini { background: rgba(66, 133, 244, 0.15); color: #4285f4; }
.llm-badge.deepseek { background: rgba(77, 107, 254, 0.15); color: #4d6bfe; }
.llm-badge.perplexity { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

/* Tone Badges */
.tone-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.tone-badge.positive { background: var(--success-bg); color: var(--success); }
.tone-badge.neutral { background: rgba(255, 255, 255, 0.1); color: var(--text-secondary); }
.tone-badge.negative { background: var(--danger-bg); color: var(--danger); }

/* Risk Badges */
.risk-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.risk-badge.low { background: var(--success-bg); color: var(--success); }
.risk-badge.medium { background: var(--warning-bg); color: var(--warning); }
.risk-badge.high { background: var(--danger-bg); color: var(--danger); }

/* Type Badges */
.type-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.type-badge.gov { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.type-badge.media { background: var(--info-bg); color: var(--info); }
.type-badge.analytics { background: rgba(139, 92, 246, 0.15); color: var(--accent-secondary); }
.type-badge.wiki { background: var(--warning-bg); color: var(--warning); }

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-field,
.select-field,
.textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-base);
}

.input-field:focus,
.select-field:focus,
.textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.textarea {
    min-height: 120px;
    resize: vertical;
}

/* Filters */
.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.filter-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.filter-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.pagination-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.pagination-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

a.pagination-btn {
    text-decoration: none;
}

/* Progress Bar */
.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Trend Badge */
.trend-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.trend-badge.up {
    background: var(--success-bg);
    color: var(--success);
}

.trend-badge.down {
    background: var(--danger-bg);
    color: var(--danger);
}

.trend-badge svg {
    width: 14px;
    height: 14px;
}

/* Light Theme Overrides */
:root.light-theme .sidebar { background: rgba(255, 255, 255, 0.95); }
:root.light-theme .header { background: rgba(255, 255, 255, 0.85); }
:root.light-theme .bg-gradient-orb { opacity: 0.12; }
:root.light-theme .bg-grid {
    background-image: linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
}
:root.light-theme .page-title,
:root.light-theme .logo-text,
:root.light-theme .stat-value {
    background: linear-gradient(135deg, #1a1c22 0%, rgba(26, 28, 34, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
:root.light-theme .card,
:root.light-theme .chart-card,
:root.light-theme .stat-card,
:root.light-theme .analysis-card,
:root.light-theme .source-card,
:root.light-theme .accordion-item,
:root.light-theme .table-container {
    background: var(--bg-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
:root.light-theme .nav-item:hover { background: rgba(0, 0, 0, 0.05); }
:root.light-theme .nav-item.active { background: rgba(85, 88, 227, 0.1); }
:root.light-theme .user-card { background: rgba(0, 0, 0, 0.03); }
:root.light-theme .user-card:hover { background: rgba(0, 0, 0, 0.06); }
:root.light-theme .btn-secondary { background: rgba(0, 0, 0, 0.05); }
:root.light-theme .btn-secondary:hover { background: rgba(0, 0, 0, 0.08); }
:root.light-theme .tab:hover { background: rgba(0, 0, 0, 0.05); }
:root.light-theme .tab.active { background: rgba(85, 88, 227, 0.1); }
:root.light-theme .header-btn { background: rgba(0, 0, 0, 0.04); }
:root.light-theme .header-btn:hover { background: rgba(0, 0, 0, 0.08); }
:root.light-theme .table th { background: rgba(0, 0, 0, 0.03); }
:root.light-theme .table tr:hover td { background: rgba(0, 0, 0, 0.02); }

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-medium);
}

.user-menu .user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.user-menu .user-name {
    font-size: 14px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1000;
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.user-dropdown-header .user-avatar {
    width: 44px;
    height: 44px;
    font-size: 16px;
}

.user-dropdown-header .user-info {
    flex: 1;
    min-width: 0;
}

.user-dropdown-header .user-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-dropdown-header .user-email {
    font-size: 13px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0 12px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.user-dropdown-item svg {
    color: var(--text-tertiary);
}

.user-dropdown-logout {
    color: var(--danger);
}

.user-dropdown-logout:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.user-dropdown-logout svg {
    color: var(--danger);
}

/* Light theme overrides for user menu */
:root.light-theme .user-menu-trigger {
    background: rgba(0, 0, 0, 0.03);
}

:root.light-theme .user-menu-trigger:hover {
    background: rgba(0, 0, 0, 0.06);
}

:root.light-theme .user-dropdown {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

:root.light-theme .user-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* Responsive */
@media (max-width: 1200px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1000px) {
    .page-header-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .content {
        padding: 20px;
    }

    .page-header-top {
        flex-direction: column;
    }

    .page-actions {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .analysis-grid,
    .sources-section {
        grid-template-columns: 1fr;
    }

    .header {
        padding: 0 16px;
    }

    .header-right {
        gap: 8px;
    }

    .status-badge {
        display: none;
    }

    .user-menu .user-name {
        display: none;
    }

    .user-menu-trigger svg {
        display: none;
    }
}
