/* ========================================
   VF-Evals: Cybernetic Data Lab Theme
   A distinctive, modern interface design
======================================== */

/* ========================================
   CSS Variables & Design Tokens
======================================== */
:root {
    /* Primary Palette - Electric Cyan */
    --primary-50: #e0fefb;
    --primary-100: #b3fcf4;
    --primary-200: #80faec;
    --primary-300: #4df7e4;
    --primary-400: #26f5dc;
    --primary-500: #00F5D4;
    --primary-600: #00c4aa;
    --primary-700: #009380;
    --primary-800: #006255;
    --primary-900: #00312b;

    /* Accent Palette - Coral */
    --accent-50: #fff0f0;
    --accent-100: #ffe0e0;
    --accent-200: #ffc7c7;
    --accent-300: #ffa3a3;
    --accent-400: #ff7a7a;
    --accent-500: #FF6B6B;
    --accent-600: #e85555;
    --accent-700: #c44040;
    --accent-800: #9c3232;
    --accent-900: #742626;

    /* Secondary - Cool Blue */
    --secondary-500: #00BBF9;
    --secondary-600: #0099cc;

    /* Neutral Palette - Deep Navy */
    --bg-100: #0D1117;
    --bg-200: #161B22;
    --bg-300: #1C2128;
    --bg-400: #21262D;
    --bg-500: #30363D;
    --bg-600: #484F58;
    --bg-700: #6E7681;
    --bg-800: #8B949E;
    --bg-900: #C9D1D9;

    /* Text Colors */
    --text-primary: #F0F6FC;
    --text-secondary: #8B949E;
    --text-muted: #6E7681;
    --text-inverse: #0D1117;

    /* Status Colors */
    --success: #3FB950;
    --success-bg: rgba(63, 185, 80, 0.15);
    --warning: #D29922;
    --warning-bg: rgba(210, 153, 34, 0.15);
    --error: #F85149;
    --error-bg: rgba(248, 81, 73, 0.15);
    --info: #58A6FF;
    --info-bg: rgba(88, 166, 255, 0.15);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #00F5D4 0%, #00BBF9 100%);
    --gradient-accent: linear-gradient(135deg, #FF6B6B 0%, #FFA07A 100%);
    --gradient-glow: radial-gradient(circle, rgba(0, 245, 212, 0.4) 0%, transparent 70%);
    --gradient-card: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(0, 245, 212, 0.3);
    --shadow-glow-accent: 0 0 40px rgba(255, 107, 107, 0.3);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.15);

    /* Sizing */
    --sidebar-width: 260px;
    --sidebar-collapsed: 80px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --border-radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Typography */
    --font-display: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Fira Code', monospace;
}

/* ========================================
   Base Reset & Styles
======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-display);
    background: var(--bg-100);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   Animated Background
======================================== */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 245, 212, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 212, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

.bg-glow-1 {
    top: -200px;
    left: -200px;
    background: rgba(0, 245, 212, 0.15);
    animation: float1 20s ease-in-out infinite;
}

.bg-glow-2 {
    bottom: -200px;
    right: -200px;
    background: rgba(255, 107, 107, 0.1);
    animation: float2 25s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(100px, 50px); }
    66% { transform: translate(-50px, 100px); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-80px, -40px); }
    66% { transform: translate(40px, -80px); }
}

/* ========================================
   App Layout
======================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ========================================
   Sidebar Navigation
======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(22, 27, 34, 0.85);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: width var(--transition-base);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

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

.logo-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(0, 245, 212, 0.5)); }
    50% { filter: drop-shadow(0 0 16px rgba(0, 245, 212, 0.8)); }
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Navigation Menu */
.nav-menu {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-base);
    text-align: left;
    width: 100%;
}

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

.nav-item.active {
    background: rgba(0, 245, 212, 0.1);
    color: var(--primary-500);
    border-color: rgba(0, 245, 212, 0.2);
}

.nav-item.active .nav-icon {
    color: var(--primary-500);
}

.nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.nav-icon svg {
    width: 100%;
    height: 100%;
}

.nav-text {
    flex: 1;
}

.nav-indicator {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gradient-primary);
    border-radius: 0 4px 4px 0;
    transition: height var(--transition-base);
}

.nav-item.active .nav-indicator {
    height: 24px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-600);
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(63, 185, 80, 0.6);
    animation: pulse 2s ease-in-out infinite;
}

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

/* ========================================
   Main Content Area
======================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 32px;
}

/* Tab Panels */
.tab-panel {
    display: none;
    animation: fadeSlideIn 0.4s ease;
}

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

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

/* Panel Header */
.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 24px;
}

.header-content {
    flex: 1;
}

