/* ========================================
   UNIVERSAL SCRAPER - MODERN DESIGN
   Inspired by Enterprise SaaS UI
   ======================================== */

/* ========== IMPORT FONTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Fira+Code:wght@400;500;600;700&display=swap');

/* ========== CSS VARIABLES ========== */
:root {
    /* Slate Color Palette (Professional) */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;

    /* Indigo Accent */
    --indigo-50: #eef2ff;
    --indigo-100: #e0e7ff;
    --indigo-200: #c7d2fe;
    --indigo-300: #a5b4fc;
    --indigo-400: #818cf8;
    --indigo-500: #6366f1;
    --indigo-600: #4f46e5;
    --indigo-700: #4338ca;

    /* Status Colors */
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-400: #f87171;
    --red-500: #ef4444;
    --red-600: #dc2626;

    /* Violet accent */
    --violet-500: #8b5cf6;
    --violet-600: #7c3aed;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --glass-blur: blur(20px);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    --gradient-mesh: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-surface: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.06) 100%);

    /* CTA / Action color (orange for high visibility) */
    --cta-500: #f97316;
    --cta-600: #ea580c;

    /* Monospace font for logs/data */
    --font-mono: 'Fira Code', 'SF Mono', 'Cascadia Code', 'Consolas', monospace;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
}

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f2f5;
    background-image:
        radial-gradient(at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(at 50% 0%, rgba(99, 102, 241, 0.04) 0%, transparent 40%);
    height: 100vh;
    color: var(--slate-900);
    line-height: 1.6;
    font-size: 14px;
    display: flex;
    overflow: hidden;
    margin: 0;
    padding: 0;
    letter-spacing: -0.01em;
}

body.dark-mode {
    background: #050506;
    background-image:
        radial-gradient(at 20% 20%, rgba(94, 106, 210, 0.1) 0%, transparent 50%),
        radial-gradient(at 80% 80%, rgba(99, 102, 241, 0.06) 0%, transparent 50%);
    color: #ededef;
}

body.dark-mode .card {
    background: rgba(10, 10, 12, 0.8);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body.dark-mode .stat-mini {
    background: rgba(10, 10, 12, 0.6);
    border-color: rgba(255, 255, 255, 0.06);
}

/* Remove particles completely */
#particles-js {
    display: none !important;
}

/* ========== LAYOUT: SIDEBAR + MAIN ========== */
.app-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 256px;
    background: var(--slate-900);
    color: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 20;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-nav-label,
.sidebar.collapsed .sidebar-nav-item span,
.sidebar.collapsed .sidebar-user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
}

.sidebar.collapsed .sidebar-nav-item {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .sidebar-user {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.sidebar.collapsed .sidebar-footer button span {
    display: none;
}

.sidebar.collapsed .sidebar-footer button {
    padding: 0.625rem;
    min-width: 40px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-footer > div {
    flex-direction: column;
    gap: 0.25rem;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: absolute;
    top: 1.5rem;
    right: -12px;
    width: 24px;
    height: 24px;
    background: var(--indigo-600);
    border: 2px solid var(--slate-900);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    transition: all 0.2s;
    z-index: 30;
}

.sidebar-toggle:hover {
    background: var(--indigo-500);
    transform: scale(1.1);
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-toggle:hover {
    transform: rotate(180deg) scale(1.1);
}

.sidebar-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #020203;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-icon {
    width: 32px;
    height: 32px;
    background: var(--indigo-600);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.3);
}

.sidebar-brand-text {
    flex: 1;
}

.sidebar-brand-title {
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.5px;
    line-height: 1;
}

.sidebar-brand-subtitle {
    font-size: 10px;
    color: var(--slate-400);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--slate-700) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--slate-700);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--slate-600);
}

.sidebar-nav-section {
    margin-bottom: 2rem;
}

.sidebar-nav-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    color: var(--slate-400);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.sidebar-nav-item:hover {
    color: white;
    background: var(--slate-800);
    transform: translateX(2px);
}

.sidebar-nav-item.active {
    background: var(--indigo-600);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.2);
    transform: translateX(2px);
}

.sidebar-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--slate-800);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--indigo-500), #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    border: 2px solid var(--slate-800);
}

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