.panel-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.panel-desc {
    color: var(--text-secondary);
    font-size: 1rem;
}

.header-badge {
    flex-shrink: 0;
}

/* ========================================
   Glass Card Component
======================================== */
.glass-card {
    background: var(--gradient-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-default);
    border-radius: var(--border-radius-lg);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.glass-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.glass-card .card-glow {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 200px;
    height: 200px;
    background: var(--gradient-glow);
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--transition-slow);
    pointer-events: none;
}

.glass-card:hover .card-glow {
    opacity: 1;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========================================
   Button Components
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary Button */
.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Primary Button with Glow */
.btn-glow {
    position: relative;
}

.btn-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-md);
    z-index: -1;
    opacity: 0;
    filter: blur(12px);
    transition: opacity var(--transition-base);
}

.btn-glow:hover::before {
    opacity: 0.6;
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Secondary Button */
.btn-secondary {
    background: var(--bg-400);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-500);
    border-color: var(--border-strong);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Button Sizes */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

/* Icon Only Button */
.btn-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon-only svg {
    width: 18px;
    height: 18px;
}

.btn-icon-only:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

/* ========================================
   Status Chips
======================================== */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--border-radius-full);
    position: relative;
}

.status-chip::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-chip.idle {
    background: var(--bg-400);
    color: var(--text-secondary);
}

.status-chip.idle::before {
    background: var(--text-muted);
}

.status-chip.running {
    background: var(--info-bg);
    color: var(--info);
    animation: statusPulse 1.5s ease-in-out infinite;
}

.status-chip.running::before {
    background: var(--info);
    animation: pulse 1s ease-in-out infinite;
}

.status-chip.success {
    background: var(--success-bg);
    color: var(--success);
}

.status-chip.success::before {
    background: var(--success);
}

.status-chip.error {
    background: var(--error-bg);
    color: var(--error);
}

.status-chip.error::before {
    background: var(--error);
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Count Badge */
.count-badge {
    display: inline-flex;
    padding: 6px 14px;
    background: var(--bg-400);
    border-radius: var(--border-radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* ========================================
   Ingestion Tab Layout
======================================== */
.ingestion-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    grid-template-rows: auto 1fr;
    gap: 24px;
}

.upload-section {
    grid-row: 1;
    grid-column: 1;
}

.pipeline-section {
    grid-row: 1;
    grid-column: 2;
}

.console-section {
    grid-row: 2;
    grid-column: 1 / -1;
}

/* File Upload Zone */
.file-upload-zone {
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.file-upload-zone:hover {
    background: rgba(0, 245, 212, 0.03);
}

.file-upload-zone.dragover {
    background: rgba(0, 245, 212, 0.08);
    border-color: var(--primary-500);
}

/* Upload Visual */
.upload-visual {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
}

.upload-rings {
    position: absolute;
    inset: 0;
}

.ring {
    position: absolute;
    border: 1px solid var(--primary-500);
    border-radius: 50%;
    opacity: 0.2;
}

.ring-1 {
    inset: 0;
    animation: ringPulse 3s ease-in-out infinite;
}

.ring-2 {
    inset: 15px;
    animation: ringPulse 3s ease-in-out infinite 0.5s;
}

.ring-3 {
    inset: 30px;
    animation: ringPulse 3s ease-in-out infinite 1s;
}

@keyframes ringPulse {
    0%, 100% { opacity: 0.1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.05); }
}

.upload-icon-wrapper {
    position: absolute;
    inset: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-300);
    border-radius: 50%;
    border: 2px solid var(--border-default);
}

.upload-icon-wrapper svg {
    width: 32px;
    height: 32px;
    color: var(--primary-500);
}

.upload-text h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.upload-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.upload-link {
    color: var(--primary-500);
    text-decoration: underline;
    cursor: pointer;
}

.upload-formats {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.format-tag {
    padding: 4px 12px;
    background: var(--bg-400);
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

/* File Preview */
.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-300);
    border-radius: var(--border-radius-md);
    margin: 20px;
    border: 1px solid var(--border-default);
}

.file-preview.hidden {
    display: none;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.file-icon-box {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-500);
    border-radius: var(--border-radius-sm);
}

.file-icon-box svg {
    width: 24px;
    height: 24px;
    color: var(--text-inverse);
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========================================
   Pipeline Visualization
======================================== */
.pipeline-section .card-header {
    padding: 18px 24px;
}

.pipeline-visual {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 24px;
    gap: 0;
}

.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    flex: 1;
    max-width: 140px;
}

.step-node {
    position: relative;
    width: 64px;
    height: 64px;
}

.node-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--border-default);
    border-radius: 50%;
    transition: all var(--transition-base);
}

.node-core {
    position: absolute;
    inset: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-400);
    border-radius: 50%;
    transition: all var(--transition-base);
}

.node-core svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
    transition: color var(--transition-base);
}

/* Step States */
.pipeline-step.active .node-ring {
    border-color: var(--primary-500);
    box-shadow: 0 0 20px rgba(0, 245, 212, 0.3);
    animation: nodeGlow 1.5s ease-in-out infinite;
}

.pipeline-step.active .node-core {
    background: rgba(0, 245, 212, 0.2);
}

.pipeline-step.active .node-core svg {
    color: var(--primary-500);
}

.pipeline-step.done .node-ring {
    border-color: var(--success);
    background: rgba(63, 185, 80, 0.1);
}

.pipeline-step.done .node-core {
    background: var(--success);
}

.pipeline-step.done .node-core svg {
    color: var(--text-inverse);
}

@keyframes nodeGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 245, 212, 0.3); }
    50% { box-shadow: 0 0 30px rgba(0, 245, 212, 0.5); }
}

.step-label {
    text-align: center;
}

.step-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.step-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Pipeline Connector */
.pipeline-connector {
    flex: 0 0 60px;
    height: 64px;
    display: flex;
    align-items: center;
    position: relative;
}

.connector-line {
    width: 100%;
    height: 2px;
    background: var(--bg-500);
    position: relative;
}

.connector-pulse {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--primary-500);
    border-radius: 50%;
    opacity: 0;
}

.pipeline-step.done + .pipeline-connector .connector-line {
    background: var(--success);
}

.pipeline-step.active + .pipeline-connector .connector-pulse {
    animation: connectorFlow 1.5s ease-in-out infinite;
}

@keyframes connectorFlow {
    0% { left: 0; opacity: 1; }
    100% { left: calc(100% - 8px); opacity: 0; }
}

.pipeline-section .btn-primary {
    margin: 0 24px 24px;
    width: calc(100% - 48px);
}

/* ========================================
   Console Output
======================================== */
.console-body {
    padding: 0;
}

.console-output {
    height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.4);
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
}

.log-entry {
    display: flex;
    gap: 12px;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-prefix {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.log-entry.system .log-prefix {
    background: var(--bg-500);
    color: var(--text-muted);
}

.log-entry.info .log-prefix {
    background: var(--info-bg);
    color: var(--info);
}

.log-entry.success .log-prefix {
    background: var(--success-bg);
    color: var(--success);
}

.log-entry.warning .log-prefix {
    background: var(--warning-bg);
    color: var(--warning);
}

.log-entry.error .log-prefix {
    background: var(--error-bg);
    color: var(--error);
}

.log-message {
    color: var(--text-secondary);
    word-break: break-word;
}

.log-entry.success .log-message {
    color: var(--success);
}

.log-entry.error .log-message {
    color: var(--error);
}

/* ========================================
   Data Viewer Tab
======================================== */
.data-viewer-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.filter-panel {
    align-self: start;
    position: sticky;
    top: 32px;
}

.filter-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.filter-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.select-wrapper {
    position: relative;
}

.select-input {
    width: 100%;
    padding: 12px 40px 12px 14px;
    background: var(--bg-300);
    border: 1px solid var(--border-default);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.9rem;
    appearance: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.select-input:hover {
    border-color: var(--border-strong);
}

.select-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.15);
}

.select-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.filter-actions .btn {
    flex: 1;
}

/* Data Panel */
.data-panel {
    min-height: 500px;
}

.data-content {
    padding: 20px;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* Data Item Card */
.data-item {
    padding: 20px;
    background: var(--bg-300);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--primary-500);
    transition: all var(--transition-fast);
}

.data-item:hover {
    border-color: var(--border-default);
    background: var(--bg-400);
}

.data-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.data-item-id {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--primary-500);
}

.data-item-category {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: var(--gradient-primary);
    color: var(--text-inverse);
    border-radius: var(--border-radius-sm);
    font-weight: 600;
}

.data-item-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 40px;
}

.empty-state.inline {
    padding: 40px 20px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    opacity: 0.4;
}

.empty-icon svg {
    width: 100%;
    height: 100%;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========================================
   Evaluation Tab
======================================== */
.evaluation-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto 1fr;
    gap: 24px;
}

.selection-panel {
    grid-row: 1 / 3;
    align-self: start;
    max-height: calc(100vh - 200px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.selection-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.helper-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.tree-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.tree-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--bg-500);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Selection Tree */
.tree-list {
    list-style: none;
}

.tree-item {
    margin: 4px 0;
}

.tree-item-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--border-radius-sm);
    transition: background var(--transition-fast);
}

.tree-item-content:hover {
    background: rgba(255, 255, 255, 0.04);
}