.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--indigo-300);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sidebar-user-role svg {
    color: var(--indigo-300);
    opacity: 0.8;
}

body.dark-mode .sidebar-user-role {
    color: var(--indigo-300);
}

body.dark-mode .sidebar-user-role svg {
    color: var(--indigo-300);
}

/* ========== MAIN CONTENT AREA ========== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.main-content-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    background: transparent;
    height: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--slate-300) transparent;
}

.main-content-scroll::-webkit-scrollbar {
    width: 8px;
}

.main-content-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.main-content-scroll::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 4px;
}

.main-content-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

body.dark-mode .main-content-scroll {
    background: transparent;
    scrollbar-color: var(--slate-600) transparent;
}

body.dark-mode .main-content-scroll::-webkit-scrollbar-thumb {
    background: var(--slate-600);
}

body.dark-mode .main-content-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--slate-500);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ========== PAGE HEADER ========== */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 0.25rem;
}

body.dark-mode .page-title {
    color: white;
}

.page-subtitle {
    color: var(--slate-500);
    font-size: 0.875rem;
}

/* ========== DEMO BANNER ========== */
.demo-banner {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 40%, #a78bfa 100%);
    border-radius: var(--radius-xl);
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.3), 0 8px 16px -8px rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.demo-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
}

.demo-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: float 8s ease-in-out infinite reverse;
}

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

.demo-banner-icon {
    font-size: 3rem;
    flex-shrink: 0;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.demo-banner-content {
    flex: 1;
}

.demo-banner-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.demo-banner-text {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.demo-banner-text strong {
    color: white;
    font-weight: 700;
}

.demo-banner-features {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.demo-feature {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.demo-banner-cta {
    background: white;
    color: var(--indigo-600);
    padding: 1rem 2rem;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.demo-banner-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    background: var(--slate-50);
}

.demo-banner-cta:active {
    transform: translateY(0);
}

body.dark-mode .demo-banner {
    background: linear-gradient(135deg, var(--indigo-700) 0%, var(--indigo-600) 100%);
}

/* Responsive demo banner */
@media (max-width: 768px) {
    .demo-banner {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .demo-banner-icon {
        font-size: 2.5rem;
    }

    .demo-banner-title {
        font-size: 1.25rem;
    }

    .demo-banner-features {
        justify-content: center;
    }

    .demo-banner-cta {
        width: 100%;
    }
}

/* ========== CARDS (Glassmorphism) ========== */
.card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

body.dark-mode .card {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(51, 65, 85, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    background: rgba(248, 250, 252, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body.dark-mode .card-header {
    background: rgba(15, 23, 42, 0.4);
    border-bottom-color: rgba(51, 65, 85, 0.5);
}

.card-title {
    font-weight: 600;
    color: var(--slate-800);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.dark-mode .card-title {
    color: white;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--slate-50);
    border-top: 1px solid var(--slate-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.dark-mode .card-footer {
    background: var(--slate-900);
    border-top-color: var(--slate-700);
}

/* ========== TABS ========== */
.tab-buttons {
    background: var(--slate-200);
    padding: 4px;
    border-radius: 8px;
    display: inline-flex;
    gap: 4px;
}

body.dark-mode .tab-buttons {
    background: var(--slate-700);
}

.tab-btn {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--slate-600);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

body.dark-mode .tab-btn {
    color: var(--slate-400);
}

.tab-btn:hover {
    color: var(--slate-900);
}

body.dark-mode .tab-btn:hover {
    color: white;
}

.tab-btn.active {
    background: white;
    color: var(--indigo-600);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

body.dark-mode .tab-btn.active {
    background: var(--slate-600);
    color: white;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-700);
    margin-bottom: 0.375rem;
}

body.dark-mode .form-group label {
    color: var(--slate-300);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: white;
    border: 1px solid var(--slate-300);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--slate-900);
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background: var(--slate-900);
    border-color: var(--slate-700);
    color: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--indigo-400);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), 0 1px 2px rgba(0,0,0,0.05);
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--slate-400);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.btn-primary:hover:not(:disabled)::before {
    opacity: 1;
}

.btn-primary:active {
    transform: scale(0.98) translateY(0);
}

.btn-cta {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    box-shadow: 0 4px 12px -2px rgba(249, 115, 22, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-cta:hover:not(:disabled) {
    box-shadow: 0 8px 20px -4px rgba(249, 115, 22, 0.5);
    transform: translateY(-2px);
}

.btn-cta:hover:not(:disabled)::before {
    opacity: 1;
}

.btn-cta:active {
    transform: scale(0.98) translateY(0);
}

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

/* ========== PROGRESS BAR ========== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--slate-100);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

body.dark-mode .progress-bar {
    background: var(--slate-700);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer-progress 2s ease-in-out infinite;
}

@keyframes shimmer-progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========== STAT CARDS ========== */
.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--slate-200);
}

body.dark-mode .stat-card {
    background: var(--slate-800);
    border-color: var(--slate-700);
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--slate-500);
    margin-bottom: 0.5rem;
}

.stat-card-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--slate-900);
}

body.dark-mode .stat-card-value {
    color: white;
}

/* ========== TABLES ========== */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--slate-50);
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--slate-100);
}

body.dark-mode th {
    background: var(--slate-900);
    border-bottom-color: var(--slate-700);
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--slate-100);
    font-size: 0.875rem;
    color: var(--slate-900);
}