.tree-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.tree-toggle:hover {
    color: var(--text-primary);
}

.tree-toggle.expanded {
    transform: rotate(90deg);
}

.tree-toggle.placeholder {
    visibility: hidden;
}

.tree-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-500);
    cursor: pointer;
    flex-shrink: 0;
}

.tree-label {
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
    flex: 1;
    color: var(--text-primary);
}

.tree-children {
    list-style: none;
    padding-left: 28px;
    display: none;
}

.tree-children.visible {
    display: block;
}

/* Evaluation Pipeline Panel */
.eval-pipeline-panel {
    grid-column: 2;
}

.eval-pipeline-visual {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px 24px;
}

.eval-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-300);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-base);
}

.eval-step.active {
    border-color: var(--primary-500);
    background: rgba(0, 245, 212, 0.08);
}

.eval-step.done {
    border-color: var(--success);
    background: rgba(63, 185, 80, 0.08);
}

.eval-step-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-400);
    border-radius: var(--border-radius-sm);
    flex-shrink: 0;
}

.eval-step-icon svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.eval-step.active .eval-step-icon {
    background: rgba(0, 245, 212, 0.2);
}

.eval-step.active .eval-step-icon svg {
    color: var(--primary-500);
}

.eval-step.done .eval-step-icon {
    background: var(--success);
}

.eval-step.done .eval-step-icon svg {
    color: var(--text-inverse);
}

.eval-step-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.eval-step-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.eval-step-status {
    margin-left: auto;
}

.eval-connector {
    width: 40px;
    height: 2px;
    background: var(--bg-500);
    flex-shrink: 0;
}

.eval-pipeline-panel .btn-primary {
    margin: 0 24px 24px;
    width: calc(100% - 48px);
}

/* Evaluation Console */
.eval-console-panel {
    grid-column: 2;
}

/* ========================================
   Results Tab
======================================== */
.results-container {
    width: 100%;
}

.results-view {
    display: none;
    animation: fadeSlideIn 0.4s ease;
}

.results-view.active-view {
    display: block;
}

.results-view.hidden {
    display: none;
}

/* Results Table Card */
.results-table-card,
.results-detail-card {
    width: 100%;
}

.table-container {
    overflow-x: auto;
    padding: 0 0 20px;
}

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

.data-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-300);
    border-bottom: 1px solid var(--border-default);
}

.data-table td {
    padding: 16px 20px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

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

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table .empty-row td {
    text-align: center;
    padding: 60px 20px;
}

/* Score Display */
.score-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.score-value {
    font-family: var(--font-mono);
    font-weight: 600;
    min-width: 28px;
}

.score-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-500);
    border-radius: 3px;
    overflow: hidden;
    max-width: 100px;
}

.score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width var(--transition-slow);
}

.score-low .score-bar-fill {
    background: var(--error);
}

.score-medium .score-bar-fill {
    background: var(--warning);
}

.score-high .score-bar-fill {
    background: var(--success);
}

/* Overall Score Badge */
.overall-score-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.overall-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 8px 14px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--border-radius-sm);
}

.overall-badge.low {
    background: var(--error-bg);
    color: var(--error);
}

.overall-badge.medium {
    background: var(--warning-bg);
    color: var(--warning);
}

.overall-badge.high {
    background: var(--success-bg);
    color: var(--success);
}

/* Detail View Header */
.results-detail-card .card-header {
    gap: 20px;
}

.results-detail-card .card-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-detail-card .card-header code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--primary-500);
    background: rgba(0, 245, 212, 0.1);
    padding: 4px 10px;
    border-radius: var(--border-radius-sm);
}

/* Action Button in Table */
.action-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* ========================================
   Scrollbar Styling
======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-600);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-700);
}

/* ========================================
   Utility Classes
======================================== */
.hidden {
    display: none !important;
}

.monospace {
    font-family: var(--font-mono);
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 1200px) {
    .ingestion-layout {
        grid-template-columns: 1fr;
    }
    
    .pipeline-section {
        grid-column: 1;
    }
    
    .console-section {
        grid-column: 1;
    }
    
    .evaluation-layout {
        grid-template-columns: 1fr;
    }
    
    .selection-panel {
        grid-row: auto;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }
    
    .logo-text,
    .nav-text {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 14px;
    }
    
    .nav-icon {
        margin: 0;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed);
    }
    
    .data-viewer-layout {
        grid-template-columns: 1fr;
    }
    
    .filter-panel {
        position: relative;
        top: auto;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .panel-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .eval-pipeline-visual {
        flex-direction: column;
    }
    
    .eval-connector {
        width: 2px;
        height: 24px;
    }
    
    .data-grid {
        grid-template-columns: 1fr;
    }
}