body.dark-mode td {
    border-bottom-color: var(--slate-700);
    color: var(--slate-100);
}

tbody tr:hover {
    background: var(--slate-50);
}

body.dark-mode tbody tr:hover {
    background: var(--slate-800);
}

/* ========== ALERTS ========== */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--emerald-600);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--red-500);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--amber-500);
}

/* ========== SPINNER ========== */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ========== UTILITY CLASSES ========== */
.hidden {
    display: none;
}

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

.text-muted {
    color: var(--slate-400);
}

.grid {
    display: grid;
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

/* ========== WARNINGS/ALERTS CONTAINER ========== */
#warningsContainer {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ========== RESULTS CONTAINER ========== */
#resultsContainer {
    margin-top: 2rem;
}

.results-table {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: 8px;
    border: 1px solid var(--slate-200);
}

body.dark-mode .results-table {
    border-color: var(--slate-700);
}

.results-table::-webkit-scrollbar {
    height: 8px;
}

.results-table::-webkit-scrollbar-track {
    background: var(--slate-100);
    border-radius: 4px;
}

.results-table::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 4px;
}

body.dark-mode .results-table::-webkit-scrollbar-track {
    background: var(--slate-800);
}

body.dark-mode .results-table::-webkit-scrollbar-thumb {
    background: var(--slate-600);
}

/* ========== HISTORY ITEM ========== */
.history-item {
    padding: 1rem;
    border-bottom: 1px solid var(--slate-200);
    transition: background 0.2s;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: var(--slate-50);
}

body.dark-mode .history-item {
    border-bottom-color: var(--slate-700);
}

body.dark-mode .history-item:hover {
    background: var(--slate-800);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-header h4 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--slate-900);
}

body.dark-mode .history-header h4 {
    color: var(--slate-100);
}

.history-item p {
    margin: 0.25rem 0;
    font-size: 0.8125rem;
    color: var(--slate-600);
}

body.dark-mode .history-item p {
    color: var(--slate-400);
}

.history-item small {
    font-size: 0.75rem;
    color: var(--slate-400);
}

body.dark-mode .history-item small {
    color: var(--slate-500);
}

.btn-view-results {
    padding: 0.375rem 0.75rem;
    background: var(--indigo-600);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-view-results:hover {
    background: var(--indigo-700);
    transform: translateY(-1px);
}

/* ========== ACTIVE JOBS ========== */
.active-job-item {
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: var(--slate-50);
    border-left: 3px solid var(--slate-300);
    transition: all 0.2s;
}

.active-job-item:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.active-job-item.running {
    border-left-color: var(--indigo-600);
    background: rgba(99, 102, 241, 0.05);
}

.active-job-item.completed {
    border-left-color: var(--emerald-600);
    background: rgba(16, 185, 129, 0.05);
}

.active-job-item.error {
    border-left-color: var(--red-500);
    background: rgba(239, 68, 68, 0.05);
}

body.dark-mode .active-job-item {
    background: var(--slate-800);
    border-left-color: var(--slate-600);
}

body.dark-mode .active-job-item.running {
    background: rgba(99, 102, 241, 0.1);
}

body.dark-mode .active-job-item.completed {
    background: rgba(16, 185, 129, 0.1);
}

body.dark-mode .active-job-item.error {
    background: rgba(239, 68, 68, 0.1);
}

.active-job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.active-job-user {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate-700);
}

body.dark-mode .active-job-user {
    color: var(--slate-300);
}

.active-job-status {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-running {
    background: var(--indigo-100);
    color: var(--indigo-700);
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
}

body.dark-mode .status-running {
    background: rgba(99, 102, 241, 0.2);
    color: var(--indigo-300);
}

body.dark-mode .status-completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--emerald-300);
}

body.dark-mode .status-error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.active-job-message {
    font-size: 0.75rem;
    color: var(--slate-600);
    margin-bottom: 0.5rem;
}

body.dark-mode .active-job-message {
    color: var(--slate-400);
}

.active-job-progress {
    width: 100%;
    height: 6px;
    background: var(--slate-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

body.dark-mode .active-job-progress {
    background: var(--slate-700);
}

.active-job-progress-fill {
    height: 100%;
    background: var(--indigo-600);
    border-radius: 3px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.25rem;
    font-size: 0.65rem;
    color: white;
    font-weight: 600;
}

.active-job-time {
    font-size: 0.7rem;
    color: var(--slate-400);
    text-align: right;
}

body.dark-mode .active-job-time {
    color: var(--slate-500);
}

/* ========== LOGS CONTAINER ========== */
#logsContainer::-webkit-scrollbar {
    width: 8px;
}

#logsContainer::-webkit-scrollbar-track {
    background: var(--slate-800);
    border-radius: 4px;
}

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

#logsContainer::-webkit-scrollbar-thumb:hover {
    background: var(--slate-500);
}

.log-entry {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-variant-ligatures: none;
}

/* Dark mode stats cards */
body.dark-mode .card-body > div[style*="background: var(--slate-50)"] {
    background: var(--slate-800) !important;
}

/* Form helper text */
.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--slate-500);
    font-size: 0.75rem;
    line-height: 1.4;
}

body.dark-mode .form-group small {
    color: var(--slate-400);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -256px;
        transition: left 0.3s;
        height: 100vh;
        z-index: 100;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar.open ~ .main-content::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }

    .main-content-scroll {
        padding: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }

    #warningsContainer {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }

    .demo-banner {
        padding: 1.5rem;
    }

    .demo-banner-title {
        font-size: 1.125rem;
    }

    .demo-banner-cta {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
        width: 100%;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    table {
        font-size: 0.75rem;
    }

    th, td {
        padding: 0.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-content-scroll {
        padding: 1.5rem;
    }

    .sidebar {
        width: 220px;
    }

    .sidebar.collapsed {
        width: 70px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
    }

    .container {
        padding: 0;
    }

    .demo-banner {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }

    .demo-banner-features {
        flex-direction: column;
        align-items: stretch;
    }

    .demo-feature {
        text-align: center;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Mobile menu toggle button */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 101;
        background: var(--indigo-600);
        color: white;
        border: none;
        width: 44px;
        height: 44px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        transition: all 0.2s;
    }

    .mobile-menu-toggle:hover {
        background: var(--indigo-700);
        transform: scale(1.05);
    }

    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* ========== MODAL STYLES ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 90%;
    max-width: 600px;
    animation: slideUp 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 1.5rem;
}

/* Suggestions List Styles */
.suggestion-section {
    margin-bottom: 1.5rem;
}

.suggestion-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--slate-700);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestion-item {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    cursor: pointer;
}

.suggestion-item:hover {
    background: var(--indigo-50);
    border-color: var(--indigo-300);
    transform: translateX(4px);
}

.suggestion-item-text {
    font-size: 0.875rem;
    color: var(--slate-700);
    flex: 1;
}

.suggestion-item-action {
    background: var(--indigo-600);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.suggestion-item-action:hover {
    background: var(--indigo-700);
    transform: scale(1.05);
}

/* ============================================================
   LOADING STATES, SKELETON, SHIMMER, PROGRESS PHASES
   ============================================================ */

/* ========== SKELETON LOADER ========== */
.skeleton {
    background: linear-gradient(90deg, var(--slate-200) 25%, var(--slate-100) 50%, var(--slate-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

body.dark-mode .skeleton {
    background: linear-gradient(90deg, var(--slate-700) 25%, var(--slate-600) 50%, var(--slate-700) 75%);
    background-size: 200% 100%;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text-sm { height: 10px; margin-bottom: 6px; }
.skeleton-text-lg { height: 20px; margin-bottom: 10px; }
.skeleton-circle { border-radius: 50%; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-button { height: 38px; width: 120px; border-radius: var(--radius-sm); }

.skeleton-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--slate-100);
}

body.dark-mode .skeleton-row {
    border-bottom-color: var(--slate-700);
}

/* ========== SHIMMER TABLE EFFECT ========== */
.table-shimmer {
    position: relative;
    overflow: hidden;
}

.table-shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: table-shimmer-sweep 2s ease-in-out infinite;
    pointer-events: none;
}

body.dark-mode .table-shimmer::after {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%
    );
}

@keyframes table-shimmer-sweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========== MULTI-PHASE PROGRESS BAR ========== */
.phase-progress {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.phase-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.phase-progress-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--slate-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.dark-mode .phase-progress-label {
    color: var(--slate-200);
}

.phase-progress-percent {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--indigo-600);
}

.phase-progress-bar {
    width: 100%;
    height: 12px;
    background: var(--slate-100);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

body.dark-mode .phase-progress-bar {
    background: var(--slate-700);
}

.phase-progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--gradient-primary);
    position: relative;
}

.phase-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer-progress 2s ease-in-out infinite;
}

/* Phase Steps */
.phase-steps {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

.phase-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}

.phase-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--slate-200);
    color: var(--slate-500);
    border: 2px solid transparent;
    position: relative;
    z-index: 1;
}

body.dark-mode .phase-step-dot {
    background: var(--slate-700);
    color: var(--slate-400);
}

.phase-step.active .phase-step-dot {
    background: var(--indigo-500);
    color: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    animation: phase-pulse 2s ease-in-out infinite;
}

.phase-step.completed .phase-step-dot {
    background: var(--emerald-500);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

@keyframes phase-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.1); }
}

.phase-step-label {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--slate-400);
    text-align: center;
    max-width: 70px;
    line-height: 1.2;
    transition: color 0.3s;
}

.phase-step.active .phase-step-label {
    color: var(--indigo-600);
    font-weight: 600;
}

body.dark-mode .phase-step.active .phase-step-label {
    color: var(--indigo-400);
}

.phase-step.completed .phase-step-label {
    color: var(--emerald-600);
}

/* Connector line between steps */
.phase-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 14px;
    left: calc(50% + 16px);
    width: calc(100% - 28px);
    height: 2px;
    background: var(--slate-200);
    z-index: 0;
}

body.dark-mode .phase-step:not(:last-child)::after {
    background: var(--slate-700);
}

.phase-step.completed:not(:last-child)::after {
    background: var(--emerald-400);
}

/* ========== COMPLETION ANIMATION ========== */
.completion-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
    pointer-events: none;
}

.completion-card {
    background: white;
    border-radius: var(--radius-2xl);
    padding: 3rem;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    animation: completion-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 400px;
}

body.dark-mode .completion-card {
    background: var(--slate-800);
}

@keyframes completion-pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.completion-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gradient-success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    animation: completion-check 0.6s ease-out 0.3s both;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

@keyframes completion-check {
    0% { transform: scale(0) rotate(-45deg); }
    100% { transform: scale(1) rotate(0); }
}

.completion-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 0.5rem;
}

body.dark-mode .completion-title {
    color: white;
}

.completion-subtitle {
    font-size: 0.875rem;
    color: var(--slate-500);
}

/* ========== QUALITY INDICATOR BADGES ========== */
.quality-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.quality-badge-green {
    background: var(--emerald-50);
    color: var(--emerald-600);
    border: 1px solid var(--emerald-100);
}

body.dark-mode .quality-badge-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-400);
    border-color: rgba(16, 185, 129, 0.2);
}

.quality-badge-yellow {
    background: var(--amber-50);
    color: #b45309;
    border: 1px solid var(--amber-100);
}

body.dark-mode .quality-badge-yellow {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber-400);
    border-color: rgba(245, 158, 11, 0.2);
}

.quality-badge-red {
    background: var(--red-50);
    color: var(--red-600);
    border: 1px solid var(--red-100);
}

body.dark-mode .quality-badge-red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red-400);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Source badges */
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.source-badge-original {
    background: var(--indigo-50);
    color: var(--indigo-600);
    border: 1px solid var(--indigo-100);
}

body.dark-mode .source-badge-original {
    background: rgba(99, 102, 241, 0.15);
    color: var(--indigo-300);
}

.source-badge-enriched {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(99, 102, 241, 0.08));
    color: var(--violet-600);
    border: 1px solid rgba(139, 92, 246, 0.15);
}

body.dark-mode .source-badge-enriched {
    background: rgba(139, 92, 246, 0.15);
    color: var(--indigo-300);
}

/* ========== STATS CARDS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.stat-mini {
    text-align: center;
    padding: 0.875rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

body.dark-mode .stat-mini {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(51, 65, 85, 0.4);
}

.stat-mini-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-mini-label {
    font-size: 0.6875rem;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

/* ========== RESULTS TABLE ENHANCEMENTS ========== */
.results-table table {
    border-collapse: separate;
    border-spacing: 0;
}

.results-table th {
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 2px solid var(--slate-200);
}

body.dark-mode .results-table th {
    background: rgba(15, 23, 42, 0.8);
    border-bottom-color: var(--slate-600);
}

.results-table tbody tr {
    transition: background 0.15s, transform 0.15s;
}

.results-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
    transform: scale(1.001);
}

body.dark-mode .results-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.08);
}

/* Row quality indicator stripe */
.results-table tbody tr[data-quality="has-email"] {
    border-left: 3px solid var(--emerald-500);
}

.results-table tbody tr[data-quality="phone-only"] {
    border-left: 3px solid var(--amber-500);
}

.results-table tbody tr[data-quality="no-contact"] {
    border-left: 3px solid var(--red-400);
}

/* ========== ENRICHMENT STATS PANEL ========== */
.enrichment-panel {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(99, 102, 241, 0.04));
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}

body.dark-mode .enrichment-panel {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.06));
    border-color: rgba(139, 92, 246, 0.2);
}

.enrichment-panel-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--violet-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.dark-mode .enrichment-panel-title {
    color: var(--indigo-300);
}

.enrichment-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.enrichment-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    padding: 0.375rem 0;
}

.enrichment-stat-label {
    color: var(--slate-600);
}

body.dark-mode .enrichment-stat-label {
    color: var(--slate-400);
}

.enrichment-stat-value {
    font-weight: 700;
}

/* ========== VIRTUAL SCROLL CONTAINER ========== */
.virtual-scroll-container {
    position: relative;
    overflow-y: auto;
    max-height: 600px;
    scrollbar-width: thin;
}

.virtual-scroll-spacer {
    position: relative;
}

.virtual-scroll-viewport {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

/* ========== RESPONSIVE MOBILE-FIRST IMPROVEMENTS ========== */
@media (max-width: 768px) {
    .phase-steps {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .phase-step:not(:last-child)::after {
        display: none;
    }

    .phase-step-dot {
        width: 24px;
        height: 24px;
        font-size: 0.6rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .completion-card {
        margin: 1rem;
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .phase-steps {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .stat-mini {
        padding: 0.625rem;
    }

    .stat-mini-value {
        font-size: 1.25rem;
    }
}

/* ========== PREFERS REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    .skeleton,
    .table-shimmer::after,
    .progress-fill::after,
    .phase-step.active .phase-step-dot,
    .demo-banner::before,
    .demo-banner::after,
    .demo-banner-icon,
    .completion-icon {
        animation: none !important;
    }

    .card,
    .stat-mini,
    .btn-primary,
    .results-table tbody tr {
        transition: none !important;
    }
}
